예제 #1
0
        public byte[] toBytes()
        {
            int total = 0;

            total += ProtoUtil.GetIntSize(this.roleID, true, 1, true, 0);
            total += ProtoUtil.GetIntSize(this.mapCode, true, 2, true, 0);
            total += ProtoUtil.GetIntSize(this.action, true, 3, true, 0);
            total += ProtoUtil.GetIntSize(this.toX, true, 4, true, 0);
            total += ProtoUtil.GetIntSize(this.toY, true, 5, true, 0);
            total += ProtoUtil.GetIntSize(this.extAction, true, 6, true, 0);
            total += ProtoUtil.GetIntSize(this.fromX, true, 7, true, 0);
            total += ProtoUtil.GetIntSize(this.fromY, true, 8, true, 0);
            total += ProtoUtil.GetLongSize(this.startMoveTicks, true, 9, true, 0L);
            total += ProtoUtil.GetStringSize(this.pathString, true, 10);
            total += ProtoUtil.GetDoubleSize(this.moveCost, true, 11, true, 0.0);
            byte[] data   = new byte[total];
            int    offset = 0;

            ProtoUtil.IntMemberToBytes(data, 1, ref offset, this.roleID, true, 0);
            ProtoUtil.IntMemberToBytes(data, 2, ref offset, this.mapCode, true, 0);
            ProtoUtil.IntMemberToBytes(data, 3, ref offset, this.action, true, 0);
            ProtoUtil.IntMemberToBytes(data, 4, ref offset, this.toX, true, 0);
            ProtoUtil.IntMemberToBytes(data, 5, ref offset, this.toY, true, 0);
            ProtoUtil.IntMemberToBytes(data, 6, ref offset, this.extAction, true, 0);
            ProtoUtil.IntMemberToBytes(data, 7, ref offset, this.fromX, true, 0);
            ProtoUtil.IntMemberToBytes(data, 8, ref offset, this.fromY, true, 0);
            ProtoUtil.LongMemberToBytes(data, 9, ref offset, this.startMoveTicks, true, 0L);
            ProtoUtil.StringMemberToBytes(data, 10, ref offset, this.pathString);
            ProtoUtil.DoubleMemberToBytes(data, 11, ref offset, this.moveCost, true, 0.0);
            return(data);
        }
예제 #2
0
        public byte[] toBytes()
        {
            int total = 0;

            total += ProtoUtil.GetIntSize(roleID, true, 1);
            total += ProtoUtil.GetIntSize(mapCode, true, 2);
            total += ProtoUtil.GetIntSize(action, true, 3);
            total += ProtoUtil.GetIntSize(toX, true, 4);
            total += ProtoUtil.GetIntSize(toY, true, 5);
            total += ProtoUtil.GetIntSize(extAction, true, 6);
            total += ProtoUtil.GetIntSize(fromX, true, 7);
            total += ProtoUtil.GetIntSize(fromY, true, 8);
            total += ProtoUtil.GetLongSize(startMoveTicks, true, 9);
            total += ProtoUtil.GetStringSize(pathString, true, 10);
            total += ProtoUtil.GetDoubleSize(moveCost, true, 11);
            byte[] data   = new byte[total];
            int    offset = 0;

            ProtoUtil.IntMemberToBytes(data, 1, ref offset, roleID);
            ProtoUtil.IntMemberToBytes(data, 2, ref offset, mapCode);
            ProtoUtil.IntMemberToBytes(data, 3, ref offset, action);
            ProtoUtil.IntMemberToBytes(data, 4, ref offset, toX);
            ProtoUtil.IntMemberToBytes(data, 5, ref offset, toY);
            ProtoUtil.IntMemberToBytes(data, 6, ref offset, extAction);
            ProtoUtil.IntMemberToBytes(data, 7, ref offset, fromX);
            ProtoUtil.IntMemberToBytes(data, 8, ref offset, fromY);
            ProtoUtil.LongMemberToBytes(data, 9, ref offset, startMoveTicks);
            ProtoUtil.StringMemberToBytes(data, 10, ref offset, pathString);
            ProtoUtil.DoubleMemberToBytes(data, 11, ref offset, moveCost);
            return(data);
        }
