Hello
here have way to check how many time online each-each player? I want make ranking with online time.
Printable View
Hello
here have way to check how many time online each-each player? I want make ranking with online time.
i wrote a "Write-Through-Hook" to write Data from MainServer direct into the SQL Server. Id make a Thread with an incremental SQL Statment. Here a snippet:
So this Thread sleeps 1 Min then looks wich Players are online in this loop and builds up an SQL Statement, that increases an Integer called Min, wich i added into Playertable. If the Player is online the Statement counts up his Min Number and you know how many Minutes a Player was Online on your Server.PHP Code:while (1){
.
.
.
Sleep(60000);
h<<"UPDATE Player SET Online = (CASE WHEN PID = 545";
for (int i = 0; i<playerObjectIDList.Size(); i++) {
IPlayer* tempplayer = damn->QueryPlayer(playerObjectIDList.GetNthUID(i));
int PID = tempplayer->GetPID();
h<<" OR PID = "<<PID;
}
h<<" THEN 1 ELSE 0 END), Min = (CASE WHEN Online = 1 THEN Min + 1 ELSE Min END)";
}
Uppa i dont think so, because i dont see there a Value from wich i could get the Onlinetime of a Player, sure there are other ways to make a min counter for players but i have no idea how to solve it simple ^^