diff --git a/Game/config.json b/Game/config.json index 8af11dd..79e2003 100755 --- a/Game/config.json +++ b/Game/config.json @@ -1,7 +1,7 @@ { "apiKey": "123", "server": { - "port": 4444, + "port": 5000, "skipTimeout": 60 }, "blacklist": [ diff --git a/Ragon/Sources/Application.cs b/Ragon/Sources/Application.cs index f311fef..4e0307c 100755 --- a/Ragon/Sources/Application.cs +++ b/Ragon/Sources/Application.cs @@ -34,7 +34,7 @@ namespace Ragon.Core public void Start() { - _socketServer.Start(5000); + _socketServer.Start(_configuration.Server.Port); foreach (var roomThread in _roomThreads) roomThread.Start(); diff --git a/Ragon/Sources/Configuration/Configuration.cs b/Ragon/Sources/Configuration/Configuration.cs index 1b6aa40..97541a4 100755 --- a/Ragon/Sources/Configuration/Configuration.cs +++ b/Ragon/Sources/Configuration/Configuration.cs @@ -2,9 +2,16 @@ namespace Ragon.Core { + [Serializable] + public struct Server + { + public ushort Port; + } + [Serializable] public struct Configuration { public string ApiKey; + public Server Server; } } \ No newline at end of file diff --git a/Ragon/Sources/Rooms/Room.cs b/Ragon/Sources/Rooms/Room.cs index bcdea6f..63eaea2 100755 --- a/Ragon/Sources/Rooms/Room.cs +++ b/Ragon/Sources/Rooms/Room.cs @@ -166,13 +166,15 @@ namespace Ragon.Core case RagonOperation.REPLICATE_EVENT: case RagonOperation.REPLICATE_ENTITY_EVENT: { - Span data = stackalloc byte[rawData.Length]; - var evntCodeData = rawData.Slice(2, 2); var evntId = RagonHeader.ReadUShort(ref evntCodeData); + if (_plugin.InternalHandle(peerId, evntId, ref rawData)) return; + Span data = stackalloc byte[rawData.Length]; + rawData.CopyTo(data); + Broadcast(_readyPlayers, data, DeliveryType.Reliable); break; }