Skip to main content

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​

FieldTypeIs it supported
HOST_PAUSE_DELAY_MILLISlongY
HTTP_CACHE_PATHStringY
HTTP_CACHE_LIMIT_STORAGElongN
DOMAIN_WHITELIST_REQUESTArrayList\<String>Y
DOMAIN_WHITELIST_SOCKETArrayList\<String>Y
DOMAIN_WHITELIST_UDPArrayList\<String>Y
DOMAIN_WHITELIST_TCPArrayList\<String>Y
DOMAIN_WHITELIST_UPLOAD_FILEArrayList\<String>Y
DOMAIN_WHITELIST_DOWNLOAD_FILEArrayList\<String>Y

Game options​

FieldTypeIs it supported
GAME_URLStringY
GAME_TYPEStringY
GAME_IDStringY
USER_IDStringN
ENABLE_DEBUGGERbooleanY
ENABLE_VCONSOLEbooleanY
ENABLE_PERFORMANCE_MONITORINGbooleanY
ENABLE_CPU_PROFILERbooleanY
ENABLE_CSHARP_DEBUGGERbooleanY
NETWORK_TIMEOUTlongY
SCREEN_ORIENTATIONintN
BUILTIN_CUSTOM_SCRIPTS_PATHStringY
SHOW_MENU_LAYOUTbooleanY
PIXEL_RATIOfloatY
ENABLE_INSPECTORbooleanY
INSPECTOR_PORTintY
INSPECTOR_HOSTStringY
INSPECTOR_WAIT_FOR_INSPECTbooleanY

3. 错误码​

Core​

Error CodeMeaningError Handling
0Success
1General ErrorRestart the host
-1Unknown ErrorRestart the host
2Internal ErrorRestart the host
3Network timeoutExtend the timeout period, check the network status, and restart the game
4Failed to create Game handleRecall createGameHandle
100Generic Game Startup ErrorRestart the game
101Failed to obtain the game packageCheck if the game package exists and if the URL is correct
102Error loading built-in scriptRestart the game, restart the host
103Compile script failedRestart the game, contact the game developer
104Failed to load entry scriptRestart the game and check if the game type is correct
110General game runtime errorRetry, restart the game, contact the game developer
111Game script execution failedRetry, restart the game, contact the game developer
120Generic Game Pause ErrorRetry, restart the game, contact the game developer
130Generic Game Stop ErrorRestart the host
131Host main thread interruptedRestart the host
132Host mismatchRestart the host

Runtime​

Error CodeMeaningError Handling
0Success
1General ErrorRestart the host
-1Unknown ErrorRestart the host
2Internal ErrorRestart the host
3Network timeoutExtend the timeout period, check the network status, and restart the game
4Failed to create Game handleRecall createGameHandle
100Generic Game Startup ErrorRestart the game
101Failed to obtain the game packageCheck if the game package exists and if the URL is correct
102Error loading built-in scriptRestart the game, restart the host
103Compile script failedRestart the game, contact the game developer
104Failed to load entry scriptRestart the game and check if the game type is correct
110General game runtime errorRetry, restart the game, contact the game developer
111Game script execution failedRetry, restart the game, contact the game developer
120Generic Game Pause ErrorRetry, restart the game, contact the game developer
130Generic Game Stop ErrorRestart the host
131Host main thread interruptedRestart the host
132Host mismatchRestart the host