private void broadcastGameUpdate(SpectatorGameLog logMsg) { foreach (IPeer p in activeGames[logMsg.broadcastID].getSpectatorsClone()) { try { p.SendMessage((short)(CustomMasterServerMSG.spectateLogUpdate), logMsg); } catch { removeSpectator(logMsg.broadcastID, p); } } }
//Update sent from the gameserver, here the master server broadcasts it to all spectators. private void handleGamelogUpdate(IIncommingMessage msg) { SpectatorGameLog logMsg = msg.Deserialize <SpectatorGameLog> (); if (activeGames.ContainsKey(logMsg.broadcastID) == false) { msg.Respond(ResponseStatus.Failed); } else { broadcastGameUpdate(logMsg); } }