--- title: 'Item_Su' disqus: hackmd tags: 'API' --- ## **Super User** A super user, also known as a privileged user, is an account that DP ( Distributed Plug-in ) uses to log in to the game. Since DP plays the role of being the central controller of the game, it has to be allowed to have the privilege to obtain other players’ data. In other words, the privileged user function here is not set to let the current user obtain his own data but to designate a particular player with an additional parameter and obtain that player’s data directly. The privilege function can only be called when the logged-in account is a super user, or callback will send back an error code that says “not authorized.” The super user function's use and parameter are similar to those of the regular player function. The former function starts with “su,” and if that privilege function aims to operate certain players’ data, there will be an additional parameter “userid” in the function to designate a certain player’s account. The following is the privilege function of CloudItem. <mark>As for those functions that only their definitions, but not their further explanations, are mentioned, please refer to the explanation under the regular user function.</mark> ## **suGetItemInstance** ***•public static void suGetItemInstance(CloudGame game, string userid, OnCallCompletionWithData cb, object token)*** ***•public static void suGetItemInstance(CloudGame game, string userid, string iguid, OnCallCompletionWithData cb, object token)*** ***•public static void suGetItemInstance(CloudGame game, string userid, string[] iguidArray, OnCallCompletionWithData cb, object token)*** ***•public static void suGetItemInstance(CloudGame game, string userid, string iguid, bool autonew, OnCallCompletionWithData cb, object token)*** ## **suGetItemClass** ***•public static void suGetItemClass(CloudGame game, string userid, int option, OnCallCompletionWithData cb, object token)*** ***•public static void suGetItemClass(CloudGame game, string userid, string iguid, OnCallCompletionWithData cb, object token)*** ***•public static void suGetItemClass(CloudGame game, string userid, string[] iguidArray, OnCallCompletionWithData cb, object token)*** ## **suNewItemInstance** ***•public static void suNewItemInstance(CloudGame game, string userid, string iguid, OnCallCompletionWithData cb, object token)*** ***•public static void suNewItemInstance(CloudGame game, uint poid, string iguid, OnCallCompletionWithData cb, object token)*** ## **suSetItemInstanceAttribute** ***•public static void suSetItemInstanceAttribute(CloudGame game, string userid, string iguid, string id, string attrName, string attrValue, OnCallCompletion cb, object token)*** ***•public static void suSetItemInstanceAttribute(CloudGame game, string userid, string iguid, string id, string[] attrNameArray, string[] attrValueArray, OnCallCompletion cb, object token)*** ***•public static void suSetItemInstanceAttribute(CloudGame game, string userid, string iguid, string id, string attrName, string attrValue, string syncToGuildReg, OnCallCompletion cb, object token)*** ***•public static void suSetItemInstanceAttribute(CloudGame game, string userid, string iguid, string id, string[] attrNameArray, string[] attrValueArray, string[] syncToGuildRegArray, OnCallCompletion cb, object token)*** ***•public static void suSetItemInstanceAttribute(CloudGame game, uint poid, string iguid, string id, string attrName, string attrValue, OnCallCompletion cb, object token)*** ***•public static void suSetItemInstanceAttribute(CloudGame game, uint poid, string iguid, string id, string[] attrNameArray, string[] attrValueArray, OnCallCompletion cb, object token)*** ***•public static void suSetItemInstanceAttribute(CloudGame game, uint poid, string iguid, string id, string attrName, string attrValue, string syncToGuildReg, OnCallCompletion cb, object token)*** ***•public static void suSetItemInstanceAttribute(CloudGame game, uint poid, string iguid, string id, string[] attrNameArray, string[] attrValueArray, string[] syncToGuildRegArray, OnCallCompletion cb, object token)*** ## **suGetItemInstanceAttribute** ***•public static void suGetItemInstanceAttribute(CloudGame game, string userid, string iguid, string id, string attrName, OnCallCompletionWithData cb, object token)*** ***•public static void suGetItemInstanceAttribute(CloudGame game, string userid, string iguid, string id, string[] attrNameArray, OnCallCompletionWithData cb, object token)*** ***•public static void suGetItemInstanceAttribute(CloudGame game, uint poid, string iguid, string id, string attrName, OnCallCompletionWithData cb, object token)*** ***•public static void suGetItemInstanceAttribute(CloudGame game, uint poid, string iguid, string id, string[] attrNameArray, OnCallCompletionWithData cb, object token)*** ## **suDeleteItemInstance** ***•public static void suDeleteItemInstance(CloudGame game, string userid, string iguid, string id, OnCallCompletion cb, object token)*** ***•public static void suDeleteItemInstance(CloudGame game, uint poid, string iguid, string id, OnCallCompletion cb, object token)*** ## **suGetItemInstanceNumber** ***•public static void suGetItemInstanceNumber(CloudGame game, string userid, string iguid, OnCallCompletionWithData cb, object token)*** ## **suResetMallItemStatus** ***•public static void suResetMallItemStatus(CloudGame game, string userid, string iguid, OnCallCompletion cb, object token)*** ## **suChangeMallItemStatus** ***•public static void suChangeMallItemStatus(CloudGame game, string userid, string iguid, int status, OnCallCompletion cb, object token)*** ## **suSetItemClassAttribute** ***•public static void suSetItemClassAttribute(CloudGame game, string iguid, string attrName, string attrValue, OnCallCompletion cb, object token)*** Set the preset attribute’s value of the object’s category. The object’s category is the attribute data which is set by the developers in the management backstage. It is not owned by any particular user. | parameter | note | |:--------- |:---------------- | | game | the game one logs in | | iguid | the object category’s iguid | | attrName | attribute’s name | | attrValue | attribute’s value | <mark>Please be aware that this privilege function does not have any corresponding regular user function.</mark> Types of back-sendings: `void cb(int code, object token)` The following are the codes' status codes and their notes. | status code | note | |:------ |:---------------------- | | 0 | the setting succeeds | | not 0 | the setting fails and the code is the error code | ***•public static void suSetItemClassAttribute(CloudGame game, string iguid, string[] attrNameArray, string[] attrValueArray, OnCallCompletion cb, object token)*** Set the preset attribute’s value of the object’s category. The object’s category is the attribute data which is set by the developers in the management backstage. It is not owned by any particular user. | parameter | note | |:--------- |:---------------- | | game | the game one logs in | | iguid | the object category’s iguid | | attrNameArray | the array word string of the attribute’s name| | attrValueArray | the array word string of the attribute’s value | <mark>Please be aware that this privilege function does not have any corresponding regular user function.</mark> Types of back-sendings: `void cb(int code, object token)` The following are the codes' status codes and their notes. | status code | note | |:------ |:---------------------- | | 0 | the setting succeeds | | not 0 | the setting fails and the code is the error code |