• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# EChatEntryType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中EChatEntryType的典型用法代码示例。如果您正苦于以下问题:C# EChatEntryType类的具体用法?C# EChatEntryType怎么用?C# EChatEntryType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EChatEntryType类属于命名空间,在下文中一共展示了EChatEntryType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnMessage

 public override void OnMessage(string message, EChatEntryType type)
 {
     message = message.ToLower();
     if (IsAdmin)
     {
         if (message == "retrieve")
         {
             var tradeOffer = TradeOffers.CreateTrade(OtherSID);
             var myInventory = CSGOInventory.FetchInventory(MySID, Bot.apiKey);
             foreach (var item in myInventory.Items)
             {
                 tradeOffer.AddMyItem(item.AppId, item.ContextId, item.Id);
             }
             var tradeId = tradeOffer.SendTrade("");
             if (tradeId > 0)
             {
                 Bot.log.Success("Successfully sent a trade offer for all my items.");
             }
         }                
     }
     else
     {
         Bot.SteamFriends.SendChatMessage(OtherSID, EChatEntryType.ChatMsg, Bot.ChatResponse);
     }
 }
开发者ID:ElPresidentePro,项目名称:CSGOShop-Steambot,代码行数:25,代码来源:StorageBotUserHandler.cs


示例2: OnMessage

        public override void OnMessage(string message, EChatEntryType type)
        {
            if (IsAdmin)
            {
                //creating a new trade offer
                var offer = Bot.NewTradeOffer(OtherSID);

                //offer.Items.AddMyItem(0, 0, 0);
                if (offer.Items.NewVersion)
                {
                    string newOfferId;
                    if (offer.Send(out newOfferId))
                    {
                        Bot.AcceptAllMobileTradeConfirmations();
                        Log.Success("Trade offer sent : Offer ID " + newOfferId);
                    }
                }

                //creating a new trade offer with token
                var offerWithToken = Bot.NewTradeOffer(OtherSID);

                //offer.Items.AddMyItem(0, 0, 0);
                if (offerWithToken.Items.NewVersion)
                {
                    string newOfferId;
                    // "token" should be replaced with the actual token from the other user
                    if (offerWithToken.SendWithToken(out newOfferId, "token"))
                    {
                        Bot.AcceptAllMobileTradeConfirmations();
                        Log.Success("Trade offer sent : Offer ID " + newOfferId);
                    }
                }
            }
        }
开发者ID:ThereWasADream,项目名称:KeyBot,代码行数:34,代码来源:TradeOfferUserHandler.cs


示例3: OnMessage

 public override void OnMessage(string message, EChatEntryType type)
 {
     Bot.main.Invoke((Action)(() =>
     {
         var other = Bot.SteamFriends.GetFriendPersonaName(OtherSID);
         var opened = OpenChat(OtherSID);
         string date = "[" + DateTime.Now + "] ";
         string name = other + ": ";
         foreach (TabPage tab in Friends.chat.ChatTabControl.TabPages)
         {
             if ((SteamID)tab.Tag == OtherSID)
             {
                 foreach (var item in tab.Controls)
                 {
                     Friends.chat.chatTab = (ChatTab)item;
                 }
             }
         }
         int islink;
         islink = 0;
         if (message.Contains("http://") || (message.Contains("https://")) || (message.Contains("www.")) || (message.Contains("ftp.")))
         {
             string[] stan = message.Split(' ');
             foreach (string word in stan)
             {
                 if (word.Contains("http://") || (word.Contains("https://")) || (word.Contains("www.")) || (word.Contains("ftp.")))
                 {
                     if (word.Contains("."))
                     {
                         islink = 1;
                     }
                 }
             }
         }
         if (islink == 1)
         {
             Friends.chat.chatTab.UpdateChat("[INFO] ", "WARNING: ", "Be cautious when clicking unknown links.");
         }
         Friends.chat.chatTab.UpdateChat(date, name, message);
         new Thread(() =>
         {
             if (opened || !Chat.hasFocus)
             {
                 int duration = 3;
                 FormAnimator.AnimationMethod animationMethod = FormAnimator.AnimationMethod.Slide;
                 FormAnimator.AnimationDirection animationDirection = FormAnimator.AnimationDirection.Up;
                 string title = Bot.SteamFriends.GetFriendPersonaName(OtherSID);
                 Notification toastNotification = new Notification(title, Util.GetColorFromPersonaState(Bot, OtherSID), message, duration, animationMethod, animationDirection, Friends.chat.chatTab.avatarBox, new Action(() =>
                 {
                     Friends.chat.BringToFront();
                 }));
                 Bot.main.Invoke((Action)(() =>
                 {
                     toastNotification.Show();
                 }));
             }
         }).Start();
     }));
 }
