Connecting MyGames Store🔗
MyGames Store is an additional behavior for existing MRGS modules. Therefore, it will be enough to set additional settings during the configuration and initialization of the MRGS SDK in order to change the behavior. On this page, only the main nuances of connection and use will be noted.
Module support🔗
Currently available in the Desktop version:
- Payments via MyGames Store (MRGSBank Module)
- MyGames Authorization (MRGSAuthentication Module)
- Notifications (local and push) (MRGSNotifications module)
- Acceptance of payments through the market.my.games site. More details see below
The issue in the GDPR is resolved on the side of the Game Center (hereinafter referred to as GC) MyGames, as well as MyGamesSupport.
MyTracker is only supported for mobile platforms.
To enable work with the MyGames Store need to set the MRGS_MYGAMES_STORE define, authorization and payments will not work without it.
Before start🔗
- Start the application on the site MRGS with the parameter "Platform" MyGames

- Before launching the application from the GC for the first time, you need to create a project on the MyGames Store website and upload your application assembly to it. Below is information on how to do this.
- Add to the created project on the site MRGS the MyGames AppID (GMRID) or SteamID (Id for steam emulation) (obtained when creating the project on the MyGames Store site at the step above) in the corresponding field, then MRGS will automatically upload all the necessary data (name, icon, etc.), validation keys, and fill in the missing fields.
- Turn on the option "Transmit data to 1link"
- If the data is not loaded automatically, enter the secret key in the "Payments and bonuses" tab to verify payments (in MyGames this is "Secret for Steam API emulation (Steam "key")")
- Add the URL of the game server on the tab "Additional features" to receive pingbacks about payments
Creating a project in MyGames Store🔗
When creating a project, MUST check the box I want to migrate my game from Steam 
Load assembly🔗
To download the distributive with the assembly of your project, follow the instructions
Assembly installation🔗
- Download Game Center (GC) from MyGames Store.
- Install it and log in using the account that is available in your team settings. Add your account (MyGames login) to the section "Betatesters" on the website MyGames Store

- Use the search to find your application in the GC. Install it and run.
Launching a game outside of the MyGames Game Center interface🔗
In the directory where the project is installed, go to the directory <Name of your project>_Data/Plugin/x86_64/. In this directory you can find the Fume.ini file which was created automatically during the first run. This file may come in handy if you do not want to upload a new build of your application to the GC every time. You can copy this file to the <Name of your project>_Data/Plugin/x86_64/ directory inside your build directory every time after a new build and then you won't have to upload the project to the GC.
Important
Payments will only work if you launched the game through the GC. Copying Fume.ini inside the assembly will not help. Those. when you are ready to test payments, you will need to upload a fresh build to the GC, then download it and run it.
User setup🔗
Use the SetUserID method to set the user as usual. But it is important to note that when you start from the GC and call this method, the installed user will be automatically linked to the internal_uid in the GC to link users of mobile applications and desktop in 1link, that is, you do not need to do anything else.
Payments🔗
Making test payments🔗
For test payments to work, when building a project, you must specify an additional #define MY_GAMES_TEST_PURCHASE. You can do this in the menu Unity -> Edit -> Project Settings -> Player, or using the method PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, "MY_GAMES_TEST_PURCHASE");

Attention!
This define must be removed in the release build, otherwise all payments will go as test ones.
Test map data can be obtained from the MyGames Developer Dashboard, under "General Properties -> Callback URL".
How payments work in MyGames Store🔗
To work with payments, you need to use the new Bank API, which was introduced in version v2.2.5 of Unity. Please read the documentation on the MRGS website. Payments on Desktop work according to the following scenario:
The user tries to buy a product, a payment form opens. He either pays or not (may pay later in the terminal, for example), we remember the orderId. After the payment form is closed, the mrgs client will call the OnReceivePendingPurchase method of the set delegate. This event means that the payment is in processing status. At this point, the game may remove the "wait cursor" and allow the user to play. The MRGS server periodically polls the MyGames server and finds out the status of the payment. When the status changes to "paid", the mrgs server goes to the game server and says that the payment has passed. In parallel (i.e., regardless of the server script), the MRCS client once a minute polls the MRCS server about the status of the payment. When the server says the payment has been paid, the mrgs client will call the OnReceiveSuccessfulPurchase method. In case of a payment error, the OnReceiveFailedPurchase method will be called. If within 24 hours the payment has not been made (this is how much time DMR (mail ru money) gives for payment), then the payment status changes to canceled and the mrcs client will inform the game client that the payment has been canceled by calling the OnReceiveCancelledPurchase method.
Payments via market.my.games🔗
MRGS allows you to process purchases made through the site market.my.games. Currently, this purchase option works only on desktop games, as Apple/Google stores and others may consider this as a violation of their rules. But if the project can synchronize progress between mobile and desktop games via MyGames account, then it turns out that the user of the mobile project can buy in-game goods via market.my.games.
Pros for the project:
- Additional point where the user can buy goods
- When synchronizing mobile and desktop projects - reduced commission for the purchase, benefits for the user and more profit for the project
To set up integration with market.my.games, you need to:
- Contact Anton Astafurov or Toan Tran for the establishment of the project, goods and prices
- Support the MRGS mechanism on the project server, as the mechanism for issuing purchases from the market is based on it.
- When setting up MRGS bonuses, add there the goods that you plan to sell through market.my.games, and tell the market the identifiers of these bonuses.
After that, when a user buys a product, the market sends a bonus issuance event in a certain number of pieces to the user by his MyGamesID.
In order to implement payments through market.my.games, not the MRGSBank module is required, and it doesn't matter whether the game works via Steam emulation or not
Working with notifications🔗
Both local and standard push notifications are supported, see the description of the MRGSNotifications module for details
Troubleshooting🔗
To detect problems, you need to study the logs. There are already three of them:
The log of the project itself is in the directory %APPDATA%..\LocalLow\<your company name, usually my.games>\<Project Name>\Player.log
The steam_api.dll library log (through which MRGS works with the GC) is in the build directory, then <Name of your project>_Data/Plugin/x86_64/Fume.log
The log of the GC itself is located in the GC directory %APPDATA%\..\Local\GameCenter\main.log
Created: 2022-02-07