コード例 #1
0
ファイル: Database.cs プロジェクト: saysoft77/CDJPScanMaster
 void ReadBinaryFormatters(Table binaryFormattersTable)
 {
     for (int i = 0, readOffset = (int)binaryFormattersTable.offset; i < binaryFormattersTable.rowCount; i++, readOffset += binaryFormattersTable.rowSize)
     {
         uint ID            = (uint)binaryFormattersTable.ReadField(dbReader.rawDB, readOffset, 0);
         uint trueStringId  = (uint)binaryFormattersTable.ReadField(dbReader.rawDB, readOffset, 1);
         uint falseStringId = (uint)binaryFormattersTable.ReadField(dbReader.rawDB, readOffset, 2);
         BinaryFormatters[ID] = new BinaryDataFormatter(this, ID, falseStringId, trueStringId);
     }
 }
コード例 #2
0
ファイル: StateMessage.cs プロジェクト: pievis/AWFramework
    public override void Deserialize(NetworkReader reader)
    {
        ushort length = reader.ReadUInt16();

        for (int i = 0; i < length; i++)
        {
            string key   = reader.ReadString();
            byte[] bytes = reader.ReadBytesAndSize();
            object value = BinaryDataFormatter.FromBytes(bytes);
            map.Add(key, value);
        }
    }
コード例 #3
0
    public override void Deserialize(NetworkReader reader)
    {
        netId  = reader.ReadPackedUInt32();
        method = reader.ReadString();
        ushort length = reader.ReadUInt16();

        args = new object[length];
        for (int i = 0; i < length; i++)
        {
            byte[] bytes = reader.ReadBytesAndSize();
            args [i] = BinaryDataFormatter.FromBytes(bytes);
        }
    }
コード例 #4
0
ファイル: StateMessage.cs プロジェクト: pievis/AWFramework
    public override void Serialize(NetworkWriter writer)
    {
        ushort count = (ushort)map.Keys.Count;

        writer.Write(count);
        foreach (KeyValuePair <string, object> p in map)
        {
            writer.Write(p.Key);
            byte[] bytes;
            try {
                bytes = BinaryDataFormatter.ToBytes(p.Value);
                writer.WriteBytesFull(bytes);
            } catch (System.Exception se) {
                Debug.LogException(se);
            }
        }
    }
コード例 #5
0
    public override void Serialize(NetworkWriter writer)
    {
        writer.WritePackedUInt32(netId);
        writer.Write(method);
        writer.Write((ushort)args.Length);

        for (int i = 0; i < args.Length; i++)
        {
            byte[] bytes;
            try {
                bytes = BinaryDataFormatter.ToBytes(args [i]);
                writer.WriteBytesFull(bytes);
            } catch (System.Exception se) {
                Debug.LogException(se);
            }
        }
    }