mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Discard instances of constant StackStrF parameters. This should always be non-const if possible.
This commit is contained in:
parent
baee2d5c33
commit
600c21d45f
@ -1888,6 +1888,16 @@ struct StackStrF
|
||||
CacheHash();
|
||||
return GetHash();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Provide a dummy non constant instance when calling functions that can work with placeholders.
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
static StackStrF & Dummy()
|
||||
{
|
||||
static StackStrF o;
|
||||
o.Release();
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -2122,7 +2132,7 @@ template<class T> struct is_reference<T&>
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Fast integer to string implementation to avoid using itoa. See https://github.com/jeaiii/itoa
|
||||
/// Fast integer to string implementation to avoid using itoa. See https://github.com/jeaiii/itoa
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
@ -350,7 +350,7 @@ SQInteger Connection::QueryF(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LightObj Connection::EscapeString(const StackStrF & str)
|
||||
LightObj Connection::EscapeString(StackStrF & str)
|
||||
{
|
||||
// Is there even a string to escape?
|
||||
if (str.mLen <= 0)
|
||||
|
@ -414,7 +414,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Escape unwanted characters from a given string.
|
||||
*/
|
||||
LightObj EscapeString(const StackStrF & str);
|
||||
LightObj EscapeString(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Attempt to execute the specified query.
|
||||
|
@ -101,7 +101,7 @@ Object GetMemoryHighwaterMark(bool reset)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CSStr EscapeString(const StackStrF & str)
|
||||
CSStr EscapeString(StackStrF & str)
|
||||
{
|
||||
// Is there even a string to escape?
|
||||
if (str.mLen <= 0)
|
||||
@ -115,7 +115,7 @@ CSStr EscapeString(const StackStrF & str)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCStr EscapeStringEx(SQChar spec, const StackStrF & str)
|
||||
CCStr EscapeStringEx(SQChar spec, StackStrF & str)
|
||||
{
|
||||
// Utility that allows changing the format specifier temporarily
|
||||
static SQChar fs[] = _SC("%q");
|
||||
|
@ -126,12 +126,12 @@ Object GetMemoryHighwaterMark(bool reset);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the escaped version of the specified string.
|
||||
*/
|
||||
CSStr EscapeString(const StackStrF & str);
|
||||
CSStr EscapeString(StackStrF & str);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the escaped version of the specified string using the supplied format specifier.
|
||||
*/
|
||||
CCStr EscapeStringEx(SQChar spec, const StackStrF & str);
|
||||
CCStr EscapeStringEx(SQChar spec, StackStrF & str);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Convert the values from the specified array to a list of column names string.
|
||||
|
@ -97,7 +97,7 @@ const ConnRef & Connection::GetCreated() const
|
||||
#endif // _DEBUG
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Connection::Open(const StackStrF & name)
|
||||
void Connection::Open(StackStrF & name)
|
||||
{
|
||||
// Should we create a connection handle?
|
||||
if (!m_Handle)
|
||||
@ -114,7 +114,7 @@ void Connection::Open(const StackStrF & name)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Connection::Open(const StackStrF & name, Int32 flags)
|
||||
void Connection::Open(StackStrF & name, Int32 flags)
|
||||
{
|
||||
// Should we create a connection handle?
|
||||
if (!m_Handle)
|
||||
@ -131,7 +131,7 @@ void Connection::Open(const StackStrF & name, Int32 flags)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Connection::Open(const StackStrF & name, Int32 flags, const StackStrF & vfs)
|
||||
void Connection::Open(StackStrF & name, Int32 flags, StackStrF & vfs)
|
||||
{
|
||||
// Should we create a connection handle?
|
||||
if (!m_Handle)
|
||||
@ -148,7 +148,7 @@ void Connection::Open(const StackStrF & name, Int32 flags, const StackStrF & vfs
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 Connection::Exec(const StackStrF & str)
|
||||
Int32 Connection::Exec(StackStrF & str)
|
||||
{
|
||||
SQMOD_VALIDATE_CREATED(*this);
|
||||
// Attempt to execute the specified query
|
||||
@ -163,7 +163,7 @@ Int32 Connection::Exec(const StackStrF & str)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object Connection::Query(const StackStrF & str) const
|
||||
Object Connection::Query(StackStrF & str) const
|
||||
{
|
||||
SQMOD_VALIDATE_CREATED(*this);
|
||||
// Return the requested information
|
||||
@ -171,7 +171,7 @@ Object Connection::Query(const StackStrF & str) const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Connection::Queue(const StackStrF & str)
|
||||
void Connection::Queue(StackStrF & str)
|
||||
{
|
||||
SQMOD_VALIDATE(*this);
|
||||
// Is there a query to commit?
|
||||
@ -198,10 +198,11 @@ bool Connection::IsReadOnly() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Connection::TableExists(const StackStrF & name) const
|
||||
bool Connection::TableExists(StackStrF & name) const
|
||||
{
|
||||
StackStrF query("SELECT count(*) FROM [sqlite_master] WHERE [type]='table' AND [name]=?");
|
||||
// Prepare a statement to inspect the master table
|
||||
Statement stmt(SQMOD_GET_CREATED(*this), "SELECT count(*) FROM [sqlite_master] WHERE [type]='table' AND [name]=?");
|
||||
Statement stmt(SQMOD_GET_CREATED(*this), query);
|
||||
// Could the statement be created?
|
||||
if (stmt.IsValid())
|
||||
{
|
||||
@ -346,9 +347,9 @@ void Register_Connection(Table & sqlns)
|
||||
Class< Connection >(sqlns.GetVM(), Typename::Str)
|
||||
// Constructors
|
||||
.Ctor()
|
||||
.Ctor< const StackStrF & >()
|
||||
.Ctor< const StackStrF &, Int32 >()
|
||||
.Ctor< const StackStrF &, Int32, const StackStrF & >()
|
||||
.Ctor< StackStrF & >()
|
||||
.Ctor< StackStrF &, Int32 >()
|
||||
.Ctor< StackStrF &, Int32, StackStrF & >()
|
||||
// Meta-methods
|
||||
.SquirrelFunc(_SC("_typename"), &Typename::Fn)
|
||||
.Func(_SC("_tostring"), &Connection::ToString)
|
||||
@ -387,9 +388,9 @@ void Register_Connection(Table & sqlns)
|
||||
.Func(_SC("ClearQueue"), &Connection::ClearQueue)
|
||||
.Func(_SC("PopQueue"), &Connection::PopQueue)
|
||||
// Member Overloads
|
||||
.Overload< void (Connection::*)(const StackStrF &) >(_SC("Open"), &Connection::Open)
|
||||
.Overload< void (Connection::*)(const StackStrF &, Int32) >(_SC("Open"), &Connection::Open)
|
||||
.Overload< void (Connection::*)(const StackStrF &, Int32, const StackStrF &) >(_SC("Open"), &Connection::Open)
|
||||
.Overload< void (Connection::*)(StackStrF &) >(_SC("Open"), &Connection::Open)
|
||||
.Overload< void (Connection::*)(StackStrF &, Int32) >(_SC("Open"), &Connection::Open)
|
||||
.Overload< void (Connection::*)(StackStrF &, Int32, StackStrF &) >(_SC("Open"), &Connection::Open)
|
||||
.Overload< Int32 (Connection::*)(Int32) >(_SC("GetInfo"), &Connection::GetInfo)
|
||||
.Overload< Int32 (Connection::*)(Int32, bool) >(_SC("GetInfo"), &Connection::GetInfo)
|
||||
.Overload< Int32 (Connection::*)(Int32, bool, bool) >(_SC("GetInfo"), &Connection::GetInfo)
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Explicit constructor.
|
||||
*/
|
||||
Connection(const StackStrF & name)
|
||||
Connection(StackStrF & name)
|
||||
: m_Handle(new ConnHnd())
|
||||
{
|
||||
SQMOD_GET_VALID(*this)->Create(name.mPtr, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nullptr);
|
||||
@ -88,7 +88,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Explicit constructor.
|
||||
*/
|
||||
Connection(const StackStrF & name, Int32 flags)
|
||||
Connection(StackStrF & name, Int32 flags)
|
||||
: m_Handle(new ConnHnd())
|
||||
{
|
||||
SQMOD_GET_VALID(*this)->Create(name.mPtr, flags, nullptr);
|
||||
@ -97,7 +97,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Explicit constructor.
|
||||
*/
|
||||
Connection(const StackStrF & name, Int32 flags, const StackStrF & vfs)
|
||||
Connection(StackStrF & name, Int32 flags, StackStrF & vfs)
|
||||
: m_Handle(new ConnHnd())
|
||||
{
|
||||
SQMOD_GET_VALID(*this)->Create(name.mPtr, flags, vfs.mPtr);
|
||||
@ -279,32 +279,32 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Attempt to open the specified database.
|
||||
*/
|
||||
void Open(const StackStrF & name);
|
||||
void Open(StackStrF & name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Attempt to open the specified database.
|
||||
*/
|
||||
void Open(const StackStrF & name, Int32 flags);
|
||||
void Open(StackStrF & name, Int32 flags);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Attempt to open the specified database.
|
||||
*/
|
||||
void Open(const StackStrF & name, Int32 flags, const StackStrF & vfs);
|
||||
void Open(StackStrF & name, Int32 flags, StackStrF & vfs);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Attempt to execute the specified query.
|
||||
*/
|
||||
Int32 Exec(const StackStrF & str);
|
||||
Int32 Exec(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Attempt to queue the specified query.
|
||||
*/
|
||||
void Queue(const StackStrF & str);
|
||||
void Queue(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Attempt to create a statement from the specified query.
|
||||
*/
|
||||
Object Query(const StackStrF & str) const;
|
||||
Object Query(StackStrF & str) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See if the database connection was opened in read-only mode.
|
||||
@ -314,7 +314,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Shortcut to test if a table exists.
|
||||
*/
|
||||
bool TableExists(const StackStrF & name) const;
|
||||
bool TableExists(StackStrF & name) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See if the database connection is or is not in auto-commit mode.
|
||||
|
@ -459,7 +459,7 @@ void Parameter::SetFloat64(SQFloat value)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Parameter::SetString(const StackStrF & value)
|
||||
void Parameter::SetString(StackStrF & value)
|
||||
{
|
||||
SQMOD_VALIDATE_CREATED(*this);
|
||||
// Attempt to bind the specified value
|
||||
|
@ -341,7 +341,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Attempt to bind a string value at the referenced parameter index.
|
||||
*/
|
||||
void SetString(const StackStrF & value);
|
||||
void SetString(StackStrF & value);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Attempt to bind a string value at the referenced parameter index.
|
||||
|
@ -160,7 +160,7 @@ void Statement::ValidateRow() const
|
||||
#endif // _DEBUG
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Statement::Statement(const Connection & connection, const StackStrF & query)
|
||||
Statement::Statement(const Connection & connection, StackStrF & query)
|
||||
: m_Handle(new StmtHnd(connection.GetHandle()))
|
||||
{
|
||||
SQMOD_GET_VALID(*this)->Create(query.mPtr, query.mLen);
|
||||
@ -425,7 +425,7 @@ void Register_Statement(Table & sqlns)
|
||||
// Constructors
|
||||
.Ctor()
|
||||
.Ctor< const Statement & >()
|
||||
.Ctor< const Connection &, const StackStrF & >()
|
||||
.Ctor< const Connection &, StackStrF & >()
|
||||
// Meta-methods
|
||||
.SquirrelFunc(_SC("_typename"), &Typename::Fn)
|
||||
.Func(_SC("_tostring"), &Statement::ToString)
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct a statement under the specified connection using the specified string.
|
||||
*/
|
||||
Statement(const ConnRef & connection, const StackStrF & query)
|
||||
Statement(const ConnRef & connection, StackStrF & query)
|
||||
: m_Handle(new StmtHnd(connection))
|
||||
{
|
||||
SQMOD_GET_VALID(*this)->Create(query.mPtr, query.mLen);
|
||||
@ -107,7 +107,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct a statement under the specified connection using the specified string.
|
||||
*/
|
||||
Statement(const Connection & connection, const StackStrF & query);
|
||||
Statement(const Connection & connection, StackStrF & query);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Direct handle constructor.
|
||||
@ -314,7 +314,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the parameter index associated with the specified name.
|
||||
*/
|
||||
Int32 GetParameterIndex(const StackStrF & name) const
|
||||
Int32 GetParameterIndex(StackStrF & name) const
|
||||
{
|
||||
return sqlite3_bind_parameter_index(SQMOD_GET_VALID(*this)->mPtr, name.mPtr);
|
||||
}
|
||||
@ -367,7 +367,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the column index associated with the specified name.
|
||||
*/
|
||||
Int32 GetColumnIndex(const StackStrF & name) const
|
||||
Int32 GetColumnIndex(StackStrF & name) const
|
||||
{
|
||||
return SQMOD_GET_VALID(*this)->GetColumnIndex(name.mPtr, name.mLen);
|
||||
}
|
||||
@ -594,7 +594,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Attempt to bind a string value at the specified parameter index.
|
||||
*/
|
||||
Statement & SetString(const Object & param, const StackStrF & value)
|
||||
Statement & SetString(const Object & param, StackStrF & value)
|
||||
{
|
||||
Parameter(SQMOD_GET_CREATED(*this), param).SetString(value);
|
||||
// Allow chaining of operations
|
||||
|
@ -307,7 +307,7 @@ CSStr AABB::ToString() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void AABB::SetStr(SQChar delim, const StackStrF & values)
|
||||
void AABB::SetStr(SQChar delim, StackStrF & values)
|
||||
{
|
||||
DefineAABB(AABB::GetEx(delim, values));
|
||||
}
|
||||
@ -734,13 +734,13 @@ Int32 AABB::IsSphereInsideFastEx(Value x, Value y, Value z, Value r) const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const AABB & AABB::Get(const StackStrF & str)
|
||||
const AABB & AABB::Get(StackStrF & str)
|
||||
{
|
||||
return AABB::GetEx(AABB::Delim, str);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const AABB & AABB::GetEx(SQChar delim, const StackStrF & str)
|
||||
const AABB & AABB::GetEx(SQChar delim, StackStrF & str)
|
||||
{
|
||||
// The format specifications that will be used to scan the string
|
||||
static SQChar fs[] = _SC(" %f , %f , %f , %f , %f , %f ");
|
||||
|
@ -300,7 +300,7 @@ struct AABB
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values extracted from the specified string using the specified delimiter.
|
||||
*/
|
||||
void SetStr(SQChar delim, const StackStrF & values);
|
||||
void SetStr(SQChar delim, StackStrF & values);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Clear the component values to default.
|
||||
@ -470,12 +470,12 @@ struct AABB
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the AABB type from a string.
|
||||
*/
|
||||
static const AABB & Get(const StackStrF & str);
|
||||
static const AABB & Get(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the AABB type from a string.
|
||||
*/
|
||||
static const AABB & GetEx(SQChar delim, const StackStrF & str);
|
||||
static const AABB & GetEx(SQChar delim, StackStrF & str);
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@ -409,7 +409,7 @@ void Circle::SetPositionEx(Value nx, Value ny)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Circle::SetStr(SQChar delim, const StackStrF & values)
|
||||
void Circle::SetStr(SQChar delim, StackStrF & values)
|
||||
{
|
||||
SetCircle(Circle::GetEx(delim, values));
|
||||
}
|
||||
@ -468,13 +468,13 @@ Circle Circle::Abs() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Circle & Circle::Get(const StackStrF & str)
|
||||
const Circle & Circle::Get(StackStrF & str)
|
||||
{
|
||||
return Circle::GetEx(Circle::Delim, str);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Circle & Circle::GetEx(SQChar delim, const StackStrF & str)
|
||||
const Circle & Circle::GetEx(SQChar delim, StackStrF & str)
|
||||
{
|
||||
// The format specifications that will be used to scan the string
|
||||
static SQChar fs[] = _SC(" %f , %f , %f ");
|
||||
|
@ -376,7 +376,7 @@ struct Circle
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values extracted from the specified string using the specified delimiter.
|
||||
*/
|
||||
void SetStr(SQChar delim, const StackStrF & values);
|
||||
void SetStr(SQChar delim, StackStrF & values);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Generate a randomly sized and positioned circle.
|
||||
@ -415,12 +415,12 @@ struct Circle
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Circle type from a string.
|
||||
*/
|
||||
static const Circle & Get(const StackStrF & str);
|
||||
static const Circle & Get(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Circle type from a string.
|
||||
*/
|
||||
static const Circle & GetEx(SQChar delim, const StackStrF & str);
|
||||
static const Circle & GetEx(SQChar delim, StackStrF & str);
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@ -530,13 +530,13 @@ void Color3::SetColor4Ex(Value nr, Value ng, Value nb, Value /*na*/)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Color3::SetStr(SQChar delim, const StackStrF & values)
|
||||
void Color3::SetStr(SQChar delim, StackStrF & values)
|
||||
{
|
||||
SetColor3(Color3::GetEx(delim, values));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Color3::SetName(const StackStrF & name)
|
||||
void Color3::SetName(StackStrF & name)
|
||||
{
|
||||
SetColor3(GetColor(name));
|
||||
}
|
||||
@ -632,13 +632,13 @@ void Color3::Inverse()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Color3 & Color3::Get(const StackStrF & str)
|
||||
const Color3 & Color3::Get(StackStrF & str)
|
||||
{
|
||||
return Color3::GetEx(Color3::Delim, str);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Color3 & Color3::GetEx(SQChar delim, const StackStrF & str)
|
||||
const Color3 & Color3::GetEx(SQChar delim, StackStrF & str)
|
||||
{
|
||||
// The format specifications that will be used to scan the string
|
||||
static SQChar fs[] = _SC(" %u , %u , %u ");
|
||||
|
@ -429,12 +429,12 @@ struct Color3
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values extracted from the specified string using the specified delimiter.
|
||||
*/
|
||||
void SetStr(SQChar delim, const StackStrF & str);
|
||||
void SetStr(SQChar delim, StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values from the identified color.
|
||||
*/
|
||||
void SetName(const StackStrF & name);
|
||||
void SetName(StackStrF & name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Get the component values packed inside an integer value.
|
||||
@ -502,12 +502,12 @@ struct Color3
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Color3 type from a string.
|
||||
*/
|
||||
static const Color3 & Get(const StackStrF & str);
|
||||
static const Color3 & Get(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Color3 type from a string.
|
||||
*/
|
||||
static const Color3 & GetEx( SQChar delim, const StackStrF & str);
|
||||
static const Color3 & GetEx( SQChar delim, StackStrF & str);
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@ -559,13 +559,13 @@ void Color4::SetColor4Ex(Value nr, Value ng, Value nb, Value na)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Color4::SetStr(SQChar delim, const StackStrF & values)
|
||||
void Color4::SetStr(SQChar delim, StackStrF & values)
|
||||
{
|
||||
SetColor4(Color4::GetEx(delim, values));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Color4::SetName(const StackStrF & name)
|
||||
void Color4::SetName(StackStrF & name)
|
||||
{
|
||||
SetColor3(GetColor(name));
|
||||
}
|
||||
@ -667,13 +667,13 @@ void Color4::Inverse()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Color4 & Color4::Get(const StackStrF & str)
|
||||
const Color4 & Color4::Get(StackStrF & str)
|
||||
{
|
||||
return Color4::GetEx(Color4::Delim, str);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Color4 & Color4::GetEx(SQChar delim, const StackStrF & str)
|
||||
const Color4 & Color4::GetEx(SQChar delim, StackStrF & str)
|
||||
{
|
||||
// The format specifications that will be used to scan the string
|
||||
static SQChar fs[] = _SC(" %u , %u , %u , %u ");
|
||||
|
@ -429,12 +429,12 @@ struct Color4
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values extracted from the specified string using the specified delimiter.
|
||||
*/
|
||||
void SetStr(SQChar delim, const StackStrF & name);
|
||||
void SetStr(SQChar delim, StackStrF & name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values from the identified color.
|
||||
*/
|
||||
void SetName(const StackStrF & name);
|
||||
void SetName(StackStrF & name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Get the component values packed inside an integer value.
|
||||
@ -502,12 +502,12 @@ struct Color4
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Color4 type from a string.
|
||||
*/
|
||||
static const Color4 & Get(const StackStrF & str);
|
||||
static const Color4 & Get(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Color4 type from a string.
|
||||
*/
|
||||
static const Color4 & GetEx(SQChar delim, const StackStrF & str);
|
||||
static const Color4 & GetEx(SQChar delim, StackStrF & str);
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@ -431,7 +431,7 @@ void Quaternion::SetVector4(const Vector4 & v)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Quaternion::SetStr(SQChar delim, const StackStrF & values)
|
||||
void Quaternion::SetStr(SQChar delim, StackStrF & values)
|
||||
{
|
||||
SetQuaternion(Quaternion::GetEx(delim, values));
|
||||
}
|
||||
@ -714,13 +714,13 @@ Quaternion Quaternion::NlerpEx(const Quaternion & quat, Value t, bool shortest_p
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Quaternion & Quaternion::Get(const StackStrF & str)
|
||||
const Quaternion & Quaternion::Get(StackStrF & str)
|
||||
{
|
||||
return Quaternion::GetEx(Quaternion::Delim, str);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Quaternion & Quaternion::GetEx(SQChar delim, const StackStrF & str)
|
||||
const Quaternion & Quaternion::GetEx(SQChar delim, StackStrF & str)
|
||||
{
|
||||
// The format specifications that will be used to scan the string
|
||||
static SQChar fs[] = _SC(" %f , %f , %f , %f ");
|
||||
|
@ -330,7 +330,7 @@ struct Quaternion
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values extracted from the specified string using the specified delimiter.
|
||||
*/
|
||||
void SetStr(SQChar delim, const StackStrF & values);
|
||||
void SetStr(SQChar delim, StackStrF & values);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Generate random values for all components of this instance.
|
||||
@ -443,12 +443,12 @@ struct Quaternion
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Quaternion type from a string.
|
||||
*/
|
||||
static const Quaternion & Get(const StackStrF & str);
|
||||
static const Quaternion & Get(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Quaternion type from a string.
|
||||
*/
|
||||
static const Quaternion & GetEx(SQChar delim, const StackStrF & str);
|
||||
static const Quaternion & GetEx(SQChar delim, StackStrF & str);
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@ -324,7 +324,7 @@ const Color3 & GetRandomColor()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Color3 GetColor(const StackStrF & name)
|
||||
Color3 GetColor(StackStrF & name)
|
||||
{
|
||||
return name.mLen <= 0 ? Color3() : GetColorStr(name.mPtr);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ Color3 GetColorStr(CSStr name);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attempt to identify the color in the specified name and return it.
|
||||
*/
|
||||
Color3 GetColor(const StackStrF & name);
|
||||
Color3 GetColor(StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Throw the last system error as an exception.
|
||||
|
@ -409,7 +409,7 @@ void Sphere::SetPositionEx(Value nx, Value ny, Value nz)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Sphere::SetStr(SQChar delim, const StackStrF & values)
|
||||
void Sphere::SetStr(SQChar delim, StackStrF & values)
|
||||
{
|
||||
SetSphere(Sphere::GetEx(delim, values));
|
||||
}
|
||||
@ -468,13 +468,13 @@ Sphere Sphere::Abs() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Sphere & Sphere::Get(const StackStrF & str)
|
||||
const Sphere & Sphere::Get(StackStrF & str)
|
||||
{
|
||||
return Sphere::GetEx(Sphere::Delim, str);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Sphere & Sphere::GetEx(SQChar delim, const StackStrF & str)
|
||||
const Sphere & Sphere::GetEx(SQChar delim, StackStrF & str)
|
||||
{
|
||||
// The format specifications that will be used to scan the string
|
||||
static SQChar fs[] = _SC(" %f , %f , %f , %f ");
|
||||
|
@ -376,7 +376,7 @@ struct Sphere
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values extracted from the specified string using the specified delimiter.
|
||||
*/
|
||||
void SetStr(SQChar delim, const StackStrF & values);
|
||||
void SetStr(SQChar delim, StackStrF & values);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Generate a randomly sized and positioned sphere.
|
||||
@ -414,12 +414,12 @@ struct Sphere
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Sphere type from a string.
|
||||
*/
|
||||
static const Sphere & Get(const StackStrF & str);
|
||||
static const Sphere & Get(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Sphere type from a string.
|
||||
*/
|
||||
static const Sphere & GetEx(SQChar delim, const StackStrF & str);
|
||||
static const Sphere & GetEx(SQChar delim, StackStrF & str);
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@ -333,7 +333,7 @@ void Vector2::SetVector2i(const Vector2i & v)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Vector2::SetStr(SQChar delim, const StackStrF & values)
|
||||
void Vector2::SetStr(SQChar delim, StackStrF & values)
|
||||
{
|
||||
SetVector2(Vector2::GetEx(delim, values));
|
||||
}
|
||||
@ -376,13 +376,13 @@ Vector2 Vector2::Abs() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Vector2 & Vector2::Get(const StackStrF & str)
|
||||
const Vector2 & Vector2::Get(StackStrF & str)
|
||||
{
|
||||
return Vector2::GetEx(Vector2::Delim, str);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Vector2 & Vector2::GetEx(SQChar delim, const StackStrF & str)
|
||||
const Vector2 & Vector2::GetEx(SQChar delim, StackStrF & str)
|
||||
{
|
||||
// The format specifications that will be used to scan the string
|
||||
static SQChar fs[] = _SC(" %f , %f ");
|
||||
|
@ -314,7 +314,7 @@ struct Vector2
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values extracted from the specified string using the specified delimiter.
|
||||
*/
|
||||
void SetStr(SQChar delim, const StackStrF & values);
|
||||
void SetStr(SQChar delim, StackStrF & values);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Generate random values for all components of this instance.
|
||||
@ -347,12 +347,12 @@ struct Vector2
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Vector2 type from a string.
|
||||
*/
|
||||
static const Vector2 & Get(const StackStrF & str);
|
||||
static const Vector2 & Get(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Vector2 type from a string.
|
||||
*/
|
||||
static const Vector2 & GetEx(SQChar delim, const StackStrF & str);
|
||||
static const Vector2 & GetEx(SQChar delim, StackStrF & str);
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@ -479,7 +479,7 @@ void Vector2i::SetVector2(const Vector2 & v)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Vector2i::SetStr(SQChar delim, const StackStrF & values)
|
||||
void Vector2i::SetStr(SQChar delim, StackStrF & values)
|
||||
{
|
||||
SetVector2i(Vector2i::GetEx(delim, values));
|
||||
}
|
||||
@ -522,13 +522,13 @@ Vector2i Vector2i::Abs() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Vector2i & Vector2i::Get(const StackStrF & str)
|
||||
const Vector2i & Vector2i::Get(StackStrF & str)
|
||||
{
|
||||
return Vector2i::GetEx(Vector2i::Delim, str);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Vector2i & Vector2i::GetEx(SQChar delim, const StackStrF & str)
|
||||
const Vector2i & Vector2i::GetEx(SQChar delim, StackStrF & str)
|
||||
{
|
||||
// The format specifications that will be used to scan the string
|
||||
static SQChar fs[] = _SC(" %d , %d ");
|
||||
|
@ -414,7 +414,7 @@ struct Vector2i
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values extracted from the specified string using the specified delimiter.
|
||||
*/
|
||||
void SetStr(SQChar delim, const StackStrF & values);
|
||||
void SetStr(SQChar delim, StackStrF & values);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Generate random values for all components of this instance.
|
||||
@ -447,12 +447,12 @@ struct Vector2i
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Vector2i type from a string.
|
||||
*/
|
||||
static const Vector2i & Get(const StackStrF & str);
|
||||
static const Vector2i & Get(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Vector2i type from a string.
|
||||
*/
|
||||
static const Vector2i & GetEx(SQChar delim, const StackStrF & str);
|
||||
static const Vector2i & GetEx(SQChar delim, StackStrF & str);
|
||||
|
||||
};
|
||||
|
||||
|
@ -415,7 +415,7 @@ void Vector3::SetQuaternionEx(Value qx, Value qy, Value qz, Value qw)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Vector3::SetStr(SQChar delim, const StackStrF & values)
|
||||
void Vector3::SetStr(SQChar delim, StackStrF & values)
|
||||
{
|
||||
SetVector3(Vector3::GetEx(delim, values));
|
||||
}
|
||||
@ -629,13 +629,13 @@ void Vector3::CenterRotateYZBy(Value degrees, const Vector3 & center)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Vector3 & Vector3::Get(const StackStrF & str)
|
||||
const Vector3 & Vector3::Get(StackStrF & str)
|
||||
{
|
||||
return Vector3::GetEx(Vector3::Delim, str);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Vector3 & Vector3::GetEx(SQChar delim, const StackStrF & str)
|
||||
const Vector3 & Vector3::GetEx(SQChar delim, StackStrF & str)
|
||||
{
|
||||
// The format specifications that will be used to scan the string
|
||||
static SQChar fs[] = _SC(" %f , %f , %f ");
|
||||
|
@ -336,7 +336,7 @@ struct Vector3
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values extracted from the specified string using the specified delimiter.
|
||||
*/
|
||||
void SetStr(SQChar delim, const StackStrF & values);
|
||||
void SetStr(SQChar delim, StackStrF & values);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Generate random values for all components of this instance.
|
||||
@ -493,12 +493,12 @@ struct Vector3
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Vector3 type from a string.
|
||||
*/
|
||||
static const Vector3 & Get(const StackStrF & str);
|
||||
static const Vector3 & Get(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Vector3 type from a string.
|
||||
*/
|
||||
static const Vector3 & GetEx(SQChar delim, const StackStrF & str);
|
||||
static const Vector3 & GetEx(SQChar delim, StackStrF & str);
|
||||
|
||||
};
|
||||
|
||||
|
@ -416,7 +416,7 @@ void Vector4::SetQuaternionEx(Value nx, Value ny, Value nz, Value nw)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Vector4::SetStr(SQChar delim, const StackStrF & values)
|
||||
void Vector4::SetStr(SQChar delim, StackStrF & values)
|
||||
{
|
||||
SetVector4(Vector4::GetEx(delim, values));
|
||||
}
|
||||
@ -465,13 +465,13 @@ Vector4 Vector4::Abs() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Vector4 & Vector4::Get(const StackStrF & str)
|
||||
const Vector4 & Vector4::Get(StackStrF & str)
|
||||
{
|
||||
return Vector4::GetEx(Vector4::Delim, str);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Vector4 & Vector4::GetEx(SQChar delim, const StackStrF & str)
|
||||
const Vector4 & Vector4::GetEx(SQChar delim, StackStrF & str)
|
||||
{
|
||||
// The format specifications that will be used to scan the string
|
||||
static SQChar fs[] = _SC(" %f , %f , %f , %f ");
|
||||
|
@ -334,7 +334,7 @@ struct Vector4
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the values extracted from the specified string using the specified delimiter.
|
||||
*/
|
||||
void SetStr(SQChar delim, const StackStrF & values);
|
||||
void SetStr(SQChar delim, StackStrF & values);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Generate random values for all components of this instance.
|
||||
@ -367,12 +367,12 @@ struct Vector4
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Vector4 type from a string.
|
||||
*/
|
||||
static const Vector4 & Get(const StackStrF & str);
|
||||
static const Vector4 & Get(StackStrF & str);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extract the values for components of the Vector4 type from a string.
|
||||
*/
|
||||
static const Vector4 & GetEx(SQChar delim, const StackStrF & str);
|
||||
static const Vector4 & GetEx(SQChar delim, StackStrF & str);
|
||||
|
||||
};
|
||||
|
||||
|
@ -51,6 +51,8 @@ extern void TerminateTasks();
|
||||
extern void TerminateRoutines();
|
||||
extern void TerminateCommands();
|
||||
extern void TerminateSignals();
|
||||
extern void MgInitialize();
|
||||
extern void MgTerminate();
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
extern Buffer GetRealFilePath(CSStr path);
|
||||
@ -372,6 +374,9 @@ bool Core::Initialize()
|
||||
InitializeRoutines();
|
||||
InitializeTasks();
|
||||
|
||||
// Initialize the Mongoose library
|
||||
//MgInitialize();
|
||||
|
||||
// Initialization successful
|
||||
return true;
|
||||
}
|
||||
@ -534,6 +539,8 @@ void Core::Terminate(bool shutdown)
|
||||
// Tell modules to do their monkey business
|
||||
_Func->SendPluginCommand(SQMOD_RELEASED_CMD, "");
|
||||
}
|
||||
// Terminate the Mongoose manager
|
||||
//MgTerminate();
|
||||
|
||||
OutputMessage("Squirrel plug-in was successfully terminated");
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ const String & CBlip::GetTag() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CBlip::SetTag(const StackStrF & tag)
|
||||
void CBlip::SetTag(StackStrF & tag)
|
||||
{
|
||||
if (tag.mLen > 0)
|
||||
{
|
||||
@ -65,7 +65,7 @@ void CBlip::SetTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CBlip & CBlip::ApplyTag(const StackStrF & tag)
|
||||
CBlip & CBlip::ApplyTag(StackStrF & tag)
|
||||
{
|
||||
SetTag(tag);
|
||||
return *this;
|
||||
|
@ -119,12 +119,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
void SetTag(const StackStrF & tag);
|
||||
void SetTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
CBlip & ApplyTag(const StackStrF & tag);
|
||||
CBlip & ApplyTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
|
@ -55,7 +55,7 @@ const String & CCheckpoint::GetTag() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CCheckpoint::SetTag(const StackStrF & tag)
|
||||
void CCheckpoint::SetTag(StackStrF & tag)
|
||||
{
|
||||
if (tag.mLen > 0)
|
||||
{
|
||||
@ -68,7 +68,7 @@ void CCheckpoint::SetTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCheckpoint & CCheckpoint::ApplyTag(const StackStrF & tag)
|
||||
CCheckpoint & CCheckpoint::ApplyTag(StackStrF & tag)
|
||||
{
|
||||
SetTag(tag);
|
||||
return *this;
|
||||
|
@ -133,12 +133,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
void SetTag(const StackStrF & tag);
|
||||
void SetTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
CCheckpoint & ApplyTag(const StackStrF & tag);
|
||||
CCheckpoint & ApplyTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
|
@ -52,7 +52,7 @@ const String & CKeybind::GetTag() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CKeybind::SetTag(const StackStrF & tag)
|
||||
void CKeybind::SetTag(StackStrF & tag)
|
||||
{
|
||||
if (tag.mLen > 0)
|
||||
{
|
||||
@ -65,7 +65,7 @@ void CKeybind::SetTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CKeybind & CKeybind::ApplyTag(const StackStrF & tag)
|
||||
CKeybind & CKeybind::ApplyTag(StackStrF & tag)
|
||||
{
|
||||
SetTag(tag);
|
||||
return *this;
|
||||
|
@ -119,12 +119,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
void SetTag(const StackStrF & tag);
|
||||
void SetTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
CKeybind & ApplyTag(const StackStrF & tag);
|
||||
CKeybind & ApplyTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
|
@ -61,7 +61,7 @@ const String & CObject::GetTag() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CObject::SetTag(const StackStrF & tag)
|
||||
void CObject::SetTag(StackStrF & tag)
|
||||
{
|
||||
if (tag.mLen > 0)
|
||||
{
|
||||
@ -74,7 +74,7 @@ void CObject::SetTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CObject & CObject::ApplyTag(const StackStrF & tag)
|
||||
CObject & CObject::ApplyTag(StackStrF & tag)
|
||||
{
|
||||
SetTag(tag);
|
||||
return *this;
|
||||
|
@ -152,12 +152,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
void SetTag(const StackStrF & tag);
|
||||
void SetTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
CObject & ApplyTag(const StackStrF & tag);
|
||||
CObject & ApplyTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
|
@ -54,7 +54,7 @@ const String & CPickup::GetTag() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPickup::SetTag(const StackStrF & tag)
|
||||
void CPickup::SetTag(StackStrF & tag)
|
||||
{
|
||||
if (tag.mLen > 0)
|
||||
{
|
||||
@ -67,7 +67,7 @@ void CPickup::SetTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CPickup & CPickup::ApplyTag(const StackStrF & tag)
|
||||
CPickup & CPickup::ApplyTag(StackStrF & tag)
|
||||
{
|
||||
SetTag(tag);
|
||||
return *this;
|
||||
|
@ -136,12 +136,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
void SetTag(const StackStrF & tag);
|
||||
void SetTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
CPickup & ApplyTag(const StackStrF & tag);
|
||||
CPickup & ApplyTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
|
@ -84,7 +84,7 @@ const String & CPlayer::GetTag() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::SetTag(const StackStrF & tag)
|
||||
void CPlayer::SetTag(StackStrF & tag)
|
||||
{
|
||||
if (tag.mLen > 0)
|
||||
{
|
||||
@ -97,7 +97,7 @@ void CPlayer::SetTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CPlayer & CPlayer::ApplyTag(const StackStrF & tag)
|
||||
CPlayer & CPlayer::ApplyTag(StackStrF & tag)
|
||||
{
|
||||
SetTag(tag);
|
||||
return *this;
|
||||
@ -314,7 +314,7 @@ CSStr CPlayer::GetName() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::SetName(const StackStrF & name) const
|
||||
void CPlayer::SetName(StackStrF & name) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1378,8 +1378,8 @@ void CPlayer::Unspectate() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::Redirect(const StackStrF & ip, Uint32 port, const StackStrF & nick,
|
||||
const StackStrF & server_pass, const StackStrF & user_pass)
|
||||
void CPlayer::Redirect(StackStrF & ip, Uint32 port, StackStrF & nick,
|
||||
StackStrF & server_pass, StackStrF & user_pass)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1565,7 +1565,7 @@ const String & CPlayer::GetMessagePrefix(Uint32 index) const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::SetMessagePrefix(Uint32 index, const StackStrF & prefix)
|
||||
void CPlayer::SetMessagePrefix(Uint32 index, StackStrF & prefix)
|
||||
{
|
||||
// Perform a range check on the specified prefix index
|
||||
if (index >= SQMOD_PLAYER_MSG_PREFIXES)
|
||||
@ -1742,7 +1742,7 @@ void CPlayer::StreamFloat(SQFloat val)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::StreamString(const StackStrF & val)
|
||||
void CPlayer::StreamString(StackStrF & val)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1756,7 +1756,7 @@ void CPlayer::StreamString(const StackStrF & val)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::StreamRawString(const StackStrF & val)
|
||||
void CPlayer::StreamRawString(StackStrF & val)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
|
@ -203,12 +203,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
void SetTag(const StackStrF & tag);
|
||||
void SetTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
CPlayer & ApplyTag(const StackStrF & tag);
|
||||
CPlayer & ApplyTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
@ -298,7 +298,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the nick name of the managed player entity.
|
||||
*/
|
||||
void SetName(const StackStrF & name) const;
|
||||
void SetName(StackStrF & name) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the current state of the managed player entity.
|
||||
@ -743,8 +743,8 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Redirect the managed player entity to the specified server.
|
||||
*/
|
||||
void Redirect(const StackStrF & ip, Uint32 port, const StackStrF & nick,
|
||||
const StackStrF & server_pass, const StackStrF & user_pass);
|
||||
void Redirect(StackStrF & ip, Uint32 port, StackStrF & nick,
|
||||
StackStrF & server_pass, StackStrF & user_pass);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Request a list of the modules loaded into the client session.
|
||||
@ -814,7 +814,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the message prefix at the specified index for the managed player entity.
|
||||
*/
|
||||
void SetMessagePrefix(Uint32 index, const StackStrF & prefix);
|
||||
void SetMessagePrefix(Uint32 index, StackStrF & prefix);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the amount of tracked position changes for the managed player entity.
|
||||
@ -909,12 +909,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Write a string to the stream buffer.
|
||||
*/
|
||||
void StreamString(const StackStrF & val);
|
||||
void StreamString(StackStrF & val);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Write a raw string to the stream buffer.
|
||||
*/
|
||||
void StreamRawString(const StackStrF & val);
|
||||
void StreamRawString(StackStrF & val);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Send the data in the stream buffer to the client.
|
||||
|
@ -57,7 +57,7 @@ const String & CVehicle::GetTag() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CVehicle::SetTag(const StackStrF & tag)
|
||||
void CVehicle::SetTag(StackStrF & tag)
|
||||
{
|
||||
if (tag.mLen > 0)
|
||||
{
|
||||
@ -70,7 +70,7 @@ void CVehicle::SetTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CVehicle & CVehicle::ApplyTag(const StackStrF & tag)
|
||||
CVehicle & CVehicle::ApplyTag(StackStrF & tag)
|
||||
{
|
||||
SetTag(tag);
|
||||
return *this;
|
||||
|
@ -139,12 +139,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
void SetTag(const StackStrF & tag);
|
||||
void SetTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
CVehicle & ApplyTag(const StackStrF & tag);
|
||||
CVehicle & ApplyTag(StackStrF & tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
|
@ -16,7 +16,7 @@
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static LightObj SqLeftStr(SQChar f, Uint32 w, const StackStrF & s)
|
||||
static LightObj SqLeftStr(SQChar f, Uint32 w, StackStrF & s)
|
||||
{
|
||||
// Is the specified width valid?
|
||||
if (!w)
|
||||
@ -46,7 +46,7 @@ static LightObj SqLeftStr(SQChar f, Uint32 w, const StackStrF & s)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static LightObj SqLeftOffsetStr(SQChar f, Uint32 w, Uint32 o, const StackStrF & s)
|
||||
static LightObj SqLeftOffsetStr(SQChar f, Uint32 w, Uint32 o, StackStrF & s)
|
||||
{
|
||||
// Is the specified width valid?
|
||||
if (!w)
|
||||
@ -90,7 +90,7 @@ static LightObj SqLeftOffsetStr(SQChar f, Uint32 w, Uint32 o, const StackStrF &
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static LightObj SqRightStr(SQChar f, Uint32 w, const StackStrF & s)
|
||||
static LightObj SqRightStr(SQChar f, Uint32 w, StackStrF & s)
|
||||
{
|
||||
// Is the specified width valid?
|
||||
if (!w)
|
||||
@ -129,7 +129,7 @@ static LightObj SqRightStr(SQChar f, Uint32 w, const StackStrF & s)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static LightObj SqRightOffsetStr(SQChar f, Uint32 w, Uint32 o, const StackStrF & s)
|
||||
static LightObj SqRightOffsetStr(SQChar f, Uint32 w, Uint32 o, StackStrF & s)
|
||||
{
|
||||
// Is the specified width valid?
|
||||
if (!w)
|
||||
@ -173,7 +173,7 @@ static LightObj SqRightOffsetStr(SQChar f, Uint32 w, Uint32 o, const StackStrF &
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static LightObj SqCenterStr(SQChar f, Uint32 w, const StackStrF & s)
|
||||
static LightObj SqCenterStr(SQChar f, Uint32 w, StackStrF & s)
|
||||
{
|
||||
// Is the specified width valid?
|
||||
if (!w)
|
||||
@ -261,7 +261,7 @@ CSStr StrJustAlphaNum(CSStr str)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static LightObj SqJustAlphaNum(const StackStrF & s)
|
||||
static LightObj SqJustAlphaNum(StackStrF & s)
|
||||
{
|
||||
const Buffer b(StrJustAlphaNumImpl(s.mPtr, s.mLen));
|
||||
// Obtain the initial stack size
|
||||
@ -323,7 +323,7 @@ CSStr StrToLowercase(CSStr str)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static LightObj SqToLowercase(const StackStrF & s)
|
||||
static LightObj SqToLowercase(StackStrF & s)
|
||||
{
|
||||
const Buffer b(StrToLowercaseImpl(s.mPtr, s.mLen));
|
||||
// Obtain the initial stack size
|
||||
@ -385,7 +385,7 @@ CSStr StrToUppercase(CSStr str)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static LightObj SqToUppercase(const StackStrF & s)
|
||||
static LightObj SqToUppercase(StackStrF & s)
|
||||
{
|
||||
const Buffer b(StrToUppercaseImpl(s.mPtr, s.mLen));
|
||||
// Obtain the initial stack size
|
||||
@ -399,7 +399,7 @@ static LightObj SqToUppercase(const StackStrF & s)
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Checks if all the characters in the specified string are of the specified class or not.
|
||||
*/
|
||||
template < int (*Fn)(int) > static bool SqAllChars(const StackStrF & s)
|
||||
template < int (*Fn)(int) > static bool SqAllChars(StackStrF & s)
|
||||
{
|
||||
// See if we actually have something to search for
|
||||
if (!s.mLen)
|
||||
@ -424,7 +424,7 @@ template < int (*Fn)(int) > static bool SqAllChars(const StackStrF & s)
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Find the position of the first character that matches the specified class.
|
||||
*/
|
||||
template < int (*Fn)(int), bool Neg > static LightObj SqFirstChar(const StackStrF & s)
|
||||
template < int (*Fn)(int), bool Neg > static LightObj SqFirstChar(StackStrF & s)
|
||||
{
|
||||
// See if we actually have something to search for
|
||||
if (s.mLen)
|
||||
@ -452,7 +452,7 @@ template < int (*Fn)(int), bool Neg > static LightObj SqFirstChar(const StackStr
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Find the position of the last character that matches the specified class.
|
||||
*/
|
||||
template < int (*Fn)(int), bool Neg > static LightObj SqLastChar(const StackStrF & s)
|
||||
template < int (*Fn)(int), bool Neg > static LightObj SqLastChar(StackStrF & s)
|
||||
{
|
||||
// See if we actually have something to search for
|
||||
if (s.mLen)
|
||||
|
@ -6,6 +6,11 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <cstdio>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#ifdef SQMOD_OS_WINDOWS
|
||||
#include <Winsock2.h>
|
||||
#endif // SQMOD_OS_WINDOWS
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
|
@ -421,14 +421,14 @@ void Register_Areas(HSQUIRRELVM vm)
|
||||
Class< Area >(vm, AreaTypename::Str)
|
||||
// Constructors
|
||||
.Ctor()
|
||||
.Ctor< const StackStrF & >()
|
||||
.Ctor< SQInteger, const StackStrF & >()
|
||||
.Ctor< StackStrF & >()
|
||||
.Ctor< SQInteger, StackStrF & >()
|
||||
.Ctor< const Vector2 &, const Vector2 &, const Vector2 & >()
|
||||
.Ctor< const Vector2 &, const Vector2 &, const Vector2 &, const StackStrF & >()
|
||||
.Ctor< const Vector2 &, const Vector2 &, const Vector2 &, SQInteger, const StackStrF & >()
|
||||
.Ctor< const Vector2 &, const Vector2 &, const Vector2 &, StackStrF & >()
|
||||
.Ctor< const Vector2 &, const Vector2 &, const Vector2 &, SQInteger, StackStrF & >()
|
||||
.Ctor< float, float, float, float, float, float >()
|
||||
.Ctor< float, float, float, float, float, float, const StackStrF & >()
|
||||
.Ctor< float, float, float, float, float, float, SQInteger, const StackStrF & >()
|
||||
.Ctor< float, float, float, float, float, float, StackStrF & >()
|
||||
.Ctor< float, float, float, float, float, float, SQInteger, StackStrF & >()
|
||||
// Meta-methods
|
||||
.SquirrelFunc(_SC("_typename"), &AreaTypename::Fn)
|
||||
.Func(_SC("_tostring"), &Area::ToString)
|
||||
|
@ -74,7 +74,7 @@ struct Area
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Named constructor.
|
||||
*/
|
||||
Area(const StackStrF & name)
|
||||
Area(StackStrF & name)
|
||||
: Area(16, name)
|
||||
{
|
||||
//...
|
||||
@ -82,7 +82,7 @@ struct Area
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Default constructor.
|
||||
*/
|
||||
Area(SQInteger sz, const StackStrF & name)
|
||||
Area(SQInteger sz, StackStrF & name)
|
||||
: mL(DEF_L), mB(DEF_B), mR(DEF_R), mT(DEF_T), mPoints(), mID(0), mCells()
|
||||
, mName(name.mPtr, name.mLen <= 0 ? 0 : name.mLen)
|
||||
|
||||
@ -97,7 +97,7 @@ struct Area
|
||||
* Vector2 constructor.
|
||||
*/
|
||||
Area(const Vector2 & a, const Vector2 & b, const Vector2 & c)
|
||||
: Area(a.x, a.y, b.x, b.y, c.x, c.y, 16, StackStrF())
|
||||
: Area(a.x, a.y, b.x, b.y, c.x, c.y, 16, StackStrF::Dummy())
|
||||
{
|
||||
//...
|
||||
}
|
||||
@ -105,7 +105,7 @@ struct Area
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Vector2 constructor with name.
|
||||
*/
|
||||
Area(const Vector2 & a, const Vector2 & b, const Vector2 & c, const StackStrF & name)
|
||||
Area(const Vector2 & a, const Vector2 & b, const Vector2 & c, StackStrF & name)
|
||||
: Area(a.x, a.y, b.x, b.y, c.x, c.y, 16, name)
|
||||
{
|
||||
//...
|
||||
@ -114,7 +114,7 @@ struct Area
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Vector2 constructor with name and memory to reserve.
|
||||
*/
|
||||
Area(const Vector2 & a, const Vector2 & b, const Vector2 & c, SQInteger sz, const StackStrF & name)
|
||||
Area(const Vector2 & a, const Vector2 & b, const Vector2 & c, SQInteger sz, StackStrF & name)
|
||||
: Area(a.x, a.y, b.x, b.y, c.x, c.y, sz, name)
|
||||
{
|
||||
//...
|
||||
@ -124,7 +124,7 @@ struct Area
|
||||
* Extended constructor.
|
||||
*/
|
||||
Area(float ax, float ay, float bx, float by, float cx, float cy)
|
||||
: Area(ax, ay, bx, by, cx, cy, 16, StackStrF())
|
||||
: Area(ax, ay, bx, by, cx, cy, 16, StackStrF::Dummy())
|
||||
{
|
||||
//...
|
||||
}
|
||||
@ -132,7 +132,7 @@ struct Area
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Extended constructor with name.
|
||||
*/
|
||||
Area(float ax, float ay, float bx, float by, float cx, float cy, const StackStrF & name)
|
||||
Area(float ax, float ay, float bx, float by, float cx, float cy, StackStrF & name)
|
||||
: Area(ax, ay, bx, by, cx, cy, 16, name)
|
||||
{
|
||||
//...
|
||||
@ -141,7 +141,7 @@ struct Area
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Base constructor.
|
||||
*/
|
||||
Area(float ax, float ay, float bx, float by, float cx, float cy, SQInteger sz, const StackStrF & name)
|
||||
Area(float ax, float ay, float bx, float by, float cx, float cy, SQInteger sz, StackStrF & name)
|
||||
: mL(DEF_L), mB(DEF_B), mR(DEF_R), mT(DEF_T), mPoints(), mID(0), mCells()
|
||||
, mName(name.mPtr, name.mLen <= 0 ? 0 : name.mLen)
|
||||
{
|
||||
@ -219,7 +219,7 @@ struct Area
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the name of this area.
|
||||
*/
|
||||
void SetName(const StackStrF & name)
|
||||
void SetName(StackStrF & name)
|
||||
{
|
||||
if (name.mLen <= 0)
|
||||
{
|
||||
@ -235,7 +235,7 @@ struct Area
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the name of this area. (allows chaining function calls)
|
||||
*/
|
||||
Area & ApplyName(const StackStrF & name)
|
||||
Area & ApplyName(StackStrF & name)
|
||||
{
|
||||
SetName(name);
|
||||
return *this;
|
||||
|
@ -108,7 +108,7 @@ CSStr GetKeyCodeName(Uint8 keycode)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetKeyCodeName(Uint8 keycode, const StackStrF & name)
|
||||
void SetKeyCodeName(Uint8 keycode, StackStrF & name)
|
||||
{
|
||||
CS_Keycode_Names[keycode].assign(name.mPtr);
|
||||
}
|
||||
@ -162,13 +162,13 @@ Table GetPluginInfo(Int32 plugin_id)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 FindPlugin(const StackStrF & name)
|
||||
Int32 FindPlugin(StackStrF & name)
|
||||
{
|
||||
return _Func->FindPlugin(name.mPtr);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SendPluginCommand(Uint32 identifier, const StackStrF & payload)
|
||||
void SendPluginCommand(Uint32 identifier, StackStrF & payload)
|
||||
{
|
||||
_Func->SendPluginCommand(identifier, payload.mPtr);
|
||||
}
|
||||
@ -180,7 +180,7 @@ const ULongInt & GetTime()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SendLogMessage(const StackStrF & msg)
|
||||
void SendLogMessage(StackStrF & msg)
|
||||
{
|
||||
if (_Func->LogMessage("%s", msg.mPtr) == vcmpErrorTooLargeInput)
|
||||
{
|
||||
@ -276,7 +276,7 @@ CSStr GetServerName()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetServerName(const StackStrF & name)
|
||||
void SetServerName(StackStrF & name)
|
||||
{
|
||||
_Func->SetServerName(name.mPtr);
|
||||
}
|
||||
@ -303,7 +303,7 @@ CSStr GetServerPassword()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetServerPassword(const StackStrF & passwd)
|
||||
void SetServerPassword(StackStrF & passwd)
|
||||
{
|
||||
_Func->SetServerPassword(passwd.mPtr);
|
||||
}
|
||||
@ -330,13 +330,13 @@ CSStr GetGameModeText()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetGameModeText(const StackStrF & text)
|
||||
void SetGameModeText(StackStrF & text)
|
||||
{
|
||||
_Func->SetGameModeText(text.mPtr);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CreateRadioStream(bool listed, const StackStrF & name, const StackStrF & url)
|
||||
void CreateRadioStream(bool listed, StackStrF & name, StackStrF & url)
|
||||
{
|
||||
if (_Func->AddRadioStream(-1, name.mPtr, url.mPtr, listed) == vcmpErrorArgumentOutOfBounds)
|
||||
{
|
||||
@ -345,7 +345,7 @@ void CreateRadioStream(bool listed, const StackStrF & name, const StackStrF & ur
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, const StackStrF & url)
|
||||
void CreateRadioStreamEx(Int32 id, bool listed, StackStrF & name, StackStrF & url)
|
||||
{
|
||||
if (_Func->AddRadioStream(id, name.mPtr, url.mPtr, listed) == vcmpErrorArgumentOutOfBounds)
|
||||
{
|
||||
@ -774,25 +774,25 @@ void SetSpawnCameraLookAtEx(Float32 x, Float32 y, Float32 z)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void BanIP(const StackStrF & addr)
|
||||
void BanIP(StackStrF & addr)
|
||||
{
|
||||
_Func->BanIP(const_cast< SStr >(addr.mPtr));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool UnbanIP(const StackStrF & addr)
|
||||
bool UnbanIP(StackStrF & addr)
|
||||
{
|
||||
return _Func->UnbanIP(const_cast< SStr >(addr.mPtr));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool IsIPBanned(const StackStrF & addr)
|
||||
bool IsIPBanned(StackStrF & addr)
|
||||
{
|
||||
return _Func->IsIPBanned(const_cast< SStr >(addr.mPtr));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetPlayerIdFromName(const StackStrF & name)
|
||||
Int32 GetPlayerIdFromName(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, const StackStrF & name);
|
||||
void SetKeyCodeName(Uint8 keycode, 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(const StackStrF & name);
|
||||
Int32 FindPlugin(StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Send a custom command to the loaded plug-ins.
|
||||
*/
|
||||
void SendPluginCommand(Uint32 identifier, const StackStrF & payload);
|
||||
void SendPluginCommand(Uint32 identifier, StackStrF & payload);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the server time.
|
||||
@ -55,7 +55,7 @@ const ULongInt & GetTime();
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Send a log message to the server.
|
||||
*/
|
||||
void SendLogMessage(const StackStrF & msg);
|
||||
void SendLogMessage(StackStrF & msg);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the last error that occurred on the server.
|
||||
@ -115,7 +115,7 @@ CSStr GetServerName();
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the server name.
|
||||
*/
|
||||
void SetServerName(const StackStrF & name);
|
||||
void SetServerName(StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the server password.
|
||||
@ -125,7 +125,7 @@ CSStr GetServerPassword();
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the server password.
|
||||
*/
|
||||
void SetServerPassword(const StackStrF & passwd);
|
||||
void SetServerPassword(StackStrF & passwd);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the game-mode text.
|
||||
@ -135,17 +135,17 @@ CSStr GetGameModeText();
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the game-mode text.
|
||||
*/
|
||||
void SetGameModeText(const StackStrF & text);
|
||||
void SetGameModeText(StackStrF & text);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Create a radio stream.
|
||||
*/
|
||||
void CreateRadioStream(bool listed, const StackStrF & name, const StackStrF & url);
|
||||
void CreateRadioStream(bool listed, StackStrF & name, StackStrF & url);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Create a radio stream.
|
||||
*/
|
||||
void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, const StackStrF & url);
|
||||
void CreateRadioStreamEx(Int32 id, bool listed, StackStrF & name, StackStrF & url);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Remove a radio stream.
|
||||
@ -427,22 +427,22 @@ void SetSpawnCameraLookAtEx(Float32 x, Float32 y, Float32 z);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Ban an IP address from the server.
|
||||
*/
|
||||
void BanIP(const StackStrF & addr);
|
||||
void BanIP(StackStrF & addr);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Unban an IP address from the server.
|
||||
*/
|
||||
bool UnbanIP(const StackStrF & addr);
|
||||
bool UnbanIP(StackStrF & addr);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See if an IP address is banned from the server.
|
||||
*/
|
||||
bool IsIPBanned(const StackStrF & addr);
|
||||
bool IsIPBanned(StackStrF & addr);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier of the player with the specified name.
|
||||
*/
|
||||
Int32 GetPlayerIdFromName(const StackStrF & name);
|
||||
Int32 GetPlayerIdFromName(StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See if a player with the specified identifier is connected.
|
||||
|
@ -16,7 +16,7 @@ CSStr GetModelName(Int32 /*id*/)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetModelName(Int32 /*id*/, const StackStrF & /*name*/)
|
||||
void SetModelName(Int32 /*id*/, StackStrF & /*name*/)
|
||||
{
|
||||
// @TODO Implement...
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ CSStr GetModelName(Int32 id);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the name associated with a model identifier.
|
||||
*/
|
||||
void SetModelName(Int32 id, const StackStrF & name);
|
||||
void SetModelName(Int32 id, 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, const StackStrF & name)
|
||||
void SetSkinName(Uint32 id, StackStrF & name)
|
||||
{
|
||||
if (id <= 159)
|
||||
{
|
||||
@ -111,7 +111,7 @@ void SetSkinName(Uint32 id, const StackStrF & name)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetSkinID(const StackStrF & name)
|
||||
Int32 GetSkinID(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, const StackStrF & name);
|
||||
void SetSkinName(Uint32 id, StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Convert a vehicle model name to a skin model identifier.
|
||||
*/
|
||||
Int32 GetSkinID(const StackStrF & name);
|
||||
Int32 GetSkinID(StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified skin model identifier is valid.
|
||||
|
@ -232,7 +232,7 @@ SQInteger Routine::Create(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Routine::IsWithTag(const StackStrF & tag)
|
||||
bool Routine::IsWithTag(StackStrF & tag)
|
||||
{
|
||||
// Is the specified tag valid?
|
||||
if (tag.mPtr != nullptr)
|
||||
|
@ -285,7 +285,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the number of used routine slots.
|
||||
*/
|
||||
static const LightObj & FindByTag(const StackStrF & tag)
|
||||
static const LightObj & FindByTag(StackStrF & tag)
|
||||
{
|
||||
// Is the specified tag valid?
|
||||
if (!tag.mPtr)
|
||||
@ -308,7 +308,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Check if a routine with a certain tag exists.
|
||||
*/
|
||||
static bool IsWithTag(const StackStrF & tag);
|
||||
static bool IsWithTag(StackStrF & tag);
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Process all active routines and update elapsed time.
|
||||
*/
|
||||
@ -384,7 +384,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
void SetTag(const StackStrF & tag)
|
||||
void SetTag(StackStrF & tag)
|
||||
{
|
||||
GetValid().mTag.assign(tag.mPtr, ClampMin(tag.mLen, 0));
|
||||
}
|
||||
|
@ -1528,7 +1528,7 @@ LightObj Signal::CreateFree()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
LightObj Signal::Create(const StackStrF & name)
|
||||
LightObj Signal::Create(StackStrF & name)
|
||||
{
|
||||
// Validate the signal name
|
||||
if (name.mLen <= 0)
|
||||
@ -1564,7 +1564,7 @@ LightObj Signal::Create(const StackStrF & name)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void Signal::Remove(const StackStrF & name)
|
||||
void Signal::Remove(StackStrF & name)
|
||||
{
|
||||
// Validate the signal name
|
||||
if (name.mLen <= 0)
|
||||
@ -1598,7 +1598,7 @@ void Signal::Remove(const StackStrF & name)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const LightObj & Signal::Fetch(const StackStrF & name)
|
||||
const LightObj & Signal::Fetch(StackStrF & name)
|
||||
{
|
||||
// Validate the signal name
|
||||
if (name.mLen <= 0)
|
||||
|
@ -706,17 +706,17 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a new signal with the specified name.
|
||||
*/
|
||||
static LightObj Create(const StackStrF & name);
|
||||
static LightObj Create(StackStrF & name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Remove the signal with the specified name.
|
||||
*/
|
||||
static void Remove(const StackStrF & name);
|
||||
static void Remove(StackStrF & name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the signal with the specified name.
|
||||
*/
|
||||
static const LightObj & Fetch(const StackStrF & name);
|
||||
static const LightObj & Fetch(StackStrF & name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Emit a signal from the module.
|
||||
|
@ -451,7 +451,7 @@ SQInteger Tasks::Exists(Int32 id, Int32 type, HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const Tasks::Task & Tasks::FindByTag(Int32 id, Int32 type, const StackStrF & tag)
|
||||
const Tasks::Task & Tasks::FindByTag(Int32 id, Int32 type, StackStrF & tag)
|
||||
{
|
||||
// Attempt to find the requested task
|
||||
for (const auto & t : s_Tasks)
|
||||
|
@ -148,7 +148,7 @@ private:
|
||||
/* ----------------------------------------------------------------------------------------
|
||||
* Modify the associated user tag.
|
||||
*/
|
||||
void SetTag(const StackStrF & tag)
|
||||
void SetTag(StackStrF & tag)
|
||||
{
|
||||
mTag.assign(tag.mPtr, ClampMin(tag.mLen, 0));
|
||||
}
|
||||
@ -358,7 +358,7 @@ protected:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Cleanup all tasks associated with the specified entity.
|
||||
*/
|
||||
static const Task & FindByTag(Int32 id, Int32 type, const StackStrF & tag);
|
||||
static const Task & FindByTag(Int32 id, Int32 type, StackStrF & tag);
|
||||
|
||||
public:
|
||||
|
||||
|
@ -102,7 +102,7 @@ String GetAutomobileName(Uint32 id)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetAutomobileName(Uint32 id, const StackStrF & name)
|
||||
void SetAutomobileName(Uint32 id, StackStrF & name)
|
||||
{
|
||||
if (id > 129 && id < 237)
|
||||
{
|
||||
@ -119,7 +119,7 @@ void SetAutomobileName(Uint32 id, const StackStrF & name)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetAutomobileID(const StackStrF & name)
|
||||
Int32 GetAutomobileID(StackStrF & name)
|
||||
{
|
||||
// Clone the string into an editable version
|
||||
String str(name.mPtr, name.mLen);
|
||||
|
@ -15,12 +15,12 @@ String GetAutomobileName(Uint32 id);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the name associated with a vehicle model identifier.
|
||||
*/
|
||||
void SetAutomobileName(Uint32 id, const StackStrF & name);
|
||||
void SetAutomobileName(Uint32 id, StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Convert a vehicle model name to a vehicle model identifier.
|
||||
*/
|
||||
Int32 GetAutomobileID(const StackStrF & name);
|
||||
Int32 GetAutomobileID(StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified vehicle model identifier is valid.
|
||||
|
@ -81,7 +81,7 @@ CCStr GetWeaponName(Uint32 id)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWeaponName(Uint32 id, const StackStrF & name)
|
||||
void SetWeaponName(Uint32 id, StackStrF & name)
|
||||
{
|
||||
// Can we consider this a custom weapon ID?
|
||||
if (IsCustomWeapon(id))
|
||||
@ -109,7 +109,7 @@ void ClearCustomWeaponNamePool()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetWeaponID(const StackStrF & name)
|
||||
Int32 GetWeaponID(StackStrF & name)
|
||||
{
|
||||
// Clone the string into an editable version
|
||||
String str(name.mPtr, name.mLen);
|
||||
|
@ -15,7 +15,7 @@ CSStr GetWeaponName(Uint32 id);
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the name associated with a weapon identifier.
|
||||
*/
|
||||
void SetWeaponName(Uint32 id, const StackStrF & name);
|
||||
void SetWeaponName(Uint32 id, StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Retrieve the total number of identifiers in the pool of custom weapon names.
|
||||
@ -30,12 +30,12 @@ void ClearCustomWeaponNamePool();
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Modify the name associated with a weapon identifier.
|
||||
*/
|
||||
void SetWeaponName(Uint32 id, const StackStrF & name);
|
||||
void SetWeaponName(Uint32 id, StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Convert a weapon name to a weapon identifier.
|
||||
*/
|
||||
Int32 GetWeaponID(const StackStrF & name);
|
||||
Int32 GetWeaponID(StackStrF & name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified weapon identifier is valid.
|
||||
|
Loading…
Reference in New Issue
Block a user