public void broadcastStartTimer(Game.PlayerColor playerColor, float startTime, TurnBasedCommProtocol protocol) { PlayerTimerMsg msg = new PlayerTimerMsg() { maxTime = startTime, color = playerColor, startTimer = true }; foreach (ConnectedClient c in clients) { protocol.sendPlayerTimerCommand(c.peerID, msg); } }
//Currently re sending alot of data. Should be opted lated public void initPlayerTimer(float startTime, Game.PlayerColor initColor, TurnBasedCommProtocol protocol) { foreach (ConnectedClient c in clients) { foreach (ConnectedPlayer p in players) { PlayerTimerMsg msg2 = new PlayerTimerMsg() { maxTime = startTime, color = p.color, startTimer = false }; protocol.sendPlayerTimerInit(c.peerID, msg2); } } }
public void sendPlayerTimerCommand(int targetID, PlayerTimerMsg ptm) { sendMsg(ptm, targetID, (short)ServerCommProtocl.PlayerTimerCommand); }