public static void serialize(Utils.Objects.Packet sender)
 {
     int wrapper1 = 0;
     Utils.BooleanByteWrapper.setFlag(ref wrapper1, 0, false); // cantBeAggressed
     Utils.BooleanByteWrapper.setFlag(ref wrapper1, 1, false); // cantBeChallenged
     Utils.BooleanByteWrapper.setFlag(ref wrapper1, 2, false); // cantTrade
     Utils.BooleanByteWrapper.setFlag(ref wrapper1, 3, false); // cantBeAttackedByMutant
     Utils.BooleanByteWrapper.setFlag(ref wrapper1, 4, false); // cantRun
     Utils.BooleanByteWrapper.setFlag(ref wrapper1, 5, false); // forceSlowWalk
     Utils.BooleanByteWrapper.setFlag(ref wrapper1, 6, false); // cantMinimize
     Utils.BooleanByteWrapper.setFlag(ref wrapper1, 7, false); // cantMove
     sender.WriteByte((byte)wrapper1);
     int wrapper2 = 0;
     Utils.BooleanByteWrapper.setFlag(ref wrapper2, 0, false); // cantAggress
     Utils.BooleanByteWrapper.setFlag(ref wrapper2, 1, false); // cantChallenge
     Utils.BooleanByteWrapper.setFlag(ref wrapper2, 2, false); // cantExchange
     Utils.BooleanByteWrapper.setFlag(ref wrapper2, 3, false); // cantAttack
     Utils.BooleanByteWrapper.setFlag(ref wrapper2, 4, false); // cantChat
     Utils.BooleanByteWrapper.setFlag(ref wrapper2, 5, false); // cantBeMerchant
     Utils.BooleanByteWrapper.setFlag(ref wrapper2, 6, false); // cantUseObject
     Utils.BooleanByteWrapper.setFlag(ref wrapper2, 7, false); // cantUseTaxCollector
     sender.WriteByte((byte)wrapper2);
     int wrapper3 = 0;
     Utils.BooleanByteWrapper.setFlag(ref wrapper3, 0, false); // cantUseInteractive
     Utils.BooleanByteWrapper.setFlag(ref wrapper3, 1, false); // cantSpeakToNPC
     Utils.BooleanByteWrapper.setFlag(ref wrapper3, 2, false); // cantChangeZone
     Utils.BooleanByteWrapper.setFlag(ref wrapper3, 3, false); // cantAttackMonster
     Utils.BooleanByteWrapper.setFlag(ref wrapper3, 4, false); // cantWalk8Directions
     sender.WriteByte((byte)wrapper3);
 }
        public void serialize(Utils.Objects.Packet sender)
        {
            // MINIMAL INFO
            sender.WriteInt(Member.Guid);
            sender.WriteByte((byte)Member.Level);
            sender.WriteUTF(Member.Name);

            // LOOK
            sender.WriteShort(1); // bones ID

            sender.WriteShort(1); // nSkins
            sender.WriteShort((short)((int)Member.Classe * 10 + (int)Member.Sexe));

            sender.WriteShort((short)5);
            for (int i = 0; i < 5; ++i)
                sender.WriteInt(Member.Colors[i] | (i + 1) * 0x1000000);

            sender.WriteShort(1); // nScales
            sender.WriteShort((short)140);

            sender.WriteShort(0); // nSubEntities

            // PARTY
            sender.WriteInt(Member.Characteristics.lifePoints);
            sender.WriteInt(Member.Characteristics.maxLifePoints);
            sender.WriteShort((short)Member.Characteristics.prospecting.Total);
            sender.WriteByte(0); // regenRate
            sender.WriteShort((short)Member.Characteristics.initiative.Total);
            sender.WriteBool(false); // pvp enabled
            sender.WriteByte(0); // alignment side
        }
        public void serialize(Utils.Objects.Packet sender)
        {
            // --------------- //
            // --- MINIMAL --- //
            // --------------- //

            sender.WriteInt(_character.Guid);
            sender.WriteByte( (byte)_character.Level );
            sender.WriteUTF(_character.Name);

            // ------------ //
            // --- LOOK --- //
            // ------------ //

            sender.WriteShort(1); // bones ID

            sender.WriteShort(1); // nSkins
            sender.WriteShort( (short)( (int)_character.Classe * 10 + (int)_character.Sexe) );

            sender.WriteShort((short)5);
            for (int i = 0; i < 5; ++i)
                sender.WriteInt(_character.Colors[i] | (i + 1) * 0x1000000);

            sender.WriteShort(1); // nScales
            sender.WriteShort( (short)140 );

            sender.WriteShort(0); // nSubEntities

            // ------------ //
            // --- BASE --- //
            // ------------ //

            sender.WriteByte( (byte)_character.Classe );
            sender.WriteByte( (byte)_character.Sexe );
        }
        public static void serialize(Utils.Objects.Packet packet, Global.Character character)
        {
            packet.WriteUTF(character.Name);
            packet.WriteByte((byte)character.Classe);
            packet.WriteByte((byte)character.Sexe);

            foreach (int color in character.Colors)
                packet.WriteInt(color);
        }
