// TODO: Create SYNC LIST and SERVER TICK to proccess
        public static void PacketsToClientEvents(Player player, GameStream stream)
        {
            // TODO: Make this generic
            var packetId = (IncomingPacketType)stream.ReadByte();

            Log.Debug($"Received packet {packetId} with {stream.Length} bytes");
            switch (packetId)
            {
            case IncomingPacketType.Token:
                Log.Debug("PlayerAuthEvent");
                var ev = new PlayerAuthEvent(player);
                ev.ReadFrom(stream);
                Func <int> runEvent = () => {
                    OnPlayerAuth(ev);
                    return(1);
                };
                //DueEvents.Add(runEvent);
                runEvent();
                break;
            }
        }
Beispiel #2
0
 public void PlayerAuthenticated(string status)
 {
     PlayerAuthEvent?.Invoke(status);
 }