| 39 | #endif |
| 40 | |
| 41 | bool 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 | } |
nothing calls this directly
no test coverage detected