public void RespondToGame(string region, string fleetName) { GameResponseComm c = new GameResponseComm(region, fleetName); string msg = JsonConvert.SerializeObject(c); client.Publish(gametopic + "/" + region, Encoding.ASCII.GetBytes(msg)); }
private void M_GameResponseRecieved(object sender, EventArgs e) { if (lookingForGame) { GameResponseComm c = (GameResponseComm)sender; if (c.fleetName == me.fleetName) { return; } else { opponent = new Player(c.fleetName); OpponentFound.Invoke(opponent, EventArgs.Empty); lookingForGame = false; } } }