Digital Paint Discussion Board

Paintball 2: The Game => Server Discussion => Topic started by: 3lf on March 07, 2019, 07:22:26 PM

Title: -DP2stat: Server side stat tracking for Digital Paintball2-
Post by: 3lf on March 07, 2019, 07:22:26 PM
DP2stat is here!

beta 3 is out:
- improved stability

beta 2 whats new:
- tracking for name changes
- new players are added automatically (no more "!addplayer")
- monthly reset for the leaderboard to keep the competition fresh
- experimental Global Stats server and client (disabled by default)

source @GitHub (https://github.com/aapokaapo/DP2scripts)

To test the script in action, connect whoa's gentlemans club server:  whoa.gq:22222

What?:
- DP2stat is a script that (thanks to mRokita's DPLib) listens to events on server and tracks each players points.
- Automated saves and loads
- Automated infomessages (SPAMMMM)


How it works?:
The script adds your Global Login id to the DP2Leaderboard(TM) list and your current nickname. After that the script will keep track of your kills, deaths, caps, grabs and k/d. It also ranks you based on your score. As for now the
score = (kills - deaths + 3* grabs + 5* caps).


Commands:
There are currently 4 commands to use:

- "!stats"
will print your current stats

- "!top10"
will print current top10 based on score

- "!top10kd"
will print current top10 based on k/d

- "!help"
gives you additional info about the ranking system

Pictures:
(https://docs.google.com/uc?id=1cTkIUiZNdEIaKlE39i9NQl1BCpvzo9lJ)

At this point you must be wondering: How to get this masterpiece of DP2Leaderboard(TM) on your server? Well wonder no more.
Here it is!



Download and Installation
This script is meant to be running side-by-side with DP2 server, so set up a server first, unless you have one already

1.Download the zip file here (GDrive) (https://drive.google.com/open?id=1r9b5epBxgiuSqvm2F3-Tb1msFDRFGEDt) and unzip it.

2. You must have Python 3.x installed, if not there are instructions online for this

3. Installing DPLib:
   Install method #1:
   This will install the DPLib to current user's /.local directory
   - cd DPLib
   - python setup.py install --prefix=$HOME/.local

   Install method #2:
   - cd DPLib
   - install pip for python
   - python -m pip install DPLib
   This will overwrite mRokitas server.py with my modified server.py
   - cp dplib/server.py $HOME/.local/lib/python3.*/site-packages/dplib/

3.1 Installing crython:
   Install crython to monthly reset the stats
   - python -m pip intall crython

4.Configure DP2stat config.py
   -set the server port
   -set the path to the servers log file
   -set the rcon password for your server
   -set the path for savefile
   -modify the automated messages to your liking, or disable them

5.Run DP2stat.py
   -use command:
      python3 DP2stat.py

(6.Modify server.cfg)
   - add [ s ] to your server hostname, so people will know the server is running DP2stat

see the README for more information

To be added in next builds:
- Support for multiple servers to make it Global Ranking system
- Cool website for the rankings
- You tell me

Other projects:

- "Skip map" -vote:
by typing "!skip" the player votes to skip the map. If the majority of players vote to skip the map, map will be changed to the next map in rotation

- Mapping Feedback system:
upload your maps to beta server and let people play them. They can directly send you feedback in-game using "!feedback (your feedback here)" and the feedback is saved to webserver where the mapper can read it.

- Clan Ranking system:
After the clan has been added to the list, the script automatically gets all the members. If both clans are registered and use the command "!Xs" (where X is a number) the server will check if there are enough players on the server for both clans  and initiates a clan match. The script keeps track of kills, deaths, caps, grabs, k/d and wins and loses for each clan and ranks them


Thanks to:
-mRokita for making the DPLib which my script relies heavily on
-Toolwut for mentoring/testing/and scripting with me
Title: Re: -DP2rank: Server side ranking system for Digital Paintball2-
Post by: xrichardx on March 08, 2019, 11:48:53 AM
What do you think about people manipulating the score? For example, imagine two players boosting their score by one of them not logging in and letting the other one kill / grab / cap them.
Title: Re: -DP2rank: Server side ranking system for Digital Paintball2-
Post by: 3lf on March 08, 2019, 12:01:49 PM
Good point. However these days as there are so few players, two players on a server attract more people to join and their plan to manipulate the leaderboard fails.

I'll be monitoring the leaderboard, but I don't think we have to worry much about the cheaters.
Title: Re: -DP2stat: Server side stat tracking for Digital Paintball2-
Post by: Ranger on March 20, 2019, 08:57:28 AM
Nice feature. Would be good if server automatically add a "new player" to the list. Keep it simple and add !top100
Title: Re: -DP2stat: Server side stat tracking for Digital Paintball2-
Post by: 3lf on March 20, 2019, 09:09:21 AM
That is actually how the script currently works, I just forgot to edit the OP. As for the "!top100"(don't know If you are joking), I don't think it's a good idea as trying to read 10 lines in dp2 is hard enough.
Title: Re: -DP2stat: Server side stat tracking for Digital Paintball2-
Post by: Ranger on March 23, 2019, 07:55:43 AM
Btw, why is "C" (capture?) usually bigger number than "G" (grab?). It seems like grabs are under "C" and caps under letter "G".
Title: Re: -DP2stat: Server side stat tracking for Digital Paintball2-
Post by: 3lf on March 23, 2019, 08:49:35 AM
The script doesn't add grabs unless you eliminated the opponent team.