Raised This Month: $ Target: $400
 0% 

Map stats showing drops and full server


Post New Thread Reply   
 
Thread Tools Display Modes
pRED*
Join Date: Dec 2006
Old 05-24-2007 , 04:20   Re: Map stats showing drops and full server
Reply With Quote #11

Wouldn't the best way be to set a task to run once per minute (or more frequently if you want more accurate results). (You could use an entities next think if you want to save CPU time, see hawks tut).

When this task exectues you need to get the number of connected players and add that to the total. Also increment the amount of 'counts' by one.

On map end divide total by counts and then write that to a file.
pRED* is offline
MrXtramean
Senior Member
Join Date: Jun 2005
Old 05-24-2007 , 11:28   Re: Map stats showing drops and full server
Reply With Quote #12

Connects don't always work cause ppl get re-directed and then drop. But if you know what I'm shooting for, then you will know what the best results are. I'm using this for GunGame mostly. Our server stays pretty steady, but the drops here and there.

If it counts the player_info_starts/deathmatch 's at start like he said that would ok, not sure if the stats results would be what we want if it counted all "connects" . It needs that equation in there somehow.
connects + disconnects /(divivded by) 2= avg players per map
MrXtramean is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-24-2007 , 12:09   Re: Map stats showing drops and full server
Reply With Quote #13

Okay, since that is the way you want it, I will set it up like that. But, I counted not when a player connected, but when they actually entered the server and got shown the motd.

EDIT: Try this
Attached Files
File Type: sma Get Plugin or Get Source (mapstats.sma - 491 views - 650 Bytes)
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 05-24-2007 at 12:13.
YamiKaitou is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-25-2007 , 00:00   Re: Map stats showing drops and full server
Reply With Quote #14

Well, here is a version that adds the timestamp to each entry. I also added the cvar

mapstats_enable <1/0> (On/Off) Default 1


The formula that I used is the one that you posted
Attached Files
File Type: sma Get Plugin or Get Source (mapstats.sma - 448 views - 807 Bytes)
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
pRED*
Join Date: Dec 2006
Old 05-25-2007 , 00:30   Re: Map stats showing drops and full server
Reply With Quote #15

Players get disconnected before plugin end is called.

So every player that connect will have to also disconnect. Making connects == disconnects. Dividing by two is just the same as counting connects. (From memory i've heard rumours of the numbers ending up slightly different, but in theory they should be equal).

The only way to calculate an average (that I can think of), is to sample the number of players in the server every x seconds.
pRED* is offline
MrXtramean
Senior Member
Join Date: Jun 2005
Old 05-26-2007 , 00:20   Re: Map stats showing drops and full server
Reply With Quote #16

Kutless= good band. Try Skillet.

Your probably right about plugin ending before disconnets can be counted. So, you have to put this on a timer. For servers running mp_timelimit, they'd have to set the plugin or have the plugin read the mp_timelimit and do a player count at "X" mins before map change. And for those that run GunGame, like myself, ( we just got another GG server running--ya!), it would have to have some checkpoint in the Gungame code and the only thing that is pretty consistent is either nade level and positively knife level. Although nade level can be bypassed if the weapon_order is set that way. I can't think of another way that on Gungame, the plugin would trigger to count the players before the game win. Except when someone triggers knife level for the plugin to count players. Sometimes the win happens very fast after someone gets knife level. So I'm not sure how fast these plugins do there thing.

Thanks for your help.

On/off cvar and time stamp are a plus.
MrXtramean is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-26-2007 , 00:44   Re: Map stats showing drops and full server
Reply With Quote #17

I am just going to make it check the amount of players every 5 seconds, or user defined. I will have to figure out a formula to use, but I will think of something. Hopefully I will have time this weekend, well I should have time.


I listen to Skillet, I only like a few of their songs. I enjoy the Audio A type more though
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
pRED*
Join Date: Dec 2006
Old 05-26-2007 , 06:36   Re: Map stats showing drops and full server
Reply With Quote #18

The formula isn't that hard is it?

Every 5 seconds (or whatever you choose/set) increment the "counts" variable by one.
Also increment the "total" variable by the number of players currently connected (prob want to exclude people in the process of connecting, but maybe not).

At plugin end do total/counts and write that to file.
pRED* is offline
MrXtramean
Senior Member
Join Date: Jun 2005
Old 05-27-2007 , 04:29   Re: Map stats showing drops and full server
Reply With Quote #19

Will that cause much lag doing a server check so often? As long as it's settable unless mot much lag. thx
MrXtramean is offline
pRED*
Join Date: Dec 2006
Old 05-27-2007 , 16:12   Re: Map stats showing drops and full server
Reply With Quote #20

Na really shouldn't lag at all. Ill have a go at making it for you later if you want and no-one else has done it.

Plugins that cause lag usually do operations during client_prethink or server frame (called 60 time per second + )

Just doing two additions every 5 seconds is nothing..
pRED* is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode