forked from mirror/openmw-tes3mp
Merge branch 'master' of https://github.com/TES3MP/openmw-tes3mp
This commit is contained in:
commit
4d053743a0
4 changed files with 18 additions and 3 deletions
|
@ -845,4 +845,9 @@ unsigned short Networking::NumberOfConnections() const
|
|||
unsigned int Networking::MaxConnections() const
|
||||
{
|
||||
return peer->GetMaximumIncomingConnections();
|
||||
}
|
||||
}
|
||||
|
||||
int Networking::GetAvgPing(RakNet::AddressOrGUID addr) const
|
||||
{
|
||||
return peer->GetAveragePing(addr);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ namespace mwmp
|
|||
|
||||
unsigned short NumberOfConnections() const;
|
||||
unsigned int MaxConnections() const;
|
||||
int GetAvgPing(RakNet::AddressOrGUID) const;
|
||||
|
||||
int MainLoop();
|
||||
|
||||
|
|
|
@ -130,4 +130,11 @@ const char *ScriptFunctions::GetProtocolVersion() noexcept
|
|||
{
|
||||
static string version = to_string(TES3MP_PROTO_VERSION);
|
||||
return version.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
int ScriptFunctions::GetAvgPing(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,-1);
|
||||
return mwmp::Networking::Get().GetAvgPing(player->guid);
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ public:
|
|||
static void Kick(unsigned short pid) noexcept;
|
||||
static const char *GetServerVersion() noexcept;
|
||||
static const char *GetProtocolVersion() noexcept;
|
||||
static int GetAvgPing(unsigned short pid) noexcept;
|
||||
|
||||
static constexpr ScriptFunctionData functions[]{
|
||||
{"CreateTimer", ScriptFunctions::CreateTimer},
|
||||
|
@ -80,7 +81,8 @@ public:
|
|||
{"SendMessage", ScriptFunctions::SendMessage},
|
||||
{"Kick", ScriptFunctions::Kick},
|
||||
{"GetServerVersion", ScriptFunctions::GetServerVersion},
|
||||
{"GetProtocolVersion", ScriptFunctions::GetProtocolVersion},
|
||||
{"GetProtocolVersion", ScriptFunctions::GetProtocolVersion},
|
||||
{"GetAvgPing", ScriptFunctions::GetAvgPing},
|
||||
|
||||
TRANSLOCATIONFUNCTIONS,
|
||||
STATSFUNCTIONS,
|
||||
|
|
Loading…
Reference in a new issue