Implemented SharedParameters system in the client (read more)

Here are more tweaks:
* InWorld's quit event now exits to the main menu, bypassing a relayed disconnect message
* InWorld's disconnect hander no longer throws exceptions (dropped creation packet bugfix)
* CombatData's internals now point to std::pair objects
* Enemies are stored in a global list
This commit is contained in:
Kayne Ruse
2014-05-26 17:11:26 +10:00
parent a47e76845f
commit 0a71f43ef3
13 changed files with 119 additions and 58 deletions
+6 -7
View File
@@ -30,12 +30,10 @@
//Public access members
//-------------------------
LobbyMenu::LobbyMenu(ConfigUtility* const argConfig, UDPNetworkUtility* const argNetwork, int* const argClientIndex, int* const argAccountIndex, int* const argCharacterIndex):
LobbyMenu::LobbyMenu(ConfigUtility* const argConfig, UDPNetworkUtility* const argNetwork, SharedParameters* const argParams):
config(*argConfig),
network(*argNetwork),
clientIndex(*argClientIndex),
accountIndex(*argAccountIndex),
characterIndex(*argCharacterIndex)
params(*argParams)
{
//setup the utility objects
image.LoadSurface(config["dir.interface"] + "button_menu.bmp");
@@ -94,6 +92,7 @@ void LobbyMenu::FrameEnd() {
}
void LobbyMenu::Render(SDL_Surface* const screen) {
//TODO: this needs rewriting
//TODO: I need a proper UI system for the entire client and the editor
//UI
search.DrawTo(screen);
@@ -221,9 +220,9 @@ void LobbyMenu::HandlePacket(SerialPacket packet) {
}
break;
case SerialPacket::Type::JOIN_RESPONSE:
clientIndex = packet.clientInfo.clientIndex;
accountIndex = packet.clientInfo.accountIndex;
characterIndex = packet.clientInfo.characterIndex;
params.clientIndex = packet.clientInfo.clientIndex;
params.accountIndex = packet.clientInfo.accountIndex;
params.characterIndex = packet.clientInfo.characterIndex;
network.Bind(&packet.meta.srcAddress, Channels::SERVER);
SetNextScene(SceneList::INWORLD);
break;