public void SendWhisper(BnetGameAccountId gameAccount, string message)
 {
     if (!string.IsNullOrEmpty(message))
     {
         bnet.protocol.notification.Notification notification = new bnet.protocol.notification.Notification();
         notification.SetType("WHISPER");
         EntityId val = new EntityId();
         val.SetLow(gameAccount.GetLo());
         val.SetHigh(gameAccount.GetHi());
         notification.SetTargetId(val);
         bnet.protocol.attribute.Attribute attribute = new bnet.protocol.attribute.Attribute();
         attribute.SetName("whisper");
         bnet.protocol.attribute.Variant variant = new bnet.protocol.attribute.Variant();
         variant.SetStringValue(message);
         attribute.SetValue(variant);
         notification.AddAttribute(attribute);
         base.m_rpcConnection.QueueRequest(base.m_battleNet.NotificationService.Id, 1, notification, new RPCContextDelegate(this.WhisperSentCallback), 0);
         BnetGameAccountId id   = BnetGameAccountId.CreateFromDll(BattleNet.GetMyGameAccountId());
         BnetWhisper       item = new BnetWhisper();
         item.SetSpeakerId(id);
         item.SetReceiverId(gameAccount);
         item.SetMessage(message);
         TimeSpan elapsedTimeSinceEpoch = TimeUtils.GetElapsedTimeSinceEpoch(null);
         item.SetTimestampMilliseconds(elapsedTimeSinceEpoch.TotalMilliseconds);
         this.m_whispers.Add(item);
     }
 }
        public void SendWhisper(BnetGameAccountId gameAccount, string message)
        {
            if (string.IsNullOrEmpty(message))
            {
                return;
            }
            Notification notification = new Notification();

            notification.SetType("WHISPER");
            bnet.protocol.EntityId entityId = new bnet.protocol.EntityId();
            entityId.SetLow(gameAccount.GetLo());
            entityId.SetHigh(gameAccount.GetHi());
            notification.SetTargetId(entityId);
            bnet.protocol.attribute.Attribute attribute = new bnet.protocol.attribute.Attribute();
            attribute.SetName("whisper");
            bnet.protocol.attribute.Variant variant = new bnet.protocol.attribute.Variant();
            variant.SetStringValue(message);
            attribute.SetValue(variant);
            notification.AddAttribute(attribute);
            this.m_rpcConnection.QueueRequest(this.m_battleNet.NotificationService.Id, 1, notification, new RPCContextDelegate(this.WhisperSentCallback), 0);
            BnetGameAccountId bnetGameAccountId = BnetGameAccountId.CreateFromEntityId(BattleNet.GetMyGameAccountId());
            BnetWhisper       bnetWhisper       = new BnetWhisper();

            bnetWhisper.SetSpeakerId(bnetGameAccountId);
            bnetWhisper.SetReceiverId(gameAccount);
            bnetWhisper.SetMessage(message);
            bnetWhisper.SetTimestampMilliseconds(TimeUtils.GetElapsedTimeSinceEpoch(null).TotalMilliseconds);
            this.m_whispers.Add(bnetWhisper);
        }
 public static bnet.protocol.attribute.Attribute CreateAttribute(string name, string val)
 {
     bnet.protocol.attribute.Attribute attribute = new bnet.protocol.attribute.Attribute();
     bnet.protocol.attribute.Variant   variant   = new bnet.protocol.attribute.Variant();
     variant.SetStringValue(val);
     attribute.SetName(name);
     attribute.SetValue(variant);
     return(attribute);
 }
Exemplo n.º 4
0
        public void SetPresenceString(uint field, string 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.SetStringValue(val);
            field1.SetKey(fieldKey);
            field1.SetValue(variant);
            fieldOperation.SetField(field1);
            updateRequest.SetEntityId(this.m_battleNet.GameAccountId);
            updateRequest.AddFieldOperation(fieldOperation);
            this.PublishField(updateRequest);
        }