Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Shaiya > Shaiya Private Server > Shaiya PServer Development
You last visited: Today at 14:33

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Request] Player's online time.

Discussion on [Request] Player's online time. within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2014
Posts: 132
Received Thanks: 224
Smile [Request] Player's online time.

Is there any possible way to read how long a player has been online in total?
Or if it is possible to read how long a player was online at a specific day.

Thanks in advance!
Penchod-Shaiya is offline  
Old 08/18/2014, 05:27   #2
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
Yes, you gotta start a counter since the server's first day.
nubness is offline  
Old 08/18/2014, 07:53   #3
 
elite*gold: 0
Join Date: Apr 2014
Posts: 132
Received Thanks: 224
Quote:
Originally Posted by nubness View Post
Yes, you gotta start a counter since the server's first day.
Not for yourself... as a owner of a server, is there a way to create a script to read how long a player has been online in total ?
Penchod-Shaiya is offline  
Old 08/18/2014, 16:53   #4
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
Not for a server that is already online for some time, no.
nubness is offline  
Old 08/19/2014, 13:33   #5
 
elite*gold: 0
Join Date: Apr 2014
Posts: 132
Received Thanks: 224
Quote:
Originally Posted by nubness View Post
Not for a server that is already online for some time, no.
I was checking the database tables and found PS_GameLog.dbo.Userlog where is shows every time a player logs in + how long he was online (if I am not wrong) it´s pasted as time such as: 2014-19-08 07:10 03:20 (where I think it´s for the Date - Clock - Online Time (3 minutes and 20 seconds) I don´t know I think it is wrong tho but there is a table for when a character logs on and when it logs out is the "LeaveDate" but that one gets updated every time a player re-logs...
Penchod-Shaiya is offline  
Old 08/19/2014, 14:04   #6
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
That table doesn't store the log out time from what I see in my database, which makes it useless for what you need.
nubness is offline  
Old 08/19/2014, 16:34   #7
 
elite*gold: 0
Join Date: Apr 2014
Posts: 132
Received Thanks: 224
Quote:
Originally Posted by nubness View Post
That table doesn't store the log out time from what I see in my database, which makes it useless for what you need.
Thank you Sir.

A small beside-request from me personally to you, could you make a tutorial on how to make a trigger for something?
Examples:
Trigger to hand out kills per Rank level and not per Kills.
Trigger to hand out DP once a player logs in once a day (daily login reward)

or something random, just the way of basics of a trigger ? - Tried google'ing but all I found was basic SQL useless stuff x.x

Thanks again
Penchod-Shaiya is offline  
Old 08/19/2014, 18:01   #8
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
A trigger is basically a query executed when something happens to a table.
There are 3 trigger types - INSERT, UPDATE, DELETE.

It looks something like this:
Code:
CREATE TRIGGER LeTrigger
ON Chars
AFTER UPDATE
AS IF UPDATE(K1)
BEGIN
-- the SQL code to execute
END
This will create a trigger which executes when the a cell of the K1 column from the Chars table is modified.

The easier way to create a trigger is by using the SQL Server Management Studio interface. Expand a table's options by clicking the + sign -> right click on Triggers -> New Trigger.

There are 2 important terms for triggers to keep in mind - inserted and deleted.

deleted represents the row before it was changed, whereas inserted represents the new row.

For example, for an UPDATE(K1) trigger:
Code:
DECLARE @OldK1 INT = (SELECT K1 FROM deleted) -- old value
DECLARE @NewK1 INT = (SELECT K1 FROM inserted) -- new value
That's pretty much the basics.

There's also some other aspects, such as INSTEAD OF, which are rather interesting. For example, INSTEAD OF INSERT will mean that the code in the BEGIN/END block will be executed INSTEAD OF an insert, rather than AFTER the insert.
nubness is offline  
Thanks
8 Users
Reply


Similar Threads Similar Threads
( Time to Pin ! ) E*PvP Player NAMES
04/24/2012 - League of Legends Guides & Strategies - 5 Replies
Du willst mit mehr leuten spielen ? mit deiner E*PvP komu. ? Na denn, wer möchte wird hier geaddet =) Pool :
Quick Time Player Pro
10/13/2010 - elite*gold Trading - 3 Replies
Verkaufe hier die keys für dieses programm ;).Legal erworben.Angebote bitte. Angebote ab 300Eg. Oder 6€ Paypal.
Cps for player 1 time in day ??
08/19/2009 - CO2 Private Server - 10 Replies
Hey, can any say me how i can make it?? i will give all players 1 time in day free cps . if players login eh get thecps but only 1 time in day and not all login ty for help guys i use 2.7 bina
Long Time and I Still Online With Big Number Of Player
07/12/2009 - CO2 Private Server - 2 Replies
Tito Still Online Wellcome To Tito Online Screen Shoot



All times are GMT +1. The time now is 14:33.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.