class FishMain extends uniLib . GameDoc { /**
     * 加载进度界面
     * loading process interface
     */ public constructor ( param ? ) { super ( param ) ; egret . ImageLoader . crossOrigin = "anonymous" ; game . GameViewConfig . mainMediatorName = uniLib . getQualifiedClassName ( game . FishMediator ) ; if ( this . _gameInfo ) { game . DataCache . gameInfo = this . _gameInfo ; } if ( param && param . destroyResOnExit ) { game . DataCache . destroyResOnExit = param . destroyResOnExit ; } if ( this . _gameInfo && this . _gameInfo . extData ) { game . DataCache . platParam = this . _gameInfo . extData ; } game . GameData . iskPoker = true ; game . Config . SeatGame = false ; game . Config . GameSeatNumber = 4 ; game . Config . IsFormatName = false ; game . Config . BetTimeout = 60 ; game . Config . BulletClientHandle = true ; } public start ( e = null ) { var initData = < uniLib . initOptions > { } ; initData . designWidth = 1280 ; initData . designHeight = 720 ; initData . scaleMode = egret . StageScaleMode . FIXED_HEIGHT ; initData . debug = true ; uniLib . init ( initData ) ; RES . setMaxLoadingThread ( 6 ) ; let assetAdapter = new AssetAdapter ( ) ; egret . registerImplementation ( "eui.IAssetAdapter" , assetAdapter ) ; egret . registerImplementation ( "eui.IThemeAdapter" , new ThemeAdapter ( ) ) ; RES . addEventListener ( RES . ResourceEvent . CONFIG_COMPLETE , this . onConfigComplete , this ) ; RES . loadConfig ( "resource/default.res.json" , "resource/" ) ; } private onConfigComplete ( event ) { RES . removeEventListener ( RES . ResourceEvent . CONFIG_COMPLETE , this . onConfigComplete , this ) ; let theme = new eui . Theme ( "resource/default.thm.json" , this . stage ) ; theme . addEventListener ( eui . UIEvent . COMPLETE , this . onThemeLoadComplete , this ) ; } private isThemeLoadEnd : boolean = false ; /**
     * 主题文件加载完成,开始预加载
     * Loading of theme configuration file is complete, start to pre-load the
     */ private onThemeLoadComplete ( ) { this . preLoadEnd ( ) ; } public preLoadEnd ( ) { uniLib . UIMgr . instance . showProcessBar ( null , 2 , 100 , "正在加载游戏资源..." ) ; if ( uniLib . Global . lobbyMode ) { uniLib . ResLoadMgr . instance . load ( game . GameConstant . ResGroup_BY , this . onLoadComplete , this . onItemLoadError , this , null ) ; } else { uniLib . ResLoadMgr . instance . load ( game . GameConstant . ResGroup_BY , this . onLoadComplete , this . onItemLoadError , this , PublicLoadingView ) ; } } /**
     * 资源组加载出错
     *  The resource group loading failed
     */ private onItemLoadError ( event ) { console . warn ( "Url:" + event . groupName + "..." + event . itemsLoaded + "..." + event . itemsTotal + " has failed to load" ) ; } private onLoadComplete ( ) { uniLib . UIMgr . instance . showProcessBar ( null , 93 , 100 , "正在加载游戏资源..." ) ; game . Sound . loadSoundGroup ( "buyu_sound" , game . SoundHand . by_musicBg , ( ) => { this . startCreateScene ( ) ; } ) ; } /**
     * 创建场景界面
     * Create scene interface
     */ protected startCreateScene ( ) { if ( uniLib . BrowersUtils . GetRequest ( "ada" ) == "true" ) egret . MainContext . instance . stage . setContentSize ( 1280 , 720 ) ; else { game . bsAdaptationStageSize ( 1280 , 720 ) ; } game . Config . BuYuClientSettle = true ; game . DataCache . stageWidth = uniLib . Global . screenWidth ; game . DataCache . stageHight = uniLib . Global . screenHeight ; uniLib . UIMgr . instance . hideLoading ( ) ; uniLib . SceneMgr . instance . changeScene ( game . PokerGameScene ) ; uniLib . Console . addLogforbid ( new Cmd . HitFishCmd_CS ( ) . GetType ( ) ) ; uniLib . Console . addLogforbid ( new Cmd . BetRoomCmd_CS ( ) . GetType ( ) ) ; uniLib . Console . addLogforbid ( new Cmd . SpawnFishCmd_S ( ) . GetType ( ) ) ; uniLib . Console . addLogforbid ( new Cmd . GameTimeSyncCmd_CS ( ) . GetType ( ) ) ; if ( ! uniLib . Global . lobbyMode ) { uniLib . Console . log = function ( message ) { for ( let item of uniLib . Console . logforbid ) { if ( message . indexOf ( item ) != - 1 ) { return ; } } var optionalParams = [ ] ; for ( var _i = 1 ; _i < arguments . length ; _i ++ ) { optionalParams [ _i - 1 ] = arguments [ _i ] ; } var level = this . getLocalLevel ( this . LogLevel ) ; if ( level <= uniLib . LOGLEVEL . DEBUG ) { if ( message == null || message == undefined || ( typeof ( message ) == "string" && message == "" ) ) { this . error ( "日志不能为空,请加标识头,不能再坑队友了!" ) ; } if ( uniLib . Global . isH5 ) { console . log ( new Date ( ) . toTimeString ( ) . split ( " " ) [ 0 ] , "LOG" , message , optionalParams ) ; } else { console . log ( message , optionalParams ) ; } if ( level != this . LogLevel ) { this . logToServer ( level , message , optionalParams ) ; } } } ; } } public resize ( ) { this . scaleY = uniLib . Global . screenHeight / game . DataCache . defaultHeight ; this . y = ( uniLib . Global . screenHeight - game . DataCache . defaultHeight ) / 2 ; } } module uniLib { export module Console { export function addLogforbid ( name ) { uniLib . Console . logforbid . push ( name ) ; } export let logforbid = [ ] ; } }