we had a guy without steam ID stored in here. caused the python part to crash

This commit is contained in:
jenz 2024-11-14 20:37:12 +01:00
parent 075d0beaca
commit cbb9cc5817

View File

@ -64,10 +64,16 @@ public void write_reward_entry(int client, char[] event_map)
g_hDatabase.Escape(sName, sEscapedName, size2 + 1); g_hDatabase.Escape(sName, sEscapedName, size2 + 1);
char SID[64]; char SID[64];
GetClientAuthId(client, AuthId_Steam2, SID, sizeof(SID)); if (GetClientAuthId(client, AuthId_Steam2, SID, sizeof(SID)))
Format(sQuery, sizeof(sQuery), "INSERT INTO `rewards` (`steamid`, `username`, `event_map`, `event_reward_days`, `admin_created_reward_steamid`, `admin_created_reward_name`) VALUES ('%s', '%s', '%s', '%i', '%s', '%s')", SID, sEscapedName, event_map, g_ireward_days, g_cadmin_sid, g_cadmin_escaped_name); {
g_hDatabase.Query(DummyCallback, sQuery, DBPrio_Normal); Format(sQuery, sizeof(sQuery), "INSERT INTO `rewards` (`steamid`, `username`, `event_map`, `event_reward_days`, `admin_created_reward_steamid`, `admin_created_reward_name`) VALUES ('%s', '%s', '%s', '%i', '%s', '%s')", SID, sEscapedName, event_map, g_ireward_days, g_cadmin_sid, g_cadmin_escaped_name);
PrintToChat(client, "Your %i days VIP were stored for winning this round. They will be awarded in the next 2-3 hours if you have a forum account.", g_ireward_days); g_hDatabase.Query(DummyCallback, sQuery, DBPrio_Normal);
PrintToChat(client, "Your %i days VIP were stored for winning this round. They will be awarded in the next 2-3 hours if you have a forum account.", g_ireward_days);
}
else
{
PrintToChat(client, "So sorry but your steam ID is not working. no vip for you.");
}
} }
public void DummyCallback(Handle hOwner, Handle hChild, const char[] err, any data) public void DummyCallback(Handle hOwner, Handle hChild, const char[] err, any data)