Skip to content

Commit a7e9910

Browse files
committed
update example
1 parent 3a49a23 commit a7e9910

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

Assets/ColyseusClient.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,26 +88,14 @@ void OnStateChangeHandler (object sender, RoomUpdateEventArgs e)
8888
// Setup room first state
8989
if (e.isFirstState) {
9090
IndexedDictionary<string, object> players = (IndexedDictionary<string, object>) e.state ["players"];
91-
92-
// trigger to add existing players
93-
foreach(KeyValuePair<string, object> player in players)
94-
{
95-
this.OnPlayerChange (new DataChange {
96-
path = new Dictionary<string, string> {
97-
{"id", player.Key}
98-
},
99-
operation = "add",
100-
value = player.Value
101-
});
102-
}
10391
}
10492
}
10593

10694
void OnPlayerChange (DataChange change)
10795
{
108-
// Debug.Log ("OnPlayerChange");
109-
// Debug.Log (change.operation);
110-
// Debug.Log (change.path["id"]);
96+
Debug.Log ("OnPlayerChange");
97+
Debug.Log (change.operation);
98+
Debug.Log (change.path["id"]);
11199
// Debug.Log (change.value);
112100

113101
if (change.operation == "add") {

0 commit comments

Comments
 (0)