UDPNetworkUtility accepts addresses by value, encapsulated ClientData

I started encapsulating ClientData, and I added the internals for the
heartbeat ssytem. However, when I took a look inside UDPNetworkUtility, I
realized that I didn't have to pass the IPaddresses by reference anymore.
Therefore, I've changed it to accept the addresses by value, and I'm
committing that change right away before I finish the heartbeat system.

This engine is really shaping up, I think.
This commit is contained in:
Kayne Ruse
2014-09-03 01:59:53 +10:00
parent 06922dc820
commit 79c7e48139
7 changed files with 79 additions and 25 deletions
+2 -2
View File
@@ -217,7 +217,7 @@ void LobbyMenu::HandleBroadcastResponse(ServerPacket* const argPacket) {
void LobbyMenu::HandleJoinResponse(ClientPacket* const argPacket) {
clientIndex = argPacket->clientIndex;
accountIndex = argPacket->accountIndex;
network.Bind(&argPacket->srcAddress, Channels::SERVER);
network.Bind(argPacket->srcAddress, Channels::SERVER);
SetNextScene(SceneList::INWORLD);
//send this player's character info
@@ -251,6 +251,6 @@ void LobbyMenu::SendJoinRequest() {
strncpy(packet.username, config["client.username"].c_str(), PACKET_STRING_SIZE);
//join the selected server
network.SendTo(&selection->address, &packet);
network.SendTo(selection->address, &packet);
selection = nullptr;
}