What I'm doing wrong?
Posted: 12 Apr 2007, 15:29
Hi, I'm creating a game where the players can move an avatar in the scene.
to update the position I want to use an extension, because I want to autorize the movement before the players do it. Then, send the update to the clients.
I have an extension based on the "simple login extension" in the docs. It works OK for login, When a player sends a login request, I have this code and trace on the server:
And the server has the following trace:
But, with the sendXtMessage nothing happens:
Flash Code:
Extension Code:
Flash Trace
Extension Trace:
In my config:
What I'm doing wrong?
to update the position I want to use an extension, because I want to autorize the movement before the players do it. Then, send the update to the clients.
I have an extension based on the "simple login extension" in the docs. It works OK for login, When a player sends a login request, I have this code and trace on the server:
Code: Select all
function handleInternalEvent(evt)
{
trace("Event received: " + evt.name)
if (evt.name == "loginRequest")
...
Code: Select all
[mwLogin.as]: Event received: loginRequest
[mwLogin.as]: Event received: userLostFlash Code:
Code: Select all
var obj:Object = {};
obj.targetX = 100;
obj.targetY = 250;
this.smartfox.sendXtMessage("mwlogin", "walk", obj, "xml");Code: Select all
function handleRequest(cmd, params, user, fromRoom)
{
trace("Request received: " + cmd);
}
Code: Select all
[Sending]: <msg t='xt'><body action='xtReq' r='null'><![CDATA[<dataObj><var n='name' t='s'>mwlogin</var><var n='cmd' t='s'>walk</var><obj t='o' o='param'><var n='targetY' t='n'>100</var><var n='targetX' t='n'>200</var></obj></dataObj>]]></body></msg>Code: Select all
Nothing...Code: Select all
<Zone name="mw" uCountUpdate="true" buddyList="20" maxUsers="4000" customLogin="true">
<Rooms>
<Room name="Lumina" maxUsers="100" 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>
<Moderators status="on">
<Mod name="modName" pwd="modPass" />
</Moderators>
</Zone>