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
ReferenceArcaletItem 》 Method

Method

public static void GetItemInstance(ArcaletGame game,OnCallCompletionWithData cb, object token)
game 		the ArcaletGame object created on login.

This method is used to obtain an object owned by a player in the game, also known as an object instance.
The type of the obj of cb(code,obj,token) is List. Each element of the List represents an item owned by the player. 

'iguid'         The iguid of the object.
'name'        The name of the object. 
'id'               The id of the object.
 'now'          The server's system time, formatted: yyyy/mm/dd hh:mm:ss 
"expire"	    The expiration date of the object , the format is yyyy / mm / dd hh: mm: ss
'attr' 	    The data of attribute is key = value. The key here is set in the background when developers specify the object category. 
                     In addition to the default that is set when it is defined, its value can be changed. 
 
Since there can be more than one attribute,  the attributes here are recorded by List. The element types of List are Hashtable, which contains three keys:

"name"        The attribute's name, which is also its key.
"value"         The attribute's value.
"stamp"       The time when the attribute is written.
  
If the object does not set the property, then Hashtable["attr”] = null 

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

code 0 means the setup succeeded. A code other than 0 means the setup failed.
 
Elements of List can be extracted one by one. The following is an example:
C#
public static void GetItemInstance(ArcaletGame game,string iguid,OnCallCompletionWithData cb, object token)
game 	   Game Login  
iguid 	   Used to specify the iguid of the object to be obtained.

Use this method to obtain the specified object using iguid, owned by a player in the game, also known as an (instance). The type of the obj of cb(code,obj,token) is  List. Each element of the List is the item (instance) owned by the player. There are 5 keys: 

"iguid" 	   The iguid of the object
"name" 	   The name of the instance
"id" 	           The id of the object
"now" 	   The server's system time, formatted: yyyy/mm/dd hh:mm:ss 
"expire"	    The expiration date of the object , the format is yyyy / mm / dd hh: mm: ss
"attr"           The data of the "attr" attribute is key = value. The key here is set in the background when developers specify the 
                    object category. In addition to the default when it is defined, its value can be changed. 

Since there can be more than one attribute, the attributes here are recorded by List. The elements are type List containing Hashtable, which contains three Keys:

"name"      The attribute's name, which is also its key
"value"       The attribute's value
"stamp"     The time when the attribute is written
									   
If this item does not have any attributes set, then Hashtable[“attr”] = null  

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

code 0 means the setup succeeded. A code other than 0 means the setup failed.	
public static void GetItemInstance(ArcaletGame game,string iguid, bool autonew,OnCallCompletionWithData cb, object token)
game	 Game login 
iguid	Used to specify the iguid of the object to be obtained.
autonew	true: When a player does not have this item (instance), it is automatically added and sent back. 

The object iquid that is owned by the player in the game is also called (instance).

cb (code, obj, token) of obj is List , instance of each element of the List of Goods is owned by the players, and there are six Keys:

"iguid" 	   The iguid of the object
"name" 	   The name of the instance
"id" 	           The id of the object
"now" 	   The server's system time, formatted: yyyy/mm/dd hh:mm:ss 
"expire"	    The expiration date of the object , the format is yyyy / mm / dd hh: mm: ss Items must be valid for the developer to 
                    set the background materials management, if the limitation period is "permanent", returns an empty string.
"attr"           The data of the "attr" attribute is key = value. The key here is set in the background when developers specify the 
                    object category. In addition to the default when it is defined, its value can be changed. 

Since there can be  more than one property, it is also recorded on List .  List of elements of is of type Hashtable, 
which has three Keys: 

"name"	attribute name, which is the key. 
"value"	attribute value
"stamp"	the time when this property is written in .
	
If this article does not set the property,  Hashtable[“attr”] = null 

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

code 0 means the setup succeeded. A code other than 0 means the setup failed.	
public static void GetItemInstance(ArcaletGame game,string[] iguidArray, OnCallCompletionWithData cb, object token)
game	        Game Login  
iguidArray	The array of strings iguid for  specified object to be claimed 

Obtain the specified object of iguid that the player owns in the game, which is also (instance). This Overloading sends the array of strings iguid to specify several objects.

cb (code, obj, token) of obj is List , instance of each element of the List of Goods is owned by the players, and there are six Keys:

"iguid" 	   The iguid of the object
"name" 	   The name of the instance
"id" 	           The id of the object
"now" 	   The server's system time, formatted: yyyy/mm/dd hh:mm:ss 
"expire"	    The expiration date of the object , the format is yyyy / mm / dd hh: mm: ss Items must be valid for the developer to 
                    set the background materials management, if the limitation period is "permanent", returns an empty string.
"attr"           The data of the "attr" attribute is key = value. The key here is set in the background when developers specify the 
                    object category. In addition to the default when it is defined, its value can be changed. 

Since there can be more than one property, it is recorded with the object's iguid. The elements of List are Hashtable and there are three Keys:

"name"	The name of the property, which is the key value.
"value"	The value of the property
"stamp"	The time when the value of the property was written.

If this article does not set the property,  Hashtable[“attr”] = null 

void cb(int code, object obj, object token)
	
code 0 means the setup succeeded. A code other than 0 means the setup failed.	
	
※ Please note: If you have a iguid which is incorrect in the  array parameter iguidArray, no error message will be sent. Furthermore, the returned instance of List  would not have this data.
public static void GetItemClass(ArcaletGame game,int option, OnCallCompletionWithData cb, object token)
game 	Game Login
option 	values mean the following:

             0 	Only obtain item types not sold in the mall (property)
             1 	Only obtain item types on sale in the mall (product)
             2 	All object categories (property + product)
             3 	Objects hidden to players (data)

Based on the value of the parameter option, obtain the items that the developers defined in the background, also known as the item category.

The type of the obj of cb(code,obj,token)is List, each element of which is defined by the developer. The Hashtable records the data of this instance. The keys of this instance are: 

'iguid'         iguid of (string) item
'name'       The name of (string) item
'desc'         Description of (string) item
'type'           (int) Item types: 1: Product, 2: Nature, 3: Data
'price'         (int) Price 
'image'      (string) URL of item image 
'attr'            Attribute. Attribute data, key = value 

Since there can be more than one attribute, the attributes here are recorded by List. The element types of List are Hashtable, and contain two keys:

'name'        is the attribute's name, which is also the key.
'value'         is the attribute's value.

If this item does not set an attribute,  then  Hashtable[“attr”] = null 

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

code with a value of 0 means the setup succeeded.  A code other than 0 means the setup failed. 

Elements of List can be obtained one by one. The following code provides and example of this:
C#
public static void GetItemClass(ArcaletGame game, string iguid,OnCallCompletionWithData cb, object token)
game 	    Game Login  
iguid  	    Defines the specified object type.

Based on the iguid parameter, obtain the type of items that the developers define in the background, 

cb(code,obj,token)the type of the obj is  List, each element of which is defined by the developer. As this function only sends back one item, there is only one element sent back. The Hashtable records the data of this instance. The keys of this item are:

'iguid'         Identifier of  (string) item
'name'       The name of (string) item
'desc'         Description of (string) item
'type'           (int) Item types: 1: Product, 2: Nature, 3: Data
'price'         (int) Price 
'image'      (string) URL of item image 
'attr'            Attribute. Attribute data, key = value

Since there can be more than one attribute, the attributes are recorded by List. The element types of List are Hashtable, which contains two keys.

'name'        is the attribute's name, which is also the key
'value'         is the attribute's value

If this item does not set an attribute,  then Hashtable[“attr”] = null

code 0 means the setup succeeded. A code other than 0 means the setup failed.	
public static void GetItemClass(ArcaletGame game, string[] iguidArray,OnCallCompletionWithData cb, object token)
game	        Game Login 
iguidArray	The iguid array which is meant to obtain several types of objects.

Obtain the type of object the developer defines in the background based on the object's iguid.

cb (code, obj, token) of obj is List , the elements of List are the objects defined by the developer. Because this function returns only one object type, there will only be one element of List returned; the elements of List records the data of the object and there are the following Keys:

"iguid"	iguid of the object(string)
'name'	The name of (string) item
'desc'	Description of (string) item
'type'	(int)Item types: 1: Product, 2: Nature, 3: Data
'price'	(int)Price
'image'	(string)URL of item image
'attr'	Attribute. Attribute data, key = value

Since there can be more than one property, it is recorded with List . The type of List is Hashtable and  there are two keys:

"name"	The name of the property, which is the key.
"value"	The value of the property

If this object has no specified property, then  Hashtable[“attr”] = null

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

code 0 means the setup succeeded. A code other than 0 means the setup failed.	

※ Please note: If you have a iguid which is wrong in the  array parameter iguidArray, no error message will be sent. And the data would not be in the returned List .
public static void NewItemInstance(ArcaletGame game,string iguid,OnCallCompletionWithData cb, object token)
game  	Game login
iguid  	The item type of the newly added instance

When the game is in progress, if players get an item for any reason, they can use this method to add an item instance.

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

code with a value of 0 means adding a new instance succeeded. code with a value other than 0 means adding a new instance failed.

id 	    When the newly added object is successful, the sent back object instance will be instance id. Please change this parameter(cast) to int.

Please note: If the newly added object is set as (merged property value and not added as a new object), then the message sent back will be itemid=0 .
public static void SetItemInstanceAttribute(ArcaletGame game,string iguid,int id,string[] attrNameArray,string attrValueArray,OnCallCompletion cb, object token)
game	Game login 
iguid	Used to specify the iguid of the object to be obtained. 
id	        It is owned by the player and the object's property is set as instance id.
attrNameArray	The name of the property to be set
attrValueArray	The value of the property to be set

Set the value of the property of the object instance by the player in the game

void cb(int code, object token)

code with a value of 0 means the setup succeeded.  A code other than 0 means the setup failed. 
public static void SetItemInstanceAttribute(ArcaletGame game,string iguid,int id,string attrName,string[] attrValue,OnCallCompletion cb, object token)
game 	 Game login
iguid        The item type
id  		 The instance identifier owned by players; the attribute of instance id has to be set
attrName  	The name of the attribute to be set
attrValue  	The value of the attribute to be set


Set the value of the attribute in the item instance in the game for the players.

void cb(int code, object token)

code with a value of 0 means the setup succeeded.  A code other than 0 means the setup failed.
public static void GetItemInstanceAttribute(ArcaletGame game,string iguid,int id,string attrName,OnCallCompletionWithData cb, object token)
game 		Game login
iguid 		The item type
id  		        The instance identifier owned by players; the attribute of instance id has to be set
attrName  	The name of the attribute
	
Use this method to obtain the attribute values of the object instance of the players in the game

The type of obj of cb(code,obj,token) is Hashtable. These are the keys: 

'name'      is the attribute's name, which is also its key.
'value'       is the attribute's value.
'stamp'     is the time when the attribute is written.
'now'         is the server's system time, formatted: yyyy/mm/dd hh:mm:ss

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

code with a value of 0 means the setup succeeded.  A code other than 0 means the setup failed. 
public static void GetItemInstanceAttribute(ArcaletGame game,string iguid,int id,string[] attrNameArray,OnCallCompletionWithData cb, object token)
game	Game Login  
iguid	Used to specify the iguid of the object to be obtained.
id	        The instance identifier owned by players; the attribute of instance id has to be set
attrNameArray	The name of the property to be set

Get the value of the property of the object instance by the player in the game 

cb (code, obj, token) of obj is of type List, List each Hasthtable attribute data element is returned, Hasthtable total of the following Key: 

"name"	    The name of the property, which is the key value.
"value"	    The value of the property
"stamp"	    The time when the value of the property was written.
"now" 	   The server's system time, formatted: yyyy/mm/dd hh:mm:ss

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

code 0 means the setup succeeded. A code other than 0 means the setup failed.	
	
※ Please note: If you have any property name in the specified array attrNameArray that is incorrect or does not exist,  no error message will be sent. Furthermore, the returned List would not contain this data.
public static void DeleteItemInstance(ArcaletGame game,string iguid,int id,OnCallCompletion cb, object token)
game 	  Game login
iguid 	  The item iguid 
id  		  The instance id owned by players. The attribute instance id has to be set.

This method will delete the item instance.

void cb(int code, object token) 

code with a value of 0 means the setup succeeded.  A code other than 0 means the setup failed. 
public static void GetMallURL(ArcaletGame game, int type,string iguid,OnCallCompletionWithData cb, object token)
game 	  Game Login
type 	  Web page version; 0: action version, 1: general webpage version
iguid 	  The object type identifier. If an empty string is returned, then the URL will be the mall page of the game. 

cb(code, obj,token) The obj type is string. There are two ways to send an Item back to the mall URL: action version or general webpage version.

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

code with a value of 0 means the setup succeeded.  A code other than 0 means the setup failed. 
public static void GetItemInstanceNumber(ArcaletGame game, string iguid, OnCallCompletionWithData cb, object token)
game	Game Login
iguid	The type of object 

Obtain a certain  number of instances from a type of an object and send back  the parameter obj through callback cb().

The type of obj is int and the number of the object instance is sent back.

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

code with a value of 0 means the setup succeeded.  A code other than 0 means the setup failed. 
	
The number of the object instance has to be changed (cast) to int.
public static void ResetMallItemStatus(ArcaletGame game, string iguid, OnCallCompletion cb, object token)
game	Game login
iguid	The type of object 

Reset the status of specified iguid goods in the mall, the state is divided into three kinds of commodities: normal, hide, lock. After the reset, is will become a "normal state."

void cb(int code, object token)

Code 0 means the reset is sucssessful.The reset fails when the code is not 0.
public static void ChangeMallItemStatus(ArcaletGame game, string iguid, int status,OnCallCompletion cb, object token)
game	Game login
iguid	The type of object
status	The status of the goods
	0:	Normal
	1:	Hide
	2:	lockin 

Based on the value of the parameter, change the status of  specified iguid goods in the mall.

void cb(int code, object token)

Code 0 means the reset is sucssessful.The reset fails when the code is not 0.
Was this page helpful?
Yes No