Beispiel #1
0
    private NrMainSystem()
    {
        NrTSingleton <NrConfigFile> .Instance.LoadData();

        NrLoadPageScreen.Init();
        NrReceiveGame.RegisterReceivePacketFunction();
    }
Beispiel #2
0
    public void MsgBoxOKEvent()
    {
        SOLDIER_INFO sOLDIER_INFO = new SOLDIER_INFO();

        sOLDIER_INFO.CharKind = 1004;
        sOLDIER_INFO.Grade    = 5;
        sOLDIER_INFO.SolID    = 1234567L;
        sOLDIER_INFO.HP       = 10000;
        NkSoldierInfo nkSoldierInfo = new NkSoldierInfo();

        nkSoldierInfo.SetCharKind(1004);
        NrReceiveGame.SolRecruitAfter(sOLDIER_INFO, null, 1, 21, null, false, nkSoldierInfo);
    }
Beispiel #3
0
        protected override int ReceiveBuffer(byte[] btBuffer, int index, int totalSize)
        {
            int num  = 0;
            int num2 = 0;
            int num3;
            int num4;

            while (true)
            {
                num2++;
                PacketHeader packetHeader = (PacketHeader)ReceivePakcet.DeserializePacket(btBuffer, index, out num, typeof(PacketHeader));
                if (index + (int)packetHeader.size + num > totalSize)
                {
                    break;
                }
                int index2 = index;
                index += num;
                num3   = NrReceiveGame.Receive_GamePacket(btBuffer, index, packetHeader);
                if (this.m_bSavePacket && packetHeader.type >= 200 && packetHeader.type <= 267)
                {
                    NrTSingleton <NkBattleReplayManager> .Instance.SavePacket(btBuffer, packetHeader.type, index2, num3 + num);
                }
                if (packetHeader.type == 203 && this.m_bSavePacket)
                {
                    this.m_bSavePacket = false;
                    NrTSingleton <NkBattleReplayManager> .Instance.Savefile();
                }
                if ((int)packetHeader.size != num3)
                {
                    Debug.LogException(new Exception(string.Concat(new object[]
                    {
                        "Err: PrevePackType: Watch Out Protocol ID:",
                        ((eGAME_PACKET_ID)this.mPrevPackType).ToString(),
                        ":Total:",
                        totalSize
                    })));
                    Debug.LogException(new Exception(string.Concat(new object[]
                    {
                        "Err :Receive_GamePacket Not Match=(Type:",
                        ((eGAME_PACKET_ID)packetHeader.type).ToString(),
                        ",Size:",
                        packetHeader.size,
                        " != ",
                        num3,
                        ")I:",
                        index
                    })));
                    num3 = (int)packetHeader.size;
                    if (0 > packetHeader.size)
                    {
                        goto Block_8;
                    }
                }
                this.mPrevPackType = packetHeader.type;
                num4 = totalSize - (num3 + index);
                if (num3 + index >= totalSize)
                {
                    goto Block_9;
                }
                index += num3;
            }
            return(index);

Block_8:
            Debug.LogWarning("Packet:ErrorSkip");
            return(index);

Block_9:
            if (num4 != 0)
            {
                Debug.Log("Packet End Remain:" + num4);
            }
            index += num3;
            return(index);
        }