Files
fc/dev/project/assets/Scripts/client/client.js
T
2026-05-23 22:10:14 +08:00

47 lines
1.2 KiB
JavaScript

/*******************************************************************************
*
* client游戏模块入口
*
*
*
* 2020.05.15
******************************************************************************/
// 组件安装
const install = function( _js ) {
const ref = require( _js );
if( ref && ref.install ) {
ref.install();
}
};
// 组件卸载
const uninstall = function( _js ) {
const ref = require( _js );
if( ref && ref.uninstall ) {
ref.uninstall();
}
};
window.gcore = window.gcore || {};
window.client = window.client || {};
client.loadView = {};
// gcore
gcore.Timer = require( 'Timer' );
gcore.BaseEvent = require( 'eventor' );
// 全局事件器
const GlobalEvent = new gcore.BaseEvent();
GlobalEvent.EVT_SOCKET_CONNECT = "EVT_SOCKET_CONNECT";
GlobalEvent.EVT_SOCKET_RECONNECT = "EVT_SOCKET_RECONNECT";
GlobalEvent.POOL_NET = "POOL_NET";
GlobalEvent.EVT_SOCKET_DISCONNECT = "EVT_SOCKET_DISCONNECT";
GlobalEvent.EVT_GUIDE_SOCKET_DISCONNECT = "EVT_GUIDE_SOCKET_DISCONNECT";
GlobalEvent.EVT_GUIDE_OPEN_MAINUI = "EVT_GUIDE_OPEN_MAINUI";
gcore.GlobalEvent = GlobalEvent;
// client
install( 'socket' );
install( 'dtkey' );