RSS

Monthly Archives: March 2015

statsystem mutator project

something i came up with for a account system / database for stats / levels
something i have been meaning to do for at least a year – but hadn’t thought of the best way to implement it securely
someone requested i build something like this for them , and after a bit of back and forth, we filled in the holes in both our ideas.

so at this point its a semi private project , but files are available in the  private Facebook group as usual

some info :

—————————————————————-

statsystem mutator
—————————————————————-
stat system is a serverside statlogger/accountsystem

Lets users create a authenticated account of your server to with lets them save
kill data , achevments , arbitrary server data and other player data.
This mod can run aside any gametype that supports gamerules in 227i+.

Nick registering

how to register a nick
Upon entering a server a user gets nagged to register there nick using a password.
They register there nick “createlogin <password>”

there password is bound to their name. there uid is saved to server.
next time user joins there uid is matched up. if thats not matching(stale) they are prompted to login again
user types “plogin <password>”
loging in saves the uid to the datbase again and reloads there permisions.

commands:
createlogin <password>
plogin <password>

alternatly you can chat /plogin <password> /createlogin <password>

———————————————————-
database class
———————————————————-

everything is saved in a dynamic array, that is interfaced using a custom class
called databaseinterationclass

you interact with it like so
table is all strings , so do conversions where nessecary.
dbobject.getdatavalue (string xplayer , string xproperty); returns a string of matching value , “nil” if not exist
dbobject.updatedatavalue (string xplayer , string xproperty,string xvalue); update a value , creat if it dont exist.
dbobject.addintvalue(string xuser , string xprop,optional int addto); increament a value (if addto is specified add that many)
dbobject.returnbool(string xuser , string xprop); return if a value is true/false “”/nil/*!true = false
dbobject.setbool(string xuser , string xprop,bool newvalue); sets a value bool status. if *!true then true
dbobject.concatgroups (string xplayer); returns space delimitedlist of properties from xplayer;
dbobject.concatpropgroups (string xprop) returns space delimitedlist of players with xprop defined;

———————————————————–

Base data gathered
———————————————————–

+kill stats saved to nick
per class kills for any monster –
ie playerdatadb=(Player=”player.bob.Killstats”,Property=”kami.Kamikaze”,Value=”37″)

+ spawns
playerdatadb=(Player=”bob”,Property=”num_of_respawns”,Value=”1″)
spawns total , including joins!

+ Levels ended saved to nick
playerdatadb=(Player=”player.bob”,Property=”levelsended”,Value=”1″)
saved when player hits ending and level is switch based on his/her touch.

————————————————————-
Achivments saved to nick
————————————————————-
+ can define arbitary achivments in a custom mutator

build the mutator using link to dataobject
decare var int achevmentcount; and set var to # of achivments

example mutator achevent :
if (dbobject.getdatavalue(“player.” $l$”.Killstats” ,”UnrealI.Titan”) > “20” &&
dbobject.getdatavalue(l$”.achivments” ,”titanterrorist”) == “nil”)
{
playerpawn(killer).ClientMessage(“————————————————“);
playerpawn(killer).ClientMessage(“[Achivment] unlocked titan terrerist! – Kill 15 titan”);
playerpawn(killer).ClientMessage(“————————————————“);
dbobject.updatedatavalue (l$”.achivments”, “titanterrorist”,”titan?Terrerist?” $ level.month$”-“$level.day$”-“$level.year);
}

possibilitys
kill of some class = # , totalkills = # , any database comparasion , any chat string , login args , pickup some gun, has inventory etc

edit: here is a link to a generic version you can customize.

Download here

 
4 Comments

Posted by on March 6, 2015 in Uncategorized