Exemplo n.º 1
0
 public void AddField(int Index, EPacketFieldType Type, object Value)
 {
     ISerializableField Field = PacketProcessor.GetFieldType(Type);
     if (Field != null)
     {
         Field.Index = Index;
         Field.val = Value;
         Field.PacketType = Type;
         AddField(Index, Field);
     }
 }
Exemplo n.º 2
0
        public void AddField(int Index, EPacketFieldType Type, object Value)
        {
            ISerializableField Field = PacketProcessor.GetFieldType(Type);

            if (Field != null)
            {
                Field.Index      = Index;
                Field.val        = Value;
                Field.PacketType = Type;
                AddField(Index, Field);
            }
        }
Exemplo n.º 3
0
        public static bool WriteField(ref PacketOutStream Stream, EPacketFieldType FieldType, object Value, bool Force)
        {
            ISerializableField Field = GetFieldType(FieldType);

            Log.Debug("WriteField", "Type=" + FieldType + ",Val=" + Value + ",Field=" + Field);
            if (Field != null)
            {
                Field.val = Value;
                Field.Serialize(ref Stream, true);
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        public static ISerializableField GetFieldType(EPacketFieldType Type)
        {
            ISerializableField Field;

            FieldsTypes.TryGetValue(Type, out Field);
            if (Field != null)
            {
                ISerializableField IField = Activator.CreateInstance(Field.GetType()) as ISerializableField;
                IField.PacketType = Type;
                return(IField);
            }

            Log.Error("PacketProcessor", "Unhandled Field Type : " + Type);
            return(null);
        }
Exemplo n.º 5
0
        public static ISerializableField GetFieldType(EPacketFieldType Type)
        {
            Log.Info("GetFieldType", "Type = " + Type);

            ISerializableField Field;
            FieldsTypes.TryGetValue(Type, out Field);
            if (Field != null)
            {
                ISerializableField IField = Activator.CreateInstance(Field.GetType()) as ISerializableField;
                IField.PacketType = Type;
                return IField;
            }

            Log.Error("PacketProcessor", "Unhandled Field Type : " + Type);
            return null;
        }
Exemplo n.º 6
0
        public static bool WriteField(ref PacketOutStream Stream, EPacketFieldType FieldType, object Value, bool Force)
        {
            ISerializableField Field = GetFieldType(FieldType);
            Log.Debug("WriteField", "Type=" + FieldType + ",Val=" + Value + ",Field="+Field);
            if (Field != null)
            {
                Field.val = Value;
                Field.Serialize(ref Stream,true);
                return true;
            }

            return false;
        }