summaryrefslogtreecommitdiff
path: root/src/net/manaserv
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/manaserv')
-rw-r--r--src/net/manaserv/effecthandler.cpp6
-rw-r--r--src/net/manaserv/itemhandler.cpp2
-rw-r--r--src/net/manaserv/messagein.cpp9
-rw-r--r--src/net/manaserv/messagein.h4
-rw-r--r--src/net/manaserv/messageout.cpp7
-rw-r--r--src/net/manaserv/messageout.h6
-rw-r--r--src/net/manaserv/network.cpp4
-rw-r--r--src/net/manaserv/npchandler.cpp2
8 files changed, 20 insertions, 20 deletions
diff --git a/src/net/manaserv/effecthandler.cpp b/src/net/manaserv/effecthandler.cpp
index 7051bedd..cc732794 100644
--- a/src/net/manaserv/effecthandler.cpp
+++ b/src/net/manaserv/effecthandler.cpp
@@ -35,7 +35,7 @@ namespace ManaServ {
EffectHandler::EffectHandler()
{
- static const Uint16 _messages[] = {
+ static const uint16_t _messages[] = {
GPMSG_CREATE_EFFECT_POS,
GPMSG_CREATE_EFFECT_BEING,
GPMSG_SHAKE,
@@ -65,8 +65,8 @@ void EffectHandler::handleMessage(Net::MessageIn &msg)
void EffectHandler::handleCreateEffectPos(Net::MessageIn &msg)
{
int id = msg.readInt16();
- Uint16 x = msg.readInt16();
- Uint16 y = msg.readInt16();
+ uint16_t x = msg.readInt16();
+ uint16_t y = msg.readInt16();
effectManager->trigger(id, x, y);
}
diff --git a/src/net/manaserv/itemhandler.cpp b/src/net/manaserv/itemhandler.cpp
index d8365d79..2b8f631f 100644
--- a/src/net/manaserv/itemhandler.cpp
+++ b/src/net/manaserv/itemhandler.cpp
@@ -32,7 +32,7 @@ namespace ManaServ {
ItemHandler::ItemHandler()
{
- static const Uint16 _messages[] = {
+ static const uint16_t _messages[] = {
GPMSG_ITEMS,
GPMSG_ITEM_APPEAR,
0
diff --git a/src/net/manaserv/messagein.cpp b/src/net/manaserv/messagein.cpp
index 128dd14f..58e6e59a 100644
--- a/src/net/manaserv/messagein.cpp
+++ b/src/net/manaserv/messagein.cpp
@@ -21,6 +21,7 @@
#include "net/manaserv/messagein.h"
+#include <cstring>
#include <enet/enet.h>
namespace ManaServ {
@@ -32,9 +33,9 @@ MessageIn::MessageIn(const char *data, unsigned int length):
mId = readInt16();
}
-Uint16 MessageIn::readInt16()
+uint16_t MessageIn::readInt16()
{
- Uint16 value = 0;
+ uint16_t value = 0;
if (mPos + 2 <= mLength)
{
uint16_t t;
@@ -45,9 +46,9 @@ Uint16 MessageIn::readInt16()
return value;
}
-Uint32 MessageIn::readInt32()
+uint32_t MessageIn::readInt32()
{
- Uint32 value = 0;
+ uint32_t value = 0;
if (mPos + 4 <= mLength)
{
uint32_t t;
diff --git a/src/net/manaserv/messagein.h b/src/net/manaserv/messagein.h
index ed6510eb..d165ac4d 100644
--- a/src/net/manaserv/messagein.h
+++ b/src/net/manaserv/messagein.h
@@ -36,8 +36,8 @@ class MessageIn : public Net::MessageIn
public:
MessageIn(const char *data, unsigned int length);
- Uint16 readInt16(); /**< Reads a short. */
- Uint32 readInt32(); /**< Reads a "long". */
+ uint16_t readInt16();
+ uint32_t readInt32();
};
}
diff --git a/src/net/manaserv/messageout.cpp b/src/net/manaserv/messageout.cpp
index 695b1b39..d332a507 100644
--- a/src/net/manaserv/messageout.cpp
+++ b/src/net/manaserv/messageout.cpp
@@ -24,11 +24,10 @@
#include <enet/enet.h>
#include <cstring>
-#include <string>
namespace ManaServ {
-MessageOut::MessageOut(Uint16 id):
+MessageOut::MessageOut(uint16_t id):
Net::MessageOut(id)
{
writeInt16(id);
@@ -45,7 +44,7 @@ void MessageOut::expand(size_t bytes)
mDataSize = mPos + bytes;
}
-void MessageOut::writeInt16(Uint16 value)
+void MessageOut::writeInt16(uint16_t value)
{
expand(2);
uint16_t t = ENET_HOST_TO_NET_16(value);
@@ -53,7 +52,7 @@ void MessageOut::writeInt16(Uint16 value)
mPos += 2;
}
-void MessageOut::writeInt32(Uint32 value)
+void MessageOut::writeInt32(uint32_t value)
{
expand(4);
uint32_t t = ENET_HOST_TO_NET_32(value);
diff --git a/src/net/manaserv/messageout.h b/src/net/manaserv/messageout.h
index a22ea824..db7c4780 100644
--- a/src/net/manaserv/messageout.h
+++ b/src/net/manaserv/messageout.h
@@ -29,12 +29,12 @@ namespace ManaServ {
class MessageOut : public Net::MessageOut
{
public:
- MessageOut(Uint16 id);
+ MessageOut(uint16_t id);
~MessageOut();
- void writeInt16(Uint16 value); /**< Writes a short. */
- void writeInt32(Uint32 value); /**< Writes a "long". */
+ void writeInt16(uint16_t value);
+ void writeInt32(uint32_t value);
protected:
/**
diff --git a/src/net/manaserv/network.cpp b/src/net/manaserv/network.cpp
index 03bd7b28..543aaa00 100644
--- a/src/net/manaserv/network.cpp
+++ b/src/net/manaserv/network.cpp
@@ -89,7 +89,7 @@ Connection *getConnection()
void registerHandler(MessageHandler *handler)
{
- for (const Uint16 *i = handler->handledMessages; *i; i++)
+ for (const uint16_t *i = handler->handledMessages; *i; i++)
{
mMessageHandlers[*i] = handler;
}
@@ -97,7 +97,7 @@ void registerHandler(MessageHandler *handler)
void unregisterHandler(MessageHandler *handler)
{
- for (const Uint16 *i = handler->handledMessages; *i; i++)
+ for (const uint16_t *i = handler->handledMessages; *i; i++)
{
mMessageHandlers.erase(*i);
}
diff --git a/src/net/manaserv/npchandler.cpp b/src/net/manaserv/npchandler.cpp
index 1c89f39f..2cec8ce8 100644
--- a/src/net/manaserv/npchandler.cpp
+++ b/src/net/manaserv/npchandler.cpp
@@ -39,7 +39,7 @@ extern Connection *gameServerConnection;
NpcHandler::NpcHandler()
{
- static const Uint16 _messages[] = {
+ static const uint16_t _messages[] = {
GPMSG_NPC_CHOICE,
GPMSG_NPC_POST,
GPMSG_NPC_MESSAGE,