开发者ID:The-Mad-Pirate,项目名称:Mist,代码行数:59,代码来源:SimpleUserHandler.cs


示例4: OnMessage

 public override void OnMessage(string message, EChatEntryType type)
 {
     if (Bot.main.InvokeRequired)
     {
         Bot.main.Invoke((Action)(() =>
         {
             var other = Bot.SteamFriends.GetFriendPersonaName(OtherSID);
             Console.WriteLine(OtherSID);
             OpenChat(OtherSID);
             string update = "[" + DateTime.Now + "] - " + other + ": " + message + "\r\n";
             foreach (TabPage tab in Friends.chat.ChatTabControl.TabPages)
             {
                 if (tab.Text == other)
                 {
                     foreach (var item in tab.Controls)
                     {
                         Friends.chat.chatTab = (ChatTab)item;
                     }
                 }
             }
             Friends.chat.chatTab.UpdateChat(update);
             if (!Chat.hasFocus)
             {
                 int duration = 3;
                 FormAnimator.AnimationMethod animationMethod = FormAnimator.AnimationMethod.Slide;
                 FormAnimator.AnimationDirection animationDirection = FormAnimator.AnimationDirection.Up;
                 string title = Bot.SteamFriends.GetFriendPersonaName(OtherSID) + " says:";
                 Notification toastNotification = new Notification(title, message, duration, animationMethod, animationDirection, Friends.chat.chatTab.avatarBox);
                 toastNotification.Show();
             }
         }));
     }
     else
     {
         var other = Bot.SteamFriends.GetFriendPersonaName(OtherSID);
         OpenChat(OtherSID);
         string update = "[" + DateTime.Now + "] - " + other + ": " + message + "\r\n";
         foreach (TabPage tab in Friends.chat.ChatTabControl.TabPages)
         {
             if (tab.Text == other)
             {
                 foreach (var item in tab.Controls)
                 {
                     Friends.chat.chatTab = (ChatTab)item;
                 }
             }
         }
         Friends.chat.chatTab.UpdateChat(update);
     }
 }
开发者ID:Jamyn,项目名称:Mist,代码行数:50,代码来源:SimpleUserHandler.cs


示例5: Advertise

        public void Advertise(EChatEntryType type)
        {
            if (TimerEnabled == true)
            {
                adTimer.Enabled = true;
                TimerDisabled = false;

            }
            if (TimerEnabled == false)
            {
                adTimer.Enabled = false;
                adTimer.Stop();
                TimerDisabled = true;
            }
        }
开发者ID:ck-pasta,项目名称:SteamBot,代码行数:15,代码来源:KeyUserHandler.cs


示例6: HandleChat

        public void HandleChat( SteamID sender, EChatEntryType type, string msg )
        {
            string friendName = Steam3.SteamFriends.GetFriendPersonaName( sender );
            string time = DateTime.Now.ToString( "h:mm tt" );

            var friend = new Friend( sender );
            var status = new StatusColor(settings);
            var statusColor = status.GetStatusColor(friend);

            switch ( type )
            {
                case EChatEntryType.ChatMsg:

                    this.AppendText( statusColor, string.Format( "{0} - {1}", time, friendName ) );
                    this.AppendText( Color.Black, ": " + msg );

                    if ( sender != Steam3.SteamClient.SteamID )
                        FlashWindow();

                    break;

                case EChatEntryType.Emote:

                    this.AppendText( statusColor, string.Format( "{0} - {1}", time, friendName ) );
                    this.AppendText( statusColor, " " + msg );

                    if ( sender != Steam3.SteamClient.SteamID )
                        FlashWindow();

                    break;

                case EChatEntryType.InviteGame:
                    this.AppendText( statusColor, string.Format( "{0} - {1}", time, friendName ) );
                    this.AppendText( statusColor, " has invited you to play a game." );

                    if ( sender != Steam3.SteamClient.SteamID )
                        FlashWindow();

                    break;

                default:
                    return;

            }

            this.AppendText( Environment.NewLine );
            this.ScrollLog();
        }
