Compare commits

..

3 Commits

Author SHA1 Message Date
edmand46 27db256902 🐛 scene entities not execute buffered events 2023-09-03 13:29:37 +03:00
edmand46 8705e93929 🐛 event size 2023-08-02 22:13:51 +03:00
edmand46 08e931d1bd 🚑 remove static entity spawn 2023-08-01 22:21:21 +03:00
5 changed files with 4 additions and 6 deletions
@@ -111,8 +111,6 @@ internal class SnapshotHandler : Handler
var hasAuthority = _playerCache.Local.Id == player.Id;
var entity = _entityCache.TryGetEntity(0, entityType, staticId, entityId, hasAuthority, out _);
_entityListener.OnEntityCreated(entity);
entity.Read(buffer);
entity.Attach(_client, entityId, entityType, hasAuthority, player);
}
@@ -120,7 +118,6 @@ internal class SnapshotHandler : Handler
if (_client.Status == RagonStatus.LOBBY)
{
_client.SetStatus(RagonStatus.ROOM);
_listenerList.OnJoined();
}
@@ -162,7 +162,6 @@ public class RagonEntity : IRagonEntity
if (Authority == RagonAuthority.OwnerOnly &&
Owner.Connection.Id != caller.Connection.Id)
{
Console.WriteLine($"Player have not enough authority for event with Id {evnt.EventCode}");
return;
}
+2 -1
View File
@@ -39,7 +39,8 @@ public class RagonEvent
public void Read(RagonBuffer buffer)
{
buffer.ReadArray(_data, buffer.Capacity);
_size = buffer.Capacity;
buffer.ReadArray(_data, _size);
}
public void Write(RagonBuffer buffer)
@@ -56,6 +56,7 @@ public sealed class SceneLoadedOperation : IRagonOperation
Authority = eventAuthority,
AttachId = 0,
StaticId = staticId,
BufferedEvents = context.Configuration.LimitBufferedEvents,
};
var entity = new RagonEntity(entityParameters);
@@ -47,7 +47,7 @@ public struct RagonServerConfiguration
public Dictionary<string, string> WebHooks;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private static readonly string ServerVersion = "1.2.0-rc";
private static readonly string ServerVersion = "1.2.9-rc";
private static Dictionary<string, ServerType> _serverTypes = new Dictionary<string, ServerType>()
{
{"enet", Server.ServerType.ENET},