Jump to content

Utility: Stat Player Connected


Recommended Posts


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

Stat Player Connected


Adding two new table and a script that help you see when the players are connected and how many.

-cust_StatPlayerCo checking every hour every day how many player were actually connected.
-cust_StatPlayerIpDay checking everyday how many players were actually connected.

Compatible with gepard and last_unique_id (enable/disable in OnInit).

There's no npc to check that in game currently, only checking in database directly.
If people are interested, I could add a npc/a command that make it possible to check directly in game for gm and/or players.


  • Submitter
  • Submitted
    06/01/2020
  • Category
  • Video
  • Content Author
    Kreustoo

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  148
  • Reputation:   10
  • Joined:  12/03/18
  • Last Seen:  

Great release!

I am assuming you need to install this on your website right?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

it would be interesting to know the ID's of the respective accounts ... it just shows a numeric ID 1,2,3,4,5 etc ...
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

@Dev G Inc It was mostly done to be checked using sql request (I used like that), but maybe it would be interesting to have a npc in game doing the work. So yeah you'll have to create the tables in your databases. But I won't do any fluxcp release ^^'.

 

@IsabelaFernandez You mean having exactly the id in another table to know who was connected? I mostly thought about it being just helping for stat. Like, knowing you usually have more player at 21h the friday than 21h the thursday (for event preparation) and watching the number of player (hopefully) growing. The problem is that it checks only the ip/gepard id, so you'd have to store exactly all the acc connected with the respective id/gid, it's doable. You'd like to have that possiblity what for?

 

Edited by Kreustoo
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  148
  • Reputation:   10
  • Joined:  12/03/18
  • Last Seen:  

Just now, Kreustoo said:

@Dev G Inc It was mostly done to be checked using sql request (I used like that), but maybe it would be interesting to have a npc in game doing the work. So yeah you'll have to create the tables in your databases. But I won't do any fluxcp release ^^'.


I have not downloaded this yet but i will check your work. Great work man.

I think it can be created with NPCs

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

13 minutes ago, Kreustoo said:

@IsabelaFernandez You mean having exactly the id in another table to know who was connected? I mostly thought about it being just helping for stat. Like, knowing you usually have more player at 21h the friday than 21h the thursday (for event preparation) and watching the number of player (hopefully) growing. The problem is that it checks only the ip/gepard id, so you'd have to store exactly all the acc connected with the respective id/gid, it's doable. You'd like to have that possiblity what for?

 

 

to be honest i still don't know exactly how your system works, could you explain it better? the purpose of me wanting to know the exact player ID is to find out which account is the most active on the server

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

That system is mostly just giving you the number of different player connected, not who @IsabelaFernandez
cust_StatPlayerIpDay: tells you how many player were connected at a specific day - ie the 31/01/20 you had 35 different players connected (without knowing who)
cust_StatPlayerCo: tells you for each hour, how many player were connected - ie the 31/01/20 at 3:00 25 players were connected (without knowing who)

Is that clearer :/?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

5 minutes ago, Kreustoo said:

That system is mostly just giving you the number of different player connected, not who @IsabelaFernandez
cust_StatPlayerIpDay: tells you how many player were connected at a specific day - ie the 31/01/20 you had 35 different players connected (without knowing who)
cust_StatPlayerCo: tells you for each hour, how many player were connected - ie the 31/01/20 at 3:00 25 players were connected (without knowing who)

Is that clearer :/?

 

One I understood basically, it serves to know the maximum number of players reached in the day, ok. But does the other report the number of hours the player was online during the day? how do i know what time xx: xx amount of players reached?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

The first one count how many player was connected in total during a day, not the maximum player reached the day, it'll count globally how many connected.
The second count how many players was connected in total during one specific hour of a day.

It does not track anything for any particular player, you can't know how many hours a specific players were connected, you just know how many were there.

 

@Dev G Inc I wrote this (not heavily tested)

Inside the OnInit add:

bindatcmd("showStats",strnpcinfo(3) + "::OnStat",99,99);

Inside the npc add:


OnStat:
	//At first it shows today's values
	.@year = gettime(7);
	.@month = gettime(6);
	.@day = gettime(5);
	OnShowDay:
	.@ipCurrent = 0;
	query_sql("SELECT `IpTotal` FROM `cust_StatPlayerIpDay` WHERE `Year`="+.@year+" AND `Month`= "+.@month+" AND `Day` = "+.@day,.@ipCurrent);
	if(.IsDayFirst)
		mes .@day+"/"+.@month+"/"+.@year;
	else
		mes .@month+"/"+.@day+"/"+.@year;
	mes "Total connected:" + .@ipCurrent;
	for(.@i = 0;.@i<23;.@i++){
		.@ipDiff = 0;
		query_sql("SELECT `ipDiff` FROM `cust_StatPlayerCo` where `Year`="+.@year+" AND `Month`= "+.@month+" AND `Day` = "+.@day+" AND `Hour` ="+.@i,.@ipDiff);
		mes .@i+") "+.@ipDiff;
	}
	next;
	select("Another Day");
	mes "Year";
	input .@year;
	mes "Month";
	input .@month;
	mes "Day";
	input .@day;
	next;
	goto OnShowDay;
end;

Using showStats as an admin you can now watch what is saved inside the sql!

But it's kinda limited, I used it to compare month to another month and things like that. But at least using that you can already fast check.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...