---
# System prepended metadata

title: Game_Event
tags: [API]

---

---
title: 'Game_Event'
disqus: hackmd
tags: 'API'
---
## **Event**
## **OnCompletion**
***• void OnCompletion(int code, CloudGame game)***   

Object `Launch()` ends.   

The following are the code's status codes and their notes.    
            
| status code| note           |
|:------ |:---------------- |
| 0      | Launch functions successfully |
|  not 0 |Launch functions unsuccessfully |

The following are the notes for the other status codes that are not 0.

| status code| note|
|:------ |:-------------------------- |
| 101    | the account cannot be empty             |
| 102    | no user data found            |
| 103    | game program does not exist       |
| 104    | unsuccessful login due to incorrect account, password, gguid, or verification|
| 105    | exception found in CCU checkup             |
| 106    | the number of current players exceeds the program's maximum capacity       |
| 107    | repeated login                 |
| 108    | fail to subscribe to Channel   |
| 109    | fail to update player's data    |
| 110    | the authorization expires   |
| 111    | excessive data   |
| 199    | other error     |
| 201    | fail to obtain subscription to Channel |
| 202    | fail to obtain nickname               |
| 203    | currently no in-time online server is available|
| 204    | fail to connect to back-end server  |
| 205    | cannot connect to in-time server      |
   
## **OnStateChanged**
***• void OnStateChanged(int state, int code)***   

Triggered when the connection status with the cloud game server changes, the following is the states' status codes and their notes:
   
| status code  | note                         |
|:------- |:---------------------------- |
| 0       | not online yet                     |
| 100     | about to connect (the server mainframe is found)   |
| 300     | connected, now in Binary mode   |
| 310     | processing account and password login           |
| 400     | logged in, obtaining user poid
         |
| 410     | obtaining nickname|
| 600     | entered the game                     |
| 900     | cannot connect to the server            |
| 901     | error occurred when receiving data (disconnected)     |
| 902     | error occurred when sending data (disconnected)     |
| 903     | error occurred when examining network quality (disconnected) |
| 900~999 | error occurred when connecting                 |
     
## **OnPrivateMessageIn**
***• void OnPrivateMessageIn(string msg, int delayMilliSecond, CloudGame game)***   

Triggered when personal scene receives messages, if the local program and the message sender have both switched on the "packet delay detection radar," parameter delayMilliSecond will suggest how many milliseconds ago the message was probably sent.   