Resources
arcalet introduction
Example
Download
API usage instruction › ArcaletGame › Method

Method

void Launch()
When the game object is created, call the Launch() method to connect to the server. There are two overloaded methods. One method does not specify the connection timeout. A system default is activated in this case. If the connection is not successful over time, the connection timeout will trigger onCompletion.
void Launch(int timeout)
timeout	  Specify the connection timeout in seconds
void WebLaunch()
If developers are creating a web application, like a Flash swf program, then once the arcalet object is built, developers must call WebLaunch() to connect to the server. There are two overloaded methods. In one method, a connection timeout is not specified. A system default is activated in this case. If the connection is not successful over time, the connection timeout will trigger onCompletion.
void WebLaunch(int timeout)
timeout    Specify the connection timeout in seconds
void STALaunch()
When the thread can not be used in a standard development environment (such as Unity3D),
developers must call STALaunch() to establish a connection to the server after the arcalet object is built. There are two overloaded methods. One does not specify the connection timeout. In this case, a system default is activated. If the connection is not successful over time, the connection timeout will trigger onCompletion.
void STALaunch(int timeout)
timeout    Specify the connection timeout in seconds
Int GetUserStatus()
After a successful login, players use this method to return the status of the player's membership.

0: Without e-mail certification
1: Free players
2: VIP players
void Dispose()
When the user is offline, an ArcaletGame object will not be able to be re-used. To reconnect, a new ArcaletGame object has to be re-created, and then launched using the Launch() method.
void Send(string msg)
msg     Message Information

Before setting the content of the message, the game developers should be aware that when sending data to the preset scenes, all players in the scene will receive it, including the sender.
void SendOnClose(string msg)
msg    Message Information

This method will store message data on the server. Only when the player is disconnected will this message be sent to other players. The recipient receives the message in the default scene
void PrivacySend(string data,int poid)
data    Message Info
poid    The recipient's private scene identifier

This method will send a message to the specified player and specify the recipient with poid (private scene id).
void StartDelayDetectionRadar(int speed)
speed    Detection interval block, divided into 0-5 gears.

This method will enable packet delay detection radar used to detect packet transmission delay time between the local computer and the game servers.

Detection radar is divided into five gears, and is based on radar detection interval. Gear 5 has the shortest interval, and is suitable for games that require real-time. Gear 1 has the longest interval and is suitable for games that are less demanding time-wise. Gear 0 is to stop detection. Please choose gears based on the features of games. When choosing higher gears, the information acquired is the most up to date and correct, but it also consumes greater bandwidth. The low gear can reduce bandwidth consumption. When detecting radar, do it after starting in ArcaletGame object successfully. In other words, use it after ArcaletGame.OnCompletion() is triggered and the status code is set.
void GetDelayMillisecond()
The current packet delivery delay time between the local and the game server is measured  in milliseconds. To use this information, one must first start packet delay detection radar with StartDelayDetectionRadar().
void SetPlayerStatus(int status,OnCallCompletion cb, object token)
This method sets the status of local players, so that other players can search all players of the same status through FindPlayersByStatus().

void cb(int code, object token)
code 0 means the setup succeeded. A code other than 0 means the setup failed.
void SetPlayerStatus(int status,int level, OnCallCompletion cb, object token)
This method sets the status of local players and their level, so that other players can search all players of the same status through FindPlayersByStatus() or search for players by level using FindPlayersByLevel().

void cb(int code, object token)
code 0 means the setup succeeded. A code other than 0 means the setup failed.
void SetPlayerLevel(int level, OnCallCompletion cb, object token)
Set local players level so that other players can search for players of the same status through FindPlayersByLevel().

void cb(int code, object token)
code 0 means the setup succeeded. A code other than 0 means the setup failed.
void FindPlayersByStatus(int status, OnCallCompletionWithData cb, object token)
Search all qualified players by their status. cb sends back List. Each Hashtable contains two columns of player information. They are 'userid' and 'poid'. 'userid' is the player's account and the 'poid' is the private scene id. 

void cb(int code, object obj, object token)

code 0 means the find operation was successful. obj type will be changed to List and contain the data for the player's found. If List.Count is 0, then that means no players with the matched status were found. 

A code other than 0 means the method failed. 

obj type is List,Hashtable contains two keys:
	userid 	players account identifier
	poid 		private scene identifier

Example: Obtain player's information information that was returned
C#
void FindPlayersByLevel(int level, OnCallCompletionWithData cb, object token)
Search by level for qualified players. For more details, please refer to FindPlayersByStatus().
void GetSceneInstance(string sguid,OnCallCompletionWithData cb, object token)
Use this method to obtain a copy of the established dynamic scene, cb will return List. Each Hashtable contains two columns of information, "sid" and "count". "sid" is the scene replica ID, "count" is the number of players that entered the scene.

void cb(int code, object obj, object token)
code 0 means the setup succeeded. A code other than 0 means the setup failed.

Example: Remove the Returned Copy of the Scene Information
C#
void EventDispatcher()
Set the object property UsePseudoSTA to true before executing Launch(). Developers must call EventDispatcher() periodically in the master thread. The API will activate the Pseudo STA threading model to trigger events and call the callback.
Was this page helpful?
Yes No