当前位置: 首页>>代码示例>>C#>>正文


C# EChatEntryType类代码示例

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


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


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