generated from AfonsoCMSousa/CPP-Template
Madjor Fix: New Player data overwrites old/connected players
This commit is contained in:
parent
15f87631e2
commit
95f5a86dd5
@ -145,7 +145,7 @@ void *db_write_thread(void *arg) {
|
|||||||
if (packet.cars[i].driver_GUID[0] == '\0') {
|
if (packet.cars[i].driver_GUID[0] == '\0') {
|
||||||
continue; // Skip empty slots
|
continue; // Skip empty slots
|
||||||
}
|
}
|
||||||
printf("[D] User disconnected (%d): GUID=%s, Name=%s\n", i, packet.cars[i].driver_GUID, packet.cars[i].driver_name);
|
// printf("[D] User disconnected (%d): GUID=%s, Name=%s\n", i, packet.cars[i].driver_GUID, packet.cars[i].driver_name);
|
||||||
// If the car is not connected, we still need to update its status in the db
|
// If the car is not connected, we still need to update its status in the db
|
||||||
const char *disconnect_query = "UPDATE users SET is_connect = false, current_server = NULL WHERE driver_guid = $1;";
|
const char *disconnect_query = "UPDATE users SET is_connect = false, current_server = NULL WHERE driver_guid = $1;";
|
||||||
const char *disconnect_paramValues[1] = {packet.cars[i].driver_GUID};
|
const char *disconnect_paramValues[1] = {packet.cars[i].driver_GUID};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user