public Game(string gametopic, string region, Player p, string fleet) { this.gametopic = gametopic; this.me = p; this.region = region; m = new mqtt(gametopic); m.connect(); m.Subscribe(gametopic + "/" + region); m.Subscribe(gametopic + "/" + region + "/" + fleet); m.PingRecieved += M_PingRecieved; m.PingResponseRecieved += M_PingResponseRecieved; m.GameStartRecieved += M_GameStartRecieved; m.GameResponseRecieved += M_GameResponseRecieved; m.ShotRecieved += M_ShotRecieved; m.ShotResponseRecieved += M_ShotResponseRecieved; //opponent = new Player("Olena"); if (me.ready) { PingStartComm c = new PingStartComm(fleet); sendRegionCommand(c); } }
public Game() { m = new mqtt("battleship"); gametopic = "battleship"; region = "NBCC"; }