--- title: 'Game_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 means “not authorized.” The use and the parameter of the super user function 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 CloudGame. <mark>As for those functions that only their definitions, but not their specific explanations, are mentioned, please refer to the explanation under the regular user function.</mark> ## **suSetPlayerNickname** ***• public void suSetPlayerNickname(string userid, string nickname, OnCallCompletion cb, object token)*** ## **suGetPlayerNickname** ***• public void suGetPlayerNickname(string userid, OnCallCompletionWithData cb, object token)*** Designate a player’s userid to obtain the nickname of a designated player. | parameter | note | |:------ |:---------------- | | userid | the designated player’s userid| <mark>Please be aware that this privilege function does not have a corresponding regular user function.</mark> Types of back-sendings: `void cb(int code, object obj, object token)` The following are the codes' status codes and their notes. | status code | note | |:------ |:------------------------------------------------ | | 0 | the obtaining succeeds | | not 0 | the obtaining fails, the code is the error code, and obj is meaningless and negligible | obj is shaped as string, and the back-sending is the designated player's nickname. ## **suSetPlayerRegister** ***• public void suSetPlayerRegister(string userid, object AX, object BX, object CX, object DX, OnCallCompletion cb, object token)*** ## **suGetPlayerRegister** ***• public void suGetPlayerRegister(string userid, OnCallCompletionWithData cb, object token)***