MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Initialize

Method Initialize

Source/Engine/Online/Online.cpp:41–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39#endif
40
41bool Online::Initialize(IOnlinePlatform* platform)
42{
43 if (Platform == platform)
44 return false;
45 const auto object = ScriptingObject::FromInterface(platform, IOnlinePlatform::TypeInitializer);
46 LOG(Info, "Changing online platform to {0}", object ? object->ToString() : (platform ? TEXT("?") : TEXT("none")));
47
48 if (Platform)
49 {
50#if USE_EDITOR
51 Scripting::ScriptsReloading.Unbind(OnOnlineScriptsReloading);
52#endif
53 Platform->Deinitialize();
54 }
55 Platform = platform;
56 if (Platform)
57 {
58 if (Platform->Initialize())
59 {
60 Platform = nullptr;
61 LOG(Error, "Failed to initialize online platform.");
62 return true;
63 }
64#if USE_EDITOR
65 Scripting::ScriptsReloading.Bind(OnOnlineScriptsReloading);
66#endif
67 }
68
69 return false;
70}

Callers

nothing calls this directly

Calls 5

FromInterfaceFunction · 0.85
ToStringMethod · 0.45
UnbindMethod · 0.45
DeinitializeMethod · 0.45
BindMethod · 0.45

Tested by

no test coverage detected