1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

Move away from C format to cpp::fmt.

This commit is contained in:
Sandu Liviu Catalin 2021-02-03 17:50:39 +02:00
parent 09a1767ffe
commit 0de21ae5a0
39 changed files with 215 additions and 215 deletions

View File

@ -769,7 +769,7 @@ void Core::SetIncomingName(const SQChar * name)
// Does the name satisfy the minimum length required? // Does the name satisfy the minimum length required?
else if (len < 2) else if (len < 2)
{ {
STHROWF("The specified name needs to be at least 2 characters: %zu", len); STHROWF("The specified name needs to be at least 2 characters: {}", len);
} }
// Copy the specified name to the assigned buffer // Copy the specified name to the assigned buffer
std::strncpy(m_IncomingNameBuffer, name, m_IncomingNameCapacity); std::strncpy(m_IncomingNameBuffer, name, m_IncomingNameCapacity);
@ -1085,7 +1085,7 @@ BlipInst & Core::AllocBlip(int32_t id, bool owned, int32_t header, LightObj & pa
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_BLIP_POOL)) if (INVALID_ENTITYEX(id, SQMOD_BLIP_POOL))
{ {
STHROWF("Cannot allocate blip with invalid identifier: %d", id); STHROWF("Cannot allocate blip with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
BlipInst & inst = m_Blips[id]; BlipInst & inst = m_Blips[id];
@ -1107,7 +1107,7 @@ BlipInst & Core::AllocBlip(int32_t id, bool owned, int32_t header, LightObj & pa
{ {
inst.ResetInstance(); inst.ResetInstance();
// Now we can throw the error // Now we can throw the error
STHROWF("Unable to create a blip instance for: %d", id); STHROWF("Unable to create a blip instance for: {}", id);
} }
// Assign the specified entity identifier // Assign the specified entity identifier
inst.mID = id; inst.mID = id;
@ -1134,7 +1134,7 @@ CheckpointInst & Core::AllocCheckpoint(int32_t id, bool owned, int32_t header, L
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_CHECKPOINT_POOL)) if (INVALID_ENTITYEX(id, SQMOD_CHECKPOINT_POOL))
{ {
STHROWF("Cannot allocate checkpoint with invalid identifier: %d", id); STHROWF("Cannot allocate checkpoint with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
CheckpointInst & inst = m_Checkpoints[id]; CheckpointInst & inst = m_Checkpoints[id];
@ -1156,7 +1156,7 @@ CheckpointInst & Core::AllocCheckpoint(int32_t id, bool owned, int32_t header, L
{ {
inst.ResetInstance(); inst.ResetInstance();
// Now we can throw the error // Now we can throw the error
STHROWF("Unable to create a checkpoint instance for: %d", id); STHROWF("Unable to create a checkpoint instance for: {}", id);
} }
// Assign the specified entity identifier // Assign the specified entity identifier
inst.mID = id; inst.mID = id;
@ -1183,7 +1183,7 @@ KeyBindInst & Core::AllocKeyBind(int32_t id, bool owned, int32_t header, LightOb
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_KEYBIND_POOL)) if (INVALID_ENTITYEX(id, SQMOD_KEYBIND_POOL))
{ {
STHROWF("Cannot allocate keybind with invalid identifier: %d", id); STHROWF("Cannot allocate keybind with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
KeyBindInst & inst = m_KeyBinds[id]; KeyBindInst & inst = m_KeyBinds[id];
@ -1205,7 +1205,7 @@ KeyBindInst & Core::AllocKeyBind(int32_t id, bool owned, int32_t header, LightOb
{ {
inst.ResetInstance(); inst.ResetInstance();
// Now we can throw the error // Now we can throw the error
STHROWF("Unable to create a keybind instance for: %d", id); STHROWF("Unable to create a keybind instance for: {}", id);
} }
// Assign the specified entity identifier // Assign the specified entity identifier
inst.mID = id; inst.mID = id;
@ -1232,7 +1232,7 @@ ObjectInst & Core::AllocObject(int32_t id, bool owned, int32_t header, LightObj
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL)) if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL))
{ {
STHROWF("Cannot allocate object with invalid identifier: %d", id); STHROWF("Cannot allocate object with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
ObjectInst & inst = m_Objects[id]; ObjectInst & inst = m_Objects[id];
@ -1254,7 +1254,7 @@ ObjectInst & Core::AllocObject(int32_t id, bool owned, int32_t header, LightObj
{ {
inst.ResetInstance(); inst.ResetInstance();
// Now we can throw the error // Now we can throw the error
STHROWF("Unable to create a object instance for: %d", id); STHROWF("Unable to create a object instance for: {}", id);
} }
// Assign the specified entity identifier // Assign the specified entity identifier
inst.mID = id; inst.mID = id;
@ -1281,7 +1281,7 @@ PickupInst & Core::AllocPickup(int32_t id, bool owned, int32_t header, LightObj
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_PICKUP_POOL)) if (INVALID_ENTITYEX(id, SQMOD_PICKUP_POOL))
{ {
STHROWF("Cannot allocate pickup with invalid identifier: %d", id); STHROWF("Cannot allocate pickup with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
PickupInst & inst = m_Pickups[id]; PickupInst & inst = m_Pickups[id];
@ -1303,7 +1303,7 @@ PickupInst & Core::AllocPickup(int32_t id, bool owned, int32_t header, LightObj
{ {
inst.ResetInstance(); inst.ResetInstance();
// Now we can throw the error // Now we can throw the error
STHROWF("Unable to create a pickup instance for: %d", id); STHROWF("Unable to create a pickup instance for: {}", id);
} }
// Assign the specified entity identifier // Assign the specified entity identifier
inst.mID = id; inst.mID = id;
@ -1330,7 +1330,7 @@ VehicleInst & Core::AllocVehicle(int32_t id, bool owned, int32_t header, LightOb
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_VEHICLE_POOL)) if (INVALID_ENTITYEX(id, SQMOD_VEHICLE_POOL))
{ {
STHROWF("Cannot allocate vehicle with invalid identifier: %d", id); STHROWF("Cannot allocate vehicle with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
VehicleInst & inst = m_Vehicles[id]; VehicleInst & inst = m_Vehicles[id];
@ -1352,7 +1352,7 @@ VehicleInst & Core::AllocVehicle(int32_t id, bool owned, int32_t header, LightOb
{ {
inst.ResetInstance(); inst.ResetInstance();
// Now we can throw the error // Now we can throw the error
STHROWF("Unable to create a vehicle instance for: %d", id); STHROWF("Unable to create a vehicle instance for: {}", id);
} }
// Assign the specified entity identifier // Assign the specified entity identifier
inst.mID = id; inst.mID = id;
@ -1384,7 +1384,7 @@ void Core::DeallocBlip(int32_t id, bool destroy, int32_t header, LightObj & payl
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_BLIP_POOL)) if (INVALID_ENTITYEX(id, SQMOD_BLIP_POOL))
{ {
STHROWF("Cannot deallocate blip with invalid identifier: %d", id); STHROWF("Cannot deallocate blip with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
BlipInst & inst = m_Blips[id]; BlipInst & inst = m_Blips[id];
@ -1401,7 +1401,7 @@ void Core::DeallocCheckpoint(int32_t id, bool destroy, int32_t header, LightObj
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_CHECKPOINT_POOL)) if (INVALID_ENTITYEX(id, SQMOD_CHECKPOINT_POOL))
{ {
STHROWF("Cannot deallocate checkpoint with invalid identifier: %d", id); STHROWF("Cannot deallocate checkpoint with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
CheckpointInst & inst = m_Checkpoints[id]; CheckpointInst & inst = m_Checkpoints[id];
@ -1418,7 +1418,7 @@ void Core::DeallocKeyBind(int32_t id, bool destroy, int32_t header, LightObj & p
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_KEYBIND_POOL)) if (INVALID_ENTITYEX(id, SQMOD_KEYBIND_POOL))
{ {
STHROWF("Cannot deallocate keybind with invalid identifier: %d", id); STHROWF("Cannot deallocate keybind with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
KeyBindInst & inst = m_KeyBinds[id]; KeyBindInst & inst = m_KeyBinds[id];
@ -1435,7 +1435,7 @@ void Core::DeallocObject(int32_t id, bool destroy, int32_t header, LightObj & pa
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL)) if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL))
{ {
STHROWF("Cannot deallocate object with invalid identifier: %d", id); STHROWF("Cannot deallocate object with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
ObjectInst & inst = m_Objects[id]; ObjectInst & inst = m_Objects[id];
@ -1452,7 +1452,7 @@ void Core::DeallocPickup(int32_t id, bool destroy, int32_t header, LightObj & pa
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_PICKUP_POOL)) if (INVALID_ENTITYEX(id, SQMOD_PICKUP_POOL))
{ {
STHROWF("Cannot deallocate pickup with invalid identifier: %d", id); STHROWF("Cannot deallocate pickup with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
PickupInst & inst = m_Pickups[id]; PickupInst & inst = m_Pickups[id];
@ -1469,7 +1469,7 @@ void Core::DeallocVehicle(int32_t id, bool destroy, int32_t header, LightObj & p
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_VEHICLE_POOL)) if (INVALID_ENTITYEX(id, SQMOD_VEHICLE_POOL))
{ {
STHROWF("Cannot deallocate vehicle with invalid identifier: %d", id); STHROWF("Cannot deallocate vehicle with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
VehicleInst & inst = m_Vehicles[id]; VehicleInst & inst = m_Vehicles[id];
@ -1490,12 +1490,12 @@ LightObj & Core::NewBlip(int32_t index, int32_t world, float x, float y, float z
// See if the entity creation failed on the server // See if the entity creation failed on the server
if (_Func->GetLastError() == vcmpErrorPoolExhausted) if (_Func->GetLastError() == vcmpErrorPoolExhausted)
{ {
STHROWF("Blip pool was exhausted: %d", id); STHROWF("Blip pool was exhausted: {}", id);
} }
// Validate the identifier returned by the server // Validate the identifier returned by the server
else if (INVALID_ENTITYEX(id, SQMOD_BLIP_POOL)) else if (INVALID_ENTITYEX(id, SQMOD_BLIP_POOL))
{ {
STHROWF("Server returned invalid blip: %d", id); STHROWF("Server returned invalid blip: {}", id);
} }
// Attempt to allocate this entity and grab the reference to the instance // Attempt to allocate this entity and grab the reference to the instance
BlipInst & inst = AllocBlip(id, true, header, payload); BlipInst & inst = AllocBlip(id, true, header, payload);
@ -1518,16 +1518,16 @@ LightObj & Core::NewCheckpoint(int32_t player, int32_t world, bool sphere, float
// See if the entity creation failed on the server // See if the entity creation failed on the server
if (_Func->GetLastError() == vcmpErrorNoSuchEntity) if (_Func->GetLastError() == vcmpErrorNoSuchEntity)
{ {
STHROWF("Invalid player reference: %d", player); STHROWF("Invalid player reference: {}", player);
} }
else if (_Func->GetLastError() == vcmpErrorPoolExhausted) else if (_Func->GetLastError() == vcmpErrorPoolExhausted)
{ {
STHROWF("Checkpoint pool was exhausted: %d", id); STHROWF("Checkpoint pool was exhausted: {}", id);
} }
// Validate the identifier returned by the server // Validate the identifier returned by the server
else if (INVALID_ENTITYEX(id, SQMOD_CHECKPOINT_POOL)) else if (INVALID_ENTITYEX(id, SQMOD_CHECKPOINT_POOL))
{ {
STHROWF("Server returned invalid checkpoint: %d", id); STHROWF("Server returned invalid checkpoint: {}", id);
} }
// Attempt to allocate this entity and grab the reference to the instance // Attempt to allocate this entity and grab the reference to the instance
CheckpointInst & inst = AllocCheckpoint(id, true, header, payload); CheckpointInst & inst = AllocCheckpoint(id, true, header, payload);
@ -1552,14 +1552,14 @@ LightObj & Core::NewKeyBind(int32_t slot, bool release, int32_t primary, int32_t
// Validate the keybind slot returned by the server // Validate the keybind slot returned by the server
if (INVALID_ENTITYEX(slot, SQMOD_KEYBIND_POOL)) if (INVALID_ENTITYEX(slot, SQMOD_KEYBIND_POOL))
{ {
STHROWF("Server returned invalid keybind slot: %d", slot); STHROWF("Server returned invalid keybind slot: {}", slot);
} }
// Request the server to create this entity // Request the server to create this entity
const vcmpError result = _Func->RegisterKeyBind(slot, release, primary, secondary, alternative); const vcmpError result = _Func->RegisterKeyBind(slot, release, primary, secondary, alternative);
// See if the entity creation failed on the server // See if the entity creation failed on the server
if (result == vcmpErrorArgumentOutOfBounds) if (result == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Out of bounds keybind argument: %d", slot); STHROWF("Out of bounds keybind argument: {}", slot);
} }
// Attempt to allocate this entity and grab the reference to the instance // Attempt to allocate this entity and grab the reference to the instance
KeyBindInst & inst = AllocKeyBind(slot, true, header, payload); KeyBindInst & inst = AllocKeyBind(slot, true, header, payload);
@ -1581,12 +1581,12 @@ LightObj & Core::NewObject(int32_t model, int32_t world, float x, float y, float
// See if the entity creation failed on the server // See if the entity creation failed on the server
if (_Func->GetLastError() == vcmpErrorPoolExhausted) if (_Func->GetLastError() == vcmpErrorPoolExhausted)
{ {
STHROWF("Object pool was exhausted: %d", id); STHROWF("Object pool was exhausted: {}", id);
} }
// Validate the identifier returned by the server // Validate the identifier returned by the server
else if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL)) else if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL))
{ {
STHROWF("Server returned invalid object: %d", id); STHROWF("Server returned invalid object: {}", id);
} }
// Attempt to allocate this entity and grab the reference to the instance // Attempt to allocate this entity and grab the reference to the instance
ObjectInst & inst = AllocObject(id, true, header, payload); ObjectInst & inst = AllocObject(id, true, header, payload);
@ -1609,12 +1609,12 @@ LightObj & Core::NewPickup(int32_t model, int32_t world, int32_t quantity,
// See if the entity creation failed on the server // See if the entity creation failed on the server
if (_Func->GetLastError() == vcmpErrorPoolExhausted) if (_Func->GetLastError() == vcmpErrorPoolExhausted)
{ {
STHROWF("Pickup pool was exhausted: %d", id); STHROWF("Pickup pool was exhausted: {}", id);
} }
// Validate the identifier returned by the server // Validate the identifier returned by the server
else if (INVALID_ENTITYEX(id, SQMOD_PICKUP_POOL)) else if (INVALID_ENTITYEX(id, SQMOD_PICKUP_POOL))
{ {
STHROWF("Server returned invalid pickup: %d", id); STHROWF("Server returned invalid pickup: {}", id);
} }
// Attempt to allocate this entity and grab the reference to the instance // Attempt to allocate this entity and grab the reference to the instance
PickupInst & inst = AllocPickup(id, true, header, payload); PickupInst & inst = AllocPickup(id, true, header, payload);
@ -1638,16 +1638,16 @@ LightObj & Core::NewVehicle(int32_t model, int32_t world, float x, float y, floa
// See if the entity creation failed on the server // See if the entity creation failed on the server
if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds) if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Out of bounds vehicle argument: %d", id); STHROWF("Out of bounds vehicle argument: {}", id);
} }
else if (_Func->GetLastError() == vcmpErrorPoolExhausted) else if (_Func->GetLastError() == vcmpErrorPoolExhausted)
{ {
STHROWF("Vehicle pool was exhausted: %d", id); STHROWF("Vehicle pool was exhausted: {}", id);
} }
// Validate the identifier returned by the server // Validate the identifier returned by the server
else if (INVALID_ENTITYEX(id, SQMOD_VEHICLE_POOL)) else if (INVALID_ENTITYEX(id, SQMOD_VEHICLE_POOL))
{ {
STHROWF("Server returned invalid vehicle: %d", id); STHROWF("Server returned invalid vehicle: {}", id);
} }
// Attempt to allocate this entity and grab the reference to the instance // Attempt to allocate this entity and grab the reference to the instance
VehicleInst & inst = AllocVehicle(id, true, header, payload); VehicleInst & inst = AllocVehicle(id, true, header, payload);
@ -1720,7 +1720,7 @@ void Core::ConnectPlayer(int32_t id, int32_t header, LightObj & payload)
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_PLAYER_POOL)) if (INVALID_ENTITYEX(id, SQMOD_PLAYER_POOL))
{ {
STHROWF("Cannot allocate player with invalid identifier: %d", id); STHROWF("Cannot allocate player with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
PlayerInst & inst = m_Players[id]; PlayerInst & inst = m_Players[id];
@ -1741,7 +1741,7 @@ void Core::ConnectPlayer(int32_t id, int32_t header, LightObj & payload)
if (!inst.mInst || inst.mObj.IsNull()) if (!inst.mInst || inst.mObj.IsNull())
{ {
inst.ResetInstance(); inst.ResetInstance();
STHROWF("Unable to create a player instance for: %d", id); STHROWF("Unable to create a player instance for: {}", id);
} }
// Assign the specified entity identifier // Assign the specified entity identifier
inst.mID = id; inst.mID = id;
@ -1769,7 +1769,7 @@ void Core::DisconnectPlayer(int32_t id, int32_t header, LightObj & payload)
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(id, SQMOD_PLAYER_POOL)) if (INVALID_ENTITYEX(id, SQMOD_PLAYER_POOL))
{ {
STHROWF("Cannot deallocate player with invalid identifier: %d", id); STHROWF("Cannot deallocate player with invalid identifier: {}", id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
PlayerInst & inst = m_Players[id]; PlayerInst & inst = m_Players[id];
@ -2290,7 +2290,7 @@ static LightObj & SqGetBlip(int32_t id)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_BLIP_POOL)) if (INVALID_ENTITYEX(id, SQMOD_BLIP_POOL))
{ {
STHROWF("Out of range blip identifier: %d", id); STHROWF("Out of range blip identifier: {}", id);
} }
// Return the requested information // Return the requested information
return Core::Get().GetBlip(id).mObj; return Core::Get().GetBlip(id).mObj;
@ -2302,7 +2302,7 @@ static LightObj & SqGetCheckpoint(int32_t id)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_CHECKPOINT_POOL)) if (INVALID_ENTITYEX(id, SQMOD_CHECKPOINT_POOL))
{ {
STHROWF("Out of range checkpoint identifier: %d", id); STHROWF("Out of range checkpoint identifier: {}", id);
} }
// Return the requested information // Return the requested information
return Core::Get().GetCheckpoint(id).mObj; return Core::Get().GetCheckpoint(id).mObj;
@ -2314,7 +2314,7 @@ static LightObj & SqGetKeyBind(int32_t id)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_KEYBIND_POOL)) if (INVALID_ENTITYEX(id, SQMOD_KEYBIND_POOL))
{ {
STHROWF("Out of range keybind identifier: %d", id); STHROWF("Out of range keybind identifier: {}", id);
} }
// Return the requested information // Return the requested information
return Core::Get().GetKeyBind(id).mObj; return Core::Get().GetKeyBind(id).mObj;
@ -2326,7 +2326,7 @@ static LightObj & SqGetObj(int32_t id)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL)) if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL))
{ {
STHROWF("Out of range object identifier: %d", id); STHROWF("Out of range object identifier: {}", id);
} }
// Return the requested information // Return the requested information
return Core::Get().GetObj(id).mObj; return Core::Get().GetObj(id).mObj;
@ -2338,7 +2338,7 @@ static LightObj & SqGetPickup(int32_t id)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_PICKUP_POOL)) if (INVALID_ENTITYEX(id, SQMOD_PICKUP_POOL))
{ {
STHROWF("Out of range blip identifier: %d", id); STHROWF("Out of range blip identifier: {}", id);
} }
// Return the requested information // Return the requested information
return Core::Get().GetPickup(id).mObj; return Core::Get().GetPickup(id).mObj;
@ -2350,7 +2350,7 @@ static LightObj & SqGetPlayer(int32_t id)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_PLAYER_POOL)) if (INVALID_ENTITYEX(id, SQMOD_PLAYER_POOL))
{ {
STHROWF("Out of range player identifier: %d", id); STHROWF("Out of range player identifier: {}", id);
} }
// Return the requested information // Return the requested information
return Core::Get().GetPlayer(id).mObj; return Core::Get().GetPlayer(id).mObj;
@ -2362,7 +2362,7 @@ static LightObj & SqGetVehicle(int32_t id)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_VEHICLE_POOL)) if (INVALID_ENTITYEX(id, SQMOD_VEHICLE_POOL))
{ {
STHROWF("Out of range vehicle identifier: %d", id); STHROWF("Out of range vehicle identifier: {}", id);
} }
// Return the requested information // Return the requested information
return Core::Get().GetVehicle(id).mObj; return Core::Get().GetVehicle(id).mObj;
@ -2374,7 +2374,7 @@ static bool SqDelBlip(int32_t id, int32_t header, LightObj & payload)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_BLIP_POOL)) if (INVALID_ENTITYEX(id, SQMOD_BLIP_POOL))
{ {
STHROWF("Out of range blip identifier: %d", id); STHROWF("Out of range blip identifier: {}", id);
} }
// Perform the requested operation // Perform the requested operation
return Core::Get().DelBlip(id, header, payload); return Core::Get().DelBlip(id, header, payload);
@ -2386,7 +2386,7 @@ static bool SqDelCheckpoint(int32_t id, int32_t header, LightObj & payload)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_CHECKPOINT_POOL)) if (INVALID_ENTITYEX(id, SQMOD_CHECKPOINT_POOL))
{ {
STHROWF("Out of range checkpoint identifier: %d", id); STHROWF("Out of range checkpoint identifier: {}", id);
} }
// Perform the requested operation // Perform the requested operation
return Core::Get().DelCheckpoint(id, header, payload); return Core::Get().DelCheckpoint(id, header, payload);
@ -2398,7 +2398,7 @@ static bool SqDelKeyBind(int32_t id, int32_t header, LightObj & payload)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_KEYBIND_POOL)) if (INVALID_ENTITYEX(id, SQMOD_KEYBIND_POOL))
{ {
STHROWF("Out of range keybind identifier: %d", id); STHROWF("Out of range keybind identifier: {}", id);
} }
// Perform the requested operation // Perform the requested operation
return Core::Get().DelKeyBind(id, header, payload); return Core::Get().DelKeyBind(id, header, payload);
@ -2410,7 +2410,7 @@ static bool SqDelObject(int32_t id, int32_t header, LightObj & payload)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL)) if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL))
{ {
STHROWF("Out of range object identifier: %d", id); STHROWF("Out of range object identifier: {}", id);
} }
// Perform the requested operation // Perform the requested operation
return Core::Get().DelObject(id, header, payload); return Core::Get().DelObject(id, header, payload);
@ -2422,7 +2422,7 @@ static bool SqDelPickup(int32_t id, int32_t header, LightObj & payload)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_PICKUP_POOL)) if (INVALID_ENTITYEX(id, SQMOD_PICKUP_POOL))
{ {
STHROWF("Out of range blip identifier: %d", id); STHROWF("Out of range blip identifier: {}", id);
} }
// Perform the requested operation // Perform the requested operation
return Core::Get().DelPickup(id, header, payload); return Core::Get().DelPickup(id, header, payload);
@ -2434,7 +2434,7 @@ static bool SqDelVehicle(int32_t id, int32_t header, LightObj & payload)
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_VEHICLE_POOL)) if (INVALID_ENTITYEX(id, SQMOD_VEHICLE_POOL))
{ {
STHROWF("Out of range vehicle identifier: %d", id); STHROWF("Out of range vehicle identifier: {}", id);
} }
// Perform the requested operation // Perform the requested operation
return Core::Get().DelVehicle(id, header, payload); return Core::Get().DelVehicle(id, header, payload);