Beispiel #5
0
 public static void serialize(Utils.Objects.Packet sender)
 {
     sender.WriteByte((byte)GlobalConfig.Version.Major);
     sender.WriteByte((byte)GlobalConfig.Version.Minor);
     sender.WriteByte((byte)GlobalConfig.Version.Release);
     sender.WriteUShort((ushort)GlobalConfig.Version.Revision);
     sender.WriteByte((byte)GlobalConfig.Version.BuildType);
     sender.WriteByte((byte)GlobalConfig.Version.Patch);
 }
        public static void serialize(Utils.Objects.Packet sender, List<Channel> enabled, List<Channel> disabled)
        {
            sender.WriteShort( (short)enabled.Count );
            foreach (Channel chan in enabled)
                sender.WriteByte( (byte)chan );

            sender.WriteShort( (short)disabled.Count );
            foreach (Channel chan in disabled)
                sender.WriteByte( (byte)chan );
        }
Beispiel #7
0
        public static void serialize(Utils.Objects.Packet sender, Global.Account acc)
        {
            sender.WriteShort(1); // nGameServers

            sender.WriteUShort((ushort)GlobalConfig.Network.Game.Guid);
            sender.WriteByte((byte)ServerState.ONLINE);
            sender.WriteByte(0); // completion
            sender.WriteBool(true); // selectable
            sender.WriteByte( (byte)acc.Characters.Count );
        }
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteInt( (int)Character.Id );
            sender.WriteByte( (byte)Character.Level );
            sender.WriteUTF(Character.Name);

            Character.Look.serialize(sender);

            sender.WriteByte( (byte)Character.Breed );
            sender.WriteByte( (byte)Character.Gender );
        }
 public static void serialize(Utils.Objects.Packet sender, Global.Account acc)
 {
     int wrapper = 0;
     Utils.BooleanByteWrapper.setFlag(ref wrapper, 0, (int)acc.GmLvl > 0);
     Utils.BooleanByteWrapper.setFlag(ref wrapper, 1, acc.Connected);
     sender.WriteByte( (byte)wrapper );
     sender.WriteUTF("[" + acc.GmLvl + "] " + acc.Nickname);
     sender.WriteInt((int)acc.Id);
     sender.WriteByte(0); // communityID
     sender.WriteUTF(""); // question
     sender.WriteDouble(31536000000); // aboTime (un an en millisecondes)
 }
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteByte((byte)alignmentSide);
            sender.WriteByte((byte)alignmentValue);
            sender.WriteByte((byte)alignmentGrade);
            sender.WriteShort((short)dishonor);
            sender.WriteInt(characterPower);

            sender.WriteShort((short)honor);
            sender.WriteShort((short)honorGradeFloor);
            sender.WriteShort((short)honorNextGradeFloor);
            sender.WriteBool(pvpEnabled);
        }
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteInt(_target.Guid);

            ////// ENTITY LOOK //////

            sender.WriteShort(1); // bones ID

            sender.WriteShort(1); // nSkins
            sender.WriteShort( (short)( (int)_target.Classe * 10 + (int)_target.Sexe) );

            sender.WriteShort((short)5);
            for (int i = 0; i < 5; ++i)
                sender.WriteInt(_target.Colors[i] | (i + 1) * 0x1000000);

            sender.WriteShort(1); // nScales
            sender.WriteShort( (short)140 );

            sender.WriteShort(0); // nSubEntities

            ////// ENTITY DISPOSITION

            sender.WriteShort(60); // EntityDisposition id

            sender.WriteShort(_target.CurCell);
            sender.WriteByte( (byte)_target.Direction );
        }
