SmaugSocket.h
SmaugWizard/Src/SmaugSocket.h · 2.8 KB
From the archive SmaugWiz203.zip
Download the archive « Back to the archive contents
/****************************************************************************
* [S]imulated [M]edieval [A]dventure multi[U]ser [G]ame | *
* -----------------------------------------------------------| \\._.// *
* SmaugWiz (C) 1998 by Russ Pillsbury (Windows NT version) | (0...0) *
* -----------------------------------------------------------| ).:.( *
* SMAUG (C) 1994, 1995, 1996 by Derek Snider | {o o} *
* -----------------------------------------------------------| / ' ' \ *
* SMAUG code team: Thoric, Altrag, Blodkai, Narn, Haus, |~'~.VxvxV.~'~*
* Scryn, Swordbearer, Rennard, Tricops, and Gorog. | *
* ------------------------------------------------------------------------ *
* Merc 2.1 Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik Staerfeldt, Tom Madsen, and Katja Nyboe. *
* ------------------------------------------------------------------------ *
* Sockets Interface file *
****************************************************************************/
#ifndef SMAUGSOCKET_H
#define SMAUGSOCKET_H
class CSmaugWizDoc;
class CSmaugSocket;
class CDescriptor;
class CSmaugSocketWnd : public CWnd {
public:
CSmaugSocketWnd (CSmaugSocket* p) { m_pSock = p; }
LRESULT OnHostNotify (WPARAM wParam, LPARAM lParam);
CSmaugSocket *m_pSock;
protected:
//{{AFX_MSG(CSmaugSocketWnd)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
// CSmaugSocket command target
class CSmaugSocket : public CAsyncSocket
{
// Attributes
public:
CSmaugWizDoc *m_pDoc;
CDescriptor *m_pDes;
CSmaugSocketWnd *m_pSocketWnd;
// Operations
public:
CSmaugSocket (CSmaugWizDoc* const pDoc);
virtual ~CSmaugSocket ();
void SocketAccept (int err);
void SocketRead (int err);
void SocketWrite (int err);
BOOL SelectReadWrite ();
HANDLE GetHostByAddr (const char* addr, int len, char* buf, int buflen);
LRESULT GetHost (WPARAM wParam, LPARAM lParam);
void CreateSocketWindow ();
// Overrides
public:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSmaugSocket)
public:
virtual void OnAccept(int nErrorCode);
virtual void OnReceive(int nErrorCode);
virtual void OnSend(int nErrorCode);
virtual void OnConnect(int nErrorCode);
//}}AFX_VIRTUAL
// Generated message map functions
//{{AFX_MSG(CSmaugSocket)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
// Implementation
protected:
};
/////////////////////////////////////////////////////////////////////////////
#endif // SMAUGSOCKET_H