Host Status, Constants, and Error Codes
1. Host State Enum HostState
- UNAVAILABLE
- WAITING
- RUNNING
- PLAYING
2. Host Constants
Class TJConstants
can be used for createGameHandle and setGameStartOptions interface options parameter interpolation key
Host options
| Field | Type | Is it supported |
|---|---|---|
| HOST_PAUSE_DELAY_MILLIS | long | Y |
| HTTP_CACHE_PATH | String | Y |
| HTTP_CACHE_LIMIT_STORAGE | long | N |
| DOMAIN_WHITELIST_REQUEST | ArrayList\<String> | Y |
| DOMAIN_WHITELIST_SOCKET | ArrayList\<String> | Y |
| DOMAIN_WHITELIST_UDP | ArrayList\<String> | Y |
| DOMAIN_WHITELIST_TCP | ArrayList\<String> | Y |
| DOMAIN_WHITELIST_UPLOAD_FILE | ArrayList\<String> | Y |
| DOMAIN_WHITELIST_DOWNLOAD_FILE | ArrayList\<String> | Y |
Game options
| Field | Type | Is it supported |
|---|---|---|
| GAME_URL | String | Y |
| GAME_TYPE | String | Y |
| GAME_ID | String | Y |
| USER_ID | String | N |
| ENABLE_DEBUGGER | boolean | Y |
| ENABLE_VCONSOLE | boolean | Y |
| ENABLE_PERFORMANCE_MONITORING | boolean | Y |
| ENABLE_CPU_PROFILER | boolean | Y |
| ENABLE_CSHARP_DEBUGGER | boolean | Y |
| NETWORK_TIMEOUT | long | Y |
| SCREEN_ORIENTATION | int | N |
| BUILTIN_CUSTOM_SCRIPTS_PATH | String | Y |
| SHOW_MENU_LAYOUT | boolean | Y |
| PIXEL_RATIO | float | Y |
| ENABLE_INSPECTOR | boolean | Y |
| INSPECTOR_PORT | int | Y |
| INSPECTOR_HOST | String | Y |
| INSPECTOR_WAIT_FOR_INSPECT | boolean | Y |
3. 错误码
Core
| Error Code | Meaning | Error Handling |
|---|---|---|
| 0 | Success | |
| 1 | General Error | Restart the host |
| -1 | Unknown Error | Restart the host |
| 2 | Internal Error | Restart the host |
| 3 | Network timeout | Extend the timeout period, check the network status, and restart the game |
| 4 | Failed to create Game handle | Recall createGameHandle |
| 100 | Generic Game Startup Error | Restart the game |
| 101 | Failed to obtain the game package | Check if the game package exists and if the URL is correct |
| 102 | Error loading built-in script | Restart the game, restart the host |
| 103 | Compile script failed | Restart the game, contact the game developer |
| 104 | Failed to load entry script | Restart the game and check if the game type is correct |
| 110 | General game runtime error | Retry, restart the game, contact the game developer |
| 111 | Game script execution failed | Retry, restart the game, contact the game developer |
| 120 | Generic Game Pause Error | Retry, restart the game, contact the game developer |
| 130 | Generic Game Stop Error | Restart the host |
| 131 | Host main thread interrupted | Restart the host |
| 132 | Host mismatch | Restart the host |
Runtime
| Error Code | Meaning | Error Handling |
|---|---|---|
| 0 | Success | |
| 1 | General Error | Restart the host |
| -1 | Unknown Error | Restart the host |
| 2 | Internal Error | Restart the host |
| 3 | Network timeout | Extend the timeout period, check the network status, and restart the game |
| 4 | Failed to create Game handle | Recall createGameHandle |
| 100 | Generic Game Startup Error | Restart the game |
| 101 | Failed to obtain the game package | Check if the game package exists and if the URL is correct |
| 102 | Error loading built-in script | Restart the game, restart the host |
| 103 | Compile script failed | Restart the game, contact the game developer |
| 104 | Failed to load entry script | Restart the game and check if the game type is correct |
| 110 | General game runtime error | Retry, restart the game, contact the game developer |
| 111 | Game script execution failed | Retry, restart the game, contact the game developer |
| 120 | Generic Game Pause Error | Retry, restart the game, contact the game developer |
| 130 | Generic Game Stop Error | Restart the host |
| 131 | Host main thread interrupted | Restart the host |
| 132 | Host mismatch | Restart the host |