View File

@ -140,7 +140,7 @@ Object & Controller::Attach(Object && obj, Listener * ptr)
if (cmd.mHash == hash) if (cmd.mHash == hash)
{ {
// Include information necessary to help identify hash collisions! // Include information necessary to help identify hash collisions!
STHROWF("Command '%s' already exists as '%s' for hash (%zu)", STHROWF("Command '{}' already exists as '{}' for hash ({})",
name.c_str(), cmd.mName.c_str(), hash); name.c_str(), cmd.mName.c_str(), hash);
} }
} }
@ -916,7 +916,7 @@ void Listener::ProcSpec(const SQChar * str)
{ {
if (idx >= SQMOD_MAX_CMD_ARGS) if (idx >= SQMOD_MAX_CMD_ARGS)
{ {
STHROWF("Extraneous type specifiers: %d >= %d", idx, SQMOD_MAX_CMD_ARGS); STHROWF("Extraneous type specifiers: {} >= {}", idx, SQMOD_MAX_CMD_ARGS);
} }
// Move to the next character // Move to the next character
++str; ++str;
@ -1005,7 +1005,7 @@ void Listener::ProcSpec(const SQChar * str)
} }
} break; } break;
// Unknown type! // Unknown type!
default: STHROWF("Unknown type specifier (%c) at argument: %u", *str, idx); default: STHROWF("Unknown type specifier ({:c}) at argument: {}", *str, idx);
} }
} }
} }

