1998-01-07 10:17:26 +00:00
|
|
|
#ifndef __SERVER_H__
|
|
|
|
#define __SERVER_H__
|
|
|
|
|
|
|
|
#ifndef __NETSOCK_H__
|
|
|
|
#include "NetSock.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1998-05-04 10:09:51 +00:00
|
|
|
// TDongleServer
|
1998-01-07 10:17:26 +00:00
|
|
|
|
1999-01-21 16:40:02 +00:00
|
|
|
class TDongleServer : public TSocketServer
|
1998-01-07 10:17:26 +00:00
|
|
|
{
|
1998-06-24 13:48:00 +00:00
|
|
|
enum { MAX_MODULES = 256 };
|
1998-01-07 10:17:26 +00:00
|
|
|
|
1998-06-24 13:48:00 +00:00
|
|
|
unsigned int _SerNo, _MaxUsers, _AssistanceYear;
|
1998-05-04 10:09:51 +00:00
|
|
|
unsigned short _int_tab[MAX_MODULES/16];
|
1998-01-07 10:17:26 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual BOOL OnConnect(const CString& topic);
|
|
|
|
virtual TConnection* OnCreateConnection(DWORD id);
|
1998-06-24 13:48:00 +00:00
|
|
|
virtual BOOL OnRemoveConnection(DWORD id);
|
1998-01-07 10:17:26 +00:00
|
|
|
|
1998-05-04 10:09:51 +00:00
|
|
|
BOOL HardlockLogin();
|
|
|
|
BOOL EutronLogin();
|
|
|
|
BOOL Login();
|
|
|
|
void Logout();
|
|
|
|
|
|
|
|
BOOL ReadHardlockWords(unsigned short reg, unsigned short num, unsigned short* data);
|
|
|
|
BOOL ReadEutronWords(unsigned short reg, unsigned short num, unsigned short* data);
|
1998-01-07 10:17:26 +00:00
|
|
|
|
1998-11-13 14:54:23 +00:00
|
|
|
int GetPeerConnections(const CString& strPeer) const;
|
|
|
|
|
1998-01-07 10:17:26 +00:00
|
|
|
public:
|
|
|
|
unsigned short SerialNumber() const
|
|
|
|
{ return _SerNo; }
|
1998-01-27 10:53:26 +00:00
|
|
|
|
|
|
|
unsigned short AssistanceYear() const
|
|
|
|
{ return _AssistanceYear; }
|
1998-01-07 10:17:26 +00:00
|
|
|
|
1998-05-04 10:09:51 +00:00
|
|
|
const unsigned short* Authorizations(unsigned short& nSize) const
|
|
|
|
{ nSize = sizeof(_int_tab); return _int_tab; }
|
1998-01-07 10:17:26 +00:00
|
|
|
|
|
|
|
unsigned short MaxUsers() const
|
1998-06-24 13:48:00 +00:00
|
|
|
{ return _MaxUsers; }
|
1998-01-07 10:17:26 +00:00
|
|
|
|
1998-06-24 13:48:00 +00:00
|
|
|
unsigned short Users() const;
|
1998-11-13 14:54:23 +00:00
|
|
|
unsigned short Peers() const;
|
1998-06-24 13:48:00 +00:00
|
|
|
|
1999-01-21 16:40:02 +00:00
|
|
|
BOOL CanClose() const;
|
|
|
|
|
1998-06-24 13:48:00 +00:00
|
|
|
TDongleServer();
|
1998-05-04 10:09:51 +00:00
|
|
|
virtual ~TDongleServer();
|
1998-01-07 10:17:26 +00:00
|
|
|
};
|
|
|
|
|
1998-11-13 14:54:23 +00:00
|
|
|
CString GetIniString(LPCSTR sec, LPCSTR key, LPCSTR def);
|
|
|
|
|
1998-01-07 10:17:26 +00:00
|
|
|
BOOL StartServer();
|
1998-05-04 10:09:51 +00:00
|
|
|
TDongleServer& GetServer();
|
1998-01-07 10:17:26 +00:00
|
|
|
BOOL StopServer();
|
|
|
|
|
|
|
|
#endif
|