Beispiel #12
0
 public static void serialize(Utils.Objects.Packet sender, Channel chan, string message, Global.Character target)
 {
     sender.WriteByte((byte)chan);
     sender.WriteUTF(message);
     sender.WriteInt(Global.Environnement.getInstance().Timestamp);
     sender.WriteUTF("abcdef"); // fingerprint ???
     sender.WriteInt(target.Guid);
     sender.WriteUTF(target.Name);
 }
        public void serialize(Utils.Objects.Packet sender)
        {
            // MINIMAL INFO
            sender.WriteInt((int)Member.Id);
            sender.WriteByte((byte)Member.Level);
            sender.WriteUTF(Member.Name);

            Member.Look.serialize(sender);

            // PARTY
            sender.WriteInt(Member.Characteristics.lifePoints);
            sender.WriteInt(Member.Characteristics.maxLifePoints);
            sender.WriteShort((short)Member.Characteristics.prospecting.Total);
            sender.WriteByte(0); // regenRate
            sender.WriteShort((short)Member.Characteristics.initiative.Total);
            sender.WriteBool(false); // pvp enabled
            sender.WriteByte(0); // alignment side
        }
Beispiel #14
0
 public static void serialize(Utils.Objects.Packet sender, Channel chan, string message, Global.Character target)
 {
     sender.WriteByte((byte)chan);
     sender.WriteUTF(message);
     sender.WriteInt( (int)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds );
     sender.WriteUTF("abcdef"); // fingerprint ???
     sender.WriteInt((int)target.Id);
     sender.WriteUTF(target.Name);
 }
Beispiel #15
0
 public static void serialize(Utils.Objects.Packet sender, Channel chan, string message, Global.Character actor)
 {
     sender.WriteByte((byte)chan);
     sender.WriteUTF(message);
     sender.WriteInt( (int)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds );
     sender.WriteUTF(string.Empty);
     sender.WriteInt((int)actor.Id);
     sender.WriteUTF(actor.Name);
     sender.WriteInt((int)actor.Owner.Id);
 }
Beispiel #16
0
 public static void serialize(Utils.Objects.Packet sender, Channel chan, string message, Global.Character actor)
 {
     sender.WriteByte((byte)chan);
     sender.WriteUTF(message);
     sender.WriteInt(Global.Environnement.getInstance().Timestamp);
     sender.WriteUTF("abcdef");
     sender.WriteInt(actor.Guid);
     sender.WriteUTF(actor.Name);
     sender.WriteInt(actor.AccountID);
 }