View File

@ -1529,7 +1529,7 @@ public:
} }
else else
{ {
STHROWF("Argument tag (%u) is out of range (%d)", max, SQMOD_MAX_CMD_ARGS); STHROWF("Argument tag ({}) is out of range ({})", max, SQMOD_MAX_CMD_ARGS);
} }
} }
@ -1669,11 +1669,11 @@ public:
// Perform a range check on the specified argument index // Perform a range check on the specified argument index
if (val >= SQMOD_MAX_CMD_ARGS) if (val >= SQMOD_MAX_CMD_ARGS)
{ {
STHROWF("Argument (%d) is out of total range (%d)", val, SQMOD_MAX_CMD_ARGS); STHROWF("Argument ({}) is out of total range ({})", val, SQMOD_MAX_CMD_ARGS);
} }
else if (static_cast< uint8_t >(val) > m_MaxArgc) else if (static_cast< uint8_t >(val) > m_MaxArgc)
{ {
STHROWF("Minimum argument (%d) exceeds maximum (%u)", val, m_MaxArgc); STHROWF("Minimum argument ({}) exceeds maximum ({})", val, m_MaxArgc);
} }
// Apply the specified value // Apply the specified value
m_MinArgc = static_cast< uint8_t >(val); m_MinArgc = static_cast< uint8_t >(val);
@ -1697,11 +1697,11 @@ public:
// Perform a range check on the specified argument index // Perform a range check on the specified argument index
if (val >= SQMOD_MAX_CMD_ARGS) if (val >= SQMOD_MAX_CMD_ARGS)
{ {
STHROWF("Argument (%d) is out of total range (%d)", val, SQMOD_MAX_CMD_ARGS); STHROWF("Argument ({}) is out of total range ({})", val, SQMOD_MAX_CMD_ARGS);
} }
else if (static_cast< uint8_t >(val) < m_MinArgc) else if (static_cast< uint8_t >(val) < m_MinArgc)
{ {
STHROWF("Maximum argument (%d) exceeds minimum (%u)", val, m_MinArgc); STHROWF("Maximum argument ({}) exceeds minimum ({})", val, m_MinArgc);
} }
// Apply the specified value // Apply the specified value
m_MaxArgc = static_cast< uint8_t >(val); m_MaxArgc = static_cast< uint8_t >(val);
@ -1779,7 +1779,7 @@ public:
// Perform a range check on the specified argument index // Perform a range check on the specified argument index
if (arg >= SQMOD_MAX_CMD_ARGS) if (arg >= SQMOD_MAX_CMD_ARGS)
{ {
STHROWF("Argument (%u) is out of total range (%u)", arg, SQMOD_MAX_CMD_ARGS); STHROWF("Argument ({}) is out of total range ({})", arg, SQMOD_MAX_CMD_ARGS);
} }
// Return the requested information // Return the requested information
return m_ArgTags[arg]; return m_ArgTags[arg];
@ -1793,7 +1793,7 @@ public:
// Perform a range check on the specified argument index // Perform a range check on the specified argument index
if (arg >= SQMOD_MAX_CMD_ARGS) if (arg >= SQMOD_MAX_CMD_ARGS)
{ {
STHROWF("Argument (%u) is out of total range (%u)", arg, SQMOD_MAX_CMD_ARGS); STHROWF("Argument ({}) is out of total range ({})", arg, SQMOD_MAX_CMD_ARGS);
} }
else if ((SQ_FAILED(name.Proc()))) else if ((SQ_FAILED(name.Proc())))
{ {
@ -1819,7 +1819,7 @@ public:
// Perform a range check on the specified argument index // Perform a range check on the specified argument index
if (idx >= SQMOD_MAX_CMD_ARGS) if (idx >= SQMOD_MAX_CMD_ARGS)
{ {
STHROWF("Argument (%u) is out of total range (%u)", idx, SQMOD_MAX_CMD_ARGS); STHROWF("Argument ({}) is out of total range ({})", idx, SQMOD_MAX_CMD_ARGS);
} }
// Return the requested information // Return the requested information
return m_ArgSpec[idx]; return m_ArgSpec[idx];
@ -1833,7 +1833,7 @@ public:
// Perform a range check on the specified argument index // Perform a range check on the specified argument index
if (arg >= SQMOD_MAX_CMD_ARGS) if (arg >= SQMOD_MAX_CMD_ARGS)
{ {
STHROWF("Argument (%u) is out of total range (%u)", arg, SQMOD_MAX_CMD_ARGS); STHROWF("Argument ({}) is out of total range ({})", arg, SQMOD_MAX_CMD_ARGS);
} }
// Retrieve the argument flags // Retrieve the argument flags
const uint8_t f = m_ArgSpec[arg]; const uint8_t f = m_ArgSpec[arg];

View File

@ -133,7 +133,7 @@ void SqThrowLastF(const SQChar * msg, ...)
if(error_num == 0) if(error_num == 0)
{ {
// Invoker is responsible for making sure this doesn't happen! // Invoker is responsible for making sure this doesn't happen!
SqThrowF("%s [Unknown error]", b.Data()); SqThrowF("{} [Unknown error]", b.Data());
} }
// The resulted message buffer // The resulted message buffer
LPSTR msg_buff = nullptr; LPSTR msg_buff = nullptr;
@ -147,9 +147,9 @@ void SqThrowLastF(const SQChar * msg, ...)
//Free the message buffer //Free the message buffer
LocalFree(msg_buff); LocalFree(msg_buff);
// Now it's safe to throw the error // Now it's safe to throw the error
SqThrowF("%s [%s]", b.Data(), message.c_str()); SqThrowF("{} [{}]", b.Data(), message);
#else #else
SqThrowF("%s [%s]", b.Data(), std::strerror(errno)); SqThrowF("{} [{}]", b.Data(), std::strerror(errno));
#endif // SQMOD_OS_WINDOWS #endif // SQMOD_OS_WINDOWS
} }
@ -266,7 +266,7 @@ LightObj BufferToStrObj(const Buffer & b, uint32_t size)
// Perform a range check on the specified buffer // Perform a range check on the specified buffer
if (size > b.Capacity()) if (size > b.Capacity())
{ {
STHROWF("The specified buffer size is out of range: %u >= %u", size, b.Capacity()); STHROWF("The specified buffer size is out of range: {} >= {}", size, b.Capacity());
} }
// Obtain the initial stack size // Obtain the initial stack size
const StackGuard sg(SqVM()); const StackGuard sg(SqVM());

View File

@ -1384,14 +1384,14 @@ void Core::EmitEntityPool(vcmpEntityPool entity_type, int32_t entity_id, bool is
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(entity_id, SQMOD_BLIP_POOL)) if (INVALID_ENTITYEX(entity_id, SQMOD_BLIP_POOL))
{ {
STHROWF("Cannot allocate blip with invalid identifier: %d", entity_id); STHROWF("Cannot allocate blip with invalid identifier: {}", entity_id);
} }
// Retrieve the specified entity instance // Retrieve the specified entity instance
BlipInst & inst = m_Blips[entity_id]; BlipInst & inst = m_Blips[entity_id];
// Make sure that the instance isn't already allocated // Make sure that the instance isn't already allocated
if (VALID_ENTITY(inst.mID)) if (VALID_ENTITY(inst.mID))
{ {
STHROWF("Cannot allocate blip that already exists: %d", entity_id); STHROWF("Cannot allocate blip that already exists: {}", entity_id);
} }
// Information about the blip entity // Information about the blip entity
int32_t world, scale, sprid; int32_t world, scale, sprid;
@ -1436,7 +1436,7 @@ void Core::EmitPlayerUpdate(int32_t player_id, vcmpPlayerUpdate update_type)
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(player_id, SQMOD_PLAYER_POOL)) if (INVALID_ENTITYEX(player_id, SQMOD_PLAYER_POOL))
{ {
STHROWF("Cannot update player with invalid identifier: %d", player_id); STHROWF("Cannot update player with invalid identifier: {}", player_id);
} }
// Retrieve the associated tracking instance // Retrieve the associated tracking instance
PlayerInst & inst = m_Players[player_id]; PlayerInst & inst = m_Players[player_id];
@ -1631,7 +1631,7 @@ void Core::EmitEntityStreaming(int32_t player_id, int32_t entity_id, vcmpEntityP
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(player_id, SQMOD_PLAYER_POOL)) if (INVALID_ENTITYEX(player_id, SQMOD_PLAYER_POOL))
{ {
STHROWF("Cannot notify player with invalid identifier about streaming: %d", player_id); STHROWF("Cannot notify player with invalid identifier about streaming: {}", player_id);
} }
// See what type of entity changed // See what type of entity changed
switch (entity_type) switch (entity_type)
@ -1640,7 +1640,7 @@ void Core::EmitEntityStreaming(int32_t player_id, int32_t entity_id, vcmpEntityP
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(entity_id, SQMOD_VEHICLE_POOL)) if (INVALID_ENTITYEX(entity_id, SQMOD_VEHICLE_POOL))
{ {
STHROWF("Cannot stream vehicle with invalid identifier: %d", entity_id); STHROWF("Cannot stream vehicle with invalid identifier: {}", entity_id);
} }
// Forward the event to the dedicated handler // Forward the event to the dedicated handler
EmitVehicleStream(player_id, entity_id, is_deleted); EmitVehicleStream(player_id, entity_id, is_deleted);
@ -1649,7 +1649,7 @@ void Core::EmitEntityStreaming(int32_t player_id, int32_t entity_id, vcmpEntityP
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(entity_id, SQMOD_OBJECT_POOL)) if (INVALID_ENTITYEX(entity_id, SQMOD_OBJECT_POOL))
{ {
STHROWF("Cannot stream object with invalid identifier: %d", entity_id); STHROWF("Cannot stream object with invalid identifier: {}", entity_id);
} }
// Forward the event to the dedicated handler // Forward the event to the dedicated handler
EmitObjectStream(player_id, entity_id, is_deleted); EmitObjectStream(player_id, entity_id, is_deleted);
@ -1658,7 +1658,7 @@ void Core::EmitEntityStreaming(int32_t player_id, int32_t entity_id, vcmpEntityP
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(entity_id, SQMOD_PICKUP_POOL)) if (INVALID_ENTITYEX(entity_id, SQMOD_PICKUP_POOL))
{ {
STHROWF("Cannot stream pickup with invalid identifier: %d", entity_id); STHROWF("Cannot stream pickup with invalid identifier: {}", entity_id);
} }
// Forward the event to the dedicated handler // Forward the event to the dedicated handler
EmitPickupStream(player_id, entity_id, is_deleted); EmitPickupStream(player_id, entity_id, is_deleted);
@ -1667,7 +1667,7 @@ void Core::EmitEntityStreaming(int32_t player_id, int32_t entity_id, vcmpEntityP
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(entity_id, SQMOD_PLAYER_POOL)) if (INVALID_ENTITYEX(entity_id, SQMOD_PLAYER_POOL))
{ {
STHROWF("Cannot stream player with invalid identifier: %d", entity_id); STHROWF("Cannot stream player with invalid identifier: {}", entity_id);
} }
// Forward the event to the dedicated handler // Forward the event to the dedicated handler
EmitPlayerStream(player_id, entity_id, is_deleted); EmitPlayerStream(player_id, entity_id, is_deleted);
@ -1676,7 +1676,7 @@ void Core::EmitEntityStreaming(int32_t player_id, int32_t entity_id, vcmpEntityP
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(entity_id, SQMOD_CHECKPOINT_POOL)) if (INVALID_ENTITYEX(entity_id, SQMOD_CHECKPOINT_POOL))
{ {
STHROWF("Cannot stream checkpoint with invalid identifier: %d", entity_id); STHROWF("Cannot stream checkpoint with invalid identifier: {}", entity_id);
} }
// Forward the event to the dedicated handler // Forward the event to the dedicated handler
EmitCheckpointStream(player_id, entity_id, is_deleted); EmitCheckpointStream(player_id, entity_id, is_deleted);
@ -1694,7 +1694,7 @@ void Core::EmitVehicleUpdate(int32_t vehicle_id, vcmpVehicleUpdate update_type)
// Make sure that the specified entity identifier is valid // Make sure that the specified entity identifier is valid
if (INVALID_ENTITYEX(vehicle_id, SQMOD_VEHICLE_POOL)) if (INVALID_ENTITYEX(vehicle_id, SQMOD_VEHICLE_POOL))
{ {
STHROWF("Cannot update vehicle with invalid identifier: %d", vehicle_id); STHROWF("Cannot update vehicle with invalid identifier: {}", vehicle_id);
} }
// Retrieve the associated instance // Retrieve the associated instance
VehicleInst & inst = m_Vehicles[vehicle_id]; VehicleInst & inst = m_Vehicles[vehicle_id];
@ -1850,7 +1850,7 @@ void Core::EmitClientScriptData(int32_t player_id, const uint8_t * data, size_t
} }
catch (const std::exception & e) catch (const std::exception & e)
{ {
STHROWF("%s", e.what()); // Re-package STHROWF("{}", e.what()); // Re-package
} }
// Make sure the buffer cannot be null at this point // Make sure the buffer cannot be null at this point
if (o.IsNull()) if (o.IsNull())

