Skip to content

Commit 091ba13

Browse files
committed
fixes triggering onChange on root structure.
1 parent e4bdfe3 commit 091ba13

File tree

1 file changed

+5
-4
lines changed
  • Assets/Plugins/Colyseus/Serializer/Schema

1 file changed

+5
-4
lines changed

Assets/Plugins/Colyseus/Serializer/Schema/Schema.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,17 @@ public void Decode(byte[] bytes, Iterator it = null, ReferenceTracker refs = nul
199199
if (it == null) { it = new Iterator(); }
200200
if (refs == null) { refs = new ReferenceTracker(); }
201201

202-
this.refs = refs;
203-
204202
var totalBytes = bytes.Length;
205203

206204
int refId = 0;
207205
IRef _ref = this;
208-
var changes = new List<DataChange>();
209206

207+
this.refs = refs;
208+
refs.Add(refId, _ref);
209+
210+
var changes = new List<DataChange>();
210211
var allChanges = new OrderedDictionary(); // Dictionary<int, List<DataChange>>
211-
refs.Add(refId, this);
212+
allChanges.Add(refId, changes);
212213

213214
while (it.Offset < totalBytes)
214215
{

0 commit comments

Comments
 (0)