private static void RegisterServer(IMessageBase message, NetIncomingMessage netMsg) { var msgData = (MsRegisterServerMsgData)message.Data; if (!ServerDictionary.ContainsKey(msgData.Id)) { ServerDictionary.TryAdd(msgData.Id, new Server(msgData, netMsg.SenderEndPoint)); ConsoleLogger.Log(LogLevels.Normal, $"NEW SERVER: {netMsg.SenderEndPoint}"); } else { //Just update ServerDictionary[msgData.Id] = new Server(msgData, netMsg.SenderEndPoint); } }
private static void RegisterServer(IMessageBase message, NetIncomingMessage netMsg) { var msgData = (MsRegisterServerMsgData)message.Data; if (!ServerDictionary.ContainsKey(msgData.Id)) { ServerDictionary.TryAdd(msgData.Id, new Server(msgData, netMsg.SenderEndPoint)); Form.UpdateServerList(ServerDictionary.Values); } else { //Just update ServerDictionary[msgData.Id] = new Server(msgData, netMsg.SenderEndPoint); } }