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);
     }
 }
Пример #2
0
        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");
            Variant variant = new Variant();

            variant.SetStringValue(message);
            attribute.SetValue(variant);
            notification.AddAttribute(attribute);
            this.m_rpcConnection.QueueRequest(this.m_battleNet.NotificationService.Id, 1u, notification, new RPCContextDelegate(this.WhisperSentCallback), 0u);
            BnetGameAccountId speakerId   = BnetGameAccountId.CreateFromEntityId(BattleNet.GetMyGameAccountId());
            BnetWhisper       bnetWhisper = new BnetWhisper();

            bnetWhisper.SetSpeakerId(speakerId);
            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, ulong val)
 {
     bnet.protocol.attribute.Attribute attribute = new bnet.protocol.attribute.Attribute();
     bnet.protocol.attribute.Variant   variant   = new bnet.protocol.attribute.Variant();
     variant.SetUintValue(val);
     attribute.SetName(name);
     attribute.SetValue(variant);
     return(attribute);
 }
Пример #4
0
        public static bnet.protocol.attribute.Attribute CreateAttribute(string name, byte[] val)
        {
            bnet.protocol.attribute.Attribute attribute = new bnet.protocol.attribute.Attribute();
            Variant variant = new Variant();

            variant.SetBlobValue(val);
            attribute.SetName(name);
            attribute.SetValue(variant);
            return(attribute);
        }