开发者ID:hekar,项目名称:Vaporized,代码行数:48,代码来源:ChatDialog.cs


示例7: OnMessage

 public override void OnMessage(string message, EChatEntryType type)
 {
     message = message.ToLower();
     if (IsAdmin)
     {
         if (message == "test")
         {
             var rand = new Random();
             var inventory = MyInventory.GetInventory(440, 2);
             var randomItem = inventory[rand.Next(inventory.Count)];
             var tradeOffer = TradeOffers.CreateTrade(OtherSID);
             tradeOffer.AddMyItem(randomItem.AppId, randomItem.ContextId, randomItem.Id);
             tradeOffer.SendTrade("test");
         }
     }
 }
开发者ID:ElPresidentePro,项目名称:CSGOShop-Steambot,代码行数:16,代码来源:SimpleUserHandler.cs


示例8: OnMessage

 public override void OnMessage(string message, EChatEntryType type)
 {
     if (Bot.currentRequest.User != null)
     {
         if (OtherSID == Bot.currentRequest.User)
         {
             if (message == "help" && Bot.currentRequest.TradeType == Bot.TradeTypes.Sell)
             {
                 Bot.SteamFriends.SendChatMessage(OtherSID, type, "Just open trade and put up almost any amount of hats. Type \"metal\" for more info. In case something goes wrong add:  http://steamcommunity.com/id/norgalyn/ .");
             }
             else if (message == "help" && Bot.currentRequest.TradeType == Bot.TradeTypes.BuySpecific)
             {
                 Bot.SteamFriends.SendChatMessage(OtherSID, type, "Just open trade and I will put up hats you have requested. I expect " + Bot.scrapToString(HatsPutUp * Bot.hatSellPrice) + " metal. In case something goes wrong add:  http://steamcommunity.com/id/norgalyn/ .");
             }
             else if (message == "ready" && Bot.currentRequest.TradeType == Bot.TradeTypes.Sell && Trade != null)
             {
                 foreach (int DefIndex in Bot.priceToDefIndex((Bot.hatBuyPrice * OtherHatsPutUp) - ScrapPutUp))
                 {
                     Trade.AddItemByDefindex(DefIndex);
                 }
                 ScrapPutUp += (Bot.hatBuyPrice * OtherHatsPutUp) - ScrapPutUp;
             }
             else if (message == "metal" && Bot.currentRequest.TradeType == Bot.TradeTypes.Sell)
             {
                 int refined = Bot.myInventory.GetItemsByDefindex(5002).Count;
                 int scrap =  Bot.myInventory.GetItemsByDefindex(5000).Count;
                 int count = 0;
                 while(true)
                 {
                     if (refined > 0 && scrap >1)
                     {
                         count++;
                         refined--;
                         scrap-=2;
                     }
                     else
                         break;
                 }
                 Bot.SteamFriends.SendChatMessage(OtherSID, type, "I can currently buy " + count + " hats.");
             }
         }
         else
             Bot.SteamFriends.SendChatMessage(OtherSID, type, "Sorry, but you have to use our web to trade with me. http://www.hatbank.tf .");
     }
     else
         Bot.SteamFriends.SendChatMessage(OtherSID, type, "Sorry, but you have to use our web to trade with me. http://www.hatbank.tf .");
 }
开发者ID:norgalyn,项目名称:SteamBot,代码行数:47,代码来源:TradeUserHandler.cs


示例9: OnMessage

 public override void OnMessage(string message, EChatEntryType type)
 {
     if (IsAdmin) {
         switch (message.ToLower()) {
             case "status":
                 Bot.SteamFriends.SendChatMessage (OtherSID, type, "NO STATUS LOL");
                 break;
             case "sup":
                 Bot.SteamFriends.SendChatMessage (OtherSID, type, "WADUP BRO");
                 break;
         }
     }
     if (messageResponses.ContainsKey (message)) {
         string[] response = messageResponses [message].Split ('|');
         Bot.SteamFriends.SendChatMessage (OtherSID, type, response [rnd.Next (1, response.Length + 1) - 1]);
     } else {
         Bot.SteamFriends.SendChatMessage(OtherSID, type, Bot.ChatResponse);
     }
 }
