Digital Paint Discussion Board
Paintball 2: The Game => Paintball 2 Discussion => Topic started by: sk89q on December 23, 2007, 01:44:00 AM
-
I'm testing out custom console commands on one of my Paintball servers. I made no modification to the game source.
paintball2://64.27.12.194:27921
* It works most of the time, but occasionally the client may refuse all the print messages from the server
* Name changes will stop it from working for you
* If your name ends in :, you're just out of luck
* A few other issues
Doing votes is possible with this, but at the speed in which the console scrolls sometimes, it's not too feasible.
(http://img170.imageshack.us/img170/497/sshot151gn8.jpg)
(http://img341.imageshack.us/img341/9079/sshot152ez4.jpg)
(http://img341.imageshack.us/img341/9693/sshot153dc9.jpg)
(http://img341.imageshack.us/img341/2751/sshot154bx3.jpg)
-
I luv you. So much.
<3
So anyway, if you could just echo that there's a vote going on every 15 seconds, it could work. Does this show up in the chat box? I assume not. That's kinda an issue.
-
The messages only show up for the user it's intended for. It will, however, show up in the chat box, so the user doesn't have to be in the console to see the messages.
-
Okay, that could work then. The vote notification messages just need to be intended for all users. ;)
-
When you join:
(http://img505.imageshack.us/img505/7836/sshot159zq8.jpg)
=========
I have basic votes going:
(http://img299.imageshack.us/img299/1820/sshot155nq0.jpg)
(http://img299.imageshack.us/img299/673/sshot156ck3.jpg)
(http://img299.imageshack.us/img299/8435/sshot157hx3.jpg)
(http://img299.imageshack.us/img299/2209/sshot158ju6.jpg)
=========
I am currently investigating how reliable these messages are.
-
Nice, how did you make it work without modifing the game source tho? Or did you mean you modified the client but not the server code?
-
Connectionless print UDP packet. But, not all the messages get through the server, since the packet isn't coming from the server's port (and clearly I can't bind to it), I don't know how well firewalls/routers are "poking a hole" in themselves for the packet, but then again, it might be because of the client that's dropping the messages.
-
Use one of the existing functions to print that text to the client.
-
I'm not aware of any function that prints text to the client from the server, without modifying the source. :3
-
Oh wait.... this is all being done externally. You're allowed to modified the server's source as you please, it doesn't have any kind of checksuming on it that prevents it from being listed in public. All the PBCup servers I ran hade modified source (for things like auto-record, and specinvites) without any problems.
-
thats pretty cool, it'd be cool if you could make a !specinvite for spec'ing members of your team... (altho I don't know what it would do) I just thought of it cuz Bain mentioned it ;D
-
As much as I can modify the source, I can't get it compiled and running on my server. It appears compiling for amd64 has been a headache for me, and compiling it on i386 and using compatibility libraries for amd64 requires I sync lib versions with my development system, and that's a pain.
-
Did you enable tripping on your server? Bain and I were playing on Shreds and even though I lag out every 15 seconds everyone else was having the problems . There was constant hiccups all over the place on that map. Dunno about others cause have shown it the cold shoulder since that experience.
-
I wasn't sure if that was just with me or something. Earlier, I was experiencing too -- jumps were hitting some "ceiling" that did not exist. The odd thing was, at least on ub_rooftop, going towards a ramp from one side had no problem, but going towards it from the other side gave the issue consistently. Tripping is off; I checked it earlier.
==
EDIT: It appears to happen with b20 for me. B19 doesn't have this problem on my server.
-
its an issue wit hthe new nix 20 code. SOmething about math fucntions being fubard.
Jits is aware of the issue.
-
Yeah, I read =( Oh well.
I downgraded the public server to b19.
-
I once wanted to do something like this with dp2 through the source, I wasnt able to do it back then.
I'm pretty sure I could do it now tho, since I was able to make a server filter out a list of custom words defined in a file from the chat messages, which is similar to what I wanted to do. And since I didnt had acces to the server code, all of this had to be done through the client code... Even though it would be so much easier to do through the server code...
-
very nice sk89q :)
-
Well, the project is a bust. I cannot get the messages to send reliably, and I do not know why. Packet sniffing on my computer does not show that my computer gets these messages, and this problem appears for other people. I was working on some C code to do the personal messages via the server code itself, but it will not compile and run correctly on my server, so I can't do that either.
However, since it seems to work most well right when you first join, my server still says HAPPY NEW YEAR or something when you connect :D, and I changed the after-game K/D, top streak, etc. info to use regular console messages.
-
Not sure if this helps: The packets include a "qport" - a random number assigned so that the q2 engine knows what packet goes with what client when the network starts screwing with the addresses and ports. If you read that out of each packet, you should be able to keep track of what ip/port goes to a specific client.
-
I can get the IP/port from when they connect, so that's (mostly) not a problem, but sending a connectionless print message to that IP/port is not working out too well.
-
Nice work, reminds me of the commands you can use in Counter-Strike servers.
-
also in warsow. i'd love to see these implemented.
-
As would I cola.
-
i allways like it when someone makes something useful for dp :)
spectacular job :)
-
sk89q,
THe k/d bug is pretty consistant that we talked about earlier. It's more like a d/k ratio. Maybe your division is backwards?
-
Well, the K/D returns correctly. It comes from my StdLog parser class, and I already went through the game you reported, KnacK, and the numbers appear to be correct. However, I haven't tried debugging the code that considers someone's play time.
Here's the code, albeit a little messy:
$best_play_time_per = 1;
foreach($game['players'] as $name => $info)
{
$play_time_per = $game['play_time'] ? $info['play_time']/$game['play_time'] : 0;
if($play_time_per > $best_play_time_per)
$best_play_time_per = $play_time_per;
}
// [...]
$top_k_d = array();
foreach($game['players'] as $name => $info)
{
if($info['k_d'] >= $top_kd['k_d'] && $game['play_time'] && $best_play_time_per && $info['play_time']/$game['play_time']/$best_play_time_per > .05 && $info['kills'] > 1)
{
$this->debug(sprintf("(debug) K/D= %4s %4s %s", round($info['k_d'], 2), round($info['play_time']/60, 1), DigitalPaintServer::clean_funname($name)));
$top_k_d = array('name' => DigitalPaintServer::clean_funname($name),
'k_d' => $info['k_d']);
}
// [...]
}
I have to fix a file-pointers-not-closing problem in my script before I can tackle this.
-
/me grabs some aspirin while attempting to read the code.
Keep up the great work sk89q.
-
Bug should be fixed.
$top_k_d vs. $top_kd
Now hopefully rewriting file_get_contents and file using just fopen will prevent the file-pointers-not-closing bug from triggering. We'll see... :/
P.S. Happy New Year!
(http://img183.imageshack.us/img183/3734/sshot184dr4.jpg)
-
Nice. :)
-
It would be cool if you made some in-game lookup to see someone's registered names so you don't have to go to dplogin.com to see who is talking trash to you.
-
It would be cool if you made some in-game lookup to see someone's registered names so you don't have to go to dplogin.com to see who is talking trash to you.
I 2nd that.
-
Can't, since there's no way for me to send a private message to someone.
-
you could have a command like !GLID <in-game ID#>, and it would just shout out to the server that persons first three names or something else related to the account.
-
I don't think shouting out to the server is a great idea :/
-
How do the counter-strike servers make it so it only shows up for that player?
-
How do the counter-strike servers make it so it only shows up for that player?
They use source modification ;)
-
sk89q,
Looks like that fixed the problem.
Good Job.