Tuesday, 21-Nov-2017  00:00:00
Enhanced Coop  
[ New messages · Members · Forum rules · Search · RSS ]
Page 1 of 11
Forum moderator: MrLoathsome 
Forum » Map Packs, Mods & Mutators » Mutators » PlayerCnt - Bot & Player Login Counter Utility (PlayerCnt - Bot & Player Login Counter Utility with source)
PlayerCnt - Bot & Player Login Counter Utility
MrLoathsomeDate: Monday, 15-Mar-2010, 11:54 PM | Message # 1
Colonel
Group: Moderators
Messages: 151
Awards: 0
Reputation: 0
Status: Offline
Decided yesterday I needed a way to track the bot usage on the servers.

No interest in score tracking, just wanted to count how often each bot is
showing up. Make sure all 320 are being used and confirm that the
XBots9b random list generation was working correctly.
Added a bit to track human logins also. Get a rough idea of traffic and
who the regulars are.

It is short and dirty, and just dumps the info into an ini file I may import into a
spreadsheet or something later.

*Source below updated for v2.0 release available in the downloads section.

Here it is:
Code

// ============================================================
// PlayerCnt.PC v2.0 (c) 2011 Mr.Loathsome
//
// Counts number of times player joins a game.  By player name.
// Counts both Human and Bot players.
// ============================================================
class PC extends Mutator config(PlayerCnt);

var bool Initialized;
struct PlyrInfoType
{
   var string PlayersName;
   var int    Count;
   var string PlayerType;
};

const MaxPlayers = 1023;

var() config int NumGames;
var() config int NumPlayers;
var() config PlyrInfoType PInfo[1024];  // Set array size to MaxPlayers + 1

function ModifyPlayer(Pawn Other)
{
   local playerpawn NewPlayer;
   local bot B;
   local int i;
   local string PName, PType;

   if (!Initialized)
   {
    Initialized = True;  NumGames++;
   }
   NewPlayer = playerpawn(Other);
   B = bot(Other);
   if ( (Other == None) || (Other.PlayerReplicationInfo.Score != 0) || (Other.PlayerReplicationInfo.Deaths != 0) )
    return;
   if (Other.IsA('Bot'))
   {
    PName = B.GetHumanName();  PType="Bot";
   }   
   else
   {
    PName = NewPlayer.PlayerReplicationInfo.PlayerName;  PType="Human";
   }
   for( i=0; i < NumPlayers; i++ )
   {
    if ( PName == PInfo[i].PlayersName )
    {
     PInfo[i].Count++; break;
    }
   }
   if ((i >= NumPlayers) && (i != MaxPlayers))
   {
    NumPlayers++; PInfo[i].Count = 1;
    PInfo[i].PlayersName = PName;
    PInfo[i].PlayerType = PType;
   }
   if (i == MaxPlayers) { PInfo[MaxPlayers].Count++; PInfo[MaxPlayers].PlayersName = "Player Array is full"; log("PlayerCnt - Warning! Array is full"); }

   SaveConfig();
   Super.ModifyPlayer(Other);
}

defaultproperties
{
   NumGames=0
   NumPlayers=0
}
 
MrLoathsomeDate: Saturday, 11-Jun-2011, 10:10 PM | Message # 2
Colonel
Group: Moderators
Messages: 151
Awards: 0
Reputation: 0
Status: Offline
If you do use this, keep an eye on the size of the ini file.

Bad things will happen if it gets over 1024 unique player names in it.
Either reset the ini file at that point, or edit the source and recompile
to increase the size of the 3 arrays.
 
HookDate: Thursday, 18-Aug-2011, 11:30 PM | Message # 3
Private
Group: Checked
Messages: 13
Awards: 0
Reputation: 0
Status: Offline
Do you have a DL of this?
May be good to run periodically on a server.
 
HookDate: Tuesday, 25-Oct-2011, 7:37 PM | Message # 4
Private
Group: Checked
Messages: 13
Awards: 0
Reputation: 0
Status: Offline
Quote

Do you have a Down Load Link for this?
May be good to run periodically on a server.

Bump! smile


Message edited by Hook - Tuesday, 25-Oct-2011, 7:38 PM
 
CoreDate: Sunday, 06-Nov-2011, 10:38 PM | Message # 5
Major
Group: Administrators
Messages: 103
Awards: 1
Reputation: 0
Status: Offline
Didn't notice the bump till yesterday. I guess Mr.Loathsome thought nobody would want to use that piece of cra.. err code as it is right now evil wink . It's probably more of an example for others to expand on it by logging additional stuff, increasing indices, things like that. In its current form, it doesn't seem to check if the array limit is reached. That will typically results in "accessed array out of bounds" error messages when it tries to address higher indices (updated).

In any case, the script needs to be compiled. If you haven't compiled an uscript before, here are a couple of ways to do so (*):





NOTES:

(*) If your UT folder is in a "protected" part of the hardrive and either you don't have administrator privileges or User Account Control (UAC) is enabled (Vista or higher) then you should run UnrealEd, text editor, command prompt, batch file, etc.. as an administrator, to avoid read/write access permission problems.

Once finished the mutator can be accessed as NameOfYourPackage.NameOfTheMutatorClass. Anyone can create and modify his own version at will, though as long as this remains a serverside mutator, no ServerPackages are required.