View File

@ -328,7 +328,7 @@ public:
} }
} }
// Unable to find such routine // Unable to find such routine
STHROWF("Unable to find a routine with tag (%s)", tag.mPtr); STHROWF("Unable to find a routine with tag ({})", tag.mPtr);
// Should not reach this point but if it did, we have to return something // Should not reach this point but if it did, we have to return something
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic push #pragma clang diagnostic push
@ -470,7 +470,7 @@ public:
// Validate the specified // Validate the specified
if (!sq_isclosure(func.GetFunc()) && !sq_isnativeclosure(func.GetFunc())) if (!sq_isclosure(func.GetFunc()) && !sq_isnativeclosure(func.GetFunc()))
{ {
STHROWF("Invalid callback type %s", SqTypeName(GetValid().mFunc.GetType())); STHROWF("Invalid callback type {}", SqTypeName(GetValid().mFunc.GetType()));
} }
// Store the function without the environment // Store the function without the environment
GetValid().mFunc = LightObj(func.GetFunc()); GetValid().mFunc = LightObj(func.GetFunc());
@ -644,7 +644,7 @@ public:
// Validate the specified index // Validate the specified index
if (idx >= 14) if (idx >= 14)
{ {
STHROWF("The specified index is out of range: %u >= %u", idx, 14); STHROWF("The specified index is out of range: {} >= {}", idx, 14);
} }
// Return the requested argument // Return the requested argument
return GetValid().mArgv[idx]; return GetValid().mArgv[idx];

View File

@ -27,7 +27,7 @@ public:
{ {
if (!mFile) if (!mFile)
{ {
STHROWF("Unable to open script source (%s)", path); STHROWF("Unable to open script source ({})", path);
} }
} }

View File

@ -1621,7 +1621,7 @@ const LightObj & Signal::Fetch(StackStrF & name)
} }
} }
// No such signal exists // No such signal exists
STHROWF("Unknown signal named (%s)", sname.c_str()); STHROWF("Unknown signal named ({})", sname);
// SHOULD NOT REACH THIS POINT! // SHOULD NOT REACH THIS POINT!
static LightObj slo; static LightObj slo;
return slo; return slo;

View File

@ -459,7 +459,7 @@ const Tasks::Task & Tasks::FindByTag(int32_t id, int32_t type, StackStrF & tag)
} }
} }
// Unable to find such task // Unable to find such task
STHROWF("Unable to find a task with tag (%s)", tag.mPtr); STHROWF("Unable to find a task with tag ({})", tag.mPtr);
// Should not reach this point but if it did, we have to return something // Should not reach this point but if it did, we have to return something
SQ_UNREACHABLE SQ_UNREACHABLE
} }

View File

@ -176,7 +176,7 @@ private:
// Validate the specified // Validate the specified
if (!sq_isclosure(func.GetFunc()) && !sq_isnativeclosure(func.GetFunc())) if (!sq_isclosure(func.GetFunc()) && !sq_isnativeclosure(func.GetFunc()))
{ {
STHROWF("Invalid callback type %s", SqTypeName(mFunc.GetType())); STHROWF("Invalid callback type {}", SqTypeName(mFunc.GetType()));
} }
// Grab the virtual machine once // Grab the virtual machine once
HSQUIRRELVM vm = SqVM(); HSQUIRRELVM vm = SqVM();
@ -257,7 +257,7 @@ private:
// Validate the specified index // Validate the specified index
if (idx >= argvn) if (idx >= argvn)
{ {
STHROWF("The specified index is out of range: %u >= %u", idx, argvn); STHROWF("The specified index is out of range: {} >= {}", idx, argvn);
} }
// Return the requested argument // Return the requested argument
return mArgv[idx]; return mArgv[idx];

View File

@ -71,7 +71,7 @@ public:
{ {
if (INVALID_ENTITY(m_ID)) if (INVALID_ENTITY(m_ID))
{ {
STHROWF("Invalid blip reference [%s]", m_Tag.c_str()); STHROWF("Invalid blip reference [{}]", m_Tag);
} }
} }

View File

@ -85,7 +85,7 @@ public:
{ {
if (INVALID_ENTITY(m_ID)) if (INVALID_ENTITY(m_ID))
{ {
STHROWF("Invalid checkpoint reference [%s]", m_Tag.c_str()); STHROWF("Invalid checkpoint reference [{}]", m_Tag);
} }
} }

View File

@ -71,7 +71,7 @@ public:
{ {
if (INVALID_ENTITY(m_ID)) if (INVALID_ENTITY(m_ID))
{ {
STHROWF("Invalid keybind reference [%s]", m_Tag.c_str()); STHROWF("Invalid keybind reference [{}]", m_Tag);
} }
} }

View File

@ -104,7 +104,7 @@ public:
{ {
if (INVALID_ENTITY(m_ID)) if (INVALID_ENTITY(m_ID))
{ {
STHROWF("Invalid object reference [%s]", m_Tag.c_str()); STHROWF("Invalid object reference [{}]", m_Tag);
} }
} }

View File

@ -134,7 +134,7 @@ bool CPickup::GetOption(int32_t option_id) const
// Check for errors // Check for errors
if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds) if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid option identifier: %d", option_id); STHROWF("Invalid option identifier: {}", option_id);
} }
// Return the requested value // Return the requested value
return value; return value;
@ -149,7 +149,7 @@ void CPickup::SetOption(int32_t option_id, bool toggle)
if (_Func->SetPickupOption(m_ID, static_cast< vcmpPickupOption >(option_id), if (_Func->SetPickupOption(m_ID, static_cast< vcmpPickupOption >(option_id),
static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds) static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid option identifier: %d", option_id); STHROWF("Invalid option identifier: {}", option_id);
} }
else if (!(m_CircularLocks & PICKUPCL_EMIT_PICKUP_OPTION)) else if (!(m_CircularLocks & PICKUPCL_EMIT_PICKUP_OPTION))
{ {
@ -169,7 +169,7 @@ void CPickup::SetOptionEx(int32_t option_id, bool toggle, int32_t header, LightO
if (_Func->SetPickupOption(m_ID, static_cast< vcmpPickupOption >(option_id), if (_Func->SetPickupOption(m_ID, static_cast< vcmpPickupOption >(option_id),
static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds) static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid option identifier: %d", option_id); STHROWF("Invalid option identifier: {}", option_id);
} }
else if (!(m_CircularLocks & PICKUPCL_EMIT_PICKUP_OPTION)) else if (!(m_CircularLocks & PICKUPCL_EMIT_PICKUP_OPTION))
{ {

View File

@ -88,7 +88,7 @@ public:
{ {
if (INVALID_ENTITY(m_ID)) if (INVALID_ENTITY(m_ID))
{ {
STHROWF("Invalid pickup reference [%s]", m_Tag.c_str()); STHROWF("Invalid pickup reference [{}]", m_Tag);
} }
} }

View File

@ -324,11 +324,11 @@ void CPlayer::SetName(StackStrF & name) const
} }
else if (ret == vcmpErrorInvalidName) else if (ret == vcmpErrorInvalidName)
{ {
STHROWF("The specified name is invalid: %s", name.mPtr); STHROWF("The specified name is invalid: {}", name.mPtr);
} }
else if (ret == vcmpErrorTooLargeInput) else if (ret == vcmpErrorTooLargeInput)
{ {
STHROWF("The specified name is too large: %" PRINT_INT_FMT, name.mLen); STHROWF("The specified name is too large: {}", name.mLen);
} }
} }
@ -349,7 +349,7 @@ int32_t CPlayer::GetOption(int32_t option_id) const
// Check for errors // Check for errors
if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds) if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid option identifier: %d", option_id); STHROWF("Invalid option identifier: {}", option_id);
} }
// Return the requested value // Return the requested value
return value; return value;
@ -378,7 +378,7 @@ void CPlayer::SetOptionEx(int32_t option_id, bool toggle, int32_t header, LightO
static_cast< vcmpPlayerOption >(option_id), static_cast< vcmpPlayerOption >(option_id),
static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds) static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid option identifier: %d", option_id); STHROWF("Invalid option identifier: {}", option_id);
} }
// Avoid infinite recursive event loops // Avoid infinite recursive event loops
else if (!(m_CircularLocks & PLAYERCL_EMIT_PLAYER_OPTION)) else if (!(m_CircularLocks & PLAYERCL_EMIT_PLAYER_OPTION))
@ -529,7 +529,7 @@ void CPlayer::SetTeam(int32_t team)
// Avoid property unwind from a recursive call // Avoid property unwind from a recursive call
else if (_Func->SetPlayerTeam(m_ID, team) == vcmpErrorArgumentOutOfBounds) else if (_Func->SetPlayerTeam(m_ID, team) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid team identifier: %d", team); STHROWF("Invalid team identifier: {}", team);
} }
// Avoid infinite recursive event loops // Avoid infinite recursive event loops
else if (!(m_CircularLocks & PLAYERCL_EMIT_PLAYER_TEAM)) else if (!(m_CircularLocks & PLAYERCL_EMIT_PLAYER_TEAM))
@ -565,7 +565,7 @@ void CPlayer::SetSkin(int32_t skin)
// Avoid property unwind from a recursive call // Avoid property unwind from a recursive call
else if (_Func->SetPlayerSkin(m_ID, skin) == vcmpErrorArgumentOutOfBounds) else if (_Func->SetPlayerSkin(m_ID, skin) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid skin identifier: %d", skin); STHROWF("Invalid skin identifier: {}", skin);
} }
// Avoid infinite recursive event loops // Avoid infinite recursive event loops
else if (!(m_CircularLocks & PLAYERCL_EMIT_PLAYER_SKIN)) else if (!(m_CircularLocks & PLAYERCL_EMIT_PLAYER_SKIN))
@ -1143,7 +1143,7 @@ void CPlayer::SetWeapon(int32_t wep) const
// Perform the requested operation // Perform the requested operation
if (_Func->SetPlayerWeapon(m_ID, wep, mDefaultAmmo) == vcmpErrorArgumentOutOfBounds) if (_Func->SetPlayerWeapon(m_ID, wep, mDefaultAmmo) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid weapon identifier: %d", wep); STHROWF("Invalid weapon identifier: {}", wep);
} }
} }
@ -1155,7 +1155,7 @@ void CPlayer::SetWeaponEx(int32_t wep, int32_t ammo) const
// Perform the requested operation // Perform the requested operation
if (_Func->SetPlayerWeapon(m_ID, wep, ammo) == vcmpErrorArgumentOutOfBounds) if (_Func->SetPlayerWeapon(m_ID, wep, ammo) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid weapon ammo: %d", ammo); STHROWF("Invalid weapon ammo: {}", ammo);
} }
} }
@ -1167,7 +1167,7 @@ void CPlayer::GiveWeapon(int32_t wep, int32_t ammo) const
// Perform the requested operation // Perform the requested operation
if (_Func->GivePlayerWeapon(m_ID, wep, ammo) == vcmpErrorArgumentOutOfBounds) if (_Func->GivePlayerWeapon(m_ID, wep, ammo) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid weapon ammo: %d", ammo); STHROWF("Invalid weapon ammo: {}", ammo);
} }
} }
@ -1197,7 +1197,7 @@ void CPlayer::SetWeaponSlot(int32_t slot) const
// Perform the requested operation // Perform the requested operation
if (_Func->SetPlayerWeaponSlot(m_ID, slot) == vcmpErrorArgumentOutOfBounds) if (_Func->SetPlayerWeaponSlot(m_ID, slot) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid weapon slot: %d", slot); STHROWF("Invalid weapon slot: {}", slot);
} }
} }
@ -1209,7 +1209,7 @@ int32_t CPlayer::GetWeaponAtSlot(int32_t slot) const
// Check for errors // Check for errors
if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds) if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid weapon slot: %d", slot); STHROWF("Invalid weapon slot: {}", slot);
} }
// Return the requested information // Return the requested information
return id; return id;
@ -1223,7 +1223,7 @@ int32_t CPlayer::GetAmmoAtSlot(int32_t slot) const
// Check for errors // Check for errors
if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds) if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid weapon slot: %d", slot); STHROWF("Invalid weapon slot: {}", slot);
} }
// Return the requested information // Return the requested information
return ammo; return ammo;
@ -1460,7 +1460,7 @@ void CPlayer::Redirect(StackStrF & ip, uint32_t port, StackStrF & nick,
if (_Func->RedirectPlayerToServer(m_ID, ip.mPtr, port, if (_Func->RedirectPlayerToServer(m_ID, ip.mPtr, port,
nick.mPtr, server_pass.mPtr, user_pass.mPtr) == vcmpErrorNullArgument) nick.mPtr, server_pass.mPtr, user_pass.mPtr) == vcmpErrorNullArgument)
{ {
STHROWF("Invalid arguments encountered: `%s:%u` `%s` `%s` %s", STHROWF("Invalid arguments encountered: `{}:{}` `{}` `{}` {}",
ip.mPtr, port, nick.mPtr, server_pass.mPtr, user_pass.mPtr); ip.mPtr, port, nick.mPtr, server_pass.mPtr, user_pass.mPtr);
} }
} }
@ -1666,7 +1666,7 @@ const String & CPlayer::GetMessagePrefix(uint32_t index) const
// Perform a range check on the specified prefix index // Perform a range check on the specified prefix index
if (index >= SQMOD_PLAYER_MSG_PREFIXES) if (index >= SQMOD_PLAYER_MSG_PREFIXES)
{ {
STHROWF("Prefix index is out of range: %u >= %d", index, SQMOD_PLAYER_MSG_PREFIXES); STHROWF("Prefix index is out of range: {} >= {}", index, SQMOD_PLAYER_MSG_PREFIXES);
} }
// Validate the managed identifier // Validate the managed identifier
Validate(); Validate();
@ -1680,7 +1680,7 @@ void CPlayer::SetMessagePrefix(uint32_t index, StackStrF & prefix)
// Perform a range check on the specified prefix index // Perform a range check on the specified prefix index
if (index >= SQMOD_PLAYER_MSG_PREFIXES) if (index >= SQMOD_PLAYER_MSG_PREFIXES)
{ {
STHROWF("Prefix index is out of range: %u >= %d", index, SQMOD_PLAYER_MSG_PREFIXES); STHROWF("Prefix index is out of range: {} >= {}", index, SQMOD_PLAYER_MSG_PREFIXES);
} }
// Validate the managed identifier // Validate the managed identifier
Validate(); Validate();
@ -1942,7 +1942,7 @@ void CPlayer::FlushStream(bool reset)
// Check for errors // Check for errors
if (result == vcmpErrorTooLargeInput) if (result == vcmpErrorTooLargeInput)
{ {
STHROWF("Stream buffer is too big: %u", m_Buffer.Position()); STHROWF("Stream buffer is too big: {}", m_Buffer.Position());
} }
} }
@ -1970,7 +1970,7 @@ void CPlayer::SendBuffer(const SqBuffer & buffer) const
// Check for errors // Check for errors
if (result == vcmpErrorTooLargeInput) if (result == vcmpErrorTooLargeInput)
{ {
STHROWF("Stream buffer is too big: %u", buffer.GetRef()->Position()); STHROWF("Stream buffer is too big: {}", buffer.GetRef()->Position());
} }
} }

