コード例 #1
0
 public void onLoadForExistingGameComplete(MultiplayerController parent, OnReciveCallBack onRcCallBack, OnDisconnect onDCCallBack,
                                           OnGameIsReady onGameIsReady, OnGameFinished onGameFinished, OnEnemyDCAccepted onEnemyDCAccepted,
                                           OnReconnectComplete onReconnectComplete, OnReconnectFailed onReconnectFailed,
                                           OnRuleReady onRuleReady, OnWeakConectionDetected onWeakConnection, bool isExistingGame)
 {
     this.onDCCallBack     = onDCCallBack;
     this.onWeakConnection = onWeakConnection;
     (new Thread(() =>
     {
         requestGameRule(onRcCallBack, onDCCallBack, onGameIsReady,
                         onGameFinished, onEnemyDCAccepted, onReconnectComplete, onReconnectFailed, onRuleReady);
     })).Start();
 }
コード例 #2
0
 public void initializeForFirstTime(MultiplayerController parent, SocketIOComponent io, OnReciveCallBack onRcCallBack, OnDisconnect onDCCallBack, OnGameIsReady onGameIsReady, OnGameFinished onGameFinished, OnEnemyDCAccepted onEnemyDCAccepted, OnReconnectComplete onReconnectComplete, OnReconnectFailed onReconnectFailed)
 {
     this.parent              = parent;
     this.io                  = io;
     this.onRcCallBack        = onRcCallBack;
     this.onDCCallBack        = onDCCallBack;
     this.onGameIsReady       = onGameIsReady;
     this.onGameFinished      = onGameFinished;
     this.onEnemyDCAccepted   = onEnemyDCAccepted;
     this.onReconnectComplete = onReconnectComplete;
     this.onReconnectFailed   = onReconnectFailed;
     io.On(Constants.serverMessage.events.START_GAME, startGame);
     io.On(Constants.serverMessage.events.END_GAME, endGame);
     io.On(Constants.serverMessage.events.ENEMY_DC_ACCEPTED, enemyDCAccepted);
     io.On(Constants.serverMessage.events.ON_GAME_STATUS_READY, gameStatusRecieve);
     io.On(Constants.serverMessage.events.ON_RECONNECT_FAILED, onRecFailed);
     io.On(Constants.serverMessage.events.NEW_TOKENS, onNewTokenRecieved);
     io.On(Constants.serverMessage.events.SERVER_ORDER, onServerOrder);
     io.On(Constants.serverMessage.events.CORRECTION, onCorrection);
     io.On(Constants.serverMessage.events.PING_SUC, onPingSuc);
     //io.On(Strings.serverMessage.events.ENABLE_USER, onEnableUser);
 }