diff --git a/client/in_world.cpp b/client/in_world.cpp index b5cc028..76435c8 100644 --- a/client/in_world.cpp +++ b/client/in_world.cpp @@ -128,7 +128,7 @@ void InWorld::RenderFrame() { } void InWorld::Render(SDL_Surface* const screen) { - //draw the map0 + //draw the map for (std::list::iterator it = regionPager.GetContainer()->begin(); it != regionPager.GetContainer()->end(); it++) { tileSheet.DrawRegionTo(screen, &(*it), camera.x, camera.y); } @@ -185,6 +185,7 @@ void InWorld::KeyDown(SDL_KeyboardEvent const& key) { case SDLK_LEFT: if (localCharacter) { localCharacter->motion.x -= CHARACTER_WALKING_SPEED; + localCharacter->CorrectSprite(); SendPlayerUpdate(); } break; @@ -192,6 +193,7 @@ void InWorld::KeyDown(SDL_KeyboardEvent const& key) { case SDLK_RIGHT: if (localCharacter) { localCharacter->motion.x += CHARACTER_WALKING_SPEED; + localCharacter->CorrectSprite(); SendPlayerUpdate(); } break; @@ -199,6 +201,7 @@ void InWorld::KeyDown(SDL_KeyboardEvent const& key) { case SDLK_UP: if (localCharacter) { localCharacter->motion.y -= CHARACTER_WALKING_SPEED; + localCharacter->CorrectSprite(); SendPlayerUpdate(); } break; @@ -206,6 +209,7 @@ void InWorld::KeyDown(SDL_KeyboardEvent const& key) { case SDLK_DOWN: if (localCharacter) { localCharacter->motion.y += CHARACTER_WALKING_SPEED; + localCharacter->CorrectSprite(); SendPlayerUpdate(); } break; @@ -218,6 +222,7 @@ void InWorld::KeyUp(SDL_KeyboardEvent const& key) { case SDLK_LEFT: if (localCharacter) { localCharacter->motion.x += CHARACTER_WALKING_SPEED; + localCharacter->CorrectSprite(); SendPlayerUpdate(); } break; @@ -225,6 +230,7 @@ void InWorld::KeyUp(SDL_KeyboardEvent const& key) { case SDLK_RIGHT: if (localCharacter) { localCharacter->motion.x -= CHARACTER_WALKING_SPEED; + localCharacter->CorrectSprite(); SendPlayerUpdate(); } break; @@ -232,6 +238,7 @@ void InWorld::KeyUp(SDL_KeyboardEvent const& key) { case SDLK_UP: if (localCharacter) { localCharacter->motion.y += CHARACTER_WALKING_SPEED; + localCharacter->CorrectSprite(); SendPlayerUpdate(); } break; @@ -239,6 +246,7 @@ void InWorld::KeyUp(SDL_KeyboardEvent const& key) { case SDLK_DOWN: if (localCharacter) { localCharacter->motion.y -= CHARACTER_WALKING_SPEED; + localCharacter->CorrectSprite(); SendPlayerUpdate(); } break; @@ -297,7 +305,8 @@ void InWorld::HandleCharacterNew(CharacterPacket* const argPacket) { character.CorrectSprite(); //catch this client's player object - if (argPacket->characterIndex == characterIndex && !localCharacter) { + if (argPacket->accountIndex == accountIndex && !localCharacter) { + characterIndex = argPacket->characterIndex; localCharacter = &character; //setup the camera diff --git a/client/main_menu.cpp b/client/main_menu.cpp index c33766c..457bd12 100644 --- a/client/main_menu.cpp +++ b/client/main_menu.cpp @@ -21,11 +21,6 @@ */ #include "main_menu.hpp" -#include - -using std::cout; -using std::endl; - //------------------------- //Public access members //------------------------- @@ -60,9 +55,7 @@ MainMenu::MainMenu(ConfigUtility* const argConfig): quitButton.SetText("Quit"); //debug - cout << config["client.username"] << endl; - cout << config["client.handle"] << endl; - cout << config["client.avatar"] << endl; + // } MainMenu::~MainMenu() { diff --git a/makefile b/makefile index aaf0418..080a22d 100644 --- a/makefile +++ b/makefile @@ -3,7 +3,7 @@ #MKDIR=mkdir #RM=del /y -CXXFLAGS+=-static-libgcc -static-libstdc++ -g +CXXFLAGS+=-static-libgcc -static-libstdc++ export diff --git a/server/server_application.cpp b/server/server_application.cpp index 9aee4c8..4bc1644 100644 --- a/server/server_application.cpp +++ b/server/server_application.cpp @@ -29,9 +29,6 @@ #include #include -using std::cout; -using std::endl; - //------------------------- //public methods //------------------------- @@ -244,8 +241,6 @@ void ServerApplication::HandleBroadcastRequest(SerialPacket* const argPacket) { } void ServerApplication::HandleJoinRequest(ClientPacket* const argPacket) { - cout << "Attempting connection: " << argPacket->username << endl; - //create the new client ClientData newClient; newClient.address = argPacket->srcAddress; @@ -273,7 +268,6 @@ void ServerApplication::HandleJoinRequest(ClientPacket* const argPacket) { } void ServerApplication::HandleDisconnect(ClientPacket* const argPacket) { - cout << "Trying to disconnect account " << argPacket->accountIndex << endl; //TODO: authenticate who is disconnecting/kicking //forward to the specified client @@ -287,10 +281,8 @@ void ServerApplication::HandleDisconnect(ClientPacket* const argPacket) { characterMgr.UnloadCharacterIf([&](std::map::iterator it) -> bool { if (argPacket->accountIndex == it->second.owner) { PumpCharacterUnload(it->first); - cout << "Deleting character " << it->first << endl; return true; } - cout << "Not deleting character " << it->first << endl; return false; }); diff --git a/todo.txt b/todo.txt index 4feb30b..d9279d1 100644 --- a/todo.txt +++ b/todo.txt @@ -1,3 +1,4 @@ +TODO: rename restart scene to cleanup scene TODO: encapsulate the data structures TODO: Get the rooms working