| 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 | { |
nothing calls this directly
no test coverage detected