Skip to content

cp6/DayZ-Trader-Bank-logging

Repository files navigation

DayZ Trader and Bank logging

Requires

Trader Bank logging from Steam Workshop OR Trader logging from Steam Workshop

Trader mod by Dr_J0nes

Banking mod by Deadcraft

Instructions

Open class.php and edit your DayZ server profile directory at line 9. This is where your log files and other mod config files are.

If you are only doing trader logging set HAS_ATM = false; at line 11 of class.php

Run database.sql onto your MySQL server.

Edit in MySQL connection details, starting line 16 of class.php.

You can have a SELECT only privileged user for tight security on the front end or just use an INSERT, UPDATE, SELECT privileged user for the whole class.

If using admin system add your Steam API key into line 20 of class.php at $api_key = '';

Fetching logs

Putting log files into the Database (fetch.php):

<?php
require_once('class.php');
$dz = new dzTraderBankLogging();

$dz->setLogType('trade');//Trader logs
$dz->processLogs();

//Dont need following if only doing trader logs:
$dz->setLogType('atm');//ATM logs
$dz->processLogs();

//To Get yesterdays logs use setDateAsYesterday()
//Like:
$dz->setLogType('trade');//Trader logs
$dz->setDateAsYesterday();//Get yesterdays (date) logfile
$dz->processLogs();

Point a Cron job at this for two minutes for up-to date data or once an hour otherwise.


Admin system

You can now protect the pages from anyone and everyone viewing them if they knew its URL.

Setting

ONLY_ADMINS_CAN_VIEW = true;

at line 18 of class.php

Means that to access any of the pages you need to sign in with Steam and have your Steam uid in the admins table.

This authorization is done with OpenId openid.php

Adding admins:
INSERT IGNORE INTO `dz_tb_logs`.`admins` (`uid`) VALUES ('ADMIN_STEAM_UID_HERE');
Updating existing database to add admin table:

*Only for those with a previous version installed

USE `dz_tb_logs`;
CREATE TABLE `admins` (
	`uid` VARCHAR(64) NULL,
	PRIMARY KEY (`uid`)
)
COLLATE='latin1_swedish_ci';

index.php has most recent hours set as 24 by default and limit for most recent table as 100 default. Change these with: index.php?hours=X&limit=X

Screenshots

About

DayZ trader and bank logging web app for mod

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published