MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ping_get

Method ping_get

src/openrct2/scripting/bindings/network/ScPlayer.cpp:74–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 }
73
74 JSValue ScPlayer::ping_get(JSContext* ctx, JSValue thisVal)
75 {
76 #ifndef DISABLE_NETWORK
77 auto index = Network::GetPlayerIndex(GetPlayerId(thisVal));
78 if (index == -1)
79 return JS_NewInt32(ctx, {});
80 return JS_NewInt32(ctx, Network::GetPlayerPing(index));
81 #else
82 return JS_NewInt32(ctx, 0);
83 #endif
84 }
85
86 JSValue ScPlayer::commandsRan_get(JSContext* ctx, JSValue thisVal)
87 {

Callers

nothing calls this directly

Calls 2

GetPlayerIndexFunction · 0.85
GetPlayerPingFunction · 0.85

Tested by

no test coverage detected