How to sync players in multiplayer game

Hello Developers,

I am doing a MMO for web with Unity3d and Smartfox, there is a virtual world in the game, any player can login and he/she can run in the virtual world, this is the basic thing of my game.

I want to know that, how can I sync each login players on other side, suppose, 3 peoples A,B,C are login from different browsers and running in the virtual word in same direction. How can I update the position of player A on B,C side, similarly we need to update position of B on A,C side and so on.

Therefore result will be, position of each player will be same on each side(A,B,C side) on each frame.

I was tried to follow [this][1] tutorial by smartfox but PROXIMITY_LIST_UPDATE never fired.

Please let me know your suggestions and tutorials for that.

Thanks!!
[1]: SmartFoxServer 2X documentation: mmo-rooms

I am still a noob at SmartFox but this is what I can suggest-

add an event listener-

SmartFox smartFox = = SmartFoxConnection.Connection;
smartFox.AddEventListener(SFSEvent.USER_VARIABLES_UPDATE, OnUserVariableUpdate);

Now in that OnUserVariableUpdate function, check the BaseEvent parameter to check if the SFSUser is smartfox.MySelf. If its not you, then spawn (if its not already spawned) or update the variables- something like this-

ArrayList changedVars = (ArrayList)evt.Params["changedVars"]; //evt is the BaseEvent Parameter
SFSUser user = (SFSUser)evt.Params["user"];
OtherPlayer.transform.position = new Vector3((float)user.GetVariable("x").GetDoubleValue(), (float)user.GetVariable("y").GetDoubleValue(), (float)user.GetVariable("z").GetDoubleValue());