Jump to content
  • 0

Player Reward System (PHP)(formally known as DRS)


MassAsster

Question

Player Reward System:

 

Due to the concern from the Epoch dev team about the whole donation based reward system, I completely re-hauled the way tokens are given to players. Players can use their in game Zombie kills, Bandit Kills and Player Kills to gain tokens in this system. You will only be able to bank tokens that are in your current ALIVE character, meaning once your character is dead - you will not be able to bank the zombie kills.

Tokens can be used on player rewards such as a backpack with building loot, a base item (like a well with water, a guard tower ),  a vehicle (not keyed), a vault code change and more.

 

How it works:

 After playing the game, I rack up 34 zombie kills, 14 bandit kills and 1 human kill.

 

Depending on the server operator, he may chose to use that 1 human kills against me when calculating the banking.

 

For the sake of this example, lets say the rewards are as follows:

(Server operators can set values )

.03  for zombie kills

.04 for bandits

.05 for humans

 

34 x .03  =  1.02

14 x .04  = .56

1 x .5 = .05

----------------------

Total Banked Tokens  1.53

 

My Zombie kills would be re-set to 0, along with my bandit kills. Human kills would remain as 1 to be used against me again next bank.

 

 

Banking is done manually - introducing a Risk / Reward system -  meaning if I kill 150 zombies, but die before I can get into the system and "bank them" - I lose my zombie kills and will not be able to bank them.

 

Image3.jpg

 

 

Each module is either allowed or disallowed separately by the server operator, IE: if he/she chooses, he can leave active building supplies, while disabling the revive. Revive is also customizable with returning to life with full gear, or being stripped of all gear and having to retrieve your body.

 

 

 

Image8.jpg

Image10.jpg

Image15.jpg

Image4.jpg

 

 

Logs are available to monitor player usage of the tool

Several SQL injection holes have been patched

Player stats are built into the system

 

http://www.es-gamers.com/prsystem.zip

 

https://github.com/MassAsster/epochproject

(Pull requests welcome)

 

 

This will be entered into GIT HUB to be a revamp in-progress, another player has indicated interest in keeping the project alive and adding features to it.

 

 

Current limitations :

 

Any "de-bug" monitor , "kill counter" etc will not be auto- updated if you bank your kills while in-game, you will need to return to the lobby and join back in for these to update your kills.

 

 Due to the quick patch work of some SQL injection protection, you must have your login database on a server with the Database port of 3306 -  your game server database port does not matter

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

buddy.png

 

A few fixes for the kill/token system were applied  -  issue with not removing kills from the player was resolved.

 

The Buddy system was added in - 

 

You set a 6 digit pin number ,  give this pin number to your friends, and they can now use a token to move their character to your character's location. Remember to eat or drink before your buddy uses the buddy system to move to you, this will allow the world location to be updated to your precise location and not a location from a few minutes earlier.

Link to comment
Share on other sites

  • 0

Mhhh, cant connect to the database....... getting this "DB Connection Failed: SQLSTATE[HY000] [2002] Connection refused"

dont know which database, i got a extern webspace, for the Player stats i use my webspace database and the dayz_epoch database is extern.

Anyway, tried it with a php test script on both databases, both worked fine.

