public static bnet.protocol.attribute.Attribute CreateAttribute(string name, bool val)
 {
     bnet.protocol.attribute.Attribute attribute = new bnet.protocol.attribute.Attribute();
     bnet.protocol.attribute.Variant   variant   = new bnet.protocol.attribute.Variant();
     variant.SetBoolValue(val);
     attribute.SetName(name);
     attribute.SetValue(variant);
     return(attribute);
 }
Beispiel #2
0
        public void SetPresenceBool(uint field, bool val)
        {
            UpdateRequest  updateRequest  = new UpdateRequest();
            FieldOperation fieldOperation = new FieldOperation();
            Field          field1         = new Field();
            FieldKey       fieldKey       = new FieldKey();

            fieldKey.SetProgram(BnetProgramId.WOW.GetValue());
            fieldKey.SetGroup(2);
            fieldKey.SetField(field);
            bnet.protocol.attribute.Variant variant = new bnet.protocol.attribute.Variant();
            variant.SetBoolValue(val);
            field1.SetKey(fieldKey);
            field1.SetValue(variant);
            fieldOperation.SetField(field1);
            updateRequest.SetEntityId(this.m_battleNet.GameAccountId);
            updateRequest.AddFieldOperation(fieldOperation);
            this.PublishField(updateRequest);
        }