Exemplo n.º 1
0
        public static ProfilePlayer ReadFrom(PrimitiveReader reader)
        {
            ProfilePlayer player = new ProfilePlayer();

            player.Name     = reader.ReadFixedString(nameLength, Utils.TextEncoding);
            player.PlayerId = reader.ReadUInt32();
            player.Unknown  = reader.ReadUInt32();

            int campaignsCount = reader.ReadInt32();
            List <ProfileCampaign> campaigns = new List <ProfileCampaign>(campaignsCount);

            for (int i = 0; i < campaignsCount; i++)
            {
                campaigns.Add(ProfileCampaign.ReadFrom(reader));
            }
            player.Campaigns = campaigns;
            player.Options   = reader.ReadBytes(522);
            var options2 = new ProfilePlayerOptions(player.Options);

            return(player);
        }
Exemplo n.º 2
0
        public static ProfileFile FromStream(PrimitiveReader reader)
        {
            ProfileFile profile = new ProfileFile();

            profile.Version1 = Version.Parse(reader.ReadASCIIString(4));
            if (profile.Version1.Minor >= 6)
            {
                profile.Version2 = Version.Parse(reader.ReadFloat32().ToString("0.00"));
            }
            profile.LastPlayerId        = reader.ReadUInt32();
            profile.SelectedPlayerIndex = reader.ReadUInt32();

            int playersCount             = reader.ReadInt32();
            List <ProfilePlayer> players = new List <ProfilePlayer>(playersCount);

            for (int i = 0; i < playersCount; i++)
            {
                players.Add(ProfilePlayer.ReadFrom(reader));
            }
            profile.Players = players;
            return(profile);
        }