From 87af4f1a1ede52e8a87d4531f94edeca4a0b9f44 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sat, 14 Feb 2015 23:54:18 +1100 Subject: [PATCH] Comment tweaks, updated network version --- client/entities/base_monster.cpp | 2 +- client/gameplay_scenes/world.hpp | 2 +- client/gameplay_scenes/world_characters.cpp | 8 ++++---- client/gameplay_scenes/world_chat.cpp | 6 +++--- client/gameplay_scenes/world_connections.cpp | 2 +- client/gameplay_scenes/world_logic.cpp | 4 ++-- client/gameplay_scenes/world_monsters.cpp | 8 ++++---- client/menu_scenes/lobby_menu.cpp | 8 ++++---- client/menu_scenes/main_menu.cpp | 2 +- common/network/serial_packet.hpp | 2 +- server/server_character_methods.cpp | 6 +++--- server/server_logic.cpp | 3 ++- server/server_methods.cpp | 6 +++++- 13 files changed, 32 insertions(+), 27 deletions(-) diff --git a/client/entities/base_monster.cpp b/client/entities/base_monster.cpp index 2d979e0..c268021 100644 --- a/client/entities/base_monster.cpp +++ b/client/entities/base_monster.cpp @@ -24,7 +24,7 @@ #include "config_utility.hpp" void BaseMonster::CorrectSprite() { - //TODO: (1) CorrectSprite + //TODO: (9) empty } std::string BaseMonster::SetHandle(std::string s) { diff --git a/client/gameplay_scenes/world.hpp b/client/gameplay_scenes/world.hpp index cc2135a..bb57f75 100644 --- a/client/gameplay_scenes/world.hpp +++ b/client/gameplay_scenes/world.hpp @@ -156,7 +156,7 @@ protected: LocalCharacter* localCharacter = nullptr; //heartbeat - //TODO: (9) Heartbeat needs it's own utility + //TODO: (2) Heartbeat needs it's own utility typedef std::chrono::steady_clock Clock; Clock::time_point lastBeat = Clock::now(); int attemptedBeats = 0; diff --git a/client/gameplay_scenes/world_characters.cpp b/client/gameplay_scenes/world_characters.cpp index 8512e76..4091824 100644 --- a/client/gameplay_scenes/world_characters.cpp +++ b/client/gameplay_scenes/world_characters.cpp @@ -128,11 +128,11 @@ void World::hQueryCharacterExists(CharacterPacket* const argPacket) { } void World::hQueryCharacterStats(CharacterPacket* const argPacket) { - //TODO: empty + //TODO: (9) empty } void World::hQueryCharacterLocation(CharacterPacket* const argPacket) { - //TODO: empty + //TODO: (9) empty } void World::hCharacterMovement(CharacterPacket* const argPacket) { @@ -152,11 +152,11 @@ void World::hCharacterMovement(CharacterPacket* const argPacket) { } void World::hCharacterAttack(CharacterPacket* const argPacket) { - //TODO: (1) attack animation + //TODO: (9) empty } void World::hCharacterDamage(CharacterPacket* const argPacket) { - //TODO: (1) attack animation + //TODO: (9) empty } //------------------------- diff --git a/client/gameplay_scenes/world_chat.cpp b/client/gameplay_scenes/world_chat.cpp index 9386478..3a29d21 100644 --- a/client/gameplay_scenes/world_chat.cpp +++ b/client/gameplay_scenes/world_chat.cpp @@ -26,14 +26,14 @@ //------------------------- void World::hTextBroadcast(TextPacket* const argPacket) { - //TODO: (1) empty + //TODO: (9) empty } void World::hTextSpeech(TextPacket* const argPacket) { - //TODO: (1) empty + //TODO: (9) empty } void World::hTextWhisper(TextPacket* const argPacket) { - //TODO: (1) empty + //TODO: (9) empty } diff --git a/client/gameplay_scenes/world_connections.cpp b/client/gameplay_scenes/world_connections.cpp index c20c101..7ace62d 100644 --- a/client/gameplay_scenes/world_connections.cpp +++ b/client/gameplay_scenes/world_connections.cpp @@ -91,7 +91,7 @@ void World::SendDisconnectRequest() { } void World::SendAdminDisconnectForced() { - //TODO: empty + //TODO: (9) empty } diff --git a/client/gameplay_scenes/world_logic.cpp b/client/gameplay_scenes/world_logic.cpp index 509d570..dcb74d0 100644 --- a/client/gameplay_scenes/world_logic.cpp +++ b/client/gameplay_scenes/world_logic.cpp @@ -60,7 +60,7 @@ World::World(int* const argClientIndex, int* const argAccountIndex): shutDownButton.SetText("Shut Down"); //load the tilesheet - //TODO: (9) Tile size and tile sheet should be loaded elsewhere + //TODO: (1) Tile size and tile sheet should be loaded elsewhere tileSheet.Load(config["dir.tilesets"] + "overworld.bmp", 32, 32); //Send the character data @@ -221,7 +221,7 @@ void World::KeyDown(SDL_KeyboardEvent const& key) { //hotkeys switch(key.keysym.sym) { case SDLK_ESCAPE: - //TODO: (9) the escape key should actually control menus and stuff + //TODO: (1) the escape key should actually control menus and stuff SendLogoutRequest(); return; } diff --git a/client/gameplay_scenes/world_monsters.cpp b/client/gameplay_scenes/world_monsters.cpp index 9b8acda..8891fad 100644 --- a/client/gameplay_scenes/world_monsters.cpp +++ b/client/gameplay_scenes/world_monsters.cpp @@ -99,11 +99,11 @@ void World::hQueryMonsterExists(MonsterPacket* const argPacket) { } void World::hQueryMonsterStats(MonsterPacket* const argPacket) { - //TODO: empty + //TODO: (9) empty } void World::hQueryMonsterLocation(MonsterPacket* const argPacket) { - //TODO: empty + //TODO: (9) empty } void World::hMonsterMovement(MonsterPacket* const argPacket) { @@ -118,9 +118,9 @@ void World::hMonsterMovement(MonsterPacket* const argPacket) { } void World::hMonsterAttack(MonsterPacket* const argPacket) { - //TODO: (1) HandleMonsterAttack + //TODO: (9) empty } void World::hMonsterDamage(MonsterPacket* const argPacket) { - //TODO: (1) empty + //TODO: (9) empty } \ No newline at end of file diff --git a/client/menu_scenes/lobby_menu.cpp b/client/menu_scenes/lobby_menu.cpp index f9997b7..8ebc361 100644 --- a/client/menu_scenes/lobby_menu.cpp +++ b/client/menu_scenes/lobby_menu.cpp @@ -100,14 +100,14 @@ void LobbyMenu::FrameEnd() { } void LobbyMenu::Render(SDL_Surface* const screen) { - //TODO: (9) I need a proper UI system for the entire client and the editor + //TODO: (2) I need a proper UI system for the entire client and the editor //UI search.DrawTo(screen); join.DrawTo(screen); back.DrawTo(screen); - //TODO: (9) draw headers for the server list + //TODO: (1) draw headers for the server list for (int i = 0; i < serverInfo.size(); i++) { //draw the selected server's highlight if (selection == &serverInfo[i]) { @@ -252,11 +252,11 @@ void LobbyMenu::HandleLoginResponse(ClientPacket* const argPacket) { } void LobbyMenu::HandleJoinRejection(TextPacket* const argPacket) { - //TODO: (9) Better output for join rejection + //TODO: (9) empty } void LobbyMenu::HandleLoginRejection(TextPacket* const argPacket) { - //TODO: (9) Better output for login rejection + //TODO: (9) empty } //------------------------- diff --git a/client/menu_scenes/main_menu.cpp b/client/menu_scenes/main_menu.cpp index 53bda74..e6735d1 100644 --- a/client/menu_scenes/main_menu.cpp +++ b/client/menu_scenes/main_menu.cpp @@ -108,7 +108,7 @@ void MainMenu::MouseButtonDown(SDL_MouseButtonEvent const& button) { } void MainMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) { - //TODO: (9) Buttons should only register as "selected" when the left button is used + //TODO: (2) Buttons should only register as "selected" when the left button is used if (startButton.MouseButtonUp(button) == Button::State::HOVER) { SetNextScene(SceneList::LOBBYMENU); } diff --git a/common/network/serial_packet.hpp b/common/network/serial_packet.hpp index 0c07cae..2075c75 100644 --- a/common/network/serial_packet.hpp +++ b/common/network/serial_packet.hpp @@ -34,7 +34,7 @@ typedef SerialPacketBase SerialPacket; //DOCS: NETWORK_VERSION is used to discern compatible servers and clients -constexpr int NETWORK_VERSION = 20150213; +constexpr int NETWORK_VERSION = 20150214; union MaxPacket { CharacterPacket a; diff --git a/server/server_character_methods.cpp b/server/server_character_methods.cpp index 5c76f83..38127e1 100644 --- a/server/server_character_methods.cpp +++ b/server/server_character_methods.cpp @@ -175,7 +175,7 @@ void ServerApplication::hCharacterUnload(CharacterPacket* const argPacket) { //character movement //------------------------- -//TODO: (9) Could replace this verbosity with a "verify" method, taking a client, account and character ptr as arguments +//TODO: (2) Could replace this verbosity with a "verify" method, taking a client, account and character ptr as arguments void ServerApplication::hCharacterMovement(CharacterPacket* const argPacket) { //get the specified objects @@ -197,7 +197,7 @@ void ServerApplication::hCharacterMovement(CharacterPacket* const argPacket) { //check if allowed if (characterData->GetOwner() != argPacket->accountIndex && !accountData->GetModerator() && !accountData->GetAdministrator()) { - //TODO: (9) send to the client? + //TODO: (2) send to the client? std::cerr << "Failed to set character motion due to lack of permissions targeting uid(" << argPacket->characterIndex << ")" << std::endl; return; } @@ -235,7 +235,7 @@ void ServerApplication::hCharacterMovement(CharacterPacket* const argPacket) { } void ServerApplication::hCharacterAttack(CharacterPacket* const argPacket) { - //TODO: (9) bounce graphical attack data + //TODO: (9) empty } void ServerApplication::hCharacterDamage(CharacterPacket* const argPacket) { diff --git a/server/server_logic.cpp b/server/server_logic.cpp index c64525f..78d5114 100644 --- a/server/server_logic.cpp +++ b/server/server_logic.cpp @@ -194,7 +194,8 @@ void ServerApplication::Proc() { void ServerApplication::Quit() { std::cout << "Shutting down" << std::endl; - //TODO: (9) save the server state + //save the server state + SaveServerState(); //close the managers accountMgr.UnloadAll(); diff --git a/server/server_methods.cpp b/server/server_methods.cpp index 0b55219..d440153 100644 --- a/server/server_methods.cpp +++ b/server/server_methods.cpp @@ -30,7 +30,7 @@ //------------------------- void ServerApplication::hAdminDisconnectForced(ClientPacket* const argPacket) { - //TODO: (9) boot players + //TODO: (9) empty } void ServerApplication::hAdminShutdownRequest(ClientPacket* const argPacket) { @@ -84,6 +84,10 @@ void ServerApplication::hAdminShutdownRequest(ClientPacket* const argPacket) { std::cout << "Shutdown signal accepted" << std::endl; } +void ServerApplication::SaveServerState() { + //TODO: (9) empty +} + //------------------------- //full unload methods //-------------------------