[Code] L2OFF Game Server Status

This is retail implementation for getting L2OFF data for site w/o direct connections to database, etc. NC Soft uses it for all gameservers. You can try to check it. If you want to use it for L2J server then you need implement responce for ProtocolVersion -3 in gameserver code. Many times ago i’m used it for getting info from L2OFF servers and for own project site. As example L2ON.NET still uses it.

<?php
	@error_reporting ( E_ALL ^ E_WARNING ^ E_NOTICE );
	@ini_set ( 'display_errors', true );
	@ini_set ( 'html_errors', false );
	@ini_set ( 'error_reporting', E_ALL ^ E_WARNING ^ E_NOTICE );

	// Open socket.
	$socket = fsockopen("127.0.0.1", 7777) or die('Sock ERROR');

	// Pack bytes XX XX - lenght, XX XX XX XX - Opcode (-3).
	$package = pack("vCi",6,0,-3);

	// Write to socket.
	fwrite($socket,$package);

	// Read answer.
	$read = fread($socket,73);

	// Closing socket.
	fclose($socket);

	// Unpack recieved data by template.
	$array = unpack("vsize/Cid/iworld/imax/icurrent/iplaying/istore", $read);
	
	// Show result.
	echo "Information -> Total: (".$array['current']."), Online: ({$array[playing]}), WTS/WTB/Craft: ({$array[store]}), Maximal: ({$array[max]})\n";
?>

Have fun!

5 thoughts on “[Code] L2OFF Game Server Status

  1. Sorry, no luck
    Changed $package = pack(“vCi”,6,0,-3); to $package = pack(“vCi”,6,14,-3);
    and result the same
    Information -> Total: (), Online: (), WTS/WTB/Craft: (), Maximal: ()
    one more thing
    unpack(“vsize/Cid/iworld/imax/icurrent/iplaying/istore”
    but in
    // Show result.
    echo
    we use current/playing/store/max
    Maybe we need to use icurrent/iplaying/istore/imax ??
    Thank you for your help.

  2. Just try
    pack(“vCi”,6,0x0E,-3);
    pack(“vCi”, 7, 0, -3);
    pack(“vCi”,6,0,-3);
    pack(“vCi”,6,14,-3);
    Bad packet size – in server console.

    • I gave you worked code from WEB status page for L2OFF server. Assume what your L2OFF server haven’t any reactions for packet SendProtocolVersion with Protocol -3. Try to craft this packet and send him via L2PHX as example for checking have you any response or not.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *