Digital Paint Discussion Board

Paintball 2: The Game => Server Discussion => Topic started by: MrLuke on April 28, 2008, 09:24:18 AM

Title: Displaying users stats at the end of round.
Post by: MrLuke on April 28, 2008, 09:24:18 AM
I know this command (g_writestats 1) displays each players stats in my server console
Can i make it so at the end of your round it displays only your own stats as a message in the game screen?

and there used to be a [KAF] server that displayed most kills, deaths...... and so on, at the end of each round. Does anybody know how this was/is done?
Title: Re: Displaying users stats at the end of round.
Post by: y00tz on April 28, 2008, 12:58:15 PM
and there used to be a [KAF] server that displayed most kills, deaths...... and so on, at the end of each round. Does anybody know how this was/is done?


Sk89q's brilliance.
Title: Re: Displaying users stats at the end of round.
Post by: sk89q on April 28, 2008, 04:14:54 PM
That was a separate PHP script that tracked the StdLog in real-time, compiling information on every player as the game went on. However, with the release of build 21, my StdLog parser might have been been rendered irrelevant because you can now shoot other players before the game starts. Unless, of course, nothing new is actually written to the StdLog; in which case, it should still all work.

You can't send a message to just one user though. You either have to vote for it on the feature vote (I think I put that feature in for voting) and wait until it's implemented; or hack it into the server C++ source yourself (that's not too hard). I never was able to get a per-user messaging system (and thus get my hacky voting to work) because getting a custom-compiled version of the server to run on amd64 was hell on its own.
Title: Re: Displaying users stats at the end of round.
Post by: T3RR0R15T on April 28, 2008, 04:32:45 PM
U also coded the info-message, which comes all 5 minutes on the QeHs servers, sk89q ?
Title: Re: Displaying users stats at the end of round.
Post by: MrLuke on April 28, 2008, 11:29:48 PM
ok so pretty much its way to complicated for me. thanks anyway.

and sk89q wat ever happened to the [kaf] public server? That was the best ping i could get on dp!!!

Actually the best any aussie could get apart from the UWS server that was around for a little bit.
Title: Re: Displaying users stats at the end of round.
Post by: sk89q on April 29, 2008, 01:05:33 AM
@T3RR0R15T: No, I didn't.

If you program PHP, it would be relatively easy to modify my code.

As for the server:

Although [kaf]'s server ping may have been good for you, it was bad for everyone else. Unless you were close (Los Angeles and surrounding areas, possibly the entirety of California), your ping was 150-200. European players pinged 200-500. Although, since it appears you're from down under, it's weird that you got such good ping. I suppose my server was on a direct pipe to Australia, or more specifically to your area. I remember a few Australians on the server, but they didn't ping well, averaging about 150 to 200. Oh, and my server isn't a dedicated game server too; all the other services give rise to lag spikes.

On another note, I wish we still had the money to pay for an additional server at The Planet. Those were the days... a single managed server nearly dedicated to our [private] Paintball server.
Title: Re: Displaying users stats at the end of round.
Post by: MrLuke on April 29, 2008, 01:15:47 AM
150-200 ping is good for anyone downunder, we average on most servers excluding the euro's.... from 220-280, it would be great if it was ever up and running again
Title: Re: Displaying users stats at the end of round.
Post by: sk89q on April 29, 2008, 01:18:49 AM
Okay, I just started up the server. The StdLog format hasn't changed, and [kaf] is up for the time being. (I can't get FreeBSD's rc.d startup scripts to work for Paintball, or anything.)
Title: Re: Displaying users stats at the end of round.
Post by: MrLuke on April 29, 2008, 01:25:21 AM
nice , ill idle in there untill someone else comes in
Title: Re: Displaying users stats at the end of round.
Post by: sk89q on April 29, 2008, 04:22:54 AM
Well, if anyone's curious, here's the ZIP for dpWatchDog:
http://digitalpaint.therisenrealm.com/downloads/sdk/serverwatchdog_no_rel.zip

I included part of the class that does the stuff for [kaf]'s server. I only added the stats stuff, though, in SimpleDPTracker. You can do the rest yourself :)

P.S. All of this is kind of hacky.
Title: Re: Displaying users stats at the end of round.
Post by: MrLuke on April 29, 2008, 06:34:20 AM
thanks buddy, ill use it for sure
EDITED
ill figure out how to use it for sure :P
Title: Re: Displaying users stats at the end of round.
Post by: sk89q on April 29, 2008, 02:47:47 PM
By the way, it *is* possible to send to a specific client by forging a UDP packet from the server. Stateful firewalls happily accept it.
Title: Re: Displaying users stats at the end of round.
Post by: sk89q on April 30, 2008, 04:20:52 PM
This displays stats for each player at the end of the game (privately):
http://sk89q.therisenrealm.com/pastebin/digitalpaint/serverwatchdog/ServerBotWatchDog.phps

In addition to those stats, it sends a welcome message when you are joining the game, before you actually enter the game. Once you enter the game, it also shows a "REMEMBER: Don't cheat, be nice, and have fun" message in chat after one or two seconds.

You need the SendIPWatchDog class that forges packets. PM me for that, whoever wants it. (I may have to know you, though.) If you are on *nix/BSD, you probably need root to do this. That class uses an external program in order to forge the packets, and it forges it down to the IP level (thus requiring raw sockets, and thus root). However, if someone writes me a function to generate a UDP packet (namely the checksum code), then PHP should be able to forge on tis own.
Title: Re: Displaying users stats at the end of round.
Post by: MrLuke on May 01, 2008, 08:03:17 AM
Next time we are both on ill have to grab that from you