public static bnet.protocol.attribute.Attribute CreateAttribute(string name, long val) { bnet.protocol.attribute.Attribute attribute = new bnet.protocol.attribute.Attribute(); bnet.protocol.attribute.Variant variant = new bnet.protocol.attribute.Variant(); variant.SetIntValue(val); attribute.SetName(name); attribute.SetValue(variant); return(attribute); }
public void SetPresenceInt(uint field, long val) { UpdateRequest updateRequest = new UpdateRequest() { EntityId = this.m_battleNet.GameAccountId }; 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.SetIntValue(val); field1.SetKey(fieldKey); field1.SetValue(variant); fieldOperation.SetField(field1); updateRequest.SetEntityId(this.m_battleNet.GameAccountId); updateRequest.AddFieldOperation(fieldOperation); this.PublishField(updateRequest); }