Exemplo n.º 1
0
        public override bool loadReader(EexBinaryReader reader)
        {
            initKVArray();
            CommandConfig cfg = ScriptConfig.Instance.getCommandConfig(Id);

            if (cfg.FieldRepeat <= 1)
            {
                for (int i = 0; i < FieldCount; i++)
                {
                    values[i] = reader.readFieldObject(keys[i]);
                }
            }
            else
            {
                for (int i = 0; i < cfg.FieldRepeat; i++)
                {
                    Object[] objs = new Object[FieldCount];
                    for (int j = 0; j < FieldCount; j++)
                    {
                        objs[j] = reader.readFieldObject(keys[j]);
                    }
                    arrayValues[i] = objs;
                }
            }

            return(true);
        }
Exemplo n.º 2
0
        public override bool loadReader(EexBinaryReader reader, int group)
        {
            initKVArray(group);
            CommandConfig cfg = ScriptConfig.Instance.getCommandConfig(Id, group);

            if (cfg.useFieldIds())
            {
                if (cfg.FieldRepeat <= 1)
                {
                    for (int i = 0; i < FieldCount; i++)
                    {
                        values[i] = reader.readFieldObject(keys[i]);
                    }
                }
                else
                {
                    for (int i = 0; i < cfg.FieldRepeat; i++)
                    {
                        Object[] objs = new Object[FieldCount];
                        for (int j = 0; j < FieldCount; j++)
                        {
                            objs[j] = reader.readFieldObject(keys[j]);
                        }
                        arrayValues[i] = objs;
                    }
                }
            }
            else
            {
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < FieldCount; i++)
                {
                    sb.Append("0x").Append(reader.readUShort().ToString("x2")).Append(",");
                    values[i] = reader.readFieldValue(cfg.FieldTypes[i]);
                }
                String sth = sb.ToString();
                Console.WriteLine(sth);
                MessageBox.Show(sth);
            }
            return(true);
        }