Beispiel #17
0
        public void serialize(Utils.Objects.Packet sender)
        {
            sender.WriteUTF(Friend.Nickname);
            sender.WriteByte(Friend.CurrentCharacter != null ? (byte)Friend.CurrentCharacter.State : (byte)Enums.PlayerStateEnum.NOT_CONNECTED);
            sender.WriteInt(0);

            if (Friend.CurrentCharacter != null && Friend.CurrentCharacter.IsConnected)
            {
                sender.WriteUTF(Friend.CurrentCharacter.Name);
                sender.WriteShort((short)Friend.CurrentCharacter.Level);
                sender.WriteByte(0); // alignmentSide
                sender.WriteByte((byte)Friend.CurrentCharacter.Classe);
                sender.WriteByte((byte)Friend.CurrentCharacter.Sexe);

                sender.WriteInt(0); // guild guid
                sender.WriteUTF(""); // guild name

                sender.WriteByte(0xff); // mood smiley id
            }
        }
        public static void serialize(Utils.Objects.Packet sender, Enums.TextInformationType type, int msgId, string message)
        {
            sender.WriteByte((byte)type);
            sender.WriteShort((byte)msgId);

            if (message != string.Empty)
            {
                sender.WriteShort(1); // nMessages
                sender.WriteUTF(message);
            }
            else
                sender.WriteShort(0); // nMessages
        }
        public static void serialize(Utils.Objects.Packet sender, Global.Map map)
        {
            sender.WriteShort( (short)map.SubAreaID );
            sender.WriteInt( map.ID );
            sender.WriteByte(0); // subareaAlignmentSide

            sender.WriteShort(0); // nHouses

            sender.WriteShort( (short)map.Actors.Count );
            foreach (Global.Character actor in map.Actors)
            {
                sender.WriteShort((short)Types.game.context.GameRolePlayActorInformations.ProtocolID);
                new Types.game.context.GameRolePlayActorInformations(actor).serialize(sender);
            }

            sender.WriteShort(0); // nInteractiveElements

            sender.WriteShort(0); // nStatedElements

            sender.WriteShort(0); // nObstacles

            sender.WriteShort(0); // nFights
        }
 public static void serialize(Utils.Objects.Packet sender, Enums.CharacterCreationResult reason)
 {
     sender.WriteByte((byte)reason);
 }
 public static void serialize(Utils.Objects.Packet sender, Enums.PartyJoinErrorEnum reason)
 {
     sender.WriteByte((byte)reason);
 }
Beispiel #22
0
        /// <summary>
        /// Serialize a packet.
        /// </summary>
        public void serializeAs_MapComplementaryInformationsDataMessage(Utils.Objects.Packet sender)
        {
            sender.WriteShort((short)_subAreaId);
            sender.WriteInt((int)_id);
            sender.WriteByte(1); // subareaAlignmentSide

            sender.WriteShort(0); // nHouses

            sender.WriteShort((short)_actors.Count);
            foreach (Character actor in _actors)
            {
                sender.WriteShort((short)Network.Types.context.GameRolePlayActorInformations.ProtocolID);
                new Network.Types.context.GameRolePlayActorInformations(actor).serialize(sender);
            }

            sender.WriteShort(0); // nInteractiveElements

            sender.WriteShort(0); // nStatedElements

            sender.WriteShort(0); // nObstacles

            sender.WriteShort(0); // nFights
        }
 public static void serialize(Utils.Objects.Packet sender, Enums.GameContextEnum context)
 {
     sender.WriteByte((byte)context);
 }
Beispiel #24
0
 public static void serialize(Utils.Objects.Packet sender, Enums.ConsoleMessageTypeEnum type, string message)
 {
     sender.WriteByte((byte)type);
     sender.WriteUTF(message);
 }
 public static void serialize(Utils.Objects.Packet sender, Channel target, bool enable)
 {
     sender.WriteByte((byte)target);
     sender.WriteBool(enable);
 }
 public static void serialize(Utils.Objects.Packet sender, Enums.ListAddFailureEnum reason)
 {
     sender.WriteByte((byte)reason);
 }
 public static void serialize(Utils.Objects.Packet sender)
 {
     sender.WriteByte(100); // regen rate
 }
 public static void serialize(Utils.Objects.Packet sender, Network.Enums.CharacterDeletionErrorEnum reason)
 {
     sender.WriteByte((byte)reason);
 }
 public void serialize(Utils.Objects.Packet sender)
 {
     sender.WriteShort((short)Cell);
     sender.WriteByte((byte)Direction);
 }
 public static void serialize(Utils.Objects.Packet sender, Enums.IdentificationFailureReason reason)
 {
     sender.WriteByte((byte)reason);
 }