Beispiel #1
0
        private void DealSendData_ChangeRoom(byte[] byt)
        {
            //接收房间数据
            int index = 4;

            name = GlobalC.GetSendData_Str(byt, ref index);

            ID        = GlobalC.GetSendData_Int(byt, ref index);
            soutai    = GlobalC.GetSendData_Int(byt, ref index);
            Boss      = GlobalC.GetSendData_Int(byt, ref index);
            mode      = GlobalC.GetSendData_Int(byt, ref index);
            mapTypeID = GlobalC.GetSendData_Int(byt, ref index);
            mapID     = GlobalC.GetSendData_Int(byt, ref index);

            IsGame   = GlobalC.GetSendData_Bool(byt, ref index);
            Islock   = GlobalC.GetSendData_Bool(byt, ref index);
            IsWS     = GlobalC.GetSendData_Bool(byt, ref index);
            modeFree = GlobalC.GetSendData_Bool(byt, ref index);

            for (int i = 0; i < 6; i++)
            {
                players[i].enabled = GlobalC.GetSendData_Bool(byt, ref index);
                players[i].IsReady = GlobalC.GetSendData_Bool(byt, ref index);
                players[i].team    = GlobalC.GetSendData_Int(byt, ref index);
            }
        }
Beispiel #2
0
        private void DealSendData_Input(byte[] byt)
        {
            //键盘输入
            //type + sit + 帧ID + bool[9]
            int index = 4;
            int sit   = GlobalC.GetSendData_Int(byt, ref index);
            int ID    = GlobalC.GetSendData_Int(byt, ref index);

            bool[] dat = new bool[9];
            for (int i = 0; i < 9; i++)
            {
                dat[i] = GlobalC.GetSendData_Bool(byt, ref index);
            }
            inputManager.SetInput(ID, sit, dat);
        }
Beispiel #3
0
        private void DealSendData_ChangeRoomPrep(byte[] byt, int sit)
        {
            //判断是否为房主
            if (sit != Boss)
            {
                return;
            }

            //读取房间属性
            int index = 4;

            IsWS     = GlobalC.GetSendData_Bool(byt, ref index);
            modeFree = GlobalC.GetSendData_Bool(byt, ref index);

            //重新发送房间状态
            var dat = GetSendData_All();

            clientS.AddData(dat);
        }