Hello, For the upcoming new statistics website I want to create a directory client in PHP. I already have a directory client in Java but running a java program from a PHP script isn't the most efficient and in this case the performance (or more specifically, the time of execution) is important. This is what I have so far. You can see I have followed the program structure of the PHP ping client by GoldEye (more or less). -- snip snap, see attachment below -- I haven't done much socket programming in PHP so this piece of code isn't working as it should. Basically, I need to make sure I'm going the right path. Given the following protocol and D1st0rt's protocol packets, can someone help me with the correct format parameters of the PHP pack method?
CLIENT SERVER
------------------------------------ --------------------------------------------------
Encryption request 0x01 ------->
<------ 0x02 Encryption response
Server list request (reliable) 0x03 ------->
Synchronization request 0x05 ------->
<------ 0x03 Reliable Packet
Reliable ACK 0x04 ------->
<------ 0x0E Cluster
<------ 0x03 Reliable Packet (contains 0x0A Massive Chunk)
Reliable ACK 0x04 -------> (0x03 is received multiple times for the complete server list)
Disconnect 0x07 ------->
<------ 0x07 Confirm Disconnection For example, the Encryption request packet I need to send contains 0x00, 0x01 (type byte), client encryption key of 4 bytes and 2 bytes for the protocol version (0x00 and 0x01). Right now I have this done with $out=pack("vvVvv",0x00,0x01,$clientkey,0x01,0x00); but I doubt this is correct. Which format parameter do I need to use for packing 4 bytes? an unsigned short (v) or an unsigned long (V)?