mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Actually expose network statistics functions.
Include an int version just inc ase a 32 bit float would overflow.
This commit is contained in:
parent
413bf546b6
commit
8ad6a0f500
@ -402,12 +402,25 @@ void CPlayer::SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj &
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Float64 CPlayer::GetNetworkStatistics(Int32 option_id) const
|
SQFloat CPlayer::GetNetworkStatisticsF(Int32 option_id) const
|
||||||
{
|
{
|
||||||
// Validate the managed identifier
|
// Validate the managed identifier
|
||||||
Validate();
|
Validate();
|
||||||
// Return the requested information
|
// Retrieve the requested information
|
||||||
return _Func->GetNetworkStatistics(m_ID, static_cast< vcmpNetworkStatisticsOption >(option_id));
|
double value = _Func->GetNetworkStatistics(m_ID, static_cast< vcmpNetworkStatisticsOption >(option_id));
|
||||||
|
// Return it in the proper type
|
||||||
|
return static_cast< SQFloat >(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
SQInteger CPlayer::GetNetworkStatisticsI(Int32 option_id) const
|
||||||
|
{
|
||||||
|
// Validate the managed identifier
|
||||||
|
Validate();
|
||||||
|
// Retrieve the requested information
|
||||||
|
double value = _Func->GetNetworkStatistics(m_ID, static_cast< vcmpNetworkStatisticsOption >(option_id));
|
||||||
|
// Return it in the proper type
|
||||||
|
return static_cast< SQInteger >(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -2811,6 +2824,8 @@ void Register_CPlayer(HSQUIRRELVM vm)
|
|||||||
.Func(_SC("GetOption"), &CPlayer::GetOption)
|
.Func(_SC("GetOption"), &CPlayer::GetOption)
|
||||||
.Func(_SC("SetOption"), &CPlayer::SetOption)
|
.Func(_SC("SetOption"), &CPlayer::SetOption)
|
||||||
.Func(_SC("SetOptionEx"), &CPlayer::SetOptionEx)
|
.Func(_SC("SetOptionEx"), &CPlayer::SetOptionEx)
|
||||||
|
.Func(_SC("GetNetworkStatisticsF"), &CPlayer::GetNetworkStatisticsF)
|
||||||
|
.Func(_SC("GetNetworkStatisticsI"), &CPlayer::GetNetworkStatisticsI)
|
||||||
.Func(_SC("WorldCompatible"), &CPlayer::IsWorldCompatible)
|
.Func(_SC("WorldCompatible"), &CPlayer::IsWorldCompatible)
|
||||||
.Func(_SC("SetColor"), &CPlayer::SetColorEx)
|
.Func(_SC("SetColor"), &CPlayer::SetColorEx)
|
||||||
.Func(_SC("SetColour"), &CPlayer::SetColorEx)
|
.Func(_SC("SetColour"), &CPlayer::SetColorEx)
|
||||||
|
@ -328,7 +328,12 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Retrieve network statistics related to the managed player entity.
|
* Retrieve network statistics related to the managed player entity.
|
||||||
*/
|
*/
|
||||||
Float64 GetNetworkStatistics(Int32 option_id) const;
|
SQFloat GetNetworkStatisticsF(Int32 option_id) const;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve network statistics related to the managed player entity.
|
||||||
|
*/
|
||||||
|
SQInteger GetNetworkStatisticsI(Int32 option_id) const;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Retrieve the world in which the managed player entity exists.
|
* Retrieve the world in which the managed player entity exists.
|
||||||
|
Loading…
Reference in New Issue
Block a user