Additionally, you can create a localization file for this mutator to have it show up in UT's mutators list.
Code

[Public]                    
Object=(Name=PkgFold.PlayerCnt,Class=Class,MetaClass=Engine.Mutator,Description="Your description of this mut, double quotes inclusive!")


Enter the above in any plain text Editor, modify and save as 'PkgFold.int' in your system folder for the english version, or under any other extension matching your UT's language (det,frt,itt,est,..).

For more detailed information about UnrealScript & its compilation, visit: http://wiki.beyondunreal.com/

Good luck,




 
MrLoathsomeDate: Saturday, 12-Nov-2011, 7:19 PM | Message # 6
Colonel
Group: Moderators
Messages: 151
Awards: 0
Reputation: 0
Status: Offline
Now available in the downloads section here: PlayerCnt Download
 
NelsonaDate: Monday, 20-Feb-2012, 7:08 PM | Message # 7
Lieutenant colonel
Group: Checked
Messages: 122
Awards: 0
Reputation: 0
Status: Offline
Um, I think this is a BUMP but I have a question about this:

Quote

If you need more than that, you can recompile the mutator after
adjusting the MaxPlayers constant and the PInfo array in the PC.uc source.


You have some codes, I gotta admit they are codes not other bullshits like other assumed coders are doing or already did. Can I use some of your work (of course modified a bit) ? I saw that some mutators done by Mr. Loathsome contains a source-code (even with help). I'm very interested about chapter with resizing monsters and shadow chapter. What is about more exactly ? Some big Kralls even other wild classes have a small shadow based on their collision radius. I want to check and fix this collision because is not looking good at all to see a huge Krall with a small shadow like a normal Krall.
 
MrLoathsomeDate: Monday, 20-Feb-2012, 11:13 PM | Message # 8
Colonel
Group: Moderators
Messages: 151
Awards: 0
Reputation: 0
Status: Offline
Sure. The source code is included for you to use as you wish.

Just try not to release anything that is broken, and I suppose give credits when appropriate.


Moo

 
NelsonaDate: Tuesday, 21-Feb-2012, 11:48 PM | Message # 9
Lieutenant colonel
Group: Checked
Messages: 122
Awards: 0
Reputation: 0
Status: Offline
Thank you very much ! For the moment I slowed down coding. Other mappers last time delivered a lot of worse things (I looked at impressive logs) and I wait them to leave game - at least some of them if not all. After that (or in private) I'll work to improve the game for my needs. I know, is not so possible to avoid default errors released by Epic, but I want more stability, effects, and generally a good looking game.
 
B4MDate: Thursday, 06-Jun-2013, 11:36 PM | Message # 10
Group: Guests





This looks very interesting , is something I have been needing for a long time.

Would be good if there were some way of bringing up the stats in game and/or via webadmin (if enabled|but not necessary)

some kind of !ServerStats || !serverstats cmd to bring up the info into console perhaps. (future revisions possibly could import to HUD few details perhaps)

if logged in as admin , also display IP addresse's/Hosts. Curious as to what it will do with aliasing players however , So Perhaps it does already count only new IP's as new players if Alias has changed since last rec?.. Being able to Tap into ACE's HWID System would be Ideal for anything like this , as it would guarantee at least 90% of Stats reliably , seeming as each players HWID is unique to an individual PC.

Interestingly enough , not sure about multiple players using same PC.. something for someone to comtemplate another day I guess smile

Keep up the good work , I shall give this a whirl , just a heads up.. is there now a check for array size?.. perhaps there should be some kind of check which does the following;

serverstats1.ini

if serverstats[x]>=1024 then NewIniNum=2

Create NewIni(serverstats(NewIniNum));

so basically force the server to create a new .ini each time the predecessor is full?

yeah anyways .. great work, thanks.

ALSO RE FORUMS SESSION TIMEOUTS: Access Denied (Session Key Not Found) , This Happens because the session Expires.. and can cause posts to be erased :F (luckily Iam in the habbit of CTRL+A , CTRL+C before submitting long boring posts.

Just a heads up but perhaps consider having the session timeout extended for your forums.

I would have lost already 2 Posts had I not copied before submitting.. thinking now , perhaps timeouts only happen for Guests?.
 
MrLoathsomeDate: Saturday, 08-Jun-2013, 4:44 AM | Message # 11
Colonel
Group: Moderators
Messages: 151
Awards: 0
Reputation: 0
Status: Offline
Glad you like it.

I haven't done anything with any of my stuff in regards to ACE or Pure or any of those type of things.

Been so long since I have used or looked at this, I don't recall if I did anything regarding the issue of the array filling up other
that a note that users should keep an eye on the file, and rotate it manually when needed.

I do have a number of other things on the to-do list.   Not sure if or when I would get back to an update for this one.
Full source is included, if you wish to update or enhance this thing yourself, go for it.

Not sure about the session timeouts problem.   Haven't had that myself yet.
afCore would need to tweak some setting on the forum software or config to adjust that.


Moo

 
Forum » Map Packs, Mods & Mutators » Mutators » PlayerCnt - Bot & Player Login Counter Utility (PlayerCnt - Bot & Player Login Counter Utility with source)
Page 1 of 11
Search:

Copyright MyCorp © 2017
Powered by uCoz