| 1949 | } |
| 1950 | |
| 1951 | static void ProcessPlayerLeftPluginHooks(uint8_t playerId) |
| 1952 | { |
| 1953 | #ifdef ENABLE_SCRIPTING |
| 1954 | using namespace OpenRCT2::Scripting; |
| 1955 | |
| 1956 | auto& hookEngine = GetContext()->GetScriptEngine().GetHookEngine(); |
| 1957 | if (hookEngine.HasSubscriptions(HookType::networkLeave)) |
| 1958 | { |
| 1959 | auto ctx = GetContext()->GetScriptEngine().GetContext(); |
| 1960 | |
| 1961 | // Create event args object |
| 1962 | JSValue obj = JS_NewObject(ctx); |
| 1963 | JS_SetPropertyStr(ctx, obj, "player", JS_NewInt32(ctx, playerId)); |
| 1964 | |
| 1965 | // Call the subscriptions |
| 1966 | hookEngine.Call(HookType::networkLeave, obj, false); |
| 1967 | } |
| 1968 | #endif |
| 1969 | } |
| 1970 | |
| 1971 | void NetworkBase::ProcessPlayerList() |
| 1972 | { |
no test coverage detected