mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-12-08 09:07:18 +01:00
Update all existing code to always receive StackStrF as a const reference.
This commit is contained in:
@@ -108,7 +108,7 @@ CSStr GetKeyCodeName(Uint8 keycode)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetKeyCodeName(Uint8 keycode, StackStrF & name)
|
||||
void SetKeyCodeName(Uint8 keycode, const StackStrF & name)
|
||||
{
|
||||
CS_Keycode_Names[keycode].assign(name.mPtr);
|
||||
}
|
||||
@@ -162,13 +162,13 @@ Table GetPluginInfo(Int32 plugin_id)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 FindPlugin(StackStrF & name)
|
||||
Int32 FindPlugin(const StackStrF & name)
|
||||
{
|
||||
return _Func->FindPlugin(name.mPtr);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SendPluginCommand(Uint32 identifier, StackStrF & payload)
|
||||
void SendPluginCommand(Uint32 identifier, const StackStrF & payload)
|
||||
{
|
||||
_Func->SendPluginCommand(identifier, payload.mPtr);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ const ULongInt & GetTime()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SendLogMessage(StackStrF & msg)
|
||||
void SendLogMessage(const StackStrF & msg)
|
||||
{
|
||||
if (_Func->LogMessage("%s", msg.mPtr) == vcmpErrorTooLargeInput)
|
||||
{
|
||||
@@ -267,7 +267,7 @@ CSStr GetServerName()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetServerName(StackStrF & name)
|
||||
void SetServerName(const StackStrF & name)
|
||||
{
|
||||
_Func->SetServerName(name.mPtr);
|
||||
}
|
||||
@@ -285,7 +285,7 @@ CSStr GetServerPassword()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetServerPassword(StackStrF & passwd)
|
||||
void SetServerPassword(const StackStrF & passwd)
|
||||
{
|
||||
_Func->SetServerPassword(passwd.mPtr);
|
||||
}
|
||||
@@ -303,13 +303,13 @@ CSStr GetGameModeText()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetGameModeText(StackStrF & text)
|
||||
void SetGameModeText(const StackStrF & text)
|
||||
{
|
||||
_Func->SetGameModeText(text.mPtr);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CreateRadioStream(bool listed, const StackStrF & name, StackStrF & url)
|
||||
void CreateRadioStream(bool listed, const StackStrF & name, const StackStrF & url)
|
||||
{
|
||||
if (_Func->AddRadioStream(-1, name.mPtr, url.mPtr, listed) == vcmpErrorArgumentOutOfBounds)
|
||||
{
|
||||
@@ -318,7 +318,7 @@ void CreateRadioStream(bool listed, const StackStrF & name, StackStrF & url)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, StackStrF & url)
|
||||
void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, const StackStrF & url)
|
||||
{
|
||||
if (_Func->AddRadioStream(id, name.mPtr, url.mPtr, listed) == vcmpErrorArgumentOutOfBounds)
|
||||
{
|
||||
@@ -744,25 +744,25 @@ void SetSpawnCameraLookAtEx(Float32 x, Float32 y, Float32 z)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void BanIP(StackStrF & addr)
|
||||
void BanIP(const StackStrF & addr)
|
||||
{
|
||||
_Func->BanIP(const_cast< SStr >(addr.mPtr));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool UnbanIP(StackStrF & addr)
|
||||
bool UnbanIP(const StackStrF & addr)
|
||||
{
|
||||
return _Func->UnbanIP(const_cast< SStr >(addr.mPtr));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool IsIPBanned(StackStrF & addr)
|
||||
bool IsIPBanned(const StackStrF & addr)
|
||||
{
|
||||
return _Func->IsIPBanned(const_cast< SStr >(addr.mPtr));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetPlayerIdFromName(StackStrF & name)
|
||||
Int32 GetPlayerIdFromName(const StackStrF & name)
|
||||
{
|
||||
return _Func->GetPlayerIdFromName(name.mPtr);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ CSStr GetKeyCodeName(Uint8 keycode);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the name of a certain key-code.
|
||||
*/
|
||||
void SetKeyCodeName(Uint8 keycode, StackStrF & name);
|
||||
void SetKeyCodeName(Uint8 keycode, const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the server version.
|
||||
@@ -40,12 +40,12 @@ Table GetPluginInfo(Int32 plugin_id);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attempt to find a plug-in identifier by it's name.
|
||||
*/
|
||||
Int32 FindPlugin(StackStrF & name);
|
||||
Int32 FindPlugin(const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Send a custom command to the loaded plug-ins.
|
||||
*/
|
||||
void SendPluginCommand(Uint32 identifier, StackStrF & payload);
|
||||
void SendPluginCommand(Uint32 identifier, const StackStrF & payload);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the server time.
|
||||
@@ -55,7 +55,7 @@ const ULongInt & GetTime();
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Send a log message to the server.
|
||||
*/
|
||||
void SendLogMessage(StackStrF & msg);
|
||||
void SendLogMessage(const StackStrF & msg);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the last error that occurred on the server.
|
||||
@@ -115,7 +115,7 @@ CSStr GetServerName();
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the server name.
|
||||
*/
|
||||
void SetServerName(StackStrF & name);
|
||||
void SetServerName(const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the server password.
|
||||
@@ -125,7 +125,7 @@ CSStr GetServerPassword();
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the server password.
|
||||
*/
|
||||
void SetServerPassword(StackStrF & passwd);
|
||||
void SetServerPassword(const StackStrF & passwd);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the game-mode text.
|
||||
@@ -135,17 +135,17 @@ CSStr GetGameModeText();
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the game-mode text.
|
||||
*/
|
||||
void SetGameModeText(StackStrF & text);
|
||||
void SetGameModeText(const StackStrF & text);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Create a radio stream.
|
||||
*/
|
||||
void CreateRadioStream(bool listed, const StackStrF & name, StackStrF & url);
|
||||
void CreateRadioStream(bool listed, const StackStrF & name, const StackStrF & url);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Create a radio stream.
|
||||
*/
|
||||
void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, StackStrF & url);
|
||||
void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, const StackStrF & url);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Remove a radio stream.
|
||||
@@ -422,22 +422,22 @@ void SetSpawnCameraLookAtEx(Float32 x, Float32 y, Float32 z);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Ban an IP address from the server.
|
||||
*/
|
||||
void BanIP(StackStrF & addr);
|
||||
void BanIP(const StackStrF & addr);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Unban an IP address from the server.
|
||||
*/
|
||||
bool UnbanIP(StackStrF & addr);
|
||||
bool UnbanIP(const StackStrF & addr);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See if an IP address is banned from the server.
|
||||
*/
|
||||
bool IsIPBanned(StackStrF & addr);
|
||||
bool IsIPBanned(const StackStrF & addr);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier of the player with the specified name.
|
||||
*/
|
||||
Int32 GetPlayerIdFromName(StackStrF & name);
|
||||
Int32 GetPlayerIdFromName(const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See if a player with the specified identifier is connected.
|
||||
|
||||
@@ -16,7 +16,7 @@ CSStr GetModelName(Int32 /*id*/)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetModelName(Int32 /*id*/, StackStrF & /*name*/)
|
||||
void SetModelName(Int32 /*id*/, const StackStrF & /*name*/)
|
||||
{
|
||||
// @TODO Implement...
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ CSStr GetModelName(Int32 id);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the name associated with a model identifier.
|
||||
*/
|
||||
void SetModelName(Int32 id, StackStrF & name);
|
||||
void SetModelName(Int32 id, const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the given model identifier is used a weapon model.
|
||||
|
||||
@@ -102,7 +102,7 @@ CCStr GetSkinName(Uint32 id)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetSkinName(Uint32 id, StackStrF & name)
|
||||
void SetSkinName(Uint32 id, const StackStrF & name)
|
||||
{
|
||||
if (id <= 159)
|
||||
{
|
||||
@@ -111,7 +111,7 @@ void SetSkinName(Uint32 id, StackStrF & name)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetSkinID(StackStrF & name)
|
||||
Int32 GetSkinID(const StackStrF & name)
|
||||
{
|
||||
// Clone the string into an editable version
|
||||
String str(name.mPtr, name.mLen);
|
||||
|
||||
@@ -15,12 +15,12 @@ CCStr GetSkinName(Uint32 id);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the name associated with a skin model identifier.
|
||||
*/
|
||||
void SetSkinName(Uint32 id, StackStrF & name);
|
||||
void SetSkinName(Uint32 id, const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Convert a vehicle model name to a skin model identifier.
|
||||
*/
|
||||
Int32 GetSkinID(StackStrF & name);
|
||||
Int32 GetSkinID(const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified skin model identifier is valid.
|
||||
|
||||
@@ -56,7 +56,7 @@ Object Signal::CreateFree()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object Signal::Create(StackStrF & name)
|
||||
Object Signal::Create(const StackStrF & name)
|
||||
{
|
||||
// Validate the signal name
|
||||
if (name.mLen <= 0)
|
||||
@@ -92,7 +92,7 @@ Object Signal::Create(StackStrF & name)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Signal::Remove(StackStrF & name)
|
||||
void Signal::Remove(const StackStrF & name)
|
||||
{
|
||||
// Validate the signal name
|
||||
if (name.mLen <= 0)
|
||||
@@ -126,7 +126,7 @@ void Signal::Remove(StackStrF & name)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object Signal::Fetch(StackStrF & name)
|
||||
Object Signal::Fetch(const StackStrF & name)
|
||||
{
|
||||
// Validate the signal name
|
||||
if (name.mLen <= 0)
|
||||
|
||||
@@ -521,17 +521,17 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a new signal with the specified name.
|
||||
*/
|
||||
static Object Create(StackStrF & name);
|
||||
static Object Create(const StackStrF & name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Remove the signal with the specified name.
|
||||
*/
|
||||
static void Remove(StackStrF & name);
|
||||
static void Remove(const StackStrF & name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the signal with the specified name.
|
||||
*/
|
||||
static Object Fetch(StackStrF & name);
|
||||
static Object Fetch(const StackStrF & name);
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
@@ -74,7 +74,7 @@ CSStr GetAutomobileName(Uint32 id)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetAutomobileName(Uint32 id, StackStrF & name)
|
||||
void SetAutomobileName(Uint32 id, const StackStrF & name)
|
||||
{
|
||||
if (id >= 130 || id <= 236)
|
||||
{
|
||||
@@ -83,7 +83,7 @@ void SetAutomobileName(Uint32 id, StackStrF & name)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetAutomobileID(StackStrF & name)
|
||||
Int32 GetAutomobileID(const StackStrF & name)
|
||||
{
|
||||
// Clone the string into an editable version
|
||||
String str(name.mPtr, name.mLen);
|
||||
|
||||
@@ -15,12 +15,12 @@ CSStr GetAutomobileName(Uint32 id);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the name associated with a vehicle model identifier.
|
||||
*/
|
||||
void SetAutomobileName(Uint32 id, StackStrF & name);
|
||||
void SetAutomobileName(Uint32 id, const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Convert a vehicle model name to a vehicle model identifier.
|
||||
*/
|
||||
Int32 GetAutomobileID(StackStrF & name);
|
||||
Int32 GetAutomobileID(const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified vehicle model identifier is valid.
|
||||
|
||||
@@ -56,7 +56,7 @@ CCStr GetWeaponName(Uint32 id)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWeaponName(Uint32 id, StackStrF & name)
|
||||
void SetWeaponName(Uint32 id, const StackStrF & name)
|
||||
{
|
||||
if (id <= 70)
|
||||
{
|
||||
@@ -65,7 +65,7 @@ void SetWeaponName(Uint32 id, StackStrF & name)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetWeaponID(StackStrF & name)
|
||||
Int32 GetWeaponID(const StackStrF & name)
|
||||
{
|
||||
// Clone the string into an editable version
|
||||
String str(name.mPtr, name.mLen);
|
||||
|
||||
@@ -15,12 +15,12 @@ CSStr GetWeaponName(Uint32 id);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the name associated with a weapon identifier.
|
||||
*/
|
||||
void SetWeaponName(Uint32 id, StackStrF & name);
|
||||
void SetWeaponName(Uint32 id, const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Convert a weapon name to a weapon identifier.
|
||||
*/
|
||||
Int32 GetWeaponID(StackStrF & name);
|
||||
Int32 GetWeaponID(const StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified weapon identifier is valid.
|
||||
|
||||
Reference in New Issue
Block a user