Skip to content

Commit

Permalink
Drop commands support in favor of talkactions
Browse files Browse the repository at this point in the history
  • Loading branch information
ranisalt committed Feb 10, 2017
1 parent 1c227d3 commit eeacf88
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 265 deletions.
3 changes: 0 additions & 3 deletions data/XML/commands.xml

This file was deleted.

1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set(tfs_SRC
${CMAKE_CURRENT_LIST_DIR}/bed.cpp
${CMAKE_CURRENT_LIST_DIR}/chat.cpp
${CMAKE_CURRENT_LIST_DIR}/combat.cpp
${CMAKE_CURRENT_LIST_DIR}/commands.cpp
${CMAKE_CURRENT_LIST_DIR}/condition.cpp
${CMAKE_CURRENT_LIST_DIR}/configmanager.cpp
${CMAKE_CURRENT_LIST_DIR}/connection.cpp
Expand Down
164 changes: 0 additions & 164 deletions src/commands.cpp

This file was deleted.

60 changes: 0 additions & 60 deletions src/commands.h

This file was deleted.

26 changes: 0 additions & 26 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#include "actions.h"
#include "bed.h"
#include "commands.h"
#include "configmanager.h"
#include "creature.h"
#include "creatureevent.h"
Expand Down Expand Up @@ -109,8 +108,6 @@ void Game::setGameState(GameState_t newState)
gameState = newState;
switch (newState) {
case GAME_STATE_INIT: {
commands.loadFromXml();

loadExperienceStages();

groups.load();
Expand Down Expand Up @@ -3236,10 +3233,6 @@ void Game::playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type,
return;
}

if (playerSayCommand(player, text)) {
return;
}

if (playerSaySpell(player, type, text)) {
return;
}
Expand Down Expand Up @@ -3289,23 +3282,6 @@ void Game::playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type,
}
}

bool Game::playerSayCommand(Player* player, const std::string& text)
{
if (text.empty()) {
return false;
}

char firstCharacter = text.front();
for (char commandTag : commandTags) {
if (commandTag == firstCharacter) {
if (commands.exeCommand(*player, text)) {
return true;
}
}
}
return false;
}

bool Game::playerSaySpell(Player* player, SpeakClasses type, const std::string& text)
{
std::string words = text;
Expand Down Expand Up @@ -5583,7 +5559,6 @@ bool Game::reload(ReloadTypes_t reloadType)
switch (reloadType) {
case RELOAD_TYPE_ACTIONS: return g_actions->reload();
case RELOAD_TYPE_CHAT: return g_chat->load();
case RELOAD_TYPE_COMMANDS: return commands.reload();
case RELOAD_TYPE_CONFIG: return g_config.reload();
case RELOAD_TYPE_CREATURESCRIPTS: return g_creatureEvents->reload();
case RELOAD_TYPE_EVENTS: return g_events->load();
Expand Down Expand Up @@ -5646,7 +5621,6 @@ bool Game::reload(ReloadTypes_t reloadType)
g_globalEvents->reload();
g_events->load();
g_chat->load();
commands.reload();
return true;
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include "account.h"
#include "combat.h"
#include "commands.h"
#include "groups.h"
#include "map.h"
#include "position.h"
Expand Down Expand Up @@ -497,9 +496,6 @@ class Game
Item* getUniqueItem(uint16_t uniqueId);
bool addUniqueItem(uint16_t uniqueId, Item* item);
void removeUniqueItem(uint16_t uniqueId);
void reloadCommands() {
commands.reload();
}

bool reload(ReloadTypes_t reloadType);

Expand All @@ -510,7 +506,6 @@ class Game
Quests quests;

protected:
bool playerSayCommand(Player* player, const std::string& text);
bool playerSaySpell(Player* player, SpeakClasses type, const std::string& text);
void playerWhisper(Player* player, const std::string& text);
bool playerYell(Player* player, const std::string& text);
Expand Down Expand Up @@ -548,7 +543,6 @@ class Game
std::map<uint32_t, BedItem*> bedSleepersMap;

ModalWindow offlineTrainingWindow { std::numeric_limits<uint32_t>::max(), "Choose a Skill", "Please choose a skill:" };
Commands commands;

static constexpr int32_t LIGHT_LEVEL_DAY = 250;
static constexpr int32_t LIGHT_LEVEL_NIGHT = 40;
Expand Down
3 changes: 0 additions & 3 deletions src/signals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ void Signals::sighupHandler()
g_config.reload();
std::cout << "Reloaded config." << std::endl;

g_game.reloadCommands();
std::cout << "Reloaded commands." << std::endl;

g_creatureEvents->reload();
std::cout << "Reloaded creature scripts." << std::endl;

Expand Down
2 changes: 0 additions & 2 deletions vc14/theforgottenserver.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
<ClCompile Include="..\src\bed.cpp" />
<ClCompile Include="..\src\chat.cpp" />
<ClCompile Include="..\src\combat.cpp" />
<ClCompile Include="..\src\commands.cpp" />
<ClCompile Include="..\src\condition.cpp" />
<ClCompile Include="..\src\configmanager.cpp" />
<ClCompile Include="..\src\connection.cpp" />
Expand Down Expand Up @@ -214,7 +213,6 @@
<ClInclude Include="..\src\bed.h" />
<ClInclude Include="..\src\chat.h" />
<ClInclude Include="..\src\combat.h" />
<ClInclude Include="..\src\commands.h" />
<ClInclude Include="..\src\condition.h" />
<ClInclude Include="..\src\configmanager.h" />
<ClInclude Include="..\src\connection.h" />
Expand Down

0 comments on commit eeacf88

Please sign in to comment.