My studio is developing a game for a company that just bought a full license
for smartfoxserver pro, and we are finding the codebase very easy to understand and a breeze to network and develop with. We have run into one
significant hitch, however.
We are using Actionscript 3 and are using the flash development environment, and as of yet, we haven't needed to create an extension and are programming client side only.
We have found a bug, the likes of which I have never before seen, or thought possible, which has derailed development and we don't know whether it is something we have done wrong or if it is a bug in the server.
The reason I describe it as a bug the likes of which I have never seen is that the bug pops up periodically during our coding and has to be fixed repeatedly, and then for the mysterious part... we sometimes, while the bug is not present, change a line or two of code, compile and test, the bug comes back, then we change the same lines of code back to what they were when it was working, recompile, but the bug is still there!
Anyway, the bug occurs when one client exits from the game after creating a new room. The other clients which are connected to the game then crash with a bug which is similar to when the updateRoomList is called in the wrong order, but its then followed by a message mentioning that the client has received malformed XML, and continues to receive that same message on every attempt to communicate with the server.
Heres the error log from both clients:
Code: Select all
Crashing Client Report:
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='154' /></body></msg>
[ RECEIVED ]: <cross-domain-policy><allow-access-from domain='*' to-ports='9339' /></cross-domain-policy>, (len: 91)
[ RECEIVED ]: <msg t='sys'><body action='apiOK' r='0'></body></msg>, (len: 53)
//Great! Connected successfully!
[Sending]: <msg t='sys'><body action='login' r='0'><login z='warlordsZone'><nick><![CDATA[Username]]></nick><pword><![CDATA[]]></pword></login></body></msg>
[ RECEIVED ]: <msg t='sys'><body action='logOK' r='0'><login n='Username' id='13' mod='0'/></body></msg>, (len: 90)
//Successfully logged in as Username
[Sending]: <msg t='sys'><body action='getRmList' r='-1'></body></msg>
[ RECEIVED ]: <msg t='sys'><body action='rmList' r='0'><rmList><rm id='1' priv='0' temp='0' game='0' ucnt='1' maxu='99999' maxs='0'><n><![CDATA[MainRoom]]></n></rm></rmList></body></msg>, (len: 172)
//We're Getting Rooms
//Gathered Room List
[Sending]: <msg t='sys'><body action='autoJoin' r='-1'></body></msg>
[ RECEIVED ]: <msg t='sys'><body action='joinOK' r='1'><pid id='0'/><vars /><uLs r='1'><u i='12' m='0'><n><![CDATA[Usernam]]></n><vars></vars></u><u i='13' m='0'><n><![CDATA[Username]]></n><vars></vars></u></uLs></body></msg>, (len: 211)
[ RECEIVED ]: <msg t='sys'><body action='roomAdd' r='0'><rm id='35' priv='0' temp='1' game='0' max='2' spec='0' limbo='0'><name><![CDATA[room]]></name><vars /></rm></body></msg>, (len: 163)
[Sending]: <msg t='sys'><body action='getRmList' r='1'></body></msg>
//We have received a new room named: room0
[ RECEIVED ]: <msg t='sys'><body action='rmList' r='0'><rmList><rm id='35' priv='0' temp='1' game='0' ucnt='0' maxu='2' maxs='0'><n><![CDATA[room]]></n></rm><rm id='1' priv='0' temp='0' game='0' ucnt='2' maxu='99999' maxs='0'><n><![CDATA[MainRoom]]></n></rm></rmList></body></msg>, (len: 266)
//We're Getting Rooms, roomlist has updated.
//Gathered Room List
[ RECEIVED ]: <msg t='sys'><body action='pubMsg' r='1'><user id='12' /><txt><![CDATA[GIVE]]></txt></body></msg>, (len: 97)
// We Send a public message to the creator of room who is simultaneously in room and MainRoom, to request an object representing room they just entered.
[ RECEIVED ]: <msg t='sys'><body action='dataObj' r='1'><user id='12' /><dataObj><![CDATA[<dataObj><var n='address' t='s'>InRoom</var><obj t='a' o='contents'><var n='0' t='s'>room0</var><var n='1' t='s'>Usernam</var></obj></dataObj>]]></dataObj></body></msg>, (len: 243)
// We got an object representing room and the names of users in room0 : Usernam
// Usernam closes his client.
[ RECEIVED ]: <msg t='sys'><body action='userGone' r='1'><user id='12' /></body></msg>, (len: 72)
// Error on UserGone, but function handleUserLeaveRoom is never called
// Client no longer receives any information but userGone from server.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at it.gotoandplay.smartfoxserver.handlers::SysHandler/handleUserLeaveRoom()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at it.gotoandplay.smartfoxserver.handlers::SysHandler/handleMessage()
at it.gotoandplay.smartfoxserver::SmartFoxClient/::xmlReceived()
at it.gotoandplay.smartfoxserver::SmartFoxClient/::handleMessage()
at it.gotoandplay.smartfoxserver::SmartFoxClient/::handleSocketData()
[ RECEIVED ]: <msg t='sys'><body action='userGone' r='1'><user id='12' /></body></msg><msg t='sys'><body action='roomDel'><rm id='35'/></body></msg>, (len: 134)
//We for some reason recieve malformed information from the server
TypeError: Error #1088: The markup in the document following the root element must be well-formed.
at it.gotoandplay.smartfoxserver::SmartFoxClient/::xmlReceived()
at it.gotoandplay.smartfoxserver::SmartFoxClient/::handleMessage()
at it.gotoandplay.smartfoxserver::SmartFoxClient/::handleSocketData()
Crasher Client Report:
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='154' /></body></msg>
[ RECEIVED ]: <cross-domain-policy><allow-access-from domain='*' to-ports='9339' /></cross-domain-policy>, (len: 91)
[ RECEIVED ]: <msg t='sys'><body action='apiOK' r='0'></body></msg>, (len: 53)
//Great! Connected successfully!
[Sending]: <msg t='sys'><body action='login' r='0'><login z='warlordsZone'><nick><![CDATA[Username]]></nick><pword><![CDATA[]]></pword></login></body></msg>
[ RECEIVED ]: <msg t='sys'><body action='logOK' r='0'><login n='Username' id='16' mod='0'/></body></msg>, (len: 90)
//Successfully logged in as Usernam
[Sending]: <msg t='sys'><body action='getRmList' r='-1'></body></msg>
[ RECEIVED ]: <msg t='sys'><body action='rmList' r='0'><rmList><rm id='1' priv='0' temp='0' game='0' ucnt='0' maxu='99999' maxs='0'><n><![CDATA[MainRoom]]></n></rm></rmList></body></msg>, (len: 172)
//We're Getting Rooms
//Gathered Room List
[Sending]: <msg t='sys'><body action='autoJoin' r='-1'></body></msg>
[ RECEIVED ]: <msg t='sys'><body action='joinOK' r='1'><pid id='0'/><vars /><uLs r='1'><u i='16' m='0'><n><![CDATA[Username]]></n><vars></vars></u></uLs></body></msg>, (len: 152)
[Sending]: <msg t='sys'><body action='createRoom' r='1'><room tmp='1' gam='0' spec='0' exit='1'><name><![CDATA[room0]]></name><pwd><![CDATA[]]></pwd><max>2</max><vars></vars></room></body></msg>
[ RECEIVED ]: <msg t='sys'><body action='roomAdd' r='0'><rm id='37' priv='0' temp='1' game='0' max='2' spec='0' limbo='0'><name><![CDATA[room0]]></name><vars /></rm></body></msg>, (len: 164)
[Sending]: <msg t='sys'><body action='getRmList' r='1'></body></msg>
// We have created room0
[Sending]: <msg t='sys'><body action='joinRoom' r='1'><room id='37' pwd='' spec='0' leave='0' old='1' /></body></msg>
[ RECEIVED ]: <msg t='sys'><body action='rmList' r='0'><rmList><rm id='1' priv='0' temp='0' game='0' ucnt='1' maxu='99999' maxs='0'><n><![CDATA[MainRoom]]></n></rm><rm id='37' priv='0' temp='1' game='0' ucnt='0' maxu='2' maxs='0'><n><![CDATA[room0]]></n></rm></rmList></body></msg>, (len: 267)
//We're Getting Rooms, the roomlist updates because of the change in room numbers.
//Gathered Room List
[ RECEIVED ]: <msg t='sys'><body action='joinOK' r='37'><pid id='0'/><vars /><uLs r='37'><u i='16' m='0'><n><![CDATA[Username]]></n><vars></vars></u></uLs></body></msg>, (len: 154)
// we close client
We hope someone can help us, this has had our heads in a spin for a long time, and we need to continue development.
If you need our code to debug more just ask.
Thanks in Advance
Chance Wees
CEO Figbox Games