diff options
author | Aaron Marks <nymacro@gmail.com> | 2005-07-13 02:59:19 +0000 |
---|---|---|
committer | Aaron Marks <nymacro@gmail.com> | 2005-07-13 02:59:19 +0000 |
commit | b426d3e5d269007f95360e40f906c5568a5abc99 (patch) | |
tree | 0dd6a4ad8ed1db374b74b6ea01d0eacb7dd50abb /src/client.cpp | |
parent | 960f631a2be601357424f9e6c5cdc64b68bff856 (diff) | |
download | manaserv-b426d3e5d269007f95360e40f906c5568a5abc99.tar.gz manaserv-b426d3e5d269007f95360e40f906c5568a5abc99.tar.bz2 manaserv-b426d3e5d269007f95360e40f906c5568a5abc99.tar.xz manaserv-b426d3e5d269007f95360e40f906c5568a5abc99.zip |
Implemented MessageOut.
Rewrote MessageIn::readString - it was overly complex and didn't operate
correctly.
Update test client so it sends a login message.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index 99b1e3dd..f07ded2b 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1,6 +1,8 @@ #include <SDL.h> #include <SDL_net.h> #include <stdlib.h> +#include "defines.h" +#include "messageout.h" int main(int argc, char *argv[]) { @@ -35,6 +37,15 @@ int main(int argc, char *argv[]) } printf("Succesfully connected!\n"); + + // Send a login message + MessageOut msg; + msg.writeByte(MSG_LOGIN); + msg.writeString("nym"); + msg.writeString("password"); + + SDLNet_TCP_Send(tcpsock, msg.getPacket()->data, msg.getPacket()->length); + SDLNet_TCP_Close(tcpsock); return 0; |