Author Topic: -DP2stat: Server side stat tracking for Digital Paintball2-  (Read 8922 times)

3lf

  • Map Committee
  • VM-68
  • Posts: 121
-DP2stat: Server side stat tracking for Digital Paintball2-
« on: March 07, 2019, 06: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

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:


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) 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
« Last Edit: June 22, 2019, 03:23:28 PM by 3lf »

xrichardx

  • 68 Carbine
  • Posts: 295
Re: -DP2rank: Server side ranking system for Digital Paintball2-
« Reply #1 on: March 08, 2019, 10: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.

3lf

  • Map Committee
  • VM-68
  • Posts: 121
Re: -DP2rank: Server side ranking system for Digital Paintball2-
« Reply #2 on: March 08, 2019, 11:01:49 AM »
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.

Ranger

  • 68 Carbine
  • Posts: 253
Re: -DP2stat: Server side stat tracking for Digital Paintball2-
« Reply #3 on: March 20, 2019, 06:57:28 AM »
Nice feature. Would be good if server automatically add a "new player" to the list. Keep it simple and add !top100

3lf

  • Map Committee
  • VM-68
  • Posts: 121
Re: -DP2stat: Server side stat tracking for Digital Paintball2-
« Reply #4 on: March 20, 2019, 07: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.
« Last Edit: March 24, 2019, 03:26:02 AM by 3lf »

Ranger

  • 68 Carbine
  • Posts: 253
Re: -DP2stat: Server side stat tracking for Digital Paintball2-
« Reply #5 on: March 23, 2019, 05: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".

3lf

  • Map Committee
  • VM-68
  • Posts: 121
Re: -DP2stat: Server side stat tracking for Digital Paintball2-
« Reply #6 on: March 23, 2019, 06:49:35 AM »
The script doesn't add grabs unless you eliminated the opponent team.