14.02.2016, 18:47
Reduce the size of those arrays.
Array "str" is really interesting, you're including the reason into it but it's only 356 chars long, while the reason is 1024 chars long.
On the other end, your chat is limited to 144 chars, so there is no reason why "reason" should be 1024 chars long.
Use "string[256]" for both the dialog and all messages, it should be enough, and make "reason[128]" instead of 1024.
Also IP is too long. IP[16] should be enough. The longest IP is one with 4 numbers of 3 digits each like 123.123.123.123 and counts 15 chars, but you need 16 chars for the added 0 character to indicate the end of the string.
Also add a check to see if "id" isn't 65535 (invalid player id), otherwise you could operate on index 65535 of your PlayerInfo array and have Array-out-of-bounds issues.
Place this immediately below the sscanf line.
Array "str" is really interesting, you're including the reason into it but it's only 356 chars long, while the reason is 1024 chars long.
On the other end, your chat is limited to 144 chars, so there is no reason why "reason" should be 1024 chars long.
Use "string[256]" for both the dialog and all messages, it should be enough, and make "reason[128]" instead of 1024.
Also IP is too long. IP[16] should be enough. The longest IP is one with 4 numbers of 3 digits each like 123.123.123.123 and counts 15 chars, but you need 16 chars for the added 0 character to indicate the end of the string.
Also add a check to see if "id" isn't 65535 (invalid player id), otherwise you could operate on index 65535 of your PlayerInfo array and have Array-out-of-bounds issues.
Place this immediately below the sscanf line.