You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.5 KiB
C++
73 lines
2.5 KiB
C++
/*
|
|
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
|
* its licensors.
|
|
*
|
|
* For complete copyright and license terms please see the LICENSE at the root of this
|
|
* distribution (the "License"). All use of this software is governed by the License,
|
|
* or, if provided, by the license below or the license accompanying this file. Do not
|
|
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
*
|
|
*/
|
|
|
|
#include <GameLiftServerSDKWrapper.h>
|
|
|
|
#include <ctime>
|
|
|
|
#pragma warning(disable : 4996)
|
|
|
|
namespace AWSGameLift
|
|
{
|
|
Aws::GameLift::GenericOutcome GameLiftServerSDKWrapper::AcceptPlayerSession(const std::string& playerSessionId)
|
|
{
|
|
return Aws::GameLift::Server::AcceptPlayerSession(playerSessionId);
|
|
}
|
|
|
|
Aws::GameLift::GenericOutcome GameLiftServerSDKWrapper::ActivateGameSession()
|
|
{
|
|
return Aws::GameLift::Server::ActivateGameSession();
|
|
}
|
|
|
|
Aws::GameLift::Server::InitSDKOutcome GameLiftServerSDKWrapper::InitSDK()
|
|
{
|
|
return Aws::GameLift::Server::InitSDK();
|
|
}
|
|
|
|
Aws::GameLift::GenericOutcome GameLiftServerSDKWrapper::ProcessReady(
|
|
const Aws::GameLift::Server::ProcessParameters& processParameters)
|
|
{
|
|
return Aws::GameLift::Server::ProcessReady(processParameters);
|
|
}
|
|
|
|
Aws::GameLift::GenericOutcome GameLiftServerSDKWrapper::ProcessEnding()
|
|
{
|
|
return Aws::GameLift::Server::ProcessEnding();
|
|
}
|
|
|
|
AZStd::string GameLiftServerSDKWrapper::GetTerminationTime()
|
|
{
|
|
// Timestamp format is using the UTC ISO8601 format
|
|
std::time_t terminationTime;
|
|
Aws::GameLift::AwsLongOutcome GetTerminationTimeOutcome = Aws::GameLift::Server::GetTerminationTime();
|
|
if (GetTerminationTimeOutcome.IsSuccess())
|
|
{
|
|
terminationTime = GetTerminationTimeOutcome.GetResult();
|
|
}
|
|
else
|
|
{
|
|
// Use the current system time if the termination time is not available from GameLift.
|
|
time(&terminationTime);
|
|
}
|
|
|
|
char buffer[50];
|
|
strftime(buffer, sizeof(buffer), "%FT%TZ", gmtime(&terminationTime));
|
|
|
|
return AZStd::string(buffer);
|
|
}
|
|
|
|
Aws::GameLift::GenericOutcome GameLiftServerSDKWrapper::RemovePlayerSession(const AZStd::string& playerSessionId)
|
|
{
|
|
return Aws::GameLift::Server::RemovePlayerSession(playerSessionId.c_str());
|
|
}
|
|
} // namespace AWSGameLift
|