Error Messages

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
Bosskafett
Posts: 41
Joined: 24 Jan 2012, 00:04

Error Messages

Post by Bosskafett »

How can I configure Error Messages?
if(_global.is_rocketsnail == 1){
mc.snail._visible = true;
smartfox.setUserVariables({snl:1, init:false})
}
The Re-creator of Old Games ;D
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Error Messages

Post by rjgtav »

Hello.
Which error messages are you referring to?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Bosskafett
Posts: 41
Joined: 24 Jan 2012, 00:04

Re: Error Messages

Post by Bosskafett »

The Error Messages such as "User already logged in", "This Zone is currently not active!" and those sort of login errors. Thanks smartfox
if(_global.is_rocketsnail == 1){
mc.snail._visible = true;
smartfox.setUserVariables({snl:1, init:false})
}
The Re-creator of Old Games ;D
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Error Messages

Post by rjgtav »

Well, I think you can't customize the on the server-side. But you can easily customize it on the client-side.
For example, when you get a Login Error saying "User already logged in" and you want to change that message, you can simply do the following:

Code: Select all

smartfox.onLogin = function (res:Object):Void
{
    if (res.success){
        trace("Successfully logged in as " + response.name)
    }else{
	var error = "";
	if(res.error == "User already logged in") error = "My new custom message 1";
	else if(res.error == "This Zone is currently not active!") error = "My new custom message 2";
        trace("Zone login error; the following error occurred: " + error)
}
But I will confirm tomorrow if it is possible or not to customize it on the server-side. I suggest you to check this topic, as it has the list of all the messages that aren't configurable through the config.xml file.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Bosskafett
Posts: 41
Joined: 24 Jan 2012, 00:04

Re: Error Messages

Post by Bosskafett »

Thanks rjgtav, that worked great.
Thanks for taking the time to write out the code too. :D

cheers,
Jack
if(_global.is_rocketsnail == 1){
mc.snail._visible = true;
smartfox.setUserVariables({snl:1, init:false})
}
The Re-creator of Old Games ;D
Post Reply