예제 #3
0
        public byte[] toBytes()
        {
            int total = 0;

            total += ProtoUtil.GetIntSize(this.RoleID, true, 1, true, 0);
            total += ProtoUtil.GetIntSize(this.MapCode, true, 2, true, 0);
            total += ProtoUtil.GetLongSize(this.StartMoveTicks, true, 3, true, 0L);
            total += ProtoUtil.GetIntSize(this.CurrentX, true, 4, true, 0);
            total += ProtoUtil.GetIntSize(this.CurrentY, true, 5, true, 0);
            total += ProtoUtil.GetIntSize(this.CurrentDirection, true, 6, true, 0);
            total += ProtoUtil.GetIntSize(this.Action, true, 7, true, 0);
            total += ProtoUtil.GetIntSize(this.ToX, true, 8, true, 0);
            total += ProtoUtil.GetIntSize(this.ToY, true, 9, true, 0);
            total += ProtoUtil.GetDoubleSize(this.MoveCost, true, 10, true, 0.0);
            total += ProtoUtil.GetIntSize(this.ExtAction, true, 11, true, 0);
            total += ProtoUtil.GetStringSize(this.PathString, true, 12);
            total += ProtoUtil.GetIntSize(this.CurrentPathIndex, true, 13, true, 0);
            byte[] data   = new byte[total];
            int    offset = 0;

            ProtoUtil.IntMemberToBytes(data, 1, ref offset, this.RoleID, true, 0);
            ProtoUtil.IntMemberToBytes(data, 2, ref offset, this.MapCode, true, 0);
            ProtoUtil.LongMemberToBytes(data, 3, ref offset, this.StartMoveTicks, true, 0L);
            ProtoUtil.IntMemberToBytes(data, 4, ref offset, this.CurrentX, true, 0);
            ProtoUtil.IntMemberToBytes(data, 5, ref offset, this.CurrentY, true, 0);
            ProtoUtil.IntMemberToBytes(data, 6, ref offset, this.CurrentDirection, true, 0);
            ProtoUtil.IntMemberToBytes(data, 7, ref offset, this.Action, true, 0);
            ProtoUtil.IntMemberToBytes(data, 8, ref offset, this.ToX, true, 0);
            ProtoUtil.IntMemberToBytes(data, 9, ref offset, this.ToY, true, 0);
            ProtoUtil.DoubleMemberToBytes(data, 10, ref offset, this.MoveCost, true, 0.0);
            ProtoUtil.IntMemberToBytes(data, 11, ref offset, this.ExtAction, true, 0);
            ProtoUtil.StringMemberToBytes(data, 12, ref offset, this.PathString);
            ProtoUtil.IntMemberToBytes(data, 13, ref offset, this.CurrentPathIndex, true, 0);
            return(data);
        }
예제 #4
0
        public byte[] toBytes()
        {
            int total = 0;

            total += ProtoUtil.GetIntSize(enemy, true, 1);
            total += ProtoUtil.GetIntSize(burst, true, 2);
            total += ProtoUtil.GetIntSize(injure, true, 3);
            total += ProtoUtil.GetDoubleSize(enemyLife, true, 4);
            total += ProtoUtil.GetLongSize(newExperience, true, 5);
            total += ProtoUtil.GetLongSize(currentExperience, true, 6);
            total += ProtoUtil.GetIntSize(newLevel, true, 7);
            total += ProtoUtil.GetIntSize(MerlinInjuer, true, 8);
            total += ProtoUtil.GetIntSize(MerlinType, true, 9);
            byte[] data   = new byte[total];
            int    offset = 0;

            ProtoUtil.IntMemberToBytes(data, 1, ref offset, enemy);
            ProtoUtil.IntMemberToBytes(data, 2, ref offset, burst);
            ProtoUtil.IntMemberToBytes(data, 3, ref offset, injure);
            ProtoUtil.DoubleMemberToBytes(data, 4, ref offset, enemyLife);
            ProtoUtil.LongMemberToBytes(data, 5, ref offset, newExperience);
            ProtoUtil.LongMemberToBytes(data, 6, ref offset, currentExperience);
            ProtoUtil.IntMemberToBytes(data, 7, ref offset, newLevel);
            ProtoUtil.IntMemberToBytes(data, 8, ref offset, MerlinInjuer);
            ProtoUtil.IntMemberToBytes(data, 9, ref offset, MerlinType);

            return(data);
        }
예제 #5
0
        public byte[] toBytes()
        {
            int total = 0;

            total += ProtoUtil.GetIntSize(this.enemy, true, 1, true, 0);
            total += ProtoUtil.GetIntSize(this.burst, true, 2, true, 0);
            total += ProtoUtil.GetIntSize(this.injure, true, 3, true, 0);
            total += ProtoUtil.GetDoubleSize(this.enemyLife, true, 4, true, 0.0);
            total += ProtoUtil.GetLongSize(this.newExperience, true, 5, true, 0L);
            total += ProtoUtil.GetLongSize(this.currentExperience, true, 6, true, 0L);
            total += ProtoUtil.GetIntSize(this.newLevel, true, 7, true, 0);
            total += ProtoUtil.GetIntSize(this.MerlinInjuer, true, 8, true, 0);
            total += ProtoUtil.GetIntSize(this.MerlinType, true, 9, true, 0);
            total += ProtoUtil.GetIntSize(this.armorV_p1, true, 10, true, 0);
            byte[] data   = new byte[total];
            int    offset = 0;

            ProtoUtil.IntMemberToBytes(data, 1, ref offset, this.enemy, true, 0);
            ProtoUtil.IntMemberToBytes(data, 2, ref offset, this.burst, true, 0);
            ProtoUtil.IntMemberToBytes(data, 3, ref offset, this.injure, true, 0);
            ProtoUtil.DoubleMemberToBytes(data, 4, ref offset, this.enemyLife, true, 0.0);
            ProtoUtil.LongMemberToBytes(data, 5, ref offset, this.newExperience, true, 0L);
            ProtoUtil.LongMemberToBytes(data, 6, ref offset, this.currentExperience, true, 0L);
            ProtoUtil.IntMemberToBytes(data, 7, ref offset, this.newLevel, true, 0);
            ProtoUtil.IntMemberToBytes(data, 8, ref offset, this.MerlinInjuer, true, 0);
            ProtoUtil.IntMemberToBytes(data, 9, ref offset, this.MerlinType, true, 0);
            ProtoUtil.IntMemberToBytes(data, 10, ref offset, this.armorV_p1, true, 0);
            return(data);
        }
예제 #6
0
        public byte[] toBytes()
        {
            int total = 0;

            total += ProtoUtil.GetIntSize(this.roleID, true, 1, true, 0);
            total += ProtoUtil.GetIntSize(this.x, true, 2, true, 0);
            total += ProtoUtil.GetIntSize(this.y, true, 3, true, 0);
            total += ProtoUtil.GetIntSize(this.direction, true, 4, true, 0);
            total += ProtoUtil.GetDoubleSize(this.lifeV, true, 5, true, 0.0);
            total += ProtoUtil.GetDoubleSize(this.magicV, true, 6, true, 0.0);
            total += ProtoUtil.GetIntSize(this.force, true, 7, true, 0);
            byte[] data   = new byte[total];
            int    offset = 0;

            ProtoUtil.IntMemberToBytes(data, 1, ref offset, this.roleID, true, 0);
            ProtoUtil.IntMemberToBytes(data, 2, ref offset, this.x, true, 0);
            ProtoUtil.IntMemberToBytes(data, 3, ref offset, this.y, true, 0);
            ProtoUtil.IntMemberToBytes(data, 4, ref offset, this.direction, true, 0);
            ProtoUtil.DoubleMemberToBytes(data, 5, ref offset, this.lifeV, true, 0.0);
            ProtoUtil.DoubleMemberToBytes(data, 6, ref offset, this.magicV, true, 0.0);
            ProtoUtil.IntMemberToBytes(data, 7, ref offset, this.force, true, 0);
            return(data);
        }
예제 #7
0
        public byte[] toBytes()
        {
            int total = 0;

            total += ProtoUtil.GetIntSize(RoleID, true, 1);
            total += ProtoUtil.GetIntSize(MapCode, true, 2);
            total += ProtoUtil.GetLongSize(StartMoveTicks, true, 3);
            total += ProtoUtil.GetIntSize(CurrentX, true, 4);
            total += ProtoUtil.GetIntSize(CurrentY, true, 5);
            total += ProtoUtil.GetIntSize(CurrentDirection, true, 6);
            total += ProtoUtil.GetIntSize(Action, true, 7);
            total += ProtoUtil.GetIntSize(ToX, true, 8);
            total += ProtoUtil.GetIntSize(ToY, true, 9);
            total += ProtoUtil.GetDoubleSize(MoveCost, true, 10);
            total += ProtoUtil.GetIntSize(ExtAction, true, 11);
            total += ProtoUtil.GetStringSize(PathString, true, 12);
            total += ProtoUtil.GetIntSize(CurrentPathIndex, true, 13);
            byte[] data   = new byte[total];
            int    offset = 0;

            ProtoUtil.IntMemberToBytes(data, 1, ref offset, RoleID);
            ProtoUtil.IntMemberToBytes(data, 2, ref offset, MapCode);
            ProtoUtil.LongMemberToBytes(data, 3, ref offset, StartMoveTicks);
            ProtoUtil.IntMemberToBytes(data, 4, ref offset, CurrentX);
            ProtoUtil.IntMemberToBytes(data, 5, ref offset, CurrentY);
            ProtoUtil.IntMemberToBytes(data, 6, ref offset, CurrentDirection);
            ProtoUtil.IntMemberToBytes(data, 7, ref offset, Action);
            ProtoUtil.IntMemberToBytes(data, 8, ref offset, ToX);
            ProtoUtil.IntMemberToBytes(data, 9, ref offset, ToY);
            ProtoUtil.DoubleMemberToBytes(data, 10, ref offset, MoveCost);
            ProtoUtil.IntMemberToBytes(data, 11, ref offset, ExtAction);
            ProtoUtil.StringMemberToBytes(data, 12, ref offset, PathString);
            ProtoUtil.IntMemberToBytes(data, 13, ref offset, CurrentPathIndex);

            return(data);
        }