Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

netplay.h

00001 /***************************************************************************
00002                           netplay.h  -  description
00003                              -------------------
00004     begin                : Sat May 3 2003
00005     copyright            : (C) 2003 by Gabor Torok
00006     email                : cctorok@yahoo.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef NET_PLAY_H
00019 #define NET_PLAY_H
00020 
00021 #include <iostream>
00022 #include <string>
00023 #include "scourge.h"
00024 #include "net/gamestatehandler.h"
00025 #include "net/commands.h"
00026 
00027 using namespace std;
00028 
00029 
00033 class NetPlay : public GameStateHandler,CommandInterpreter {
00034 private:
00035   Scourge *scourge;
00036   Window *mainWin;
00037   ScrollingList *messageList;
00038   TextField *chatText;
00039   int chatStrCount;
00040   char **chatStr;
00041   static const int MAX_CHAT_SIZE = 100;
00042   static const int CHAT_STR_LENGTH = 120;
00043 
00044 public:
00045   NetPlay(Scourge *scourge);
00046   virtual ~NetPlay();
00047 
00048   char *getGameState();
00049   
00050   void chat(char *message);
00051   void logout();
00052   void ping(int frame);
00053   void processGameState(int frame, char *p);
00054   void handleUnknownMessage();
00055   void serverClosing();
00056   void character(char *bytes, int length);
00057   void addPlayer(Uint32 id, char *bytes, int length);
00058 
00059   inline Window *getWindow() { return mainWin; }
00060 
00061   bool handleEvent(Widget *widget, SDL_Event *event);
00062 };
00063 
00064 #endif
00065 

Generated on Thu Jun 16 21:50:43 2005 for scourge by  doxygen 1.4.0