diff --git a/Assets/Plugins/Colyseus/Room.cs b/Assets/Plugins/Colyseus/Room.cs index ebf4cafe..db52872d 100644 --- a/Assets/Plugins/Colyseus/Room.cs +++ b/Assets/Plugins/Colyseus/Room.cs @@ -19,7 +19,7 @@ public class RoomAvailable { /// /// - public class Room : DeltaContainer + public class Room : StateContainer { public string id; public string name; @@ -204,7 +204,7 @@ protected void Patch (byte[] delta) this.Set(newState); if (this.OnStateChange != null) - this.OnStateChange.Invoke(this, new RoomUpdateEventArgs(this.data)); + this.OnStateChange.Invoke(this, new RoomUpdateEventArgs(this.state)); } } } diff --git a/Assets/Plugins/Colyseus/DeltaListener/Compare.cs b/Assets/Plugins/Colyseus/StateListener/Compare.cs similarity index 100% rename from Assets/Plugins/Colyseus/DeltaListener/Compare.cs rename to Assets/Plugins/Colyseus/StateListener/Compare.cs diff --git a/Assets/Plugins/Colyseus/DeltaListener/DeltaContainer.cs b/Assets/Plugins/Colyseus/StateListener/StateContainer.cs similarity index 94% rename from Assets/Plugins/Colyseus/DeltaListener/DeltaContainer.cs rename to Assets/Plugins/Colyseus/StateListener/StateContainer.cs index c7ad8650..9f1140cd 100644 --- a/Assets/Plugins/Colyseus/DeltaListener/DeltaContainer.cs +++ b/Assets/Plugins/Colyseus/StateListener/StateContainer.cs @@ -25,9 +25,9 @@ public struct Listener public string[] rawRules; } - public class DeltaContainer + public class StateContainer { - public IndexedDictionary data; + public IndexedDictionary state; private List listeners; private FallbackPatchListener defaultListener; @@ -40,17 +40,17 @@ public class DeltaContainer { ":*", new Regex(@"(.*)") }, }; - public DeltaContainer (IndexedDictionary data) + public StateContainer (IndexedDictionary state) { - this.data = data; + this.state = state; this.Reset(); } public PatchObject[] Set(IndexedDictionary newData) { - var patches = Compare.GetPatchList(this.data, newData); + var patches = Compare.GetPatchList(this.state, newData); this.CheckPatches(patches); - this.data = newData; + this.state = newData; return patches; } diff --git a/Assets/Tests/ClientComponent.cs b/Assets/Tests/ClientComponent.cs index 6ca6c8e8..75894a43 100644 --- a/Assets/Tests/ClientComponent.cs +++ b/Assets/Tests/ClientComponent.cs @@ -9,7 +9,7 @@ public class ClientComponent : MonoBehaviour // Use this for initialization public IEnumerator Start () { - client = new Client("ws://localhost:3553"); + client = new Client("ws://localhost:8080"); yield return StartCoroutine(client.Connect()); diff --git a/Assets/Tests/RoomTest.cs b/Assets/Tests/RoomTest.cs index 7dcc7baf..db06ed16 100644 --- a/Assets/Tests/RoomTest.cs +++ b/Assets/Tests/RoomTest.cs @@ -29,8 +29,8 @@ public IEnumerator TestConnection() }; component.room.OnStateChange += (object sender, RoomUpdateEventArgs e) => { - Assert.NotNull (component.room.data ["players"]); - Assert.NotNull (component.room.data ["messages"]); + Assert.NotNull (component.room.state ["players"]); + Assert.NotNull (component.room.state ["messages"]); }; } } diff --git a/Assets/Tests/DeltaContainerTest.cs b/Assets/Tests/StateContainerTest.cs similarity index 97% rename from Assets/Tests/DeltaContainerTest.cs rename to Assets/Tests/StateContainerTest.cs index 9bdb7404..78f1935c 100644 --- a/Assets/Tests/DeltaContainerTest.cs +++ b/Assets/Tests/StateContainerTest.cs @@ -7,12 +7,12 @@ using Colyseus; using GameDevWare.Serialization; -public class DeltaContainerTest { - DeltaContainer container; +public class StateContainerTest { + StateContainer container; [SetUp] public void Init () { - container = new DeltaContainer (GetRawData()); + container = new StateContainer (GetRawData()); } [TearDown] @@ -192,7 +192,7 @@ public void ListenRemoveArray() { [Test] public void ListenInitialState() { - var container = new DeltaContainer (new IndexedDictionary()); + var container = new StateContainer (new IndexedDictionary()); var listenCalls = 0; container.Listen ("players/:id/position/:attribute", (DataChange change) => { diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index f8b7acfc..aa4e8d2d 100644 Binary files a/ProjectSettings/GraphicsSettings.asset and b/ProjectSettings/GraphicsSettings.asset differ diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index a5a78980..dc6a64a6 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