View File

@ -155,7 +155,7 @@ public:
{ {
if (INVALID_ENTITY(m_ID)) if (INVALID_ENTITY(m_ID))
{ {
STHROWF("Invalid player reference [%s]", m_Tag.c_str()); STHROWF("Invalid player reference [{}]", m_Tag);
} }
} }

View File

@ -137,7 +137,7 @@ bool CVehicle::GetOption(int32_t option_id) const
// Check for errors // Check for errors
if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds) if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid option identifier: %d", option_id); STHROWF("Invalid option identifier: {}", option_id);
} }
// Return the requested value // Return the requested value
return value; return value;
@ -152,7 +152,7 @@ void CVehicle::SetOption(int32_t option_id, bool toggle)
if (_Func->SetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id), if (_Func->SetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id),
static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds) static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid option identifier: %d", option_id); STHROWF("Invalid option identifier: {}", option_id);
} }
else if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_OPTION)) else if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_OPTION))
{ {
@ -172,7 +172,7 @@ void CVehicle::SetOptionEx(int32_t option_id, bool toggle, int32_t header, Light
if (_Func->SetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id), if (_Func->SetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id),
static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds) static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Invalid option identifier: %d", option_id); STHROWF("Invalid option identifier: {}", option_id);
} }
else if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_OPTION)) else if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_OPTION))
{ {

View File

@ -91,7 +91,7 @@ public:
{ {
if (INVALID_ENTITY(m_ID)) if (INVALID_ENTITY(m_ID))
{ {
STHROWF("Invalid vehicle reference [%s]", m_Tag.c_str()); STHROWF("Invalid vehicle reference [{}]", m_Tag);
} }
} }

View File

@ -161,7 +161,7 @@ uint8_t Chrono::DaysInMonth(uint16_t year, uint8_t month)
// Is the specified month within range? // Is the specified month within range?
if (month > 12) if (month > 12)
{ {
STHROWF("Month value is out of range: %u > 12", month); STHROWF("Month value is out of range: {} > 12", month);
} }
// Obtain the days in this month // Obtain the days in this month
uint8_t days = *(MonthLengths + month); uint8_t days = *(MonthLengths + month);

View File

@ -79,7 +79,7 @@ void Date::Set(uint16_t year, uint8_t month, uint8_t day)
{ {
if (!Chrono::ValidDate(year, month, day)) if (!Chrono::ValidDate(year, month, day))
{ {
STHROWF("Invalid date: %04u%c%02u%c%02u" , m_Year, m_Delimiter, m_Month, m_Delimiter, m_Day); STHROWF("Invalid date: {:04}{:c}{:02}{:c}{:02}" , m_Year, m_Delimiter, m_Month, m_Delimiter, m_Day);
} }
// Assign the specified values // Assign the specified values
m_Year = year; m_Year = year;
@ -133,7 +133,7 @@ void Date::SetYear(uint16_t year)
// Make sure the year is valid // Make sure the year is valid
if (!year) if (!year)
{ {
STHROWF("Invalid year: %u", year); STHROWF("Invalid year: {}", year);
} }
// Assign the value // Assign the value
m_Year = year; m_Year = year;
@ -151,7 +151,7 @@ void Date::SetMonth(uint8_t month)
// Make sure the month is valid // Make sure the month is valid
if (month == 0 || month > 12) if (month == 0 || month > 12)
{ {
STHROWF("Invalid month: %u", month); STHROWF("Invalid month: {}", month);
} }
// Assign the value // Assign the value
m_Month = month; m_Month = month;
@ -170,11 +170,11 @@ void Date::SetDay(uint8_t day)
// Make sure the day is valid // Make sure the day is valid
if (day == 0) if (day == 0)
{ {
STHROWF("Invalid day: %u", day); STHROWF("Invalid day: {}", day);
} }
else if (day > dim) else if (day > dim)
{ {
STHROWF("Day is out of range: %u > %u", day, dim); STHROWF("Day is out of range: {} > {}", day, dim);
} }
// Assign the value // Assign the value
m_Day = day; m_Day = day;

View File

@ -122,7 +122,7 @@ void Datetime::Set(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint
// Validate the specified date // Validate the specified date
if (!Chrono::ValidDate(year, month, day)) if (!Chrono::ValidDate(year, month, day))
{ {
STHROWF("Invalid date: %04u%c%02u%c%02u%c%u" STHROWF("Invalid date: {:04}{:c}{:02}{:c}{:02}{:c}{}"
, m_DateDelim, m_Year , m_DateDelim, m_Year
, m_DateDelim, m_Month , m_DateDelim, m_Month
, m_DateDelim, m_Day , m_DateDelim, m_Day
@ -131,22 +131,22 @@ void Datetime::Set(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint
// Is the specified hour within range? // Is the specified hour within range?
else if (hour >= 24) else if (hour >= 24)
{ {
STHROWF("Hour value is out of range: %u >= 24", hour); STHROWF("Hour value is out of range: {} >= 24", hour);
} }
// Is the specified minute within range? // Is the specified minute within range?
else if (minute >= 60) else if (minute >= 60)
{ {
STHROWF("Minute value is out of range: %u >= 60", minute); STHROWF("Minute value is out of range: {} >= 60", minute);
} }
// Is the specified second within range? // Is the specified second within range?
else if (second >= 60) else if (second >= 60)
{ {
STHROWF("Second value is out of range: %u >= 60", second); STHROWF("Second value is out of range: {} >= 60", second);
} }
// Is the specified millisecond within range? // Is the specified millisecond within range?
else if (millisecond >= 1000) else if (millisecond >= 1000)
{ {
STHROWF("Millisecond value is out of range: %u >= 1000", millisecond); STHROWF("Millisecond value is out of range: {} >= 1000", millisecond);
} }
// Assign the specified values // Assign the specified values
m_Year = year; m_Year = year;
@ -216,7 +216,7 @@ void Datetime::SetYear(uint16_t year)
// Make sure the year is valid // Make sure the year is valid
if (!year) if (!year)
{ {
STHROWF("Invalid year: %u", year); STHROWF("Invalid year: {}", year);
} }
// Assign the value // Assign the value
m_Year = year; m_Year = year;
@ -234,7 +234,7 @@ void Datetime::SetMonth(uint8_t month)
// Make sure the month is valid // Make sure the month is valid
if (month == 0 || month > 12) if (month == 0 || month > 12)
{ {
STHROWF("Invalid month: %u", month); STHROWF("Invalid month: {}", month);
} }
// Assign the value // Assign the value
m_Month = month; m_Month = month;
@ -253,11 +253,11 @@ void Datetime::SetDay(uint8_t day)
// Make sure the day is valid // Make sure the day is valid
if (day == 0) if (day == 0)
{ {
STHROWF("Invalid day: %u", day); STHROWF("Invalid day: {}", day);
} }
else if (day > dim) else if (day > dim)
{ {
STHROWF("Day is out of range: %u > %u", day, dim); STHROWF("Day is out of range: {} > {}", day, dim);
} }
// Assign the value // Assign the value
m_Day = day; m_Day = day;
@ -269,7 +269,7 @@ void Datetime::SetHour(uint8_t hour)
// Is the specified hour within range? // Is the specified hour within range?
if (hour >= 24) if (hour >= 24)
{ {
STHROWF("Hour value is out of range: %u >= 24", hour); STHROWF("Hour value is out of range: {} >= 24", hour);
} }
// Now it's safe to assign the value // Now it's safe to assign the value
m_Hour = hour; m_Hour = hour;
@ -281,7 +281,7 @@ void Datetime::SetMinute(uint8_t minute)
// Is the specified minute within range? // Is the specified minute within range?
if (minute >= 60) if (minute >= 60)
{ {
STHROWF("Minute value is out of range: %u >= 60", minute); STHROWF("Minute value is out of range: {} >= 60", minute);
} }
// Now it's safe to assign the value // Now it's safe to assign the value
m_Minute = minute; m_Minute = minute;
@ -293,7 +293,7 @@ void Datetime::SetSecond(uint8_t second)
// Is the specified second within range? // Is the specified second within range?
if (second >= 60) if (second >= 60)
{ {
STHROWF("Second value is out of range: %u >= 60", second); STHROWF("Second value is out of range: {} >= 60", second);
} }
// Now it's safe to assign the value // Now it's safe to assign the value
m_Second = second; m_Second = second;
@ -305,7 +305,7 @@ void Datetime::SetMillisecond(uint16_t millisecond)
// Is the specified millisecond within range? // Is the specified millisecond within range?
if (millisecond >= 1000) if (millisecond >= 1000)
{ {
STHROWF("Millisecond value is out of range: %u >= 1000", millisecond); STHROWF("Millisecond value is out of range: {} >= 1000", millisecond);
} }
// Now it's safe to assign the value // Now it's safe to assign the value
m_Millisecond = millisecond; m_Millisecond = millisecond;

View File

@ -93,22 +93,22 @@ void Time::Set(uint8_t hour, uint8_t minute, uint8_t second, uint16_t millisecon
// Is the specified hour within range? // Is the specified hour within range?
if (hour >= 24) if (hour >= 24)
{ {
STHROWF("Hour value is out of range: %u >= 24", hour); STHROWF("Hour value is out of range: {} >= 24", hour);
} }
// Is the specified minute within range? // Is the specified minute within range?
else if (minute >= 60) else if (minute >= 60)
{ {
STHROWF("Minute value is out of range: %u >= 60", minute); STHROWF("Minute value is out of range: {} >= 60", minute);
} }
// Is the specified second within range? // Is the specified second within range?
else if (second >= 60) else if (second >= 60)
{ {
STHROWF("Second value is out of range: %u >= 60", second); STHROWF("Second value is out of range: {} >= 60", second);
} }
// Is the specified millisecond within range? // Is the specified millisecond within range?
else if (millisecond >= 1000) else if (millisecond >= 1000)
{ {
STHROWF("Millisecond value is out of range: %u >= 1000", millisecond); STHROWF("Millisecond value is out of range: {} >= 1000", millisecond);
} }
// Now it's safe to assign the values // Now it's safe to assign the values
m_Hour = hour; m_Hour = hour;
@ -155,7 +155,7 @@ void Time::SetHour(uint8_t hour)
// Is the specified hour within range? // Is the specified hour within range?
if (hour >= 24) if (hour >= 24)
{ {
STHROWF("Hour value is out of range: %u >= 24", hour); STHROWF("Hour value is out of range: {} >= 24", hour);
} }
// Now it's safe to assign the value // Now it's safe to assign the value
m_Hour = hour; m_Hour = hour;
@ -167,7 +167,7 @@ void Time::SetMinute(uint8_t minute)
// Is the specified minute within range? // Is the specified minute within range?
if (minute >= 60) if (minute >= 60)
{ {
STHROWF("Minute value is out of range: %u >= 60", minute); STHROWF("Minute value is out of range: {} >= 60", minute);
} }
// Now it's safe to assign the value // Now it's safe to assign the value
m_Minute = minute; m_Minute = minute;
@ -179,7 +179,7 @@ void Time::SetSecond(uint8_t second)
// Is the specified second within range? // Is the specified second within range?
if (second >= 60) if (second >= 60)
{ {
STHROWF("Second value is out of range: %u >= 60", second); STHROWF("Second value is out of range: {} >= 60", second);
} }
// Now it's safe to assign the value // Now it's safe to assign the value
m_Second = second; m_Second = second;
@ -191,7 +191,7 @@ void Time::SetMillisecond(uint16_t millisecond)
// Is the specified millisecond within range? // Is the specified millisecond within range?
if (millisecond >= 1000) if (millisecond >= 1000)
{ {
STHROWF("Millisecond value is out of range: %u >= 1000", millisecond); STHROWF("Millisecond value is out of range: {} >= 1000", millisecond);
} }
// Now it's safe to assign the value // Now it's safe to assign the value
m_Millisecond = millisecond; m_Millisecond = millisecond;

View File

@ -223,7 +223,7 @@ LightObj SqBuffer::ReadRawString(SQInteger length)
// Validate the obtained length // Validate the obtained length
if ((m_Buffer->Position() + len) > m_Buffer->Capacity()) if ((m_Buffer->Position() + len) > m_Buffer->Capacity())
{ {
STHROWF("String of size (%u) starting at (%u) is out of buffer capacity (%u)", STHROWF("String of size ({}) starting at ({}) is out of buffer capacity ({})",
len, m_Buffer->Position(), m_Buffer->Capacity()); len, m_Buffer->Position(), m_Buffer->Capacity());
} }
// Remember the current stack size // Remember the current stack size
@ -248,7 +248,7 @@ LightObj SqBuffer::ReadClientString()
// Validate the obtained length // Validate the obtained length
if ((m_Buffer->Position() + sizeof(uint16_t) + length) > m_Buffer->Capacity()) if ((m_Buffer->Position() + sizeof(uint16_t) + length) > m_Buffer->Capacity())
{ {
STHROWF("String of size (%u) starting at (%u) is out of buffer capacity (%u)", STHROWF("String of size ({}) starting at ({}) is out of buffer capacity ({})",
length, m_Buffer->Position() + sizeof(uint16_t), m_Buffer->Capacity()); length, m_Buffer->Position() + sizeof(uint16_t), m_Buffer->Capacity());
} }
// Advance the buffer to the actual string // Advance the buffer to the actual string

View File

@ -481,7 +481,7 @@ public:
} }
catch (const std::exception & e) catch (const std::exception & e)
{ {
STHROWF("%s", e.what()); // Re-package STHROWF("{}", e.what()); // Re-package
} }
} }

View File

@ -19,20 +19,20 @@ void IniResult::Check() const
switch (m_Result) switch (m_Result)
{ {
case SI_FAIL: case SI_FAIL:
STHROWF("Unable to %s. Probably invalid", m_Action.c_str()); STHROWF("Unable to {}. Probably invalid", m_Action);
break; break;
case SI_NOMEM: case SI_NOMEM:
STHROWF("Unable to %s. Ran out of memory", m_Action.c_str()); STHROWF("Unable to {}. Ran out of memory", m_Action);
break; break;
case SI_FILE: case SI_FILE:
STHROWF("Unable to %s. %s", strerror(errno)); STHROWF("Unable to {}. {}", m_Action, strerror(errno));
break; break;
case SI_OK: case SI_OK:
case SI_UPDATED: case SI_UPDATED:
case SI_INSERTED: case SI_INSERTED:
break; /* These are not error messages. */ break; /* These are not error messages. */
default: default:
STHROWF("Unable to %s for some unforeseen reason", m_Action.c_str()); STHROWF("Unable to {} for some unforeseen reason", m_Action);
} }
} }

View File

@ -145,7 +145,7 @@ bool GetEntryAsBool(const MMDB_entry_data_s & ed)
value = ConvTo< bool >::From(ed.float_value); value = ConvTo< bool >::From(ed.float_value);
} break; } break;
default: default:
STHROWF("Unsupported conversion from (%s) to (boolean)", AsTypeStr(ed.type)); STHROWF("Unsupported conversion from ({}) to (boolean)", AsTypeStr(ed.type));
} }
// Return the extracted value // Return the extracted value
return value; return value;
@ -199,7 +199,7 @@ SQInteger GetEntryAsInteger(const MMDB_entry_data_s & ed)
value = ConvTo< SQInteger >::From(ed.float_value); value = ConvTo< SQInteger >::From(ed.float_value);
} break; } break;
default: default:
STHROWF("Unsupported conversion from (%s) to (integer)", AsTypeStr(ed.type)); STHROWF("Unsupported conversion from ({}) to (integer)", AsTypeStr(ed.type));
} }
// Return the extracted value // Return the extracted value
return value; return value;
@ -258,7 +258,7 @@ SQFloat GetEntryAsFloat(const MMDB_entry_data_s & ed)
value = ConvTo< SQFloat >::From(ed.float_value); value = ConvTo< SQFloat >::From(ed.float_value);
} break; } break;
default: default:
STHROWF("Unsupported conversion from (%s) to (float)", AsTypeStr(ed.type)); STHROWF("Unsupported conversion from ({}) to (float)", AsTypeStr(ed.type));
} }
// Return the extracted value // Return the extracted value
return value; return value;
@ -312,7 +312,7 @@ LightObj GetEntryAsLong(const MMDB_entry_data_s & ed)
value = ConvTo< uint64_t >::From(ed.float_value); value = ConvTo< uint64_t >::From(ed.float_value);
} break; } break;
default: default:
STHROWF("Unsupported conversion from (%s) to (long)", AsTypeStr(ed.type)); STHROWF("Unsupported conversion from ({}) to (long)", AsTypeStr(ed.type));
} }
// Return a long integer instance with the requested value // Return a long integer instance with the requested value
return LightObj(SqTypeIdentity< ULongInt >{}, SqVM(), value); return LightObj(SqTypeIdentity< ULongInt >{}, SqVM(), value);
@ -366,7 +366,7 @@ LightObj GetEntryAsString(const MMDB_entry_data_s & ed)
sq_pushstring(vm, fmt::format("{}", ed.float_value).c_str(), -1); sq_pushstring(vm, fmt::format("{}", ed.float_value).c_str(), -1);
} break; } break;
default: default:
STHROWF("Unsupported conversion from (%s) to (string)", AsTypeStr(ed.type)); STHROWF("Unsupported conversion from ({}) to (string)", AsTypeStr(ed.type));
} }
// Obtain the object from the stack and return it // Obtain the object from the stack and return it
return LightObj(-1); return LightObj(-1);
@ -424,7 +424,7 @@ LightObj GetEntryAsBytes(const MMDB_entry_data_s & ed)
sizeof(ed.float_value), 0); sizeof(ed.float_value), 0);
} }
default: default:
STHROWF("Unsupported conversion from (%s) to (buffer)", AsTypeStr(ed.type)); STHROWF("Unsupported conversion from ({}) to (buffer)", AsTypeStr(ed.type));
} }
// Return a null object (shouldn't reach here) // Return a null object (shouldn't reach here)
return LightObj{}; return LightObj{};
@ -444,7 +444,7 @@ void SockAddr::Validate(CCStr file, int32_t line) const
{ {
if (!m_Handle) if (!m_Handle)
{ {
SqThrowF("Invalid sockaddr structure handle =>[%s:%d]", file, line); SqThrowF("Invalid sockaddr structure handle =>[{}:{}]", file, line);
} }
} }
#else #else
@ -494,9 +494,9 @@ SockAddr::SockAddr(const SQChar * addr)
} }
// Now it's safe to throw the error // Now it's safe to throw the error
#if defined(UNICODE) || defined(_UNICODE) #if defined(UNICODE) || defined(_UNICODE)
STHROWF("Unable to query the specified address for information [%s]", gai_strerrorA(status)); STHROWF("Unable to query the specified address for information [{}]", gai_strerrorA(status));
#else #else
STHROWF("Unable to query the specified address for information [%s]", gai_strerror(status)); STHROWF("Unable to query the specified address for information [{}]", gai_strerror(status));
#endif #endif
} }
// Save the specified string address // Save the specified string address
@ -526,7 +526,7 @@ DbHnd::DbHnd(const SQChar * filepath, uint32_t flags)
// Validate the result of the operation // Validate the result of the operation
if (status != MMDB_SUCCESS) if (status != MMDB_SUCCESS)
{ {
STHROWF("Unable to open the specified database [%s]", MMDB_strerror(status)); STHROWF("Unable to open the specified database [{}]", MMDB_strerror(status));
} }
} }
@ -551,7 +551,7 @@ void Database::Validate(CCStr file, int32_t line) const
{ {
if (!m_Handle) if (!m_Handle)
{ {
SqThrowF("Invalid Maxmind database reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind database reference =>[{}:{}]", file, line);
} }
} }
#else #else
@ -594,7 +594,7 @@ LightObj Database::GetMetadataAsEntryDataList() const
// Validate the status code // Validate the status code
if (status != MMDB_SUCCESS) if (status != MMDB_SUCCESS)
{ {
STHROWF("Unable to get meta-data entry data list [%s]", MMDB_strerror(status)); STHROWF("Unable to get meta-data entry data list [{}]", MMDB_strerror(status));
} }
// Return the resulted list // Return the resulted list
return LightObj(SqTypeIdentity< EntryDataList >{}, SqVM(), m_Handle, entry_data_list); return LightObj(SqTypeIdentity< EntryDataList >{}, SqVM(), m_Handle, entry_data_list);
@ -618,15 +618,15 @@ LookupResult Database::LookupString(const SQChar * addr)
if (gai_error != 0) if (gai_error != 0)
{ {
#if defined(UNICODE) || defined(_UNICODE) #if defined(UNICODE) || defined(_UNICODE)
STHROWF("Unable to resolve address (%s) because [%s]", addr, gai_strerrorA(gai_error)); STHROWF("Unable to resolve address ({}) because [{}]", addr, gai_strerrorA(gai_error));
#else #else
STHROWF("Unable to resolve address (%s) because [%s]", addr, gai_strerror(gai_error)); STHROWF("Unable to resolve address ({}) because [{}]", addr, gai_strerror(gai_error));
#endif #endif
} }
// Validate the lookup status code // Validate the lookup status code
else if (mmdb_error != MMDB_SUCCESS) else if (mmdb_error != MMDB_SUCCESS)
{ {
STHROWF("Unable to lookup address (%s) because [%s]", addr, MMDB_strerror(mmdb_error)); STHROWF("Unable to lookup address ({}) because [{}]", addr, MMDB_strerror(mmdb_error));
} }
// Now it's safe to return the lookup result // Now it's safe to return the lookup result
return LookupResult(m_Handle, result); return LookupResult(m_Handle, result);
@ -649,7 +649,7 @@ LookupResult Database::LookupSockAddr(SockAddr & addr)
// Validate the lookup status code // Validate the lookup status code
if (mmdb_error != MMDB_SUCCESS) if (mmdb_error != MMDB_SUCCESS)
{ {
STHROWF("Unable to lookup address (%s) because [%s]", addr.GetAddress(), MMDB_strerror(mmdb_error)); STHROWF("Unable to lookup address ({}) because [{}]", addr.GetAddress(), MMDB_strerror(mmdb_error));
} }
// Now it's safe to return the lookup result // Now it's safe to return the lookup result
return LookupResult(m_Handle, result); return LookupResult(m_Handle, result);
@ -667,7 +667,7 @@ SearchNode Database::ReadNode(uint32_t node) const
// Validate the status code // Validate the status code
if (status != MMDB_SUCCESS) if (status != MMDB_SUCCESS)
{ {
STHROWF("Unable to get node [%s]", MMDB_strerror(status)); STHROWF("Unable to get node [{}]", MMDB_strerror(status));
} }
// Return the resulted list // Return the resulted list
return SearchNode(m_Handle, search_node); return SearchNode(m_Handle, search_node);
@ -687,7 +687,7 @@ void Description::Validate(CCStr file, int32_t line) const
{ {
if (!m_Handle) if (!m_Handle)
{ {
SqThrowF("Invalid Maxmind database reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind database reference =>[{}:{}]", file, line);
} }
} }
#else #else
@ -708,7 +708,7 @@ Description::Pointer Description::GetValid(CCStr file, int32_t line) const
// Validate the referenced description // Validate the referenced description
if (!m_Description) if (!m_Description)
{ {
SqThrowF("Invalid Maxmind meta-data description reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind meta-data description reference =>[{}:{}]", file, line);
} }
// Return the description pointer // Return the description pointer
return m_Description; return m_Description;
@ -747,7 +747,7 @@ void EntryData::Validate(CCStr file, int32_t line) const
{ {
if (!m_Handle) if (!m_Handle)
{ {
SqThrowF("Invalid Maxmind database reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind database reference =>[{}:{}]", file, line);
} }
} }
#else #else
@ -768,7 +768,7 @@ EntryData::ConstRef EntryData::GetValid(CCStr file, int32_t line) const
// See if the entry has any data // See if the entry has any data
if (!m_Entry.has_data) if (!m_Entry.has_data)
{ {
SqThrowF("The referenced entry has no data =>[%s:%d]", file, line); SqThrowF("The referenced entry has no data =>[{}:{}]", file, line);
} }
// Return the entry // Return the entry
return m_Entry; return m_Entry;
@ -821,7 +821,7 @@ void EntryDataList::Validate(CCStr file, int32_t line) const
{ {
if (!m_Handle) if (!m_Handle)
{ {
SqThrowF("Invalid Maxmind database reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind database reference =>[{}:{}]", file, line);
} }
} }
#else #else
@ -842,7 +842,7 @@ EntryDataList::Pointer EntryDataList::GetValid(CCStr file, int32_t line) const
// Validate the managed list // Validate the managed list
if (!m_List) if (!m_List)
{ {
SqThrowF("Invalid Maxmind entry data list reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind entry data list reference =>[{}:{}]", file, line);
} }
// return the list // return the list
return m_List; return m_List;
@ -869,7 +869,7 @@ EntryDataList::Pointer EntryDataList::GetValidElem(CCStr file, int32_t line) con
// Validate the current element // Validate the current element
if (!m_List) if (!m_List)
{ {
SqThrowF("Invalid Maxmind entry data element reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind entry data element reference =>[{}:{}]", file, line);
} }
// return the element // return the element
return m_Elem; return m_Elem;
@ -952,7 +952,7 @@ void EntryDataList::DumpTo(const SQChar * filepath, int32_t indent) const
// Validate the file handle // Validate the file handle
if (!fp) if (!fp)
{ {
STHROWF("Unable to open file %s", filepath); STHROWF("Unable to open file {}", filepath);
} }
// Attempt to dump the entry data list // Attempt to dump the entry data list
int32_t status = MMDB_dump_entry_data_list(fp, ptr, indent); int32_t status = MMDB_dump_entry_data_list(fp, ptr, indent);
@ -961,7 +961,7 @@ void EntryDataList::DumpTo(const SQChar * filepath, int32_t indent) const
// Validate the result of the operation // Validate the result of the operation
if (status != MMDB_SUCCESS) if (status != MMDB_SUCCESS)
{ {
STHROWF("Unable to dump the list [%s]", MMDB_strerror(status)); STHROWF("Unable to dump the list [{}]", MMDB_strerror(status));
} }
} }
@ -979,7 +979,7 @@ void LookupResult::Validate(CCStr file, int32_t line) const
{ {
if (!m_Handle) if (!m_Handle)
{ {
SqThrowF("Invalid Maxmind database reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind database reference =>[{}:{}]", file, line);
} }
} }
#else #else
@ -1042,7 +1042,7 @@ Object LookupResult::GetEntryDataList()
// Validate the status code // Validate the status code
if (status != MMDB_SUCCESS) if (status != MMDB_SUCCESS)
{ {
STHROWF("Unable to get entry data list [%s]", MMDB_strerror(status)); STHROWF("Unable to get entry data list [{}]", MMDB_strerror(status));
} }
// Return the resulted list // Return the resulted list
return Object(new EntryDataList(m_Handle, entry_data_list)); return Object(new EntryDataList(m_Handle, entry_data_list));
@ -1139,7 +1139,7 @@ void Metadata::Validate(CCStr file, int32_t line) const
{ {
if (!m_Handle) if (!m_Handle)
{ {
SqThrowF("Invalid Maxmind database reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind database reference =>[{}:{}]", file, line);
} }
} }
#else #else
@ -1160,7 +1160,7 @@ Metadata::Pointer Metadata::GetValid(CCStr file, int32_t line) const
// Validate the referenced meta-data // Validate the referenced meta-data
if (!m_Metadata) if (!m_Metadata)
{ {
SqThrowF("Invalid Maxmind meta-data reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind meta-data reference =>[{}:{}]", file, line);
} }
// Return the meta-data pointer // Return the meta-data pointer
return m_Metadata; return m_Metadata;
@ -1191,7 +1191,7 @@ Description Metadata::GetDescriptionHandle(uint32_t idx) const
// Validate the specified index // Validate the specified index
if (idx > SQMOD_GET_VALID(*this)->description.count) if (idx > SQMOD_GET_VALID(*this)->description.count)
{ {
STHROWF("The specified description index is out of range: %u > %u", idx, m_Metadata->description.count); STHROWF("The specified description index is out of range: {} > {}", idx, m_Metadata->description.count);
} }
// Return the requested description // Return the requested description
return Description(m_Handle, m_Metadata->description.descriptions[idx]); return Description(m_Handle, m_Metadata->description.descriptions[idx]);
@ -1211,7 +1211,7 @@ void SearchNode::Validate(CCStr file, int32_t line) const
{ {
if (!m_Handle) if (!m_Handle)
{ {
SqThrowF("Invalid Maxmind database reference =>[%s:%d]", file, line); SqThrowF("Invalid Maxmind database reference =>[{}:{}]", file, line);
} }
} }
#else #else
@ -1269,7 +1269,7 @@ Object SearchNode::GetLeftRecordEntryDataList()
// Validate the status code // Validate the status code
if (status != MMDB_SUCCESS) if (status != MMDB_SUCCESS)
{ {
STHROWF("Unable to get entry data list [%s]", MMDB_strerror(status)); STHROWF("Unable to get entry data list [{}]", MMDB_strerror(status));
} }
// Return the resulted list // Return the resulted list
return Object(new EntryDataList(m_Handle, entry_data_list)); return Object(new EntryDataList(m_Handle, entry_data_list));
@ -1285,7 +1285,7 @@ Object SearchNode::GetRightRecordEntryDataList()
// Validate the status code // Validate the status code
if (status != MMDB_SUCCESS) if (status != MMDB_SUCCESS)
{ {
STHROWF("Unable to get entry data list [%s]", MMDB_strerror(status)); STHROWF("Unable to get entry data list [{}]", MMDB_strerror(status));
} }
// Return the resulted list // Return the resulted list
return Object(new EntryDataList(m_Handle, entry_data_list)); return Object(new EntryDataList(m_Handle, entry_data_list));

