Пример #1
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(Files.Length);
     foreach (var file in Files)
     {
         writer.WriteUTF(file);
     }
 }
 public override void Serialize(BigEndianWriter writer)
 {
     base.Serialize(writer);
     writer.WriteInt(grade);
 }
Пример #3
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(initiatorId);
     writer.WriteInt(otherId);
     writer.WriteSByte(role);
 }
Пример #4
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(mapRideId);
 }
Пример #5
0
 public virtual void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(mapId);
     writer.WriteSByte(state);
 }
 public override void Serialize(BigEndianWriter writer)
 {
     base.Serialize(writer);
     writer.WriteInt(kickerId);
 }
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(elemId);
     writer.WriteShort(skillId);
 }
Пример #8
0
 public override void Serialize(BigEndianWriter writer)
 {
     base.Serialize(writer);
     writer.WriteInt(carryingCharacterId);
 }
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(type);
     writer.WriteInt(genId);
 }
Пример #10
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(targetId);
 }
Пример #11
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(entityId);
     writer.WriteSByte(smileyId);
     writer.WriteInt(accountId);
 }
Пример #12
0
 private static void WriteFieldI18n(BigEndianWriter writer, int value)
 {
     writer.WriteInt(value);
 }
Пример #13
0
 private void WriteHeader()
 {
     m_writer.WriteUTFBytes("D2O");
     m_writer.WriteInt(0); // allocate space to write the correct index table offset
 }
 public override void Serialize(BigEndianWriter writer)
 {
     base.Serialize(writer);
     writer.WriteInt(storageMaxSlot);
 }
Пример #15
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(requiredVersion);
     writer.WriteInt(currentVersion);
 }
Пример #16
0
 public virtual void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(this.value);
 }
Пример #17
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(memberId);
     writer.WriteBoolean(online);
 }
Пример #18
0
        public void Save(string uri)
        {
            using (var contentWriter = new BigEndianWriter(new StreamWriter(uri).BaseStream))
            {
                var headerWriter = new BigEndianWriter();
                contentWriter.Seek(4, SeekOrigin.Begin);

                // first table = index table
                foreach (var index in m_entries.Where(x => x.Value.Text != null))
                {
                    headerWriter.WriteInt(index.Key);
                    headerWriter.WriteBoolean(index.Value.UseUndiactricalText);

                    headerWriter.WriteInt((int)contentWriter.Position);
                    contentWriter.WriteUTF(index.Value.Text);

                    if (index.Value.UseUndiactricalText)
                    {
                        headerWriter.WriteInt((int)contentWriter.Position);
                        contentWriter.WriteUTF(index.Value.UnDiactricialText);
                    }
                }

                var indexLen = (int)headerWriter.Position;

                // second table = text index table
                headerWriter.WriteInt(0); // placeholder for text index table len

                foreach (var index in m_textEntries.Where(x => x.Value.Text != null))
                {
                    headerWriter.WriteUTF(index.Key);
                    headerWriter.WriteInt((int)contentWriter.Position);
                    contentWriter.WriteUTF(index.Value.Text);
                }

                var textIndexLen   = headerWriter.Position - indexLen - 4;
                var searchTablePos = headerWriter.Position;
                headerWriter.Seek(indexLen);
                headerWriter.WriteInt((int)textIndexLen); // write table len
                headerWriter.Seek((int)searchTablePos);

                // third table = search index table
                headerWriter.WriteInt(0); // placeholder for table len
                var sortedEntries = m_entries.Values.OrderBy(x => x.Text);
                foreach (var entry in sortedEntries)
                {
                    headerWriter.WriteInt(entry.Key);
                }

                var searchTableLen = headerWriter.Position - searchTablePos - 4;
                headerWriter.Seek((int)searchTablePos);
                headerWriter.WriteInt((int)searchTableLen); // write table len

                var indexPos = (int)contentWriter.Position;

                /* write index at end */
                byte[] indexData = headerWriter.Data;
                contentWriter.WriteInt(indexLen);
                contentWriter.WriteBytes(indexData);

                /* write index pos at begin */
                contentWriter.Seek(0, SeekOrigin.Begin);
                contentWriter.WriteInt(indexPos);
            }
        }
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(spellId);
 }
Пример #20
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(paddockId);
     writer.WriteBoolean(bought);
     writer.WriteVarInt(realPrice);
 }
Пример #21
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(uid);
     writer.WriteBoolean(bought);
 }
Пример #22
0
 public override void Serialize(BigEndianWriter writer)
 {
     base.Serialize(writer);
     writer.WriteInt(spawnMapId);
 }
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteShort(dungeonId);
     writer.WriteInt(buddyId);
     writer.WriteBoolean(accept);
 }
Пример #24
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(objectUID);
 }
 public override void Serialize(BigEndianWriter writer)
 {
     base.Serialize(writer);
     writer.WriteUTF(name);
     writer.WriteInt(id);
 }
Пример #26
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(kamasTotal);
 }
Пример #27
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(fightId);
     writer.WriteVarInt(playerId);
 }
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(characterId);
     writer.WriteUTF(secretAnswerHash);
 }
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(kickedId);
 }
Пример #30
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(timestamp);
     writer.WriteShort(timezoneOffset);
 }
Пример #31
0
 public override void Serialize(BigEndianWriter writer)
 {
     writer.WriteInt(objectUID);
     writer.WriteByte(position);
 }