Player Movement History

Curgen

New Member
Good day,

i would just like to find out if it would be possible to add an option to track and display player movement history (Like a line from where they started when they logged in and the route they travelled to their current location).

If this is already possible could you please explain to me how to do this.

This is a really great tool and it is helping us a lot in managing our server. (Unclearwalls BlissAdmin tool)

Thanks in advance
 
I used to use a table I created with the name survivor_log which was filled with a trigger in the survivor table everytime that table was updated, but since the last release it is not working as I see that the last_updated field is no longer changing :S . Does anyone know how is this handled now?
 
I would like to know how to add this in as well, if someone could break it down. Im no database genius. Im still learning. Thanks
 
Sorry, the last_updated is working, I was checking the wrong dates lol. I will upload what I use to track the users in my server.
 
This would be greatly appreciated.

What do you use to view this, can you view this via the Bliss Admin tool, or have you done your own php page?
 
Sorry the delay, I was a little bit busy. Well, so far I have to do this all by queries as I don't have the time to develop a tool (Don't know if I will do in the future), I understand that there's a few tools which are user friendly but unfortunayely this is not, as you have to make your queries directly to the database and you must have a little bit of knowledge in order to get the info you need.

Ok, what I did is very simple, I have created a table which has the same fields of the survivor table and called it survivor_log , here is the code in mysql to create that table (Remember to use the dayz database as default):


Code:
delimiter $$
 
