本文整理汇总了C#中SteamKit2.SteamFriends.RemoveFriend方法的典型用法代码示例。如果您正苦于以下问题:C# SteamFriends.RemoveFriend方法的具体用法?C# SteamFriends.RemoveFriend怎么用?C# SteamFriends.RemoveFriend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SteamKit2.SteamFriends
的用法示例。
在下文中一共展示了SteamFriends.RemoveFriend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//.........这里部分代码省略.........
{
SteamID sid = callback.Sender;
if (!clients.Contains(callback.Sender))
{
printConsole("[New Client]" + callback.Sender, ConsoleColor.Magenta);
clients.Add(callback.Sender);
steamFriends.SendChatMessage(callback.Sender, EChatEntryType.ChatMsg, "Welcome to TradeBot created by Jessecar. To see a list of commands type /help");
}
if (callback.Message.StartsWith("/"))
{
string message = callback.Message.Replace("/", "");
printConsole("[Command]" + callback.Sender + " (" + steamFriends.GetFriendPersonaName(callback.Sender) + "): " + message, ConsoleColor.Magenta);
//string[] args = .Split(" ");
string[] words = message.Split(new char[] { ' ' }, 2);
switch (words[0])
{
case "trade":
//Send a trade
trade.RequestTrade(callback.Sender);
printConsole("Trade requested by " + callback.Sender + " (" + steamFriends.GetFriendPersonaName(callback.Sender) + ")", ConsoleColor.Green);
steamFriends.SendChatMessage(callback.Sender, EChatEntryType.Emote, "initiated a trade request.");
break;
case "remove":
//Remove Friend
steamFriends.SendChatMessage(callback.Sender, EChatEntryType.ChatMsg, "Thank you for using the Steam TradeBot BETA.");
steamFriends.RemoveFriend(callback.Sender);
printConsole("[Friend] Friend Removed: " + callback.Sender + " (" + steamFriends.GetFriendPersonaName(callback.Sender) + ")", ConsoleColor.Yellow);
break;
case "status":
//get status (nothing)
steamFriends.SendChatMessage(callback.Sender, EChatEntryType.Emote, "is Online and working good.");
break;
case "hi":
steamFriends.SendChatMessage(callback.Sender, EChatEntryType.Emote, "says hello.");
break;
case "help":
steamFriends.SendChatMessage(callback.Sender, EChatEntryType.ChatMsg, "\nList Of Commands:\n/trade - Start a trade.\n/remove - Remove TradeBot from your friends.\n/hi - say hello");
break;
case "name":
if(checkAdmin(sid))
steamFriends.SetPersonaName(words[1]);
break;
case "send":
string[] wrds = message.Split(new char[] { ' ' }, 3);
int index = int.Parse(wrds[1]);
if(index<clients.Count() && index>=0)
steamFriends.SendChatMessage(clients[index], EChatEntryType.ChatMsg, wrds[2]);
else
steamFriends.SendChatMessage(callback.Sender, EChatEntryType.Emote, "Error: index out of bounds.");
break;
default:
printConsole("[Error]Unknown command from " + callback.Sender + ": " + callback.Message, ConsoleColor.Red);
steamFriends.SendChatMessage(callback.Sender, EChatEntryType.Emote, "doesn't know that command.");
break;
}