private void LobbyHeartBeatResponse(byte[] bytes, IPEndPoint refEp) { LobbyHeartbeatConv conv = ConversationFactory.Instance .CreateFromMessage <LobbyHeartbeatConv>(bytes, refEp, null, null, null); conv.Start(); }
private void SendButton_Click(object sender, EventArgs e) { //gets the address, port, and message to be sent from the textfields IPEndPoint playerIP = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 1024); LobbyHeartbeatConv conv = ConversationFactory.Instance .CreateFromConversationType <LobbyHeartbeatConv> (playerIP, null, null, null); conv._NumberOfPlayers = 3; Thread convThread = new Thread(conv.Execute); convThread.Start(); }
public void SendHeartbeats()//run as seperate thread { while (isRunning) { //hearbeat to all players that have joined games foreach (var keypair in gameList) { GameInfo g = keypair.Value; int numberOfPlayers = g.playerList.Count; foreach (Player p in g.playerList) { IPEndPoint playerIP = p.GetIP(); LobbyHeartbeatConv conv = ConversationFactory.Instance .CreateFromConversationType <LobbyHeartbeatConv> (playerIP, null, null, null); conv._NumberOfPlayers = numberOfPlayers; Thread convThread = new Thread(conv.Execute); convThread.Start(); //If timeout, remove player from game } } } }