跳到主要内容

Client System API Reference

The System module provides some relatively scattered APIs and events.

API List

APIDescription
GetServerTimeGet the current UTC time of the server in seconds.

Event List

EventDescription
SetOnTssHandledWhen some apis are called, if the api requires TSS information, this event will be triggered, and the game needs to return TSS information in this event.
SetOnGameCustomMsgThe event will be triggered when the game calls the HTTP API 'PushMsg'.

API Details

GetServerTime

Get the current UTC time of the server in seconds.

/**
* Get the current UTC time of the server in seconds.
*
* @return The current UTC time of the server in seconds. The return value is 0 before logging in.
*/
int64_t GetServerTime();

Parameters:

(No parameters)

Return: int64_t

The current UTC time of the server in seconds. The return value is 0 before logging in.

Event Details

SetOnTssHandled

When some apis are called, if the api requires TSS information, this event will be triggered, and the game needs to return TSS information in this event.

/**
* OnSetOnTssHandled:
* When some apis are called, if the api requires TSS information, this event will be triggered, and the game needs to return TSS information in this event.
*
* @param in Contextual information of the API.
* @param out TSS information that needs to be returned.
*/
void SetOnTssHandled(
const TssHandledIn& in,
TssHandledOut& out);

Parameters:

ParamTypeDescription
inconst TssHandledIn&Contextual information of the API.
outTssHandledOut&TSS information that needs to be returned.

SetOnGameCustomMsg

The event will be triggered when the game calls the HTTP API 'PushMsg'.

/**
* OnSetOnGameCustomMsg:
* The event will be triggered when the game calls the HTTP API 'PushMsg'.
*
* @param event Info of the event.
*/
void SetOnGameCustomMsg(
const GameCustomMsgEvt& event);

Parameters:

ParamTypeDescription
eventconst GameCustomMsgEvt&Info of the event.