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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user