problem with SmartfoxClient, please help.
Posted: 13 Apr 2007, 17:03
Hi,
Please Lapo, Patso or any smartfox guru.. I'm stuck with this.
I'm creating a game using an extension with custom login.
In my config I have this:
The response of that is
I'm using an external class for the SmartfoxClient
When I call any extension command, I get the message [ WARNING ] > Extension Call has invalid RoomID. User = malito -
And I have this in my flash
that code returns this:
I have converted the SmartFoxCLient object to JSON, and this is the result:
Please.. I really need this.
Please Lapo, Patso or any smartfox guru.. I'm stuck with this.
I'm creating a game using an extension with custom login.
In my config I have this:
The extension code is:<Zone name="mw" uCountUpdate="true" buddyList="20" maxUsers="4000" customLogin="true">
<Rooms>
<Room name="Lumina" maxUsers="50" isPrivate="false" isTemp="false" autoJoin="true" uCountUpdate="true" />
</Rooms>
<Extensions>
<extension name="json" className="jsonSample.as" type="script" />
<extension name="mwlogin" className="mwLogin.as" type="script" />
</Extensions>
</Zone>
Code: Select all
var obj = _server.loginUser(nick, pass, chan)
...
if (error == "")
{
u = _server.instance.getUserByChannel(chan)
trace("User " + u.getName() + " logged in")
response.nick = u.getName()
response._cmd = "logOK"
}
...
_server.sendResponse(response, -1, null, chan)
_server.sendRoomList(u)
_server.joinRoom(u,-1,false,defaultRoom.getId(),"",false,false)The console have the following output:[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='137' /></body></msg>
[Received]: <cross-domain-policy><allow-access-from domain="*" to-ports="9339" /></cross-domain-policy>
[Received]: <msg t="sys"><body action="apiOK" r="0" /></msg>
[Sending]: <msg t='sys'><body action='login' r='0'><login z='mw'><nick><![CDATA[malito]]></nick><pword><![CDATA[monster]]></pword></login></body></msg>
[Received]: <msg t="xt"><body action="xtRes" r="-1"><dataObj><var n='nick' t='s'>malito</var><var n='_cmd' t='s'>logOK</var></dataObj></body></msg>
RESPONSE: {"_cmd":"logOK","nick":"malito"}
[Sending]: <msg t='sys'><body action='getRmList' r='-1'></body></msg>
[Received]: <msg t="sys"><body action="rmList" r="0"><rmList><rm id="7" priv="0" temp="0" game="0" ucnt="0" maxu="50" maxs="0"><n>Lumina</n></rm></rmList></body></msg>
[Sending]: <msg t='sys'><body action='autoJoin' r='-1'></body></msg>
[Received]: <msg t="sys"><body action="uCount" r="7" u="1" /></msg>
[Received]: <msg t="sys"><body action="rmList" r="0"><rmList><rm id="7" priv="0" temp="0" game="0" ucnt="1" maxu="50" maxs="0"><n>Lumina</n></rm></rmList></body></msg>
[Received]: <msg t="sys"><body action="joinKO" r="0"><error msg="User is already in this room!" /></body></msg>
[Received]: <msg t="sys"><body action="uCount" r="7" u="1" /></msg>
Code: Select all
12:14:44.499 - [ INFO ] > Server is up and running!
[mwLogin.as]: User malito logged in
[mwLogin.as]: User: malito joined room: Lumina
12:18:22.162 - [ INFO ] > Room Join Error: User is already in this room!, User:
malito, IP: 127.0.0.1
12:18:23.107 - [ WARNING ] > Extension Call has invalid RoomID. User = malito -
/127.0.0.1I'm using an external class for the SmartfoxClient
Code: Select all
this.evtQueue = [];
//this.ip = "www.xatme.com";
this.ip = "127.0.0.1";
this.port = 9339;
this.zone = "mw";
this.extensionName = "mwlogin";
this.protocolo = "xml";
this.smartfox = new SmartFoxClient();
this.smartfox.debug = true;
this.smartfox.onConnection = Delegate.create(this,handleConnection);
this.smartfox.onUserVariablesUpdate = Delegate.create(this,onUserVariablesUpdate);
this.smartfox.onRoomListUpdate = Delegate.create(this,onRoomListUpdate);
....
And I have this in my flash
Code: Select all
var room:Room = this.smartfox.getRoom(this.smartfox.activeRoomId)
trace("CurrentRoom is : " + room.getName())
trace("My user ID is: " + this.smartfox.myUserId)
trace("I am player " + this.smartfox.playerId)
trace("Current API version: " + this.smartfox.getVersion())Code: Select all
CurrentRoom is : undefined
My user ID is: null
I am player null
Current API version: 1.3.7Code: Select all
{"ipAddress":"127.0.0.1","messageHandlers":{"xt":{},"sys":{}},"arrayTags":
{"uLs":true,"rmList":true,"vars":true,"bList":true,"vs":true},
"amIModerator":false,"changingRoom":false,"isConnected":true,
"debug":true,"playerId":null,"myUserName":"",
"myUserId":null,"activeRoomId":null,
"buddyVars":[],"buddyList":[],
"roomList":[null,null,null,null,null,null,null,{"variables":[],"userList":{},
"specCount":null,"userCount":1,"description":"","updatable":false,
"limbo":false,"priv":false,"game":false,"temp":false,"maxSpectators":0,
"maxUsers":50,"name":"Lumina","id":7}],
"os":{"hexTable":[0,1,2,3,4,5,6,7,8,9],
"ascTabRev":[],"ascTab":[],"eof":"","debug":false,"xmlStr":"",
"tabs":"\t\t\t\t\t\t\t\t\t\t"}}