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

Function ProcessPlayerJoinedPluginHooks

src/openrct2/network/NetworkBase.cpp:1931–1949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 2

ProcessPlayerListMethod · 0.85
ServerClientJoinedMethod · 0.85

Calls 4

GetContextFunction · 0.85
HasSubscriptionsMethod · 0.80
CallMethod · 0.80
GetContextMethod · 0.45

Tested by

no test coverage detected