View File

@ -1467,7 +1467,7 @@ public:
// Validate the specified index // Validate the specified index
if (idx > SQMOD_GET_VALID(*this)->languages.count) if (idx > SQMOD_GET_VALID(*this)->languages.count)
{ {
STHROWF("The specified language index is out of range: %u > %u", idx, m_Metadata->languages.count); STHROWF("The specified language index is out of range: {} > {}", idx, m_Metadata->languages.count);
} }
// Return the requested name // Return the requested name
return m_Metadata->languages.names[idx]; return m_Metadata->languages.names[idx];
@ -1518,7 +1518,7 @@ public:
// Validate the specified index // Validate the specified index
if (idx > SQMOD_GET_VALID(*this)->description.count) if (idx > SQMOD_GET_VALID(*this)->description.count)
{ {
STHROWF("The specified description index is out of range: %u > %u", idx, m_Metadata->description.count); STHROWF("The specified description index is out of range: {} > {}", idx, m_Metadata->description.count);
} }
// Return the requested description value // Return the requested description value
return m_Metadata->description.descriptions[idx]->description; return m_Metadata->description.descriptions[idx]->description;
@ -1532,7 +1532,7 @@ public:
// Validate the specified index // Validate the specified index
if (idx > SQMOD_GET_VALID(*this)->description.count) if (idx > SQMOD_GET_VALID(*this)->description.count)
{ {
STHROWF("The specified description index is out of range: %u > %u", idx, m_Metadata->description.count); STHROWF("The specified description index is out of range: {} > {}", idx, m_Metadata->description.count);
} }
// Return the requested description language // Return the requested description language
return m_Metadata->description.descriptions[idx]->language; return m_Metadata->description.descriptions[idx]->language;

