summaryrefslogtreecommitdiff
path: root/src/game-server
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server')
-rw-r--r--src/game-server/gamehandler.cpp17
-rw-r--r--src/game-server/gamehandler.hpp5
-rw-r--r--src/game-server/main-game.cpp2
3 files changed, 17 insertions, 7 deletions
diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp
index 8b7be98b..bd5248bd 100644
--- a/src/game-server/gamehandler.cpp
+++ b/src/game-server/gamehandler.cpp
@@ -285,12 +285,7 @@ void GameHandler::processMessage(NetComputer *comp, MessageIn &message)
case PGMSG_WALK:
{
- int x = message.readShort();
- int y = message.readShort();
- Point dst(x, y);
- computer.character->setDestination(dst);
-
- // no response should be required
+ handleWalk(&computer, message);
} break;
case PGMSG_EQUIP:
@@ -580,3 +575,13 @@ void GameHandler::sendError(NetComputer *computer, int id, std::string errorMsg)
msg.writeString(errorMsg, errorMsg.size());
computer->send(msg);
}
+
+void GameHandler::handleWalk(GameClient *client, MessageIn &message)
+{
+ int x = message.readShort();
+ int y = message.readShort();
+
+ Point dst(x, y);
+ client->character->setDestination(dst);
+
+}
diff --git a/src/game-server/gamehandler.hpp b/src/game-server/gamehandler.hpp
index 4a078813..77ba8a29 100644
--- a/src/game-server/gamehandler.hpp
+++ b/src/game-server/gamehandler.hpp
@@ -134,6 +134,11 @@ class GameHandler: public ConnectionHandler
*/
void processMessage(NetComputer *computer, MessageIn &message);
+ /**
+ * Set the position a player wants to move to
+ */
+ void handleWalk(GameClient *client, MessageIn &message);
+
private:
/**
diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp
index 39727384..2cf025e7 100644
--- a/src/game-server/main-game.cpp
+++ b/src/game-server/main-game.cpp
@@ -54,7 +54,7 @@
#define DEFAULT_MAPSDB_FILE "maps.xml"
#define DEFAULT_MONSTERSDB_FILE "monsters.xml"
-utils::Timer worldTimer(150, false); /**< Timer for world tics set to 100 ms */
+utils::Timer worldTimer(100, false); /**< Timer for world tics set to 100 ms */
int worldTime = 0; /**< Current world time in 100ms ticks */
bool running = true; /**< Determines if server keeps running */