Jump to content

Tool L2Server Admin Socket

Recommended Posts



As you know, there is no separate "Admin" socket for GM. But iv you send packet 00 (Version) with negative values, it will dump some information:


import socket
import struct 

port = 7777         # client accepting port
host = ''  # game server IP

clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect((host, port))

# Preparing request
my_bytes = bytearray()
# size

# packetId

# -3


# Response

unpacker = struct.Struct('h')
size = unpacker.unpack(clientsocket.recv(unpacker.size))[0] - 2
#print "got packet with payload's size: %s" % size

data = clientsocket.recv(size)
#print('Received', repr(data))

# format:                  cdddddS
unpacker = struct.Struct('<bIIIII')

# c        i              i              i          i            i
msgId, npcConnected, maxUsers, usersConnected, usersPlaying, privateStores = unpacker.unpack(data[0:unpacker.size])

str_unpacker = struct.Struct('%ss' % (size - unpacker.size))
stats = str_unpacker.unpack(data[unpacker.size:])[0].decode('utf-16')
print('msgId: %s, npcStatus (2 - Off, 1 - On): %s, maxUsers: %s, usersConnected: %s, usersPlaying: %s, privateStores: %s, stats (free memory, allocated objects, free pool slots, server Up time minutes): %s') % (msgId, npcConnected, maxUsers, usersConnected, usersPlaying, privateStores, stats)


And results:



msgId: 0, npcStatus (2 - Off, 1 - On): 2, maxUsers: 1, usersConnected: 0, usersPlaying: 0, privateStores: 0, stats (free memory, allocated objects, free pool slots, server Up time minutes): 2381589,24,2996,57


This doesn't work for C4, they changed format a bit. But if you have IDA, you can check yourself

Edited by MasterToma
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disbaled AdBlock