guy 981f57a971 Aggiunta gestione del comando rpc DongleYear per l'anno di assistenza
git-svn-id: svn://10.65.10.50/trunk@6062 c028cbd2-c16b-5b4b-a496-9718f37d4682
1998-01-29 09:43:10 +00:00

43 lines
934 B
C++
Executable File

#include "StdAfx.h"
#include "connect.h"
#include "server.h"
int f_DongleHasModule(TConnection& conn, void* pJolly)
{
BOOL ok = FALSE;
CStringArray& argv = *(CStringArray*)pJolly;
const int argc = argv.GetSize();
if (argc > 0)
{
const int n = atoi(argv[0]) - 1;
const unsigned short* int_tab = GetServer().Authorizations();
if (int_tab)
ok = (int_tab[n / 16] >> (n % 16)) & 0x1;
}
return conn.ReturnBool(ok);
}
int f_DongleModules(TConnection& conn, void* pJolly)
{
const unsigned short* int_tab = GetServer().Authorizations();
if (int_tab)
{
BYTE* buff = GetServer().GetBuffer(8);
memcpy(buff, int_tab, 8);
}
return int_tab != NULL;
}
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);
}