Author Topic: Displaying users stats at the end of round.  (Read 2471 times)

MrLuke

  • Stingray
  • Posts: 68
Displaying users stats at the end of round.
« on: April 28, 2008, 07: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?

y00tz

  • Autococker
  • Posts: 2742
Re: Displaying users stats at the end of round.
« Reply #1 on: April 28, 2008, 10:58:15 AM »
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.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Displaying users stats at the end of round.
« Reply #2 on: April 28, 2008, 02: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.

T3RR0R15T

  • Map Committee
  • Autococker
  • Posts: 2593
Re: Displaying users stats at the end of round.
« Reply #3 on: April 28, 2008, 02:32:45 PM »
U also coded the info-message, which comes all 5 minutes on the QeHs servers, sk89q ?

MrLuke

  • Stingray
  • Posts: 68
Re: Displaying users stats at the end of round.
« Reply #4 on: April 28, 2008, 09: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.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Displaying users stats at the end of round.
« Reply #5 on: April 28, 2008, 11:05:33 PM »
@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.

MrLuke

  • Stingray
  • Posts: 68
Re: Displaying users stats at the end of round.
« Reply #6 on: April 28, 2008, 11:15:47 PM »
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

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Displaying users stats at the end of round.
« Reply #7 on: April 28, 2008, 11:18:49 PM »
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.)

MrLuke

  • Stingray
  • Posts: 68
Re: Displaying users stats at the end of round.
« Reply #8 on: April 28, 2008, 11:25:21 PM »
nice , ill idle in there untill someone else comes in

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Displaying users stats at the end of round.
« Reply #9 on: April 29, 2008, 02: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.
« Last Edit: April 29, 2008, 11:57:20 AM by sk89q »

MrLuke

  • Stingray
  • Posts: 68
Re: Displaying users stats at the end of round.
« Reply #10 on: April 29, 2008, 04:34:20 AM »
thanks buddy, ill use it for sure
EDITED
ill figure out how to use it for sure :P

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Displaying users stats at the end of round.
« Reply #11 on: April 29, 2008, 12: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.
« Last Edit: April 30, 2008, 12:44:59 AM by sk89q »

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Displaying users stats at the end of round.
« Reply #12 on: April 30, 2008, 02: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.

MrLuke

  • Stingray
  • Posts: 68
Re: Displaying users stats at the end of round.
« Reply #13 on: May 01, 2008, 06:03:17 AM »
Next time we are both on ill have to grab that from you