예제 #1
0
        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));
        }
예제 #2
0
 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;
         }
     }
 }