| 1929 | } |
| 1930 | |
| 1931 | static void ProcessPlayerJoinedPluginHooks(uint8_t playerId) |
| 1932 | { |
| 1933 | #ifdef ENABLE_SCRIPTING |
| 1934 | using namespace OpenRCT2::Scripting; |
| 1935 | |
| 1936 | auto& hookEngine = GetContext()->GetScriptEngine().GetHookEngine(); |
| 1937 | if (hookEngine.HasSubscriptions(HookType::networkJoin)) |
| 1938 | { |
| 1939 | auto ctx = GetContext()->GetScriptEngine().GetContext(); |
| 1940 | |
| 1941 | // Create event args object |
| 1942 | JSValue obj = JS_NewObject(ctx); |
| 1943 | JS_SetPropertyStr(ctx, obj, "player", JS_NewInt32(ctx, playerId)); |
| 1944 | |
| 1945 | // Call the subscriptions |
| 1946 | hookEngine.Call(HookType::networkJoin, obj, false); |
| 1947 | } |
| 1948 | #endif |
| 1949 | } |
| 1950 | |
| 1951 | static void ProcessPlayerLeftPluginHooks(uint8_t playerId) |
| 1952 | { |
no test coverage detected