Example #1
0
        internal void QuitBattle(bool isForce)
        {
            m_WaitDisconnect = false;
            m_IsWaitStart    = true;

            Msg_CR_Quit msg = new Msg_CR_Quit();

            msg.is_force = isForce;
            SendMessage(msg);

            m_Robot.DelayActionQueue.QueueAction(this.ShutdownNetClient);
        }
Example #2
0
        internal void QuitBattle(bool is_force)
        {
            m_WaitDisconnect = false;
            m_IsWaitStart    = true;

            if (m_IsConnected)
            {
                Msg_CR_Quit msg = new Msg_CR_Quit();
                msg.is_force = is_force;
                SendMessage(msg);
            }
            WorldSystem.Instance.QueueAction(this.ShutdownNetClient);
        }
        internal void QuitBattle(bool is_force)
        {
            m_IsWaitStart = true;

            if (m_IsConnected)
            {
                Msg_CR_Quit msg = new Msg_CR_Quit();
                msg.is_force = is_force;
                SendMessage(RoomMessageDefine.Msg_CR_Quit, msg);

                Thread.Sleep(1000);
                m_NetClient.Disconnect("bye for quit");
                Thread.Sleep(1000);
            }

            ClearArgs();
            PluginFramework.Instance.QueueAction(this.ShutdownNetClient);
        }
Example #4
0
        internal static void Execute(object msg, User user)
        {
            Msg_CR_Quit quitClient = msg as Msg_CR_Quit;

            if (quitClient == null)
            {
                return;
            }
            if (null != user.OwnRoom)
            {
                if (quitClient.is_force)
                {
                    user.OwnRoom.DeleteUser(user);
                }
                else
                {
                    user.OwnRoom.DropUser(user);
                }
            }
        }
Example #5
0
 internal void Tick()
 {
     try
     {
         object msg = null;
         while ((msg = peer_.PeekLogicMsg()) != null)
         {
             //观察者只处理2个消息,进入与退出
             Msg_CR_Observer observerMsg = msg as Msg_CR_Observer;
             if (null != observerMsg)
             {
                 IsEntered = true;
                 Scene scene = OwnRoom.GetActiveScene();
                 if (null != scene)
                 {
                     scene.SyncForNewObserver(this);
                 }
                 LogSys.Log(LOG_TYPE.DEBUG, "Msg_CR_Observer from observer {0}({1})", Guid, Name);
             }
             else
             {
                 Msg_CR_Quit quitMsg = msg as Msg_CR_Quit;
                 if (null != quitMsg)
                 {
                     OwnRoom.DropObserver(this);
                     LogSys.Log(LOG_TYPE.DEBUG, "Msg_CR_Quit from observer {0}({1})", Guid, Name);
                     break;
                 }
                 else
                 {
                     //LogSys.Log(LOG_TYPE.DEBUG, "msg {0} from observer {1}({2})", msg.GetType().Name, Guid, Name);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogSys.Log(LOG_TYPE.ERROR, "Exception {0}\n{1}", ex.Message, ex.StackTrace);
     }
 }