- Joined
- Aug 14, 2009
- Messages
- 2,304
- Reaction score
- 1,189
So because I'm kind of lost, and to be honest.. Frustrated. Can somebody help me with this?
This is how I sent my data to the server (So basically the "client")
This should result in:
But.. My server is getting everything right. Except SuperID. Which is:
The server is simply just reintpret_cast to my struct. Which is:
And after testing a while. The following works.
Somehow.. The c++ server ignores the first 3 bytes of the superid.
My question now is.. Why
EDIT:
Also this:
Results in:
If somebody wonders.. I'm outputting the superID like this:
This is how I sent my data to the server (So basically the "client")
PHP:
$ip = '127.0.0.1';
$queryport = 34005;
$socket = [USER=493081]fsockopen[/USER]("udp://".$ip, $queryport , $errno, $errstr, 1);
stream_set_timeout($socket, 1);
stream_set_blocking($socket, TRUE);
fwrite($socket, "\xFF\xFF\xFF\xFF\x56\x00\x00\x00\x1");
$response = fread($socket, 4096);
@fclose($socket);
header('Content-type: text/plain');
hex_dump($response);
This should result in:
Code:
ID = -1
Header = 0x56 / 86 (int)
SuperID = 1
But.. My server is getting everything right. Except SuperID. Which is:
Code:
3452816641 (ulong / DWORD) / cdcdcd01 (Hex)
The server is simply just reintpret_cast to my struct. Which is:
Code:
struct A2S_SUPERINFO
{
long id;
BYTE header;
DWORD superId;
};
And after testing a while. The following works.
PHP:
fwrite($socket, "\xFF\xFF\xFF\xFF\x56\x00\x00\x00\x1\x00\x00\x00");
Somehow.. The c++ server ignores the first 3 bytes of the superid.
My question now is.. Why
EDIT:
Also this:
PHP:
fwrite($socket, "\xFF\xFF\xFF\xFF\x56\x1\x00\x00\x00");
Results in:
Code:
3452816640 / cdcdcd00
If somebody wonders.. I'm outputting the superID like this:
Code:
printf("%lu / %lx\n", p->superId, p->superId);