Skip to content

Commit

Permalink
Updated manually, Version : 24.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wijanarko-ab committed Mar 29, 2024
1 parent a563012 commit 1821caa
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AccelByteUe4Sdk.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 53,
"VersionName": "24.7.1",
"VersionName": "24.7.2",
"FriendlyName": "AccelByte Unreal Engine SDK",
"Description": "Official AccelByte SDK for Unreal Engine 4",
"Category": "Online Platform",
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [24.7.2](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/24.7.2%0D24.7.1) (2024-03-29)


### Bug Fixes

* **DSM:** add RegisterServerToDSM with detailed server registration response returned ([af49a7c](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/commits/af49a7c76cd68ec00c87e4abc8f126bfeab387cb))


### [24.7.1](https://bitbucket.org/accelbyte/justice-unreal-sdk-plugin/branches/compare/24.7.1%0D24.7.0) (2024-01-02)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,65 @@ void ServerDSM::RegisterServerToDSM(const int32 Port
}
}

void ServerDSM::RegisterServerToDSM(const int32 Port
, const THandler<FAccelByteModelsServerInfo>& OnSuccess
, const FErrorHandler& OnError
, const FString& CustomAttribute)
{
FReport::Log(FString(__FUNCTION__));
ParseCommandParam();

if (ServerType != EServerType::NONE)
{
OnError.ExecuteIfBound(409, TEXT("Server already registered."));
}
else
{
ServerName = Environment::GetEnvironmentVariable("POD_NAME", 100);

const FString Url = FString::Printf(TEXT("%s/namespaces/%s/servers/register")
, *ServerSettingsRef.DSMControllerServerUrl
, *ServerCredentialsRef.GetClientNamespace());

const FAccelByteModelsRegisterServerRequest Register{
GameVersion,
DSPubIp,
ServerName,
Port,
Provider,
CustomAttribute
};

FReport::Log(TEXT("Starting DSM Register Request..."));

const TDelegate<void(const FJsonObject&)> OnSuccessHttpClient = THandler<FJsonObject>::CreateLambda(
[OnSuccess, this](FJsonObject const& JSONObject)
{
FTickerAlias::GetCoreTicker().RemoveTicker(AutoShutdownDelegateHandle);

FString JSONString;
const TSharedRef<TJsonWriter<>> Writer = TJsonWriterFactory<>::Create(&JSONString);
FJsonSerializer::Serialize(MakeShared<FJsonObject>(JSONObject), Writer);

FAccelByteModelsServerInfo Result;
if (FJsonObjectConverter::JsonObjectStringToUStruct(JSONString, &Result, 0, 0))
{
RegisteredServerInfo = Result;
SetServerName(Result.Pod_name);
}
if (CountdownTimeStart != -1)
{
AutoShutdownDelegateHandle = FTickerAlias::GetCoreTicker().AddTicker(AutoShutdownDelegate, ShutdownTickSeconds);
}
SetServerType(EServerType::CLOUDSERVER);

OnSuccess.ExecuteIfBound(Result);
});

HttpClient.ApiRequest(TEXT("POST"), Url, {}, Register, OnSuccessHttpClient, OnError);
}
}

void ServerDSM::SendShutdownToDSM(const bool KillMe
, const FString& MatchId
, const FVoidHandler& OnSuccess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,21 @@ class ACCELBYTEUE4SDK_API ServerDSM : public FServerApiBase
, const FErrorHandler& OnError
, const FString& CustomAttribute = TEXT(""));

/**
* @brief send register request to DSM
*
* @param Port the port where your game server run.
* @param OnSuccess This will be called when the operation succeeded.
* @param OnError This will be called when the operation failed.
* @param CustomAttribute A value that will be sent to client that join via armada matchmaking DSNotice event
*/
void RegisterServerToDSM(int32 Port
, const THandler<FAccelByteModelsServerInfo>& OnSuccess
, const FErrorHandler& OnError
, const FString& CustomAttribute = TEXT(""));

/**

/**
* @brief send register local server to DSM
*
* @param IPAddress the machine's IP address this local DS is in.
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "24.7.1"
"version": "24.7.2"
}

0 comments on commit 1821caa

Please sign in to comment.