Extend
How to extend GS2’s microservices functionality.
GS2-SDK provides SDKs tailored to game engines. Developers using Unity, Unreal Engine 5, and Godot can take advantage of the various features provided by these SDKs.
“GS2-SDK for Unity” is available as an SDK for Unity. It is fully integrated with the Unity Package Manager (UPM) and SDK updates can be done through UPM.
Dependent libraries are LitJSON(Public Domain) / websocket-sharp(MIT) / Protocol Buffers(BSD). The GS2-SDK for Unity is available under Apache License 2.0 and all source code is available in the following GitHub repository
The GS2-SDK for Unity provides state management capabilities for data retrieved from the server. Data retrieved through the API is cached in a layer of the SDK, and when server values are updated, the cache is automatically updated as well.
Therefore, developers can call the GS2-SDK API from the Update function to access the latest values without having to think about reading data.
var result = await gs2.Account.Namespace(
namespaceName: "namespace-0001"
).CreateAsync();
var item = await result.ModelAsync();
var userId = item.UserId;
var password = item.Password;GS2-SDK for Unreal Engine is available as an SDK for Unreal Engine 5. It is provided as a plugin for Unreal Engine and can be integrated into your project by simply placing code.
There are no external libraries to depend on and everything is implemented using standard Unreal Engine 5 functionality. GS2-SDK for Unreal Engine is licensed under Apache License 2.0 and all source code is available in the following GitHub repository
const auto Domain = Gs2->Account->Namespace(
"namespace-0001" // namespaceName
);
const auto Future = Domain->Create(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError()) return false;
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (!TestFalse(WHAT, Future2->GetTask().IsError()))) return false;
const auto Result = Future2->GetTask().Result();
This SDK is more specific to Unreal Engine 5.
This SDK supports Blueprint, a node-based programming environment that can be developed in the Unreal Editor. The Blueprint SDK allows you to access GS2 functionality without having to use C++.
GS2 SDK for Godot is available for Godot 4 (GDScript).
The SDK is provided as an addons/gs2 folder that you can copy into a Godot project.
GS2 SDK for Godot includes both an Ez layer designed for use from games and a low-level API client. After creating Gs2EzDomain, access each feature through service properties such as ez.account and ez.inventory, matching Unity’s gs2.Account style.
It is distributed under the Apache License 2.0, and all source code is available in the following GitHub repository:
var credential = Gs2BasicCredential.new("client-id", "client-secret")
var connection = Gs2Connection.new(credential, Gs2Region.AP_NORTHEAST_1)
var ez = Gs2EzDomain.new(connection)
var create_result = await ez.account.namespace_(
"namespace-0001"
).create()
if create_result.error != null:
push_error(str(create_result.error))
return
var model_result = await create_result.result.model()
if model_result.error != null:
push_error(str(model_result.error))
return
var account = model_result.result
print("UserId: ", account.user_id)
print("Password: ", account.password)How to extend GS2’s microservices functionality.