开发者ID:Elinea,项目名称:SteamBot,代码行数:19,代码来源:SteamEPHandler.cs


示例10: OnMessage

        public override void OnMessage(string message, EChatEntryType type)
        {
            //var inventory = OtherInventory;
            //var jsonIventory = JsonConvert.SerializeObject(inventory);
            //var inventory2 = JsonConvert.DeserializeObject<TF2Inventory>(jsonIventory);
            //Log.Info(jsonIventory);
            //Console.WriteLine("test");
            //SendChatMessage(Bot.ChatResponse);
            /**                         **/
            //var rand = new Random();
            //Bot.GetInventory();
            //var inventory = Bot.MyInventory.Items;
            //var randomItem = inventory[rand.Next(inventory.Length)];
            //var tradeOffer = Bot.NewTradeOffer(OtherSID);
            //tradeOffer.Items.AddMyItem(randomItem.AppId, randomItem.ContextId, (long) randomItem.Id);

            //string tradeId;
            //tradeOffer.Send(out tradeId);

            var rand = new Random();

            List<long> contextId = new List<long>();
            //contextId.Add(6);
            contextId.Add(2);

            var genericInv = new GenericInventory(Bot.SteamWeb);
            genericInv.load(730, contextId, OtherSID);

            var inventory = genericInv.items;
            foreach (var item in genericInv.items)
            {
                Log.Info(genericInv.getDescription(item.Key).name);

            }

            //var randomItem = inventory[rand.Next(inventory.Length)];
            //var tradeOffer = Bot.NewTradeOffer(OtherSID);
            //tradeOffer.Items.AddMyItem(randomItem.AppId, randomItem.ContextId, (long)randomItem.Id);

            //string tradeId;
            //tradeOffer.Send(out tradeId);
        }
开发者ID:nicolas-martin,项目名称:csgoescrow,代码行数:42,代码来源:CustomUserHandler.cs


示例11: OnMessage

        public override void OnMessage(string message, EChatEntryType type)
        {
            if (IsAdmin)
            {
                //creating a new trade offer
                var tradeOffer = TradeOffers.CreateTrade(OtherSID);

                //tradeOffer.AddMyItem(0, 0, 0);

                var tradeOfferId = tradeOffer.SendTrade("message");
                if (tradeOfferId > 0)
                {
                    Log.Success("Trade offer sent : Offer ID " + tradeOfferId);
                }

                // sending trade offer with token
                // "token" should be replaced with the actual token from the other user
                var tradeOfferIdWithToken = tradeOffer.SendTradeWithToken("message", "token");
                if (tradeOfferIdWithToken > 0)
                {
                    Log.Success("Trade offer sent : Offer ID " + tradeOfferIdWithToken);
                }
            }
        }
开发者ID:GreenBeard,项目名称:SteamTradeOffersBot,代码行数:24,代码来源:TradeOfferUserHandler.cs


示例12: OnMessage

        public override void OnMessage(string message, EChatEntryType type)
        {
            Bot.SteamFriends.SendChatMessage(OtherSID, type, Bot.ChatResponse);
            if (message.StartsWith("+"))
            {
                string[] args = message.Split(' ');
                string command = args[0];

                switch (command)
                {
                    case "+help":
                        Bot.SteamFriends.SendChatMessage(OtherSID, type, "command stuff");
                        break;
                    case "+info":
                        Bot.SteamFriends.SendChatMessage(OtherSID, type, "info stuff goes here");
                        break;
                    case "+withdraw":
                        Bot.SteamFriends.SendChatMessage(OtherSID, type, "add transaction here");
                        break;
                    case "+tip":
                        Bot.SteamFriends.SendChatMessage(OtherSID, type, "movefromaccounts here");
                        break;
                    case "+accept":
                        Bot.SteamFriends.SendChatMessage(OtherSID, type, "create account here");
                        break;
                    case "+reject":
                        Bot.SteamFriends.SendChatMessage(OtherSID, type, "do nothing here");
                        break;
                    case "+register":
                        Bot.SteamFriends.SendChatMessage(OtherSID, type, "register here");
                        break;

                }

            }
        }
