void ProcessHostIp(SessionCommand session) { var currentHostIp = _hostIP == null ? null : _hostIP.ToString(); if (session.HostIP == currentHostIp && session.Hosting == _hosting) return; _hosting = session.Hosting; var addr = session.HostIP; _hostIP = string.IsNullOrWhiteSpace(addr) ? null : new ServerAddress(addr); CalculatedGameSettings.RaiseEvent(new MyActiveServerAddressChanged(_hostIP)); }
void ProcessSession(SessionCommand session) { var sb = new StringBuilder(); ProcessHostIp(session); _playerId = session.PlayerId; if (session.Hosting) sb.Append("(HOSTING)"); Message = sb.ToString(); }