コード例 #1
0
        public void RPC_UpdateRoleComValue(ulong roleId, string name, RPC.DataReader value)
        {
            var role = GetRole(roleId);

            if (role == null)
            {
                return;
            }
            switch (name)
            {
            case "RoleLevel":
            {
                role.RoleData.Level = value.ReadUInt16();
            }
            break;

            case "Camp":
            {
                role.RoleData.Camp = value.ReadByte();
            }
            break;

            case "Profession":
            {
                role.RoleData.Profession = value.ReadByte();
            }
            break;

            case "PlanesId":
            {
                role.RoleData.PlanesId = value.ReadUInt16();
            }
            break;
            }
        }
コード例 #2
0
ファイル: WorldManager.cs プロジェクト: 372285834/GServer
        public void DeserializeArms(byte[] buffer)
        {
            HoldPoints.Clear();

            RPC.DataReader dr    = new RPC.DataReader(buffer, 0, buffer.Length, buffer.Length);
            var            count = dr.ReadByte();

            for (int i = 0; i < count; i++)
            {
                var hold = new HoldPoint();
                HoldPoints.Add(hold);
                hold.ArmsCount = dr.ReadUInt32();
                hold.Camp      = (CSCommon.eCamp)dr.ReadByte();
            }
            count = dr.ReadByte();
            for (int i = 0; i < count; i++)
            {
                var val = dr.ReadUInt64();
                if (i < Defender.Length)
                {
                    Defender[i] = val;
                }
            }
            count = dr.ReadByte();
            for (int i = 0; i < count; i++)
            {
                var val = dr.ReadUInt32();
                if (i < AdvanceArms.Length)
                {
                    AdvanceArms[i] = val;
                }
            }
        }
コード例 #3
0
        //--------------------------------------数据存取---------------------------------------------------------

        //初始化数据库数据
        public void MartialUnSerialize(PlayerInstance role, byte[] buffer)
        {
            mRole = role;
            if (buffer == null || buffer.Length <= 0)
            {
                return;
            }
            RPC.DataReader dr    = new RPC.DataReader(buffer, 0, buffer.Length, buffer.Length);
            byte           count = dr.ReadByte();

            for (byte i = 0; i < count; i++)
            {
                byte        type   = dr.ReadByte();
                BuildOutPut output = new BuildOutPut(type);
                output.mStartTime      = dr.ReadDateTime();
                output.mOutCount       = dr.ReadByte();
                output.mUpOutIndex     = dr.ReadSByte();
                output.mUpStartTime    = dr.ReadDateTime();
                output.mOutPutTotalNum = dr.ReadInt32();
                AddOutPut(output, false);
            }
            InitOutData();
        }
コード例 #4
0
        //初始化数据库数据
        public void VisitDataUnSerialize()
        {
            byte[] buffer = RoleData.VisitPlayers;
            VisitTopList.Clear();
            VisitFriendList.Clear();
            if (buffer == null || buffer.Length <= 0)
            {
                return;
            }
            RPC.DataReader dr    = new RPC.DataReader(buffer, 0, buffer.Length, buffer.Length);
            byte           count = dr.ReadByte();

            for (byte i = 0; i < count; i++)
            {
                ulong id = dr.ReadUInt64();
                VisitTopList.Add(id);
            }
            count = dr.ReadByte();
            for (byte i = 0; i < count; i++)
            {
                ulong id = dr.ReadUInt64();
                VisitFriendList.Add(id);
            }
        }
コード例 #5
0
ファイル: RecordManager.cs プロジェクト: 372285834/GServer
        public void AchieveUnSerialize(byte[] buffer)
        {
            AcceptAchieveDict.Clear();
            if (buffer == null || buffer.Length <= 0)
            {
                return;
            }
            RPC.DataReader dr    = new RPC.DataReader(buffer, 0, buffer.Length, buffer.Length);
            int            count = dr.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                AcceptAchieveData data = new AcceptAchieveData();
                data.id                    = dr.ReadInt32();
                data.targetNum             = dr.ReadInt32();
                data.getReward             = dr.ReadByte();
                AcceptAchieveDict[data.id] = data;
            }
        }
コード例 #6
0
ファイル: Role_Rank.cs プロジェクト: 372285834/GServer
        public void RPC_UpdateRankDataValue(ulong roleId, string name, RPC.DataReader value)
        {
            RankData rank = GetRank(roleId);

            if (rank == null)
            {
                return;
            }
            switch (name)
            {
            case "RoleLevel":
                rank.Level = value.ReadUInt16();
                break;

            case "Fighting":
                rank.Fighting = value.ReadInt32();
                break;

            case "Exploit":
                rank.Exploit = value.ReadInt32();
                break;

            case "ExploitBox":
                rank.ExploitBox = value.ReadByte();
                break;

            case "KillEnemy":
                rank.KillEnemy = value.ReadInt32();
                break;

            case "Challenge":
                rank.Challenge = value.ReadInt32();
                break;
            }
            UPdateRankData(rank);
        }