diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-12-29 02:59:30 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-12-29 02:59:30 +0000 |
commit | 41101dbd7f38c7e9898422c755b8eaf379f1d7c1 (patch) | |
tree | 6d8f60024c355d15b3a42a7c0340c53d1859a910 /src/net | |
parent | 83ff9b3685fbf239772095b829e9c233e7907b3b (diff) | |
download | mana-41101dbd7f38c7e9898422c755b8eaf379f1d7c1.tar.gz mana-41101dbd7f38c7e9898422c755b8eaf379f1d7c1.tar.bz2 mana-41101dbd7f38c7e9898422c755b8eaf379f1d7c1.tar.xz mana-41101dbd7f38c7e9898422c755b8eaf379f1d7c1.zip |
Added popup support to the Gui class. Moved all mouse input handling into the Gui class.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/protocol.cpp | 18 | ||||
-rw-r--r-- | src/net/protocol.h | 8 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp index e57be110..7a98ffb6 100644 --- a/src/net/protocol.cpp +++ b/src/net/protocol.cpp @@ -23,13 +23,10 @@ #include "protocol.h" -#include "messagein.h" #include "messageout.h" -#include "network.h" #include "../being.h" #include "../game.h" -#include "../log.h" #include "../main.h" #include "../playerinfo.h" #include "../sound.h" @@ -85,6 +82,21 @@ void action(char type, int id) outMsg.writeInt8(type); } +void talk(Being *being) +{ + MessageOut outMsg; + outMsg.writeInt16(CMSG_NPC_TALK); + outMsg.writeInt32(being->getId()); + outMsg.writeInt8(0); +} + +void pickUp(Uint32 floorItemId) +{ + MessageOut outMsg; + outMsg.writeInt16(0x009f); + outMsg.writeInt32(floorItemId); +} + Being* attack(unsigned short x, unsigned short y, unsigned char direction) { Being *target = NULL; diff --git a/src/net/protocol.h b/src/net/protocol.h index c6e118d4..8ac0f16d 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -24,6 +24,8 @@ #ifndef _TMW_PROTOCOL_ #define _TMW_PROTOCOL_ +#include <SDL_types.h> + class Being; // Packets from server to client @@ -127,4 +129,10 @@ void attack(Being *target); /** Request action */ void action(char type, int id); +/** Talk to a being */ +void talk(Being *being); + +/** Pick up an item */ +void pickUp(Uint32 floorItemId); + #endif |