User System

The User System of SGUtil For Unity provides following methods.

Login

Method

void Login()

Remark
  • Starts up channel login screen, followed by channel login confirmation and game server login.
  • The login result is notified via OnLogin.

Recover

Method

void Recover(string recover_token)

Parameters
  • recover_token - token used to recover session
Remark
  • Recover channel session quickly after logout.
  • Game server login is performed normally.
  • The recover result is notified via OnLogin.

Login Callback

Method

void OnLogin(SGUResult resultCode, SGUAccount account)

Parameters
  • resultCode - result code
  • account - account information
Remark
  • Failure or cancellation at any stage indicates the failure of whole login flow.
  • Only success of game server login indicates the success of whole login flow.

Logout

Method

void Logout()

Remark
  • Start game server logout, followed by channel logout.
  • As long as game server logout succeeded, the whole logout flow is considered as finished regardless of the result of channel logout.
  • The logout result is notified via OnLogout.

Logout Callback

Method

void OnLogout(SGUResult result)

Parameters
  • result - result code
Remark
  • The result of logout flow is notified to caller via this callback.

Exit

Method

void Exit(bool silent)

Parameters
  • silent - true:do not show confirmation screen,false:show confirmation screen
Remark
  • Exit application.
  • You please show your own confirmation screen and call Exit(false) if user selects to exit.

Exit Callback

Method

void OnExitCancelled()

Parameters Remark
  • If user selects not to exit, this callback will be invoked to indicate application should go on.