private void HandlePlayerConnected(IConnectedPlayer player) { Plugin.Log?.Info($"Player '{player.userId}' joined"); var extendedPlayer = new ExtendedPlayer(player); players[player.userId] = extendedPlayer; playerConnectedEvent?.Invoke(extendedPlayer); }
public void RegisterCallback <T>(ExtendedSessionManager.MessageType serializerType, Action <T, ExtendedPlayer> callback, Func <T> constructor) where T : INetSerializable { Action <T, IConnectedPlayer> extendedCallback = delegate(T packet, IConnectedPlayer player) { ExtendedPlayer extendedPlayer = GetExtendedPlayer(player); callback(packet, extendedPlayer); }; _packetSerializer.RegisterCallback(serializerType, extendedCallback, constructor); }
private void HandlePlayerPacket(ExtendedPlayerPacket packet, ExtendedPlayer player) { Plugin.Log?.Info($"Received 'ExtendedPlayerPacket' from '{player.userId}' with '{packet.platformID}'"); player.platformID = packet.platformID; }
private void OnPlayerConnected(ExtendedPlayer player) { SendLocalPlayerPacket(); }