Document
Introduction
Summary
arcalet ?
Capabilities
Object Model
arcalet API
Synchronization
Event Processing
Callback
API Class
Objects Summary
Error Code
Reference
ArcaletGame
Constructor
Method
Property
Event
ArcaletScene
Constructor
Method
Property
Event
ArcaletItem
Method
Super User
ArcaletScore
Method
Super User
ArcaletShop
Method
ArcaletSystem
Method
ArcaletThreadPool
Method
ReferenceArcaletGame 》 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()
※ After the Unity3D 4.x version, WebLaunch() is no longer necessary.

If the version Unit3D 3.x is in use, after creating Web application (the program Unity3D Web Player), after the establishment of an arcalet object, WebLaunch() must be called to connect to the server. There are two overloading methods. The overloading does not specify overtime but the system's default value. If the connection to the server fails due to the overtime, then OnCompletion will be triggered to connect to the server.
void WebLaunch(int timeout)
timeout	 Specify the connection timeout in seconds.
void STALaunch()
※ arcalet API 2.x no longer uses STALaunch(),but it is still compatible to the previous version.

Under certain development environments (such as Unity3D), the standard processing thread can not be used. after the establishment of arcalet object, STALaunch() must be called to connect to the server. There are two overloading methods. The overloading method does not specify overtime but the system's default value. If the connection to the server fails due to the overtime, then OnCompletion will be triggered to connect to the server.

void STALaunch(int timeout)
timeout	  Specify the connection timeout in seconds.
Int GetUserGrade()
When a player logs in successfully, the status of the member is sent back with this method.

0:System account ( made by arcalet server ) .
1:Without e-mail certification
2: Free players
3: 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 SendOnClose(string msg , int poid )
msg    Message data 

Store message data to the server. Send this message to other players only when the players are offline. The recipient of this overloading poid can be specified. It is usually DP's poid to send the offline messages to specific users online.
void SendOnClose(string msg, ArcaletScene scene)
scene    Specify the spread of this scene
msg    Message data 

Store message data to the server. Send this message to other players only when the players are offline. This overloading can specify a particular scene, offline messages to users in this scenario.
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 SetPlayerNickname(string nickname, OnCallCompletion cb, object token)
Set (Change) the player's nickname, which can not include whitespace, special symbols can only be "." "-."

void cb(int code, object token)
	
Code 0 means the setup is successful. The value of ArclatGame.nickname is updated at the same time.

The setup fails if the code is not 0.


Was this page helpful?
Yes No