开发者ID:RonnChyran,项目名称:SteamDogebot,代码行数:36,代码来源:DogeUserHandler.cs


示例13: ISteamFriends_GetClanChatMessage

		public static extern int ISteamFriends_GetClanChatMessage(CSteamID steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, out EChatEntryType peChatEntryType, out CSteamID psteamidChatter);
开发者ID:xulinqs,项目名称:Steamworks.NET,代码行数:1,代码来源:NativeMethods.cs


示例14: ISteamMatchmaking_GetLobbyChatEntry

		public static extern int ISteamMatchmaking_GetLobbyChatEntry(CSteamID steamIDLobby, int iChatID, out CSteamID pSteamIDUser, [In, Out] byte[] pvData, int cubData, out EChatEntryType peChatEntryType);
开发者ID:xulinqs,项目名称:Steamworks.NET,代码行数:1,代码来源:NativeMethods.cs


示例15: OnMessage

 public override void OnMessage(string message, EChatEntryType type)
 {
     Bot.SteamFriends.SendChatMessage(OtherSID, type, Bot.ChatResponse);
     Bot.SteamFriends.SendChatMessage(OtherSID, type, "Send a trade request and this bot will accept if it is not busy with another user!");
 }
开发者ID:enthdegree,项目名称:EnthSteamBot,代码行数:5,代码来源:AutoTrader.cs


示例16: OnMessage

 /// <summary>
 /// Called whenever a message is sent to the bot.
 /// This is limited to regular and emote messages.
 /// </summary>
 public abstract void OnMessage(string message, EChatEntryType type);
开发者ID:GreenBeard,项目名称:SteamTradeOffersBot,代码行数:5,代码来源:UserHandler.cs


示例17: OnMessageHandler

 public void OnMessageHandler(string message, EChatEntryType type)
 {
     _lastMessageWasFromTrade = false;
     if(!HandleWaitingOnUserResponse(message))
     {
         OnMessage(message, type);
     }
 }
开发者ID:kevalane,项目名称:SteamBot,代码行数:8,代码来源:UserHandler.cs


示例18: SendChatMessage

        /// <summary>
        /// Sends a chat message to a friend.
        /// </summary>
        /// <param name="target">The target to send to.</param>
        /// <param name="type">The type of message to send.</param>
        /// <param name="message">The message to send.</param>
        public void SendChatMessage( SteamID target, EChatEntryType type, string message )
        {
            var chatMsg = new ClientMsgProtobuf<CMsgClientFriendMsg>( EMsg.ClientFriendMsg );

            chatMsg.Body.steamid = target;
            chatMsg.Body.chat_entry_type = ( int )type;
            chatMsg.Body.message = Encoding.UTF8.GetBytes( message );

            this.Client.Send( chatMsg );
        }
开发者ID:katsalap,项目名称:SteamKit,代码行数:16,代码来源:SteamFriends.cs


示例19: GetLobbyChatEntry

		/// <summary>
		/// <para> Get a chat message as specified in a LobbyChatMsg_t callback</para>
		/// <para> iChatID is the LobbyChatMsg_t::m_iChatID value in the callback</para>
		/// <para> *pSteamIDUser is filled in with the CSteamID of the member</para>
		/// <para> *pvData is filled in with the message itself</para>
		/// <para> return value is the number of bytes written into the buffer</para>
		/// </summary>
		public static int GetLobbyChatEntry(CSteamID steamIDLobby, int iChatID, out CSteamID pSteamIDUser, byte[] pvData, int cubData, out EChatEntryType peChatEntryType) {
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamMatchmaking_GetLobbyChatEntry(steamIDLobby, iChatID, out pSteamIDUser, pvData, cubData, out peChatEntryType);
		}
开发者ID:zsebastian,项目名称:Steamworks.NET,代码行数:11,代码来源:isteammatchmaking.cs


示例20: ISteamFriends_GetFriendMessage

		public static extern int ISteamFriends_GetFriendMessage(CSteamID steamIDFriend, int iMessageID, IntPtr pvData, int cubData, out EChatEntryType peChatEntryType);
开发者ID:xulinqs,项目名称:Steamworks.NET,代码行数:1,代码来源:NativeMethods.cs



注:本文中的EChatEntryType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# EEType类代码示例发布时间:2022-05-24
下一篇:
C# ECPoint类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap