Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Network.h
Package: SwordOnline.rar [view]
Upload User: dzyhzl
Upload Date: 2019-04-29
Package Size: 56270k
Code Size: 2k
Category:
Game Server Simulator
Development Platform:
C/C++
- /********************************************************************
- created: 2003/05/05
- file base: Network
- file ext: h
- author: liupeng
- purpose:
- *********************************************************************/
- #ifndef __INCLUDE_NETWORK_H__
- #define __INCLUDE_NETWORK_H__
- #pragma once
- #include "IClient.h"
- #include "RainbowInterface.h"
- #include "IServer.h"
- #include "HeavenInterface.h"
- #include "Library.h"
- #include "Buffer.h"
- #include "tstring.h"
- #include "CriticalSection.h"
- class CNetwork
- {
- public:
- CNetwork();
- virtual ~CNetwork();
- bool Create();
- void Destroy();
- IClient *CreateAccSvrClient( const char * const pAddressToConnectServer,
- unsigned short usPortToConnectServer );
- const char *GetAccSvrIP() { return m_sAccSvrIP.c_str(); }
- unsigned short GetAccSvrPort() { return m_nAccSvrPort; }
- const char *GetRoleSvrIP() { return m_sRoleSvrIP.c_str(); }
- void SetRoleSvrIP( const char *pAddress ) { if ( pAddress ) { m_sRoleSvrIP = pAddress; } }
- unsigned short GetRoleSvrPort() { return m_nRoleSvrPort; }
- void SetRoleSvrPort( unsigned short nRoleSvrPort ) { m_nRoleSvrPort = nRoleSvrPort; }
- unsigned short GetClientOpenPort() { return m_nClientOpenPort; }
- void SetClientOpenPort( unsigned short nClientOpenPort ) { m_nClientOpenPort = nClientOpenPort; }
- unsigned short GetGameSvrOpenPort() { return m_nGameSvrOpenPort; }
- void SetGameSvrOpenPort( unsigned short nGameSvrOpenPort ) { m_nGameSvrOpenPort = nGameSvrOpenPort; }
- static OnlineGameLib::Win32::CBuffer::Allocator m_theGlobalAllocator;
- protected:
- typedef HRESULT ( __stdcall * pfnCreateServerInterface )( REFIID riid, void **ppv );
- typedef HRESULT ( __stdcall * pfnCreateClientInterface )( REFIID riid, void **ppv );
- static OnlineGameLib::Win32::CLibrary m_theHeavenLib;
- static OnlineGameLib::Win32::CLibrary m_theRainbowLib;
- static void __stdcall AccSvrEventNotify( LPVOID lpParam, const unsigned long &ulnEventType );
- void DistroyAccSvrClient();
- private:
- /*
- * Account server config
- */
- IClient *m_pAccSvrClient;
- OnlineGameLib::Win32::_tstring m_sAccSvrIP;
- unsigned short m_nAccSvrPort;
- /*
- * Role server config
- */
- OnlineGameLib::Win32::_tstring m_sRoleSvrIP;
- unsigned short m_nRoleSvrPort;
- /*
- * Client config
- */
- unsigned short m_nClientOpenPort;
- /*
- * Game server config
- */
- unsigned short m_nGameSvrOpenPort;
- };
- #endif // __INCLUDE_NETWORK_H__