Show ONLINE and OFFLINE

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
netvirus
Advanced User
Advanced User
Posts: 408
Joined: Sun Aug 02, 2009 3:43 pm
Location: Russia
Contact:

Show ONLINE and OFFLINE

Post by netvirus »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 4134:
L2JDP Revision 7354:

It is possible to divide somehow display of players which really online and that which sit on an offline trade ?
Such review would be very convenient, at present all of them in one heap...
FidoNet - iddqd
User avatar
Gnacik
L2j Veteran
L2j Veteran
Posts: 925
Joined: Tue Dec 16, 2008 3:49 pm
Location: Wąchock ٩(̾●̮̮̃̾•̃̾)۶ Polska
Contact:

Re: Show ONLINE and OFFLINE

Post by Gnacik »

sure, via telnet for example.

Code: Select all

<?$usetelnet = fsockopen("yourtelnetip", "yourtelnetport", $errno, $errstr, 30);if($usetelnet) {   fputs($usetelnet, "yourtelnetpassword");   fputs($usetelnet, "\r\n");   fputs($usetelnet, "status");   fputs($usetelnet, "\r\n");   fputs($usetelnet, "exit\r\n");   while (!feof($usetelnet)) {      $line = fgets($usetelnet, 2000);      if( preg_match('/Player Count: (.*)\/([0-9]{1,9})/i', $line, $matches)) {         $online = $matches[1];      }      if( preg_match('/Offline Count: (.*)\/([0-9]{1,9})/i', $line, $matches)) {         $offline = $matches[1];      }   }   $real = ($online-$offline);   fclose($usetelnet);}else {   $real = "-";   $offline = "-";}echo "Online players: {$real}<br>Offline stores: {$offline}<br>";?> 
User avatar
netvirus
Advanced User
Advanced User
Posts: 408
Joined: Sun Aug 02, 2009 3:43 pm
Location: Russia
Contact:

Re: Show ONLINE and OFFLINE

Post by netvirus »

Well. But not absolutely that that is necessary.
I should see names of those who online
For this purpose, what teleported to the player and to look that it does and whether is it a bot :D
FidoNet - iddqd
User avatar
Notorious
Posts: 501
Joined: Thu May 28, 2009 3:50 pm
Location: Sweden

Re: Show ONLINE and OFFLINE

Post by Notorious »

This might be the fix you're looking for.
Shows players who are in shop-mode or crafting-mode in grey colour in the Community BBS region tab.
This is part of a larger patch I have for the Community BBS, and I'm pretty sure it should work, but needs to be tested since I only "cut out" this part for you:

Code: Select all

Index: java/com/l2jserver/gameserver/communitybbs/Manager/RegionBBSManager.java===================================================================--- java/com/l2jserver/gameserver/communitybbs/Manager/RegionBBSManager.java	(revision 4168)+++ java/com/l2jserver/gameserver/communitybbs/Manager/RegionBBSManager.java	(working copy)@@ -391,7 +391,10 @@ 					} 					else 					{-						htmlCode.append(player.getName());+						if (player.isInCraftMode() || player.isInStoreMode())+							StringUtil.append(htmlCode, "<font color=\"808080\">", player.getName(), "</font>");+						else+							htmlCode.append(player.getName()); 					}  					htmlCode.append("</a></td>");@@ -484,7 +487,10 @@ 					} 					else 					{-						htmlCode.append(player.getName());+						if (player.isInCraftMode() || player.isInStoreMode())+							StringUtil.append(htmlCode, "<font color=\"808080\">", player.getName(), "</font>");+						else+							htmlCode.append(player.getName()); 					}  					htmlCode.append("</a></td>"); 
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Show ONLINE and OFFLINE

Post by janiii »

i think he means not all trading players, but only players in offline mode

Code: Select all

player.getClient().isDetached()
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
Notorious
Posts: 501
Joined: Thu May 28, 2009 3:50 pm
Location: Sweden

Re: Show ONLINE and OFFLINE

Post by Notorious »

netvirus wrote:For this purpose, what teleported to the player and to look that it does and whether is it a bot :D
Indeed, but to me it sounded like he want to filter out the players who can't be bots to narrow down the players to teleport to, and then not only offline shops should count... imho.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Show ONLINE and OFFLINE

Post by janiii »

Notorious wrote:Indeed, but to me it sounded like he want to filter out the players who can't be bots to narrow down the players to teleport to, and then not only offline shops should count... imho.
netvirus wrote:It is possible to divide somehow display of players which really online and that which sit on an offline trade ?
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
netvirus
Advanced User
Advanced User
Posts: 408
Joined: Sun Aug 02, 2009 3:43 pm
Location: Russia
Contact:

Re: Show ONLINE and OFFLINE

Post by netvirus »

I suggest to make probably to include or switch off/on this option in a configuration file.

General.properties:
# Default: False
BBSShowPlayerList = True

# Default: False. To sort only "live" players.
BBSShowOnlyOnlinePlayer = True
FidoNet - iddqd
User avatar
ButterCup
Posts: 15
Joined: Fri May 07, 2010 8:43 am
Location: Romania

Re: Show ONLINE and OFFLINE

Post by ButterCup »

not working
I get no errors (when i sit on craft mode name in Community is the same no change)
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Show ONLINE and OFFLINE

Post by janiii »

try using as color: "LEVEL" or "FF9933" or "FF0000" or "00FF00"
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
Notorious
Posts: 501
Joined: Thu May 28, 2009 3:50 pm
Location: Sweden

Re: Show ONLINE and OFFLINE

Post by Notorious »

ButterCup wrote:not working
I get no errors (when i sit on craft mode name in Community is the same no change)
Try logging out and in again. It's only updated when somebody logs in if I remember correctly.
lerato
Posts: 1
Joined: Tue Apr 01, 2008 2:42 am

Re: Show ONLINE and OFFLINE

Post by lerato »

It is possible to change the telnet rights? i mean to not have access to all telnet commands just to safe commands.
Post Reply