if(! DB::Open(LOCATION_DATABASE))
{
printf("[TKAdminv3] - ERROR: The filterscript couldn't be loaded cause the database file(%s) wasn't opened.", LOCATION_DATABASE);
return 0;
}
gGlobal[s_usertable] = DB::VerifyTable(TABLE_USERS, "ID");
if(gGlobal[s_usertable] == DB_INVALID_TABLE)
{
printf("[TKAdminv3] - ERROR: The Users table(%s) couldn't be verified.", TABLE_USERS);
}
else
{
DB::VerifyColumn(gGlobal[s_usertable], "username", DB::TYPE_STRING, "");
DB::VerifyColumn(gGlobal[s_usertable], "password", DB::TYPE_STRING, "");
DB::VerifyColumn(gGlobal[s_usertable], "ip", DB::TYPE_STRING, "");
DB::VerifyColumn(gGlobal[s_usertable], "joindate", DB::TYPE_STRING, "");
DB::VerifyColumn(gGlobal[s_usertable], "laston", DB::TYPE_STRING, "");
DB::VerifyColumn(gGlobal[s_usertable], "kicked", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "jailed", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "jailtime", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "muted", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "mutetime", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "cmuted", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "cmutetime", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "cash", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "admin", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "vip", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "kills", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "deaths", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "score", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "money", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "hours", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "minutes", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "seconds", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "autologin", DB::TYPE_NUMBER, 0);
}
printf("[TKAdminv3] - NOTICE: Total %i accounts loaded from the table ''%s''", DB::CountRows(gGlobal[s_usertable]), TABLE_USERS);
printf("%i", DB::GetHighestRegisteredKey(gGlobal[s_usertable]));
|