Aggiunto supporto per l'anno d'assistenza

git-svn-id: svn://10.65.10.50/trunk@6037 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1998-01-27 10:53:26 +00:00
parent 2690db37fe
commit 2594a69bab
3 changed files with 17 additions and 2 deletions

View File

@ -34,3 +34,9 @@ int f_DongleNumber(TConnection& conn, void* pJolly)
int serno = GetServer().SerialNumber();
return conn.ReturnInteger(serno);
}
int f_DongleYear(TConnection& conn, void* pJolly)
{
int year = GetServer().AssistanceYear();
return conn.ReturnInteger(year);
}

View File

@ -74,8 +74,12 @@ unsigned short THardlockServer::GetSer()
unsigned short THardlockServer::GetUsers()
{
_Users = 0;
_AssistanceYear = 0;
if (_SerNo == 0)
_Users = 1;
{
_Users = 4;
_AssistanceYear = 1998;
}
else
{
if (_SerNo != 0xFFFF)
@ -86,9 +90,11 @@ unsigned short THardlockServer::GetUsers()
HL_READ(62, EYECAST &Val[2]);
HL_READ(63, EYECAST &Val[3]);
HL_CODE(Val, HLBLOCK);
_AssistanceYear = Val[0];
_Users = Val[1];
}
}
Trace(-1, "Assistance Year is %d", (int)_AssistanceYear);
Trace(-1, "Maximum number of users is %d", (int)_Users);
return _Users;
}

View File

@ -20,7 +20,7 @@ class THardlockServer : public BASE_SERVER
{
enum { MAX_MODULES = 48 };
unsigned short _SerNo, _Users, _int_tab[4];
unsigned short _SerNo, _Users, _AssistanceYear, _int_tab[4];
protected:
virtual BOOL OnConnect(const CString& topic);
@ -36,6 +36,9 @@ protected:
public:
unsigned short SerialNumber() const
{ return _SerNo; }
unsigned short AssistanceYear() const
{ return _AssistanceYear; }
const unsigned short* Authorizations()
{ return GetAut() ? _int_tab : NULL; }