Jump to content
  • 0

Server And Player Online Time


ElBato

Question

I want to do this and I have no idea.
 
This image is a time counter that the character is online, the counter returns to 0 when it returns to login.
thump_9166879shot00009.jpg


This image is the same as the first, but the time that the server is online
thump_9166884shot00010.jpg

 

The part in the htm ready, but I need the java side

Thanks in advance and sorry for my english..

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0
// Server Time
private static String getServerRunTime()
{
int timeSeconds = (GameTimeController.getGameTicks() - 36000) / 10;
String timeResult = (timeSeconds >= 86400 ? Integer.toString(timeSeconds / 86400) + " Days " + Integer.toString((timeSeconds % 86400) / 3600) + " hours." : Integer.toString(timeSeconds / 3600) + " Hours " + Integer.toString((timeSeconds % 3600) / 60) + " mins.");
return timeResult;
}

Link to comment
Share on other sites

  • 0

 

I want to do this and I have no idea.
 
This image is a time counter that the character is online, the counter returns to 0 when it returns to login.
thump_9166879shot00009.jpg

This image is the same as the first, but the time that the server is online
thump_9166884shot00010.jpg

 

The part in the htm ready, but I need the java side

Thanks in advance and sorry for my english..

 

you want that on npcright??

Link to comment
Share on other sites

  • 0

Sorry for the delayed response, I was sick.

 

I am creating a npc/command which displays the statistics of the character and server. What I lack is the code to display the time line of the session character and server.

 

Sorry for my eng

Edited by ElBato
Link to comment
Share on other sites

  • 0

so you actually need a time counter that will get increased until a player log out?

Yes

 

 

// Server Time
private static String getServerRunTime()
{
int timeSeconds = (GameTimeController.getGameTicks() - 36000) / 10;
String timeResult = (timeSeconds >= 86400 ? Integer.toString(timeSeconds / 86400) + " Days " + Integer.toString((timeSeconds % 86400) / 3600) + " hours." : Integer.toString(timeSeconds / 3600) + " Hours " + Integer.toString((timeSeconds % 3600) / 60) + " mins.");
return timeResult;
}

 

Thanks ExCaLiBuR®, u are amazing.. 1 less, lack the other :D
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...