26.02.2015, 15:57
That is not a solution, that's a workaround.
That select query is only 97 characters long, not accounting for the placeholder. Given that maximum length of a player's name is 24 characters and the maximum length of an ip address is 15 characters, the total maximum length for that query is 97 + 24 + 15 + 1 null terminator = 137 characters. Yet you declare a string 500 characters in size to hold that.
Then you declare another 256 character string to hold "timeBanned" which should realistically only contain something like 16 characters.
Then you declare yet another 256 character to format the message sent to the client, even though the maximum chat output is 144 characters.
In short: decrease your string sizes wherever you can and don't scatter them around carelessly.
That select query is only 97 characters long, not accounting for the placeholder. Given that maximum length of a player's name is 24 characters and the maximum length of an ip address is 15 characters, the total maximum length for that query is 97 + 24 + 15 + 1 null terminator = 137 characters. Yet you declare a string 500 characters in size to hold that.
Then you declare another 256 character string to hold "timeBanned" which should realistically only contain something like 16 characters.
Then you declare yet another 256 character to format the message sent to the client, even though the maximum chat output is 144 characters.
In short: decrease your string sizes wherever you can and don't scatter them around carelessly.

