Using the Island Demo, I am trying to do is "SetVariables" for the LocalSpawnPlayer so when the next person logs in, and it loops to set the RemoteSpawnPlayer, it will show the values I set for that User.
Also, when I log into the AdminTool of SmartFoxServer, I don't see any values set.
Here is a sample code:
Code: Select all
private void SpawnLocalPlayer() {
int n = spawnPoints.Length;
String colorChoice;
String characterType;
SetCharacterInfo myTest;
myTest = GameObject.Find("PivotParams").GetComponent(typeof(SetCharacterInfo)) as SetCharacterInfo;
SmartFoxClient client = NetworkController.GetClient();
Hashtable myUserList = client.GetActiveRoom().GetUserList();
User myUser = (User)myUserList[client.myUserId];
Hashtable myHashtable = new Hashtable();
colorChoice = myTest.colorChoice;
characterType = myTest.characterType;
myHashtable.Add("colorChoice", colorChoice);
myHashtable.Add("characterType", characterType);
myUser.SetVariables (myHashtable);
Debug.Log("myUser.characterType: "+myUser.GetVariable("characterType"));
Debug.Log("myUser.colorChoice: "+myUser.GetVariable("colorChoice"));
Transform spawnPoint = spawnPoints[random.Next(n)];
localPlayerObject.transform.position = spawnPoint.transform.position;
localPlayerObject.transform.rotation = spawnPoint.transform.rotation;
localPlayerObject.SendMessage("StartSending"); // Start sending our transform to other players
}
It works locally, but not across the network.
Any thoughts?