View File

@ -1115,7 +1115,7 @@ SQFloat SqIToF(int64_t sigv, int64_t expv, int32_t padn, bool negf)
// Is the number of pad characters out of range? // Is the number of pad characters out of range?
if (static_cast< uint32_t >(padn) >= sizeof(padb)) if (static_cast< uint32_t >(padn) >= sizeof(padb))
{ {
STHROWF("Pad characters out of range: %d >= %d", padn, sizeof(padb)); STHROWF("Pad characters out of range: {} >= {}", padn, sizeof(padb));
} }
// Write the padding characters // Write the padding characters
std::memset(padb, '0', padn); std::memset(padb, '0', padn);

View File

@ -45,7 +45,7 @@ public:
{ {
if (!mHandle) if (!mHandle)
{ {
STHROWF("Cannot %s. Invalid directory handle.", action); STHROWF("Cannot {}. Invalid directory handle.", action);
} }
} }
@ -396,7 +396,7 @@ public:
{ {
if (!mHandle) if (!mHandle)
{ {
STHROWF("Cannot %s. Invalid file handle.", action); STHROWF("Cannot {}. Invalid file handle.", action);
} }
} }
@ -527,11 +527,11 @@ public:
// Now we can throw the exception // Now we can throw the exception
if (errno != 0) if (errno != 0)
{ {
STHROWF("Failed to open file: %s [%s]", path.mPtr, strerror(errno)); STHROWF("Failed to open file: {} [{}]", path.mPtr, strerror(errno));
} }
else else
{ {
STHROWLASTF("Failed to open file: %s", path.mPtr); STHROWLASTF("Failed to open file: {}", path.mPtr);
} }
} }
} }

View File

