OpenMortal Apocalypse mirror
Sourceforge mirror
SourceForge.net Logo
      News | Info | Characters | Arenas | Screenshots | Forums | Download  
Developer: Making of | Character-HOWTO | AI Design | Submit a Character
Documentation: Main Page | Modules | Class Hierarchy | Class List | File List

COnlineChat Class Reference
[Networking layer]

The "mortal.net" chat protocol should be simple enough... More...

#include <OnlineChat.h>

List of all members.

Public Member Functions

 COnlineChat ()
 ~COnlineChat ()
bool Start ()
void Stop ()
void DoOnlineChat ()

Protected Member Functions

void Redraw ()
void Update ()
void SendRawData (char a_cID, const std::string &a_rsData)
void ReceiveMsg (char a_cID, char *a_pcData)
void ReceiveUser (char a_cID, char *a_pcData)
void DrawNickList ()
void Menu ()

Protected Attributes

TCPsocket m_poSocket
 The TCP/IP network socket.
SDLNet_SocketSet m_poSocketSet
 SDLNet construct for watching the socket.
char m_acIncomingBuffer [4096]
 Received data goes here.
int m_iIncomingBufferSize
 How much of the buffer is filled?
std::string m_sLastError
 The last error message from SDLNet.
SDL_Surface * m_poScreen
SDL_Surface * m_poBackground
CReadline * m_poReadline
CTextAream_poTextArea
bool m_bMyNickIsOk
TNickMap m_asNicks


Detailed Description

The "mortal.net" chat protocol should be simple enough...

[LOGGING IN]

Server: <greeting msg=""> Client: N <version> <nickname> Server: OK <actual nickname="">

[CHATTING]

Server: J <user> <ip> - User joins. Server: L <user> - User leaves. Server: N <user> <newnick> - Nick change. Server: W <user> <ip> - Whois response Server: Y <num> - You are now known as... Server: C <user> - Someone has challenged you!

Server: M <user> <text> - Public message. Server: S <text> - Server message.

Client: M <text> - Send message. Client: W <user> - WHOIS query Client: L - Quit Client: C <user> - Challenge a user


Constructor & Destructor Documentation

COnlineChat::COnlineChat  ) 
 

COnlineChat::~COnlineChat  ) 
 


Member Function Documentation

void COnlineChat::DoOnlineChat  ) 
 

void COnlineChat::DrawNickList  )  [protected]
 

void COnlineChat::Menu  )  [protected]
 

void COnlineChat::ReceiveMsg char  a_cID,
char *  a_pcData
[protected]
 

void COnlineChat::ReceiveUser char  a_cID,
char *  a_pcData
[protected]
 

void COnlineChat::Redraw  )  [protected]
 

void COnlineChat::SendRawData char  a_cID,
const std::string &  a_rsData
[protected]
 

bool COnlineChat::Start  ) 
 

void COnlineChat::Stop  ) 
 

void COnlineChat::Update  )  [protected]
 


Member Data Documentation

char COnlineChat::m_acIncomingBuffer[4096] [protected]
 

Received data goes here.

TNickMap COnlineChat::m_asNicks [protected]
 

bool COnlineChat::m_bMyNickIsOk [protected]
 

int COnlineChat::m_iIncomingBufferSize [protected]
 

How much of the buffer is filled?

SDL_Surface* COnlineChat::m_poBackground [protected]
 

CReadline* COnlineChat::m_poReadline [protected]
 

SDL_Surface* COnlineChat::m_poScreen [protected]
 

TCPsocket COnlineChat::m_poSocket [protected]
 

The TCP/IP network socket.

SDLNet_SocketSet COnlineChat::m_poSocketSet [protected]
 

SDLNet construct for watching the socket.

CTextArea* COnlineChat::m_poTextArea [protected]
 

std::string COnlineChat::m_sLastError [protected]
 

The last error message from SDLNet.


The documentation for this class was generated from the following files: