summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-06 17:30:40 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-06 17:30:40 +0000
commit4c15d1d1dcedb3627e501fb5ddba4ae74281968c (patch)
treede4a44e603d05742b4eaffff75b759e1ac6ff85c /src/client.cpp
parentce849af300a70425b574b724c62dc9f5fce6016b (diff)
downloadmanaserv-4c15d1d1dcedb3627e501fb5ddba4ae74281968c.tar.gz
manaserv-4c15d1d1dcedb3627e501fb5ddba4ae74281968c.tar.bz2
manaserv-4c15d1d1dcedb3627e501fb5ddba4ae74281968c.tar.xz
manaserv-4c15d1d1dcedb3627e501fb5ddba4ae74281968c.zip
Implemented crude handling of being movements.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp
index f1d73541..752d65d0 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -269,8 +269,8 @@ int main(int argc, char *argv[])
std::cin >> y;
msg.writeShort(PGMSG_WALK);
- msg.writeLong(x);
- msg.writeLong(y);
+ msg.writeShort(x);
+ msg.writeShort(y);
msgDestination = 1;
} break;
@@ -720,6 +720,20 @@ void parsePacket(char *data, int recvLength) {
}
} break;
+ case GPMSG_BEINGS_MOVE:
+ {
+ int nb = (recvLength - 2) / (1*4 + 4*2);
+ std::cout << "Beings are moving:" << std::endl;
+ for(; nb > 0; --nb) {
+ int id = msg.readLong();
+ int cx = msg.readShort(), cy = msg.readShort();
+ int dx = msg.readShort(), dy = msg.readShort();
+ std::cout << " ID " << id << " at ("
+ << cx << ", " << cy << ") toward ("
+ << dx << ", " << dy << ")." << std::endl;
+ }
+ } break;
+
case XXMSG_INVALID:
std::cout << "The server does not understand our message." << std::endl;
break;