@ -376,7 +376,7 @@ SysPath & SysPath::Assign(const Buffer & path, int32_t size)
} }
else else
{ {
STHROWF("The specified path size is out of range: %u >= %u", size, path.Capacity()); STHROWF("The specified path size is out of range: {} >= {}", size, path.Capacity());
} }
// Allow chaining // Allow chaining
return *this; return *this;
@ -445,7 +445,7 @@ SysPath & SysPath::Assign(const Buffer & path, Style style, int32_t size)
} }
else else
{ {
STHROWF("The specified path size is out of range: %u >= %u", size, path.Capacity()); STHROWF("The specified path size is out of range: {} >= {}", size, path.Capacity());
} }
// Allow chaining // Allow chaining
return *this; return *this;

View File

@ -222,7 +222,7 @@ template < class T > struct SqVector
{ {
if (static_cast< size_t >(i) >= mC->size()) if (static_cast< size_t >(i) >= mC->size())
{ {
STHROWF("Invalid vector container index(%d" PRINT_INT_FMT ")", i); STHROWF("Invalid vector container index({})", i);
} }
return *mC; return *mC;
} }
@ -234,7 +234,7 @@ template < class T > struct SqVector
{ {
if (static_cast< size_t >(i) >= mC->size()) if (static_cast< size_t >(i) >= mC->size())
{ {
STHROWF("Invalid vector container index(%d" PRINT_INT_FMT ")", i); STHROWF("Invalid vector container index({})", i);
} }
return *mC; return *mC;
} }
@ -623,7 +623,7 @@ template < class T > struct SqVector
Validate(); Validate();
if (static_cast< size_t >(p) >= mC->size()) if (static_cast< size_t >(p) >= mC->size())
{ {
STHROWF("Invalid container index (%d" PRINT_INT_FMT ")", p); STHROWF("Invalid container index ({})", p);
} }
for (auto i = static_cast< size_t >(p); n--; ++i) for (auto i = static_cast< size_t >(p); n--; ++i)
{ {
@ -646,7 +646,7 @@ template < class T > struct SqVector
} }
else if (static_cast< size_t >(p + n) >= mC->size()) else if (static_cast< size_t >(p + n) >= mC->size())
{ {
STHROWF("Invalid container index (%d" PRINT_INT_FMT ")", p + n); STHROWF("Invalid container index ({})", p + n);
} }
for (n = (p + n); p <= n; ++p) for (n = (p + n); p <= n; ++p)
{ {

View File

@ -354,7 +354,7 @@ void Logger::BindCb(uint8_t level, Function & func)
// Is the log level valid? // Is the log level valid?
if (idx > 6) if (idx > 6)
{ {
STHROWF("Out of range log level index: %d > 4", int(idx)); STHROWF("Out of range log level index: {} > 4", int(idx));
} }
// Obtain the function instance called for this log level // Obtain the function instance called for this log level
Function & cb = m_LogCb[idx]; Function & cb = m_LogCb[idx];

View File

@ -116,7 +116,7 @@ static const LightObj & Blip_FindBySprID(int32_t spr_id)
// Perform a range check on the specified identifier // Perform a range check on the specified identifier
if (spr_id < 0) if (spr_id < 0)
{ {
STHROWF("The specified sprite identifier is invalid: %d", spr_id); STHROWF("The specified sprite identifier is invalid: {}", spr_id);
} }
// Obtain the ends of the entity pool // Obtain the ends of the entity pool
auto itr = Core::Get().GetBlips().cbegin(); auto itr = Core::Get().GetBlips().cbegin();

View File

@ -911,7 +911,7 @@ template < typename T > struct AppendElemFunc
// Append the object at the back of the array // Append the object at the back of the array
if (SQ_FAILED(sq_arrayappend(mVM, mIdx))) if (SQ_FAILED(sq_arrayappend(mVM, mIdx)))
{ {
STHROWF("Unable to append %s instance to the list", InstSpec< T >::LcName); STHROWF("Unable to append {} instance to the list", InstSpec< T >::LcName);
} }
} }
}; };
@ -1187,7 +1187,7 @@ public:
// Perform a range check on the specified identifier // Perform a range check on the specified identifier
if (INVALID_ENTITYEX(id, Inst::Max)) if (INVALID_ENTITYEX(id, Inst::Max))
{ {
STHROWF("The specified %s identifier is invalid: %d", Inst::LcName, id); STHROWF("The specified {} identifier is invalid: {}", Inst::LcName, id);
} }
// Obtain the ends of the entity pool // Obtain the ends of the entity pool
typename Inst::Instances::const_iterator itr = Inst::CBegin(); typename Inst::Instances::const_iterator itr = Inst::CBegin();

View File

@ -146,7 +146,7 @@ Table GetPluginInfo(int32_t plugin_id)
// Attempt to update the plug-in info structure // Attempt to update the plug-in info structure
if (_Func->GetPluginInfo(plugin_id, &g_PluginInfo) == vcmpErrorNoSuchEntity) if (_Func->GetPluginInfo(plugin_id, &g_PluginInfo) == vcmpErrorNoSuchEntity)
{ {
STHROWF("Unknown plug-in identifier: %d", plugin_id); STHROWF("Unknown plug-in identifier: {}", plugin_id);
} }
// Allocate a script table // Allocate a script table
Table tbl; Table tbl;
@ -260,7 +260,7 @@ const SQChar * GetServerName()
// Populate the buffer // Populate the buffer
//if (_Func->GetServerName(g_SvNameBuff, SQMOD_SVNAMELENGTH) == vcmpErrorBufferTooSmall) //if (_Func->GetServerName(g_SvNameBuff, SQMOD_SVNAMELENGTH) == vcmpErrorBufferTooSmall)
//{ //{
// STHROWF("Server name was too big for the available buffer: %u", sizeof(g_SvNameBuff)); // STHROWF("Server name was too big for the available buffer: {}", sizeof(g_SvNameBuff));
//} //}
// TEMPORARY WROKAROUND // TEMPORARY WROKAROUND
@ -287,7 +287,7 @@ const SQChar * GetServerPassword()
// Populate the buffer // Populate the buffer
//if (_Func->GetServerPassword(g_PasswdBuff, SQMOD_PASSWDLENGTH) == vcmpErrorBufferTooSmall) //if (_Func->GetServerPassword(g_PasswdBuff, SQMOD_PASSWDLENGTH) == vcmpErrorBufferTooSmall)
//{ //{
// STHROWF("Server password was too big for the available buffer: %u", sizeof(g_PasswdBuff)); // STHROWF("Server password was too big for the available buffer: {}", sizeof(g_PasswdBuff));
//} //}
// TEMPORARY WROKAROUND // TEMPORARY WROKAROUND
@ -314,7 +314,7 @@ const SQChar * GetGameModeText()
// Populate the buffer // Populate the buffer
//if (_Func->GetGameModeText(g_GmNameBuff, SQMOD_GMNAMELENGTH) == vcmpErrorBufferTooSmall) //if (_Func->GetGameModeText(g_GmNameBuff, SQMOD_GMNAMELENGTH) == vcmpErrorBufferTooSmall)
//{ //{
// STHROWF("Game-mode text was too big for the available buffer: %u", sizeof(g_GmNameBuff)); // STHROWF("Game-mode text was too big for the available buffer: {}", sizeof(g_GmNameBuff));
//} //}
// TEMPORARY WROKAROUND // TEMPORARY WROKAROUND
@ -369,7 +369,7 @@ bool GetServerOption(int32_t option_id)
// Check for errors // Check for errors
if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds) if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Unknown option identifier: %d", option_id); STHROWF("Unknown option identifier: {}", option_id);
} }
// Return the obtained value // Return the obtained value
return value; return value;
@ -381,7 +381,7 @@ void SetServerOption(int32_t option_id, bool toggle)
if (_Func->SetServerOption(static_cast< vcmpServerOption >(option_id), if (_Func->SetServerOption(static_cast< vcmpServerOption >(option_id),
static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds) static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Unknown option identifier: %d", option_id); STHROWF("Unknown option identifier: {}", option_id);
} }
else else
{ {
@ -395,7 +395,7 @@ void SetServerOptionEx(int32_t option_id, bool toggle, int32_t header, LightObj
if (_Func->SetServerOption(static_cast< vcmpServerOption >(option_id), if (_Func->SetServerOption(static_cast< vcmpServerOption >(option_id),
static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds) static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds)
{ {
STHROWF("Unknown option identifier: %d", option_id); STHROWF("Unknown option identifier: {}", option_id);
} }
else else
{ {

View File

@ -94,7 +94,7 @@ String GetAutomobileName(uint32_t id)
} }
else else
{ {
STHROWF("Vehicle identifier breaks these demands (%u > 129 and %u < 237) or (%u > 6399 and %u < 6500)", id, id, id, id); STHROWF("Vehicle identifier breaks these demands ({} > 129 and {} < 237) or ({} > 6399 and {} < 6500)", id, id, id, id);
} }
// Should never reach this point // Should never reach this point
return NullString(); return NullString();
@ -113,7 +113,7 @@ void SetAutomobileName(uint32_t id, StackStrF & name)
} }
else else
{ {
STHROWF("Vehicle identifier breaks these demands (%u > 129 and %u < 237) or (%u > 6399 and %u < 6500)", id, id, id, id); STHROWF("Vehicle identifier breaks these demands ({} > 129 and {} < 237) or ({} > 6399 and {} < 6500)", id, id, id, id);
} }
} }

View File

@ -149,7 +149,7 @@ void SqDataStatement::UseEx(LightObj & obj, const std::string & name, Poco::Data
case OT_BOOL: case OT_BOOL:
case OT_STRING: STHROWF("Use Bind(...) for non-reference types."); break; case OT_STRING: STHROWF("Use Bind(...) for non-reference types."); break;
case OT_INSTANCE: UseInst_(obj, name, dir); break; case OT_INSTANCE: UseInst_(obj, name, dir); break;
default: STHROWF("Can't use (%s) values", SqTypeName(obj.GetType())); break; default: STHROWF("Can't use ({}) values", SqTypeName(obj.GetType())); break;
} }
} }
@ -200,7 +200,7 @@ void SqDataStatement::UseInst_(LightObj & obj, const std::string & name, Poco::D
Var< LightObj >::push(SqVM(), obj); Var< LightObj >::push(SqVM(), obj);
String type_name = SqTypeName(SqVM(), -1); String type_name = SqTypeName(SqVM(), -1);
sq_poptop(SqVM()); sq_poptop(SqVM());
STHROWF("Can't use (%s) values", type_name.c_str()); STHROWF("Can't use {}) values", type_name);
} }
} }
@ -239,7 +239,7 @@ void SqDataStatement::BindEx(LightObj & obj, const std::string & name, Poco::Dat
} break; } break;
// Special? // Special?
case OT_INSTANCE: BindInst_(obj, name, dir); break; case OT_INSTANCE: BindInst_(obj, name, dir); break;
default: STHROWF("Can't bind (%s) values", SqTypeName(obj.GetType())); break; default: STHROWF("Can't bind ({}) values", SqTypeName(obj.GetType())); break;
} }
} }
@ -287,7 +287,7 @@ void SqDataStatement::BindInst_(LightObj & obj, const std::string & name, Poco::
Var< LightObj >::push(SqVM(), obj); Var< LightObj >::push(SqVM(), obj);
String type_name = SqTypeName(SqVM(), -1); String type_name = SqTypeName(SqVM(), -1);
sq_poptop(SqVM()); sq_poptop(SqVM());
STHROWF("Can't bind (%s) values", type_name.c_str()); STHROWF("Can't bind ({}) values", type_name);
} }
} }
@ -335,7 +335,7 @@ SqDataStatement & SqDataStatement::Into(LightObj & obj)
Var< LightObj >::push(SqVM(), obj); Var< LightObj >::push(SqVM(), obj);
String type_name = SqTypeName(SqVM(), -1); String type_name = SqTypeName(SqVM(), -1);
sq_poptop(SqVM()); sq_poptop(SqVM());
STHROWF("Can't extract (%s) values", type_name.c_str()); STHROWF("Can't extract ({}) values", type_name);
} }
return *this; return *this;
} }
@ -384,7 +384,7 @@ SqDataStatement & SqDataStatement::Into_(LightObj & obj, LightObj & def)
Var< LightObj >::push(SqVM(), obj); Var< LightObj >::push(SqVM(), obj);
String type_name = SqTypeName(SqVM(), -1); String type_name = SqTypeName(SqVM(), -1);
sq_poptop(SqVM()); sq_poptop(SqVM());
STHROWF("Can't extract (%s) values", type_name.c_str()); STHROWF("Can't extract ({}) values", type_name);
} }
return *this; return *this;
} }