private void HandleServerStateReceived(object state) { var serverState = (ServerState)state; ConnectedServer.State = serverState; OnServerStateUpdated.Invoke(serverState); }
/// <summary> /// Handles the serverStateUpdated packet type /// </summary> /// <param name="inMsg">The message to decode</param> private void HandleServerStateReceived(NetIncomingMessage inMsg) { if (myConnectedServer != null) { ServerTag tag = myConnectedServer.Value; tag.State = (ServerState)inMsg.ReadByte(); myConnectedServer = tag; OnServerStateUpdated?.Invoke(this, tag.State); } }