summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
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;