CREATE TABLE `survivor_log` (
  `id` int(8) unsigned NOT NULL AUTO_INCREMENT,
  `unique_id` varchar(128) NOT NULL,
  `world_id` smallint(5) unsigned NOT NULL,
  `worldspace` varchar(60) NOT NULL,
  `inventory` varchar(2048) NOT NULL,
  `backpack` varchar(2048) NOT NULL,
  `medical` varchar(255) NOT NULL,
  `is_dead` tinyint(3) unsigned NOT NULL,
  `model` varchar(128) NOT NULL,
  `state` varchar(128) NOT NULL,
  `survivor_kills` int(3) unsigned NOT NULL,
  `bandit_kills` int(3) unsigned NOT NULL,
  `zombie_kills` int(4) unsigned NOT NULL,
  `headshots` int(4) unsigned NOT NULL,
  `last_ate` int(3) unsigned NOT NULL,
  `last_drank` int(3) unsigned NOT NULL,
  `survival_time` int(3) unsigned NOT NULL,
  `last_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `start_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx1_main` (`unique_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8$$

Then I created a trigger in the survivor table which is activated before the table is updated and will insert the record in the survivor_log :

Code:
delimiter $$
CREATE
DEFINER=`root`@`localhost`
TRIGGER `dayz`.`Survivor_Log`
BEFORE UPDATE ON `dayz`.`survivor`
FOR EACH ROW
BEGIN
 
insert into survivor_log (`unique_id`,`world_id`,`worldspace`,`inventory`,`backpack`,`medical`,`is_dead`,`model`,`state`,`survivor_kills`,`bandit_kills`,`zombie_kills`,`headshots`,`last_ate`,`last_drank`,`survival_time`,`last_updated`,`start_time`)
values(NEW.unique_id,NEW.world_id,NEW.worldspace,NEW.inventory,NEW.backpack,NEW.medical,NEW.is_dead,NEW.model,NEW.state,NEW.survivor_kills,NEW.bandit_kills,NEW.zombie_kills,NEW.headshots,NEW.last_ate,NEW.last_drank,NEW.survival_time,NEW.last_updated,NEW.start_time);
 
END
$$

Keep in mind that this will generate a lot of records in you survivor_log table as it is saving everything.

With this table I have identified and tracked players with banned weapons, teleports, injecting items, etc. I did this same procedure with the instance_vehicle table to track also the inventory and check if a player was using a vehicle if it is a suspect of teleport :p , I think I will do to the instance_deployable to track tents history also.

This is the query I use to track, you can modify it to your needs.

Code:
select
profile.unique_id,
name,
CONCAT_WS(' ', LPAD(ROUND(SUBSTRING_INDEX(SUBSTRING_INDEX(worldspace, '[', -1), ',', 1)/100, 0), 3, '0'), LPAD(ROUND((15360-SUBSTRING_INDEX(SUBSTRING_INDEX(worldspace, ',', -2), ',', 1))/100, 0), 3, '0')) as grid_ref,
TIMEDIFF(last_updated,start_time)DIFERENCIA,
last_updated,
start_time,
is_dead,
inventory,
backpack,
survivor_kills,
bandit_kills,
medical,
worldspace,
model
 
from survivor_log
inner join profile on survivor_log.unique_id=profile.unique_id
 
where profile.unique_id=WHATEVER ID YOU ARE CHEKING
-- where inventory like '%TWS%' uncomment this one and comment the above to look for banned weapons.
 
order by last_updated desc

Ok, that's all, I hope this could help a bit.
 
Ok so I tried in putting that into mine. The first set worked but the 2nd set.
Code:
delimiter $$
CREATE
DEFINER=`root`@`localhost`
TRIGGER `dayz`.`Survivor_Log`
BEFORE UPDATE ON `dayz`.`survivor`
FOR EACH ROW
BEGIN
 
insert into survivor_log (`unique_id`,`world_id`,`worldspace`,`inventory`,`backpack`,`medical`,`is_dead`,`model`,`state`,`survivor_kills`,`bandit_kills`,`zombie_kills`,`headshots`,`last_ate`,`last_drank`,`survival_time`,`last_updated`,`start_time`)
values(NEW.unique_id,NEW.world_id,NEW.worldspace,NEW.inventory,NEW.backpack,NEW.medical,NEW.is_dead,NEW.model,NEW.state,NEW.survivor_kills,NEW.bandit_kills,NEW.zombie_kills,NEW.headshots,NEW.last_ate,NEW.last_drank,NEW.survival_time,NEW.last_updated,NEW.start_time);
 
END
$$
I keep getting an error saying
" #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 9 "
Line 9 is the beginning of values (NEW.unique_id, etc.
 
mmm, I have created a new database for namalsk and ran both queries and worked, are you executing this with workbench and as root?
 
Well I will say I am not an advanced SQL database user in any way. I am very new to this but I to a point understand tables and how they work. Just the code I am still learning. Originally I used the delimiter $$ and END $$ functions but I got a different error using those Ill post that one.
"
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$$' at line 12 "
When I take out the $$ it gives me the previous error.

I have no idea about workbench or root. I would say root i guess? lol

I am logged into Bliss PhP Web admin tool using the SQL query menu, its the same way I input the 1st code that created the survivor_log table. That worked just fine. I have NaviCat on my PC should I try doing it that way? Or would it make a difference? Sorry if these are too simple of questions. I do plan on taking a database class this next term. I should get better at this lol
 
Oh also,

At the bottom of my PHP admin control panel for the hive.
In the SQL tab it says on the bottom, it shows Delimeter and box with a value I can change If needed but in that box the dafault Delimiter is set to the semicolon key or ' ; '
minus the apostrophes.
is that causing an error since you were using $$?
 
Hi, ive found a different tool to do this for you.

It is also an admin tool, if anyone want the link let me know.

(it is still in beta and needs to be purchased, only works with bliss private hives)
 
Hi, ive found a different tool to do this for you.

It is also an admin tool, if anyone want the link let me know.

(it is still in beta and needs to be purchased, only works with bliss private hives)


have about if you give us a link?
 
sorry could not paste full link, have to wait 10 days after registering to paste a link according to the forum
 
Sounds pretty awesome but Im not a fan of the ... Its in beta but needs to be purchased

Once you finish your beta testing on it and work out all the bugs let me know. Ill help beta test it on my server, but im surely not spending money on some beta program for a game that will be obsolete in the next month. Id rather just look through the hives and work codes in manually. Pretty comfortable with Bliss Hive. Im learning so much more this way.

Maybe if standalone ends up have private hives and this tool makes its way over to it. Would be nice to have while Im trying to get my DayZ adventures in. Cut down on Admin time.

Thanks though! :)
 
Im guessing that the survivor_log table grow very rapidly in size. Anybody checked how large the table is after a few weeks of running? of course it all depends on how many players you have on the server.


I use a different approach for checking player movement history (only done when an incident is reported in). I parse the hiveExt.log. It contain all updates to the database.

eg. for player updates(php code):
Code:
$hits = preg_match_all("/^([0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*)\s.*Worldspace` = '(\[[0-9]*,\[[0-9]*\.?.*,[0-9]*\.?.*,[0-9]*\.?.*]]).*id` = ([0-9]*).*$/i", $line, $result);

here you get date/time, position and id (id in survivor table) in the $result array.

A 100mb hiveExt.log takes on my old server around 10sec to parse.

Then I display it on a map (google map with polyline and markers). Every marker has title with id and timestamp.

example (filtered out only one id):
http://i44.servimg.com/u/f44/17/84/76/17/captur10.jpg
 
Back
Top