my you could help me a bit :( ?

Link to comment
Share on other sites

  • 0

Your webserver at the moment is required to have a default port of 3306 for SQL - but the error your getting seems like your being blocked. If your hosting your php on the same box that is hosting the database for the users, then make sure you are using 'localhost' for the inc/config.php

 

Usually a connection refused means wrong location (address) or incorrect port

 

without actually looking at your setup(configs), it's REALLY hard to trouble shoot.

Link to comment
Share on other sites

  • 0

Mhh idk, both database (webspace database and my extern database on my root server) have the default port (3306), dont think its the extern database cause i also run phpmyadmin on my webspace a access with it my extern database.

I will try the localhost thing. maybe it works. 

 

this is how my config.php looks like (changed the passwords and ips)

http://pastebin.com/hNZR1mxA

Link to comment
Share on other sites

  • 0
//setup the names and tables for the GAME SERVER database
////////////MODIFY THIS SECTION //////////////////
$hostname = "129.270.299.21";
$username = "dayz_epoch";
$password = "d7dyrasFUPwkLB26r363nL4";
$databasename = "dayz_epoch";
 
this GAME SERVER connection needs a port
 
 
$hostname = "129.270.299.21:3306";

 

 

I'm assuming your getting this access error after logging into the system?

Link to comment
Share on other sites

  • 0

 

//setup the names and tables for the GAME SERVER database
////////////MODIFY THIS SECTION //////////////////
$hostname = "129.270.299.21";
$username = "dayz_epoch";
$password = "d7dyrasFUPwkLB26r363nL4";
$databasename = "dayz_epoch";
 
this GAME SERVER connection needs a port

 

 
$hostname = "129.270.299.21:3306";

 

 

I'm assuming your getting this access error after logging into the system?

 

Nop, just when i load the login.php, so it should be the database for the reward system itself or ?

btw. i deleted the .html files cause as far as i know they are not nessecary anymore or ?

tried it with the port seems also not to work, and for the database itself i use also the IP with and without the port, did not work also.

Link to comment
Share on other sites

  • 0

if your not able to log in - then yes- the database connection for the first round setup (the login database) is not correct -  remember that whatever you have for the first config must match in the inc/config.php

 

(there are two configs)

 

Example

 

 

//set up the names of the database and table for the WEB SERVER
////////////MODIFY THIS SECTION //////////////////
$db_name ="apocalyp_donators";
$table_name ="authorize";  // don't touch table name
//connect to the server and select the database
$server = "localhost";    
$dbusername = "apocalyp_bobdole";   
$dbpassword = "lovepasswords#1121";
////////////MODIFY THIS SECTION //////////////////
//setup the names and tables for the GAME SERVER database
////////////MODIFY THIS SECTION //////////////////
$hostname = "199.116.118.7:3306";
$username = "myusername";
$password = "mypasswprd";
$databasename = "dayz_overpoch";
////////////MODIFY THIS SECTION //////////////////

 

 

 

2nd config inside the  INC  folder

 

 

//////  WEB SERVER SETUP. NOT GAME SERVER DATABASE //////
if (!defined('DB_HOST')) define('DB_HOST', 'localhost');
if (!defined('DB_USER')) define('DB_USER', 'apocalyp_bobdole');
if (!defined('DB_PASS')) define('DB_PASS', 'lovepasswords#1121');
if (!defined('DB_NAME')) define('DB_NAME', 'apocalyp_donators');
if (!defined('DB_PORT')) define('DB_PORT', '3306');
////////////MODIFY THIS SECTION //////////////////

if (!defined('NUMBER_OF_ATTEMPTS')) define('NUMBER_OF_ATTEMPTS', 6);

////////////MODIFY THIS SECTION //////////////////
// REMEMBER TRAILING SLASH >> /
if (!defined('DOMAIN_NAME')) define('DOMAIN_NAME', 'http://apocalypseatlanta.com/perks/');
////////////MODIFY THIS SECTION //////////////////

if (!defined('LOGIN_LOCATION')) define('LOGIN_LOCATION', DOMAIN_NAME . 'login.php');

////////////MODIFY THIS SECTION //////////////////
if (!defined('SITE_NAME')) define('SITE_NAME', 'ApocalypseAtlanta.com');
if (!defined('EMAIL_EXT')) define('EMAIL_EXT', 'apocalypseatlanta.com');
if (!defined('APP_VERSION')) define('APP_VERSION', '1');
////////////MODIFY THIS SECTION //////////////////

Link to comment
Share on other sites

  • 0

Anyway, no i configured everything can sucessfully register and login, but when i am loggged in this message is coming:

Access denied for user ''@'172.17.42.1' (using password: NO)

The corious thing is that i dont know that ip, its not my webserver, its not my webserver database and its not my gameserver database.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...