Error opening room
Posted: 24 Jun 2010, 21:16
Hi, I am having trouble logging into my game. I have 3 different zones, and the one I use, connects to a database and retrieves usernames and passwords. The problem is, when I try to login to that zone, it says the room does not exist... Even though I know it does, because I check every time in the config file. When I switch over to simpleChat where it just needs a username, it works fine! So why is this? I think I know why but I dont know how to fix it.
In order to login using the usernames and passwords of players, there is a function for onExtentionResponce. This is where I think the problem is because when your not using accounts, it wont use that part. Here is the onExtentionResponce part:
I also thought this would be helpful! Here is the output of me running the game:
Does anyone know how to fix this? Because I know its not the rest of the coding becasue it all works fine on the zone simpleChat. And if anyone is wondering, the logOK is just saying that the user and pass are right.
In order to login using the usernames and passwords of players, there is a function for onExtentionResponce. This is where I think the problem is because when your not using accounts, it wont use that part. Here is the onExtentionResponce part:
Code: Select all
//----------------------------------------------------------
// The server must handle an extention response
//----------------------------------------------------------
smartfox.onExtensionResponse = function(resObj:Object) {
if (resObj._cmd == "logOK") {
// Login Success Example Code
gotoAndPlay("chat")
smartfox.joinRoom("The Hall")
_global.myName = resObj.name
} else if (resObj._cmd == "logKO") {
// Login failed example code
_global.isBusy = true
_root.status_txt.text = "Something has gone wrong. Please refresh the page and try logging in again.";
redoLogin();
}
}
Code: Select all
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='140' /></body></msg>
[Received]: <cross-domain-policy><allow-access-from domain="*" to-ports="9349" /></cross-domain-policy>
[Received]: <msg t="sys"><body action="apiOK" r="0" /></msg>
[Sending]: <msg t='sys'><body action='login' r='0'><login z='Island of Turtles'><nick><![CDATA[Billybob]]></nick><pword><![CDATA[********]]></pword></login></body></msg>
[Received]: <msg t="xt"><body action="xtRes" r="-1"><dataObj><var n='err' t='s'></var><var n='_cmd' t='s'>logOK</var></dataObj></body></msg>
SmartFoxError: requested room to join does not exist!
[Sending]: <msg t='sys'><body action='loadB' r='-1'></body></msg>
[Received]: <msg t="sys"><body action="bList" r="-1"><bList /></body></msg>