#include <ExManagerNetWork.h>
Graphe d'héritage de la classe ExManagerNetwork
Membres publics | |
void | Reset (void) |
void | Init (void) |
void | Draw (void) |
void | DrawNetStat (void) |
void | DrawMessage (void) |
void | Connect (void) |
void | Disconnect (void) |
void | Ping (void) |
void | Say (void) |
bool | GetNetstatState (void) |
void | SetNetstatState (bool state) |
bool | GetMessageState (void) |
void | SetMessageState (bool state) |
bool | GetSayBarState (void) |
void | SetSayBarState (bool state) |
ExCAction | InputAction (ExCAction Action) |
ExCAction | InputCommand (ExCCommand Command) |
void | SetFlux (std::ostrstream *consol, ExCFluxAction *action) |
bool | GetStatus (void) |
void | SetStatus (bool status) |
void | SetAskForCommand (bool status) |
void | SetAskForExclusifCommand (bool status) |
bool | AskForCommand (void) |
bool | AskForExclusifCommand (void) |
virtual void | Reload (void) |
Membres publics statiques | |
ExManagerNetwork * | CreateSingleton (void) |
Attributs Publics | |
std::ostrstream * | Consol |
ExCFluxAction * | FluxAction |
Attributs Protégés | |
bool | m_Status |
bool | m_AskForCommand |
bool | m_Exclusif |
Membres privés | |
ExManagerNetwork (void) | |
~ExManagerNetwork (void) | |
Attributs Privés | |
ExCSocketClient | m_SocketClient |
std::string | m_ServerIp |
bool | m_ShowNetStat |
bool | m_ShowMessage |
bool | m_ShowSayBar |
bool | m_Connected |
float | m_LastPing |
std::string | m_BuffSay |
std::string | m_BuffOldSay1 |
std::string | m_BuffOldSay2 |
std::string | m_BuffOldSay3 |
Attributs Privés Statiques | |
bool | m_flag = false |
ExManagerNetwork * | m_instance = NULL |
|
Définition à la ligne 43 du fichier ExManagerNetwork.cpp.
00044 { 00045 00046 } |
|
Définition à la ligne 48 du fichier ExManagerNetwork.cpp.
00049 { 00050 } |
|
Définition à la ligne 89 du fichier ExManager.h. Références ExManager::m_AskForCommand. Référencé par ExManagerCommand::InputCommand().
00089 {return m_AskForCommand;} |
|
Définition à la ligne 90 du fichier ExManager.h. Références ExManager::m_Exclusif. Référencé par ExManagerCommand::InputCommand().
00090 {return m_Exclusif;} |
|
Définition à la ligne 127 du fichier ExManagerNetwork.cpp. Références ExCSocket::Close(), ExCSocketClient::Connect(), Connect(), Guard, ExCSocketClient::Init(), m_Connected, m_ServerIp, m_ShowNetStat, m_SocketClient, MESSAGE_LOGIN, ExCSocket::RecvMessage(), ExCSocket::SendMessage(), ExCMessage::SetMessage(), ExCMessage::SetType(), et UnGuard. Référencé par Connect(), et InputAction().
00128 { 00129 Guard(void ExManagerNetwork::Connect(void)) 00130 m_SocketClient.Init(); 00131 if(m_SocketClient.Connect()==0) 00132 { 00133 m_Connected=true; 00134 m_ServerIp="192.168.0.1"; 00135 m_ShowNetStat=true; 00136 ExCMessage buffmsg; 00137 00138 //w8 msg from server 00139 m_SocketClient.RecvMessage(buffmsg); 00140 // *Consol<<buffmsg<<std::endl; 00141 //send login 00142 00143 buffmsg.SetType(MESSAGE_LOGIN); 00144 buffmsg.SetMessage("Client"); 00145 m_SocketClient.SendMessage(buffmsg); 00146 // *Consol<<"connected"<<std::endl; 00147 }else 00148 { 00149 // *Consol<<"Socket error"<<std::endl; 00150 m_SocketClient.Close(); 00151 } 00152 UnGuard 00153 } |
|
Définition à la ligne 29 du fichier ExManagerNetwork.cpp. Références CreateSingleton(), Guard, m_flag, m_instance, et UnGuard. Référencé par CreateManager(), et CreateSingleton().
00029 { 00030 Guard(ExManagerNetwork* ExManagerNetwork::CreateSingleton(void)) 00031 if(!m_flag) 00032 { 00033 m_flag = true; // We are creating the error log now, so set flag to true 00034 m_instance = new ExManagerNetwork; // Create the error log 00035 }else 00036 { 00037 std::cout<<"Error singleton already created"<<std::endl; 00038 } 00039 return m_instance; 00040 UnGuard 00041 } |
|
Définition à la ligne 155 du fichier ExManagerNetwork.cpp. Références ExCSocket::Close(), Disconnect(), Guard, m_Connected, m_ServerIp, m_SocketClient, MESSAGE_QUIT, ExCSocket::SendMessage(), ExCMessage::SetType(), et UnGuard. Référencé par Disconnect(), et InputAction().
00156 { 00157 Guard(void ExManagerNetwork::Disconnect(void)) 00158 ExCMessage buffmsg; 00159 buffmsg.SetType(MESSAGE_QUIT); 00160 m_SocketClient.SendMessage(buffmsg); 00161 m_SocketClient.Close(); 00162 m_Connected=false; 00163 m_ServerIp="No Connexion"; 00164 00165 UnGuard 00166 } |
|
Définition à la ligne 65 du fichier ExManagerNetwork.cpp. Références DrawMessage(), DrawNetStat(), m_ShowMessage, et m_ShowNetStat. Référencé par ExManagerOutput::DrawScene().
00066 { 00067 if(m_ShowNetStat)DrawNetStat(); 00068 if(m_ShowMessage)DrawMessage(); 00069 00070 00071 } |
|
Définition à la ligne 88 du fichier ExManagerNetwork.cpp. Références ExNihilo::DrawCadre(), m_BuffOldSay1, m_BuffOldSay2, m_BuffOldSay3, m_BuffSay, m_ShowSayBar, et ExNihilo::WriteToScreen(). Référencé par Draw().
00089 { 00090 //draw old message 00091 ExNihilo::DrawCadre(10,glutGet(GLUT_WINDOW_HEIGHT)-80,glutGet(GLUT_WINDOW_WIDTH)-150,50,0.8f,0.0f,0.0f,0.9f); 00092 ExNihilo::WriteToScreen(15,glutGet(GLUT_WINDOW_HEIGHT)-65,1,1,1,m_BuffOldSay3); 00093 ExNihilo::WriteToScreen(15,glutGet(GLUT_WINDOW_HEIGHT)-50,1,1,1,m_BuffOldSay2); 00094 ExNihilo::WriteToScreen(15,glutGet(GLUT_WINDOW_HEIGHT)-35,1,1,1,m_BuffOldSay1); 00095 //draw current phrase 00096 if(m_ShowSayBar) 00097 { 00098 ExNihilo::DrawCadre(10,glutGet(GLUT_WINDOW_HEIGHT)-25,glutGet(GLUT_WINDOW_WIDTH)-15,20,0.7f,0.1f,0.0f,0.9f); 00099 ExNihilo::WriteToScreen(15,glutGet(GLUT_WINDOW_HEIGHT)-10,1,1,1,m_BuffSay); 00100 } 00101 } |
|
Définition à la ligne 73 du fichier ExManagerNetwork.cpp. Références ExNihilo::DrawCadre(), m_LastPing, m_ServerIp, Ping(), et ExNihilo::WriteToScreen(). Référencé par Draw().
00074 { 00075 //ExNihilo::DrawCadre(10,glutGet(GLUT_WINDOW_HEIGHT)-135,140,50,0.2f,0.0f,0.6f,0.9f); 00076 00077 ExNihilo::DrawCadre(glutGet(GLUT_WINDOW_WIDTH)-135, glutGet(GLUT_WINDOW_HEIGHT)-80, 130,50,0.2f,0.0f,0.6f,0.9f); 00078 ExNihilo::WriteToScreen(glutGet(GLUT_WINDOW_WIDTH)-130,glutGet(GLUT_WINDOW_HEIGHT)-65,1,1,1,"NetStat"); 00079 std::string buffserver("Server :"); 00080 buffserver=buffserver+m_ServerIp; 00081 ExNihilo::WriteToScreen(glutGet(GLUT_WINDOW_WIDTH)-130,glutGet(GLUT_WINDOW_HEIGHT)-50,1,1,1,buffserver); 00082 char buffping[255]; 00083 Ping(); 00084 sprintf(buffping,"Ping :%4.4f",m_LastPing); 00085 ExNihilo::WriteToScreen(glutGet(GLUT_WINDOW_WIDTH)-130,glutGet(GLUT_WINDOW_HEIGHT)-35,1,1,1,buffping); 00086 } |
|
Définition à la ligne 112 du fichier ExManagerNetWork.h. Références m_ShowMessage.
00112 {return m_ShowMessage;} |
|
Définition à la ligne 110 du fichier ExManagerNetWork.h. Références m_ShowNetStat.
00110 {return m_ShowNetStat;} |
|
Définition à la ligne 114 du fichier ExManagerNetWork.h. Références m_ShowSayBar.
00114 {return m_ShowSayBar;} |
|
Définition à la ligne 85 du fichier ExManager.h. Références ExManager::m_Status. Référencé par ExManagerInterface::Draw(), ExManagerConsole::Draw(), et ExManagerOutput::DrawScene().
00085 {return m_Status;} |
|
Redéfinie à partir de ExManager. Définition à la ligne 52 du fichier ExManagerNetwork.cpp. Références m_Connected, m_LastPing, m_ServerIp, m_ShowMessage, m_ShowNetStat, m_ShowSayBar, ExManager::SetAskForCommand(), et ExManager::SetAskForExclusifCommand(). Référencé par PreInitManager().
00053 { 00054 m_ShowNetStat=false; 00055 m_ShowMessage=false; 00056 m_ShowSayBar=false; 00057 m_ServerIp="No Connexion"; 00058 m_Connected=false; 00059 m_LastPing=0.0f; 00060 SetAskForCommand(false); 00061 SetAskForExclusifCommand(false); 00062 00063 } |
|
Redéfinie à partir de ExManager. Définition à la ligne 177 du fichier ExManagerNetwork.cpp. Références Connect(), CONNECT, Disconnect(), DISCONNECT, Guard, HIDE_CHAT, HIDE_NET_STAT, InputAction(), ExCAction::m_Action, ExCAction::m_NextAction, NOTHING, Say(), SAY, SetMessageState(), SetNetstatState(), SHOW_CHAT, SHOW_NET_STAT, et UnGuard. Référencé par InputAction(), et ExManagerCommand::ProcesExCAction().
00178 { 00179 Guard(ExCAction ExManagerNetwork::InputAction(ExCAction Action)) 00180 switch(Action.m_Action) 00181 { 00182 case SHOW_NET_STAT: 00183 SetNetstatState(true); 00184 break; 00185 case HIDE_NET_STAT: 00186 SetNetstatState(false); 00187 break; 00188 case SHOW_CHAT: 00189 SetMessageState(true); 00190 break; 00191 case HIDE_CHAT: 00192 SetMessageState(false); 00193 break; 00194 case CONNECT: 00195 Connect(); 00196 break; 00197 case DISCONNECT: 00198 Disconnect(); 00199 break; 00200 case SAY: 00201 Say(); 00202 break; 00203 } 00204 if(Action.m_NextAction){return *Action.m_NextAction;} 00205 else{return NOTHING;} 00206 UnGuard 00207 } |
|
Redéfinie à partir de ExManager. Définition à la ligne 209 du fichier ExManagerNetwork.cpp. Références ExNihilo::AddKeyToBuffer(), Guard, InputCommand(), KEYBOARD_DOWN_ENTER, KEYBOARD_UP_ARROW_LEFT, KEYBOARD_UP_BACKSPACE, m_BuffOldSay1, m_BuffOldSay2, m_BuffOldSay3, m_BuffSay, ExCCommand::m_Command, m_Connected, m_SocketClient, MESSAGE_SAY, NOTHING, ExCSocket::SendMessage(), ExManager::SetAskForCommand(), ExManager::SetAskForExclusifCommand(), ExCMessage::SetMessage(), SetSayBarState(), ExCMessage::SetType(), et UnGuard. Référencé par InputCommand(), et ExManagerCommand::InputCommand().
00210 { 00211 Guard(ExCAction ExManagerNetwork::InputCommand(ExCCommand Command)) 00212 //std::cout<<"ExManagerNetwork::Input Command network:"<<Command.m_Command<<std::endl; 00213 //custom action 00214 switch(Command.m_Command) 00215 { 00216 case KEYBOARD_UP_ARROW_LEFT: 00217 if(m_BuffSay.size()>0) 00218 { 00219 m_BuffSay.erase(m_BuffSay.end()-1,m_BuffSay.end()); 00220 } 00221 return NOTHING; 00222 00223 case KEYBOARD_UP_BACKSPACE: 00224 if(m_BuffSay.size()>0) 00225 { 00226 m_BuffSay.erase(m_BuffSay.end()-1,m_BuffSay.end()); 00227 } 00228 return NOTHING; 00229 00230 case KEYBOARD_DOWN_ENTER: 00231 if(m_Connected) 00232 { 00233 ExCMessage buffmsg; 00234 buffmsg.SetType(MESSAGE_SAY); 00235 buffmsg.SetMessage(m_BuffSay); 00236 m_SocketClient.SendMessage(buffmsg); 00237 } 00238 SetAskForCommand(false); 00239 SetAskForExclusifCommand(false); 00240 m_BuffOldSay3=m_BuffOldSay2; 00241 m_BuffOldSay2=m_BuffOldSay1; 00242 m_BuffOldSay1=m_BuffSay; 00243 SetSayBarState(false); 00244 m_BuffSay.erase(m_BuffSay.begin(),m_BuffSay.end()); 00245 00246 return NOTHING; 00247 } 00248 //simple text action 00249 ExNihilo::AddKeyToBuffer(Command.m_Command,m_BuffSay); 00250 return NOTHING; 00251 UnGuard 00252 } |
|
Définition à la ligne 103 du fichier ExManagerNetwork.cpp. Références m_Connected, m_LastPing, m_SocketClient, MESSAGE_PING, ExCSocket::RecvMessage(), ExCSocket::SendMessage(), et ExCMessage::SetType(). Référencé par DrawNetStat().
00104 { 00105 if(glutGet(GLUT_ELAPSED_TIME)%100==0) 00106 { 00107 if(m_Connected) 00108 { 00109 int time; 00110 ExCMessage buffmsg; 00111 time=glutGet(GLUT_ELAPSED_TIME); 00112 buffmsg.SetType(MESSAGE_PING); 00113 m_SocketClient.SendMessage(buffmsg); 00114 m_SocketClient.RecvMessage(buffmsg); 00115 m_LastPing=((float)(glutGet(GLUT_ELAPSED_TIME)-time)/100); 00116 } 00117 } 00118 } |
|
|
Redéfinie à partir de ExManager. Définition à la ligne 120 du fichier ExManagerNetwork.cpp. Références Guard, Reset(), et UnGuard. Référencé par Reset().
|
|
Définition à la ligne 168 du fichier ExManagerNetwork.cpp. Références Guard, Say(), ExManager::SetAskForCommand(), ExManager::SetAskForExclusifCommand(), SetSayBarState(), et UnGuard. Référencé par InputAction(), et Say().
00169 { 00170 Guard(void ExManagerNetwork::Say(void)) 00171 SetAskForCommand(true); 00172 SetAskForExclusifCommand(true); 00173 SetSayBarState(true); 00174 UnGuard 00175 } |
|
Définition à la ligne 87 du fichier ExManager.h. Références ExManager::m_AskForCommand. Référencé par ExManagerConsole::ExManagerConsole(), ExManagerModel::ExManagerModel(), ExManagerObjectWindow::Init(), Init(), ExManagerConsole::InputAction(), InputCommand(), ExManagerLoad::LoadSetOfFile(), et Say().
00087 {m_AskForCommand=status;} |
|
Définition à la ligne 88 du fichier ExManager.h. Références ExManager::m_Exclusif. Référencé par ExManagerConsole::ExManagerConsole(), ExManagerModel::ExManagerModel(), ExManagerObjectWindow::Init(), Init(), ExManagerConsole::InputAction(), InputCommand(), et Say().
00088 {m_Exclusif=status;} |
|
Définition à la ligne 35 du fichier ExManager.cpp. Références ExManager::Consol, et ExManager::FluxAction. Référencé par SetManagerLink().
00036 { 00037 Consol=consol; 00038 FluxAction=action; 00039 } |
|
Définition à la ligne 113 du fichier ExManagerNetWork.h. Références m_ShowMessage. Référencé par InputAction().
00113 {m_ShowMessage=state;} |
|
Définition à la ligne 111 du fichier ExManagerNetWork.h. Références m_ShowNetStat. Référencé par InputAction().
00111 {m_ShowNetStat=state;} |
|
Définition à la ligne 115 du fichier ExManagerNetWork.h. Références m_ShowSayBar. Référencé par InputCommand(), et Say().
00115 {m_ShowSayBar=state;} |
|
Définition à la ligne 86 du fichier ExManager.h. Références ExManager::m_Status. Référencé par ExManagerConsole::Draw(), ExManagerConsole::ExManagerConsole(), ExManagerObjectWindow::Init(), ExManagerInterface::Init(), ExManagerConsole::InputAction(), ExManagerLoad::LoadSetOfFile(), et ExManagerConsole::SetConsoleState().
00086 {m_Status=status;} |
|
|
Définition à la ligne 74 du fichier ExManager.h. Référencé par ExManagerWindow::Apply(), ExManagerCommand::ApplyAction(), ExManagerCommand::LoadExecFile(), ExManagerId::RecordObject(), ExManager::SetFlux(), et ExManagerSpecialEffect::Specialeffect(). |
|
Définition à la ligne 70 du fichier ExManager.h. Référencé par ExManager::AskForCommand(), ExManagerConsole::ExManagerConsole(), et ExManager::SetAskForCommand(). |
|
Définition à la ligne 84 du fichier ExManagerNetWork.h. Référencé par DrawMessage(), et InputCommand(). |
|
Définition à la ligne 85 du fichier ExManagerNetWork.h. Référencé par DrawMessage(), et InputCommand(). |
|
Définition à la ligne 86 du fichier ExManagerNetWork.h. Référencé par DrawMessage(), et InputCommand(). |
|
Définition à la ligne 83 du fichier ExManagerNetWork.h. Référencé par DrawMessage(), et InputCommand(). |
|
Définition à la ligne 81 du fichier ExManagerNetWork.h. Référencé par Connect(), Disconnect(), Init(), InputCommand(), et Ping(). |
|
Définition à la ligne 71 du fichier ExManager.h. Référencé par ExManager::AskForExclusifCommand(), et ExManager::SetAskForExclusifCommand(). |
|
Définition à la ligne 26 du fichier ExManagerNetwork.cpp. Référencé par CreateSingleton(). |
|
Définition à la ligne 27 du fichier ExManagerNetwork.cpp. Référencé par CreateSingleton(). |
|
Définition à la ligne 82 du fichier ExManagerNetWork.h. Référencé par DrawNetStat(), Init(), et Ping(). |
|
Définition à la ligne 77 du fichier ExManagerNetWork.h. Référencé par Connect(), Disconnect(), DrawNetStat(), et Init(). |
|
Définition à la ligne 79 du fichier ExManagerNetWork.h. Référencé par Draw(), GetMessageState(), Init(), et SetMessageState(). |
|
Définition à la ligne 78 du fichier ExManagerNetWork.h. Référencé par Connect(), Draw(), GetNetstatState(), Init(), et SetNetstatState(). |
|
Définition à la ligne 80 du fichier ExManagerNetWork.h. Référencé par DrawMessage(), GetSayBarState(), Init(), et SetSayBarState(). |
|
Définition à la ligne 76 du fichier ExManagerNetWork.h. Référencé par Connect(), Disconnect(), InputCommand(), et Ping(). |
|
Définition à la ligne 69 du fichier ExManager.h. Référencé par ExManager::GetStatus(), et ExManager::SetStatus(). |