02/25/2025 15:42:55

Switch guidelines (Switch MSDKV5 to MSDKPIX)

Warning

MSDKPIX depends on PixUI and PluginCrosCurl, so switching MSDKV5 to MSDKPIX requires access to PixUI and PluginCrosCurl.

MSDKPIX currently only supports domestic channels.

Unity

I. Obtain the entire GCloud package

Obtain the entire GCloud standard package and back up the MSDKConfig. ini configuration file in Android and iOS directories in the original project.

II. Update C# interfaces

To replace the C# interfaces in Assets/GCloudSDK/Scripts in the Unity project directory, you need to delete MSDKxxx and replace it with MSDKPIXxxx.

III. Android

  1. To replace the Android plugin in the Assets/Plugins/Android directory, you need to delete gcloudsdk-msdk-xxx, then replace it with gcloudsdk-msdkpix-xxx, and replace the MSDK resource file in the assets folder with the resource file in the entire package.
  1. Remove the MSDKV5 configuration from AndroidManifest.xml. Refer to the AndroidManifest.xml related configuration in the entire package.
  2. Update MainActivity.jar in the Assets/Plugins/Android directory. As for the jar package's source code, you can refer to the MainActivity.java file in the entire package. Recompile the jar package according to the GCloud guidelines

IV. IOS

  1. To replace the iOS packaging configuration in the Assets/GCloudSDK/Editor/Mods directory, you need to delete MSDKxxx and then replace it with MSDKPIXxxx.
  2. To replace the iOS plugin in the Assets/Plugins/iOS/GCloudSDK directory, you need to delete MSDKxxx and then replace it with `MSDKPIXxxx'.

V. Restore the configuration

Replace the backup MSDKConfig.ini file with its original file.

VI. MSDK initialization modification

Changes in the usage timing of MSDK interfaces:

MSDK initialization is changed from synchronization to asynchronization, and a registration interface is added for the callback sent after the completion of MSDK initialization:

Register MSDK initialization callback

1) Function description

To receive the callback sent after the completion of MSDK initialization, the game needs to register a callback function for processing. The game needs to wait for the callback to complete before it can start calling the functional interfaces of other MSDK modules.

2) Interface declaration
/// <summary>
//// MSDK initialization callback
/// </summary>
public static event OnMSDKRetEventHandler<MSDKBaseRet> InitRetEvent;
3) Demo code
MSDK.InitRetEvent += OnInitRetEvent;

private void OnInitRetEvent(MSDKBaseRet baseRet)
{
    Debug.Log ("OnInitRetEvent in MSDK");

    if (baseRet.retCode == MSDKError.SUCCESS) {
        Debug.Log ("MSDK is initialized successfully. ");
        // The MSDK interface can be invoked at this time
    } else {
        Debug.Log ("Failed to initialize MSDK.");
    }
}

UE

I. Obtain the entire GCloud package

Obtain the entire GCloud standard package and back up the MSDKConfig. ini configuration file in Android and iOS directories in the original project.

II. Replace UE plugin

To replace the Plugins/yourPluginPath/MSDKxxx plugin, you need to delete MSDKxxx and then replace it with MSDKPIXxxx in the entire package.

III. Android

Update GCloudCore_APL.xml file under yourPluginPath/GCloudCore/Source/GCloudCore. As for specific file configuration, you can refer to GCloudCore_APL.xml file in the entire package.

IV. Update UE Build.cs script

Update the dependent modules in yourProjectName.Build.cs and change MSDKxxx to MSDKPIXxxx.

V. Restore the configuration

Replace the backed up MSDKConfig.ini file with its original file.

VI. MSDK initialization modification

Changes in the usage timing of MSDK interfaces:

MSDK initialization is changed from synchronization to asynchronization, and a registration interface is added for the callback sent after the completion of MSDK initialization:

Register MSDK initialization callback

1) Function description

To receive the callback sent after the completion of MSDK initialization, the game needs to register a callback function for processing. The game needs to wait for the callback to complete before it can start calling the functional interfaces of other MSDK modules.

2) Interface declaration
class MSDK_EXPORT MSDKInitObserver
{

public:
    //Add a virtual destructor; otherwise, UE4 will report an error
    virtual ~MSDKInitObserver(){};

    // MSDK initialization callback
    virtual void OnInitCompleteNotify(const MSDKBaseRet &baseRet) {};
};
3) Demo code
MSDK::SetMSDKInitObserver(new MSDKDemoInitObserver());

class MSDKDemoInitObserver : public MSDKInitObserver
{
public:
    // MSDK initialization completion callback
    void OnInitCompleteNotify(const MSDKBaseRet &baseRet) 
    {
        if (baseRet.retCode == MSDKError::SUCCESS)
        {
            MSDKPIX_LOG_DEBUG("", "MSDK is initialized successfully. ");
            // MSDK interfaces can be invoked at this time
        } 
        else 
        {
            MSDKPIX_LOG_ERROR("", "Failed to initialize MSDK.");
        }
    }
};



Copyright © 2025 MSDK.
All rights reserved.

results matching ""

    No results matching ""