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); } }
private void CacheMyAccountInfo() { if (this.m_idString == null) { BnetGameAccountId myGameAccountId = BnetPresenceMgr.Get().GetMyGameAccountId(); if (myGameAccountId != null) { BnetPlayer myPlayer = BnetPresenceMgr.Get().GetMyPlayer(); if (myPlayer != null) { BnetAccountId accountId = myPlayer.GetAccountId(); if (accountId != null) { BnetBattleTag battleTag = myPlayer.GetBattleTag(); if (battleTag != null) { this.m_myGameAccountLo = myGameAccountId.GetLo(); StringBuilder builder = new StringBuilder(); builder.Append(accountId.GetHi()); builder.Append(','); builder.Append(accountId.GetLo()); builder.Append(','); builder.Append(myGameAccountId.GetHi()); builder.Append(','); builder.Append(myGameAccountId.GetLo()); builder.Append(','); builder.Append(battleTag.GetName()); builder.Append(','); builder.Append(battleTag.GetNumber()); builder.Append(','); builder.Append(BattleNet.GetVersion()); builder.Append(','); builder.Append(BattleNet.GetEnvironment()); this.m_idString = builder.ToString(); } } } } } }