00001 /************************************************************************/ 00002 /* Ex Nihlo Engine by Hermanns Christophe */ 00003 /************************************************************************/ 00004 /* This program is free software; you can redistribute it and/or */ 00005 /* modify it under the terms of the GNU General Public License */ 00006 /* as published by the Free Software Foundation; either version 2 */ 00007 /* of the License, or (at your option) any later version. */ 00008 /* */ 00009 /* This program is distributed in the hope that it will be useful, */ 00010 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 00011 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ 00012 /* */ 00013 /* See the GNU General Public License for more details. */ 00014 /* */ 00015 /* You should have received a copy of the GNU General Public License */ 00016 /* along with this program; if not, write to the Free Software */ 00017 /* Foundation, Inc., 59 Temple Place - Suite 330, */ 00018 /* Boston, MA 02111-1307, USA. */ 00019 /* */ 00020 /* If you use a important part of this code please send me a mail */ 00021 /* I just want to see where my code go thks :) */ 00022 /************************************************************************/ 00023 00024 /************************************************************************/ 00025 /* Contact */ 00026 /************************************************************************/ 00027 /* ExNihilo Website :www.ploksoftware.org */ 00028 /* */ 00029 /* Hermanns Christophe ExNihilo creator and main programmer */ 00030 /* */ 00031 /* Mail : Data@ploksoftware.org */ 00032 /* ICQ : 8030901 */ 00033 /* MSN Messenger : Data_7@hotmail.com */ 00034 /* */ 00035 /* */ 00036 /************************************************************************/ 00037 00038 /************************************************************************/ 00039 /* File Description */ 00040 /************************************************************************/ 00041 /* File Name :ExManagerNetwork.h */ 00042 /* */ 00043 /* Start Date :03/15/2002 */ 00044 /* */ 00045 /* */ 00046 /* Last Update :06/20/2003 */ 00047 /* */ 00048 /* File Description : */ 00049 /* */ 00050 /* For update of this file check : www.ploksoftware.org */ 00051 /************************************************************************/ 00052 00053 #ifndef __EXMANAGERNETWORK_H__ 00054 #define __EXMANAGERNETWORK_H__ 00055 //------------------------------------------------------------------------ 00056 //Includes 00057 //------------------------------------------------------------------------ 00058 #include "ExDefine.h" 00059 #include "ExNihiloNameSpace.h" 00060 #include "ExCAction.h" 00061 //------------------------------------------------------------------------ 00062 #include "Math/ExMath.h" 00063 //------------------------------------------------------------------------ 00064 #include "Manager/ExManager.h" 00065 //------------------------------------------------------------------------ 00066 #include "NetWork/ExCSocket.h" 00067 #include "NetWork/ExCSocketClient.h" 00068 #include "NetWork/ExCMessage.h" 00069 //------------------------------------------------------------------------ 00070 class ExManagerNetwork : public ExManager 00071 { 00072 private: 00073 //------------------------------------------------------------------------ 00074 // Variable 00075 //------------------------------------------------------------------------ 00076 ExCSocketClient m_SocketClient; 00077 std::string m_ServerIp; 00078 bool m_ShowNetStat; 00079 bool m_ShowMessage; 00080 bool m_ShowSayBar; 00081 bool m_Connected; 00082 float m_LastPing; 00083 std::string m_BuffSay; 00084 std::string m_BuffOldSay1; 00085 std::string m_BuffOldSay2; 00086 std::string m_BuffOldSay3; 00087 //------------------------------------------------------------------------ 00088 // Singleton creation 00089 //------------------------------------------------------------------------ 00090 static bool m_flag; 00091 static ExManagerNetwork *m_instance; 00092 ExManagerNetwork(void); 00093 ~ExManagerNetwork(void); 00094 public: 00095 //------------------------------------------------------------------------ 00096 // Methode 00097 //------------------------------------------------------------------------ 00098 static ExManagerNetwork* CreateSingleton(void); 00099 00100 void Reset(void); 00101 void Init(void); 00102 void Draw(void); 00103 void DrawNetStat(void); 00104 void DrawMessage(void); 00105 void Connect(void); 00106 void Disconnect(void); 00107 void Ping(void); 00108 void Say(void); 00109 00110 inline bool GetNetstatState(void){return m_ShowNetStat;} 00111 inline void SetNetstatState(bool state){m_ShowNetStat=state;} 00112 inline bool GetMessageState(void){return m_ShowMessage;} 00113 inline void SetMessageState(bool state){m_ShowMessage=state;} 00114 inline bool GetSayBarState(void){return m_ShowSayBar;} 00115 inline void SetSayBarState(bool state){m_ShowSayBar=state;} 00116 ExCAction InputAction(ExCAction Action); 00117 ExCAction InputCommand(ExCCommand Command); 00118 }; 00119 //------------------------------------------------------------------------ 00120 #endif //__EXMANAGERNETWORK_H__