Page 1 of 1
Serverside errorcodes
Posted: 26 Jun 2007, 07:40
by potmo
Id like to add my own errorcodes and override the errormessages return by i.e. _server.
I Know that its not possible to just edit a xml-file to change the errormessages so ill have to do like this
var errorcode = 0
var obj = _server.loginUser(nick, pass, chan)
if (obj.error == "This user name is already taken")
{
errorcode = 135
}
// return logKO and errorcode
The problem is i dont really know all errors and i dont want to do everything that might produce an error so is there any reference of the errormessages?
Posted: 26 Jun 2007, 16:23
by Lapo
Yep, the error message system is pretty limited at the moment without error codes. It's our intention to add a code-based error system to allow localization etc...
At the moment we don't have such list ready, but I can prepare one in a couple of days and publish it here.
Hope it helps
Posted: 26 Jun 2007, 20:30
by potmo
thats really great.
I dont want to send a lot of information to the hackers.
If they want to hack me. They will have to work for it

Posted: 29 Jun 2007, 12:13
by Lapo
Here we go:
Login errors:
Sorry, this zone is full!
You should provide a non empty user name!
Socket connection is null
Socket connection is closed
User already logged in
Zone does not exist!
This user name is already taken.
Your username contains badwords!
Too many connections coming from your ip address.
Join errors:
Room does not exist or was just deleted (id=*roomId)
This room is currently full
All player slots are occupied
All spectator slots are occupied
Room creation errors:
Bad or empty room name.
Room name already taken.
Too many rooms.
You have reached the max. amount of rooms that you can create at once.
Buddy List errors:
Unable to load the Buddy List!
Your buddy list is full!
Hope to have listed them all
* = roomId of the missing room
Posted: 02 Jul 2007, 07:18
by potmo
thanks a lot! This will make my day brighter

Posted: 02 Jul 2007, 21:10
by potmo
for those who wants to know. it seems as all strings have a space in the beginning
"This user name is already taken." is really " This user name is already taken."
Posted: 03 Jul 2007, 06:52
by Lapo
Really? I've double checked and no, there's no initial white space.
Sounds odd
Posted: 05 Aug 2009, 06:23
by Ganius
Sorry to revive an old post, but is there somewhere where not only these messages are listed, but also explains the cause of these errors? I have a number of "Socket connection is closed" errors every day, but I'm not sure what would be causing them...
Cheers,
G.
Posted: 05 Aug 2009, 13:29
by Lapo
Hi,
there isn't an official list of errors, as most of them are self explanatory.
Could you provide a copy/paste of the error you are referring to?
Posted: 07 Aug 2009, 07:06
by Ganius
Code: Select all
var obj = _server.loginUser(nick, pass, chan, true);
var error = "";
if (obj.success == false)
{
error = obj.error;
if (error != null)
{
error = error.trim();
}
}
if (error == "")
{
// normal login procedures
response._cmd = "logIN";
.....
}
else
{
// login error
response._cmd = "logBAD";
trace("Login failed for "+nick+": "+error);
.....
}
Sometimes in the login error, we get 'Login failed for XXXXXX: Socket connection is closed'.
So I'm assuming that this just means that between the time the user connected to the server and sent a login request, the socket was closed somehwere along the way. It's just that we get quite a few per day.
I DO detect some hacked clients, and log them in, get some details, then log them out again, but this is in a completely separate process before we even get to this section - if they are using a hacked client, I don't even try to log them in here. They only reach this code if everything is ok. So it's not a matter of me disconnecting them myself beforehand.
It's not a massive problem (I don't think), but I'm curious as to why it happens so often...
Cheers,
G.
Posted: 07 Aug 2009, 08:06
by Lapo
So I'm assuming that this just means that between the time the user connected to the server and sent a login request, the socket was closed somehwere along the way. It's just that we get quite a few per day.
Exactly correct.
It's not a massive problem (I don't think), but I'm curious as to why it happens so often...
If you have a high traffic and use a database for checking credentials you might need to adjust the threading settings in order to avoid that login requests lag.
Database calls are slower than normal code execution so you need to add few more threads if you see the server queues become busy.
How does this connects to the problem you have mentioned?
If the server queue are very busy and there's not enough worker threads the login process will slow down and people will have to wait in line. If the wait is too long the socket will disconnect.
Maybe you could adjust the <MaxSocketIdleTime> as well if it's too short.
This topic is discussed in greater details here:
http://www.smartfoxserver.com/docs/docP ... Safety.htm
Posted: 12 Aug 2009, 12:18
by Ganius
Is there any message returned for a user that has been banned? If not, is there some indication of banned users (either banned by username or IP) trying to connect and log in?
Cheers,
G.
Posted: 12 Aug 2009, 19:14
by Lapo
Yes, the user receives a login error message that is customizable via the config.xml ( <BannedLoginMessage> )
Posted: 13 Aug 2009, 06:04
by Ganius
Forgot about that one!!
But I was thinking more along the lines of server-side logging/notification/messages etc. So we can see if a banned user is trying to gain access but is being denied due to their ban. Is there anything like that?
Also, is there a limit to the number that can be entered into the <BanDuration> tag?
Cheers,
G.
Posted: 13 Aug 2009, 15:56
by Lapo
No there isn't
<BanDuration> is a signed integer, so it goes up to 2^31