57 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| #ifndef __SERVER_H__
 | |
| #define __SERVER_H__
 | |
| 
 | |
| /*
 | |
| #ifndef __NETDDE_H__
 | |
| #include "netdde.h"
 | |
| #define BASE_SERVER TDDEServer
 | |
| #endif
 | |
| */
 | |
| 
 | |
| #ifndef __NETSOCK_H__
 | |
| #include "NetSock.h"
 | |
| #define BASE_SERVER TSocketServer
 | |
| #endif
 | |
| 
 | |
| /////////////////////////////////////////////////////////////////////////////
 | |
| // THardlockServer
 | |
| 
 | |
| class THardlockServer : public BASE_SERVER
 | |
| {
 | |
|     enum { MAX_MODULES = 48 };
 | |
| 
 | |
| 	unsigned short _SerNo, _Users, _AssistanceYear, _int_tab[4];
 | |
| 
 | |
| protected:
 | |
| 	virtual BOOL OnConnect(const CString& topic);
 | |
| 	virtual TConnection* OnCreateConnection(DWORD id);
 | |
|     virtual BOOL OnRemoveConnection(DWORD id);
 | |
| 
 | |
| 	BOOL Login() const;
 | |
| 	void Logout() const;
 | |
| 	unsigned short GetSer();
 | |
| 	unsigned short GetUsers();
 | |
| 	BOOL GetAut();
 | |
| 
 | |
| public:  
 | |
| 	unsigned short SerialNumber() const 
 | |
| 	{ return _SerNo; }
 | |
| 
 | |
| 	unsigned short AssistanceYear() const 
 | |
| 	{ return _AssistanceYear; }
 | |
| 	
 | |
| 	const unsigned short* Authorizations() 
 | |
| 	{ return GetAut() ? _int_tab : NULL; }
 | |
| 
 | |
| 	unsigned short MaxUsers() const
 | |
| 	{ return _Users; }
 | |
| 
 | |
| 	THardlockServer();
 | |
| 	virtual ~THardlockServer();
 | |
| };
 | |
| 
 | |
| BOOL StartServer();
 | |
| THardlockServer& GetServer();
 | |
| BOOL StopServer();
 | |
| 
 | |
| #endif |