本文整理汇总了C#中GameClients.SendWhisper方法的典型用法代码示例。如果您正苦于以下问题:C# GameClients.SendWhisper方法的具体用法?C# GameClients.SendWhisper怎么用?C# GameClients.SendWhisper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameClients
的用法示例。
在下文中一共展示了GameClients.SendWhisper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
return;
if (Params.Length == 1)
{
Session.SendWhisper("Oops, you forgot to enter a bubble ID!");
return;
}
int Bubble = 0;
if (!int.TryParse(Params[1].ToString(), out Bubble))
{
Session.SendWhisper("Please enter a valid number.");
return;
}
ChatStyle Style = null;
if (!PlusEnvironment.GetGame().GetChatManager().GetChatStyles().TryGetStyle(Bubble, out Style) || (Style.RequiredRight.Length > 0 && !Session.GetHabbo().GetPermissions().HasRight(Style.RequiredRight)))
{
Session.SendWhisper("Oops, you cannot use this bubble due to a rank requirement, sorry!");
return;
}
User.LastBubble = Bubble;
Session.GetHabbo().CustomBubbleId = Bubble;
Session.SendWhisper("Bubble set to: " + Bubble);
}
示例2: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Please enter the username of the user you wish to alert.");
return;
}
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (TargetClient == null)
{
Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
return;
}
if (TargetClient.GetHabbo() == null)
{
Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
return;
}
if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
{
Session.SendWhisper("Get a life.");
return;
}
string Message = CommandManager.MergeParams(Params, 2);
TargetClient.SendNotification(Session.GetHabbo().Username + " alerted you with the following message:\n\n" + Message);
Session.SendWhisper("Alert successfully sent to " + TargetClient.GetHabbo().Username);
}
示例3: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (!Room.CheckRights(Session, true))
{
Session.SendWhisper("Oops, only the room owner can run this command!");
return;
}
foreach (RoomUser User in Room.GetRoomUserManager().GetUserList().ToList())
{
if (User == null || User.IsPet || !User.IsBot)
continue;
RoomUser BotUser = null;
if (!Room.GetRoomUserManager().TryGetBot(User.BotData.Id, out BotUser))
return;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `bots` SET `room_id` = '0' WHERE `id` = @id LIMIT 1");
dbClient.AddParameter("id", User.BotData.Id);
dbClient.RunQuery();
}
Session.GetHabbo().GetInventoryComponent().TryAddBot(new Bot(Convert.ToInt32(BotUser.BotData.Id), Convert.ToInt32(BotUser.BotData.ownerID), BotUser.BotData.Name, BotUser.BotData.Motto, BotUser.BotData.Look, BotUser.BotData.Gender));
Session.SendMessage(new BotInventoryComposer(Session.GetHabbo().GetInventoryComponent().GetBots()));
Room.GetRoomUserManager().RemoveBot(BotUser.VirtualId, false);
}
Session.SendWhisper("Success, removed all bots.");
}
示例4: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length != 3)
{
Session.SendWhisper("Please enter a username and the code of the badge you'd like to give!");
return;
}
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (TargetClient != null)
{
if (!TargetClient.GetHabbo().GetBadgeComponent().HasBadge(Params[2]))
{
TargetClient.GetHabbo().GetBadgeComponent().GiveBadge(Params[2], true, TargetClient);
if (TargetClient.GetHabbo().Id != Session.GetHabbo().Id)
TargetClient.SendNotification("You have just been given a badge!");
else
Session.SendWhisper("You have successfully given yourself the badge " + Params[2] + "!");
}
else
Session.SendWhisper("Oops, that user already has this badge (" + Params[2] + ") !");
return;
}
else
{
Session.SendWhisper("Oops, we couldn't find that target user!");
return;
}
}
示例5: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Please enter the username of the user you wish to summon.");
return;
}
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (TargetClient == null)
{
Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
return;
}
if (TargetClient.GetHabbo() == null)
{
Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
return;
}
if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
{
Session.SendWhisper("Get a life.");
return;
}
TargetClient.SendNotification("You have been summoned to " + Session.GetHabbo().Username + "!");
if (!TargetClient.GetHabbo().InRoom)
TargetClient.SendMessage(new RoomForwardComposer(Session.GetHabbo().CurrentRoomId));
else
TargetClient.GetHabbo().PrepareRoom(Session.GetHabbo().CurrentRoomId, "");
}
示例6: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Please enter a dance ID. (1-4)");
return;
}
int DanceId = Convert.ToInt32(Params[1]);
if (DanceId < 0 || DanceId > 4)
{
Session.SendWhisper("Please enter a dance ID. (1-4)");
return;
}
List<RoomUser> Users = Room.GetRoomUserManager().GetRoomUsers();
if (Users.Count > 0)
{
foreach (RoomUser U in Users.ToList())
{
if (U == null)
continue;
if (U.CarryItemID > 0)
U.CarryItemID = 0;
U.DanceId = DanceId;
Room.SendMessage(new DanceComposer(U, DanceId));
}
}
}
示例7: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Please enter the username you wish to flag.");
return;
}
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (TargetClient == null)
{
Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
return;
}
if (TargetClient.GetHabbo().GetPermissions().HasRight("mod_tool"))
{
Session.SendWhisper("You are not allowed to flag that user.");
return;
}
else
{
TargetClient.GetHabbo().LastNameChange = 0;
TargetClient.GetHabbo().ChangingName = true;
TargetClient.SendNotification("Please be aware that if your username is deemed as inappropriate, you will be banned without question.\r\rAlso note that Staff will NOT allow you to change your username again should you have an issue with what you have chosen.\r\rClose this window and click yourself to begin choosing a new username!");
TargetClient.SendMessage(new UserObjectComposer(TargetClient.GetHabbo()));
}
}
示例8: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
RoomUser ThisUser = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (ThisUser == null)
return;
if (Params.Length == 1)
{
Session.SendWhisper("Please enter an ID of a dance.");
return;
}
int DanceId;
if (int.TryParse(Params[1], out DanceId))
{
if (DanceId > 4 || DanceId < 0)
{
Session.SendWhisper("The dance ID must be between 0 and 4!");
return;
}
Session.GetHabbo().CurrentRoom.SendMessage(new DanceComposer(ThisUser, DanceId));
}
else
Session.SendWhisper("Please enter a valid dance ID.");
}
示例9: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Please enter a username and a valid length in days (min 1 day, max 365 days).");
return;
}
Habbo Habbo = PlusEnvironment.GetHabboByUsername(Params[1]);
if (Habbo == null)
{
Session.SendWhisper("An error occoured whilst finding that user in the database.");
return;
}
if (Convert.ToDouble(Params[2]) == 0)
{
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `user_info` SET `trading_locked` = '0' WHERE `user_id` = '" + Habbo.Id + "' LIMIT 1");
}
if (Habbo.GetClient() != null)
{
Habbo.TradingLockExpiry = 0;
Habbo.GetClient().SendNotification("Your outstanding trade ban has been removed.");
}
Session.SendWhisper("You have successfully removed " + Habbo.Username + "'s trade ban.");
return;
}
double Days;
if (double.TryParse(Params[2], out Days))
{
if (Days < 1)
Days = 1;
if (Days > 365)
Days = 365;
double Length = (PlusEnvironment.GetUnixTimestamp() + (Days * 86400));
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `user_info` SET `trading_locked` = '" + Length + "', `trading_locks_count` = `trading_locks_count` + '1' WHERE `user_id` = '" + Habbo.Id + "' LIMIT 1");
}
if (Habbo.GetClient() != null)
{
Habbo.TradingLockExpiry = Length;
Habbo.GetClient().SendNotification("You have been trade banned for " + Days + " day(s)!");
}
Session.SendWhisper("You have successfully trade banned " + Habbo.Username + " for " + Days + " day(s).");
}
else
Session.SendWhisper("Please enter a valid integer.");
}
示例10: Execute
public void Execute(GameClients.GameClient Session, Room Room, string[] Params)
{
RoomUser RoomUser = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (RoomUser == null)
return;
if (!Room.PetMorphsAllowed)
{
Session.SendWhisper("The room owner has disabled the ability to use a pet morph in this room.");
if (Session.GetHabbo().PetId > 0)
{
Session.SendWhisper("Oops, you still have a morph, un-morphing you.");
//Change the users Pet Id.
Session.GetHabbo().PetId = 0;
//Quickly remove the old user instance.
Room.SendMessage(new UserRemoveComposer(RoomUser.VirtualId));
//Add the new one, they won't even notice a thing!!11 8-)
Room.SendMessage(new UsersComposer(RoomUser));
}
return;
}
if (Params.Length == 1)
{
Session.SendWhisper("Oops, you forgot to choose the type of pet you'd like to turn into! Use :pet list to see the availiable morphs!");
return;
}
if (Params[1].ToString().ToLower() == "list")
{
Session.SendWhisper("Habbo, Dog, Cat, Terrier, Croc, Bear, Pig, Lion, Rhino, Spider, Turtle, Chick, Frog, Drag, Monkey, Horse, Bunny, Pigeon, Demon and Gnome.");
return;
}
int TargetPetId = GetPetIdByString(Params[1].ToString());
if (TargetPetId == 0)
{
Session.SendWhisper("Oops, couldn't find a pet by that name!");
return;
}
//Change the users Pet Id.
Session.GetHabbo().PetId = (TargetPetId == -1 ? 0 : TargetPetId);
//Quickly remove the old user instance.
Room.SendMessage(new UserRemoveComposer(RoomUser.VirtualId));
//Add the new one, they won't even notice a thing!!11 8-)
Room.SendMessage(new UsersComposer(RoomUser));
//Tell them a quick message.
if (Session.GetHabbo().PetId > 0)
Session.SendWhisper("Use ':pet habbo' to turn back into a Habbo!");
}
示例11: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (!Room.CheckRights(Session, true))
{
Session.SendWhisper("Oops, only the owner of this room can run this command!");
return;
}
Room.GetGameMap().GenerateMaps();
Session.SendWhisper("Game map of this room successfully re-generated.");
}
示例12: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (!Room.CheckRights(Session, true))
{
Session.SendWhisper("Oops, only the owner of this room can run this command!");
return;
}
Room.GetGameMap().DiagonalEnabled = !Room.GetGameMap().DiagonalEnabled;
Session.SendWhisper("Successfully updated the diagonal boolean value for this room.");
}
示例13: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
return;
User.moonwalkEnabled = !User.moonwalkEnabled;
if (User.moonwalkEnabled)
Session.SendWhisper("Moonwalk enabled!");
else
Session.SendWhisper("Moonwalk disabled!");
}
示例14: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
Session.GetHabbo().AllowPetSpeech = !Session.GetHabbo().AllowPetSpeech;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `users` SET `pets_muted` = '" + ((Session.GetHabbo().AllowPetSpeech) ? 1 : 0) + "' WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
}
if (Session.GetHabbo().AllowPetSpeech)
Session.SendWhisper("Change successful, you can no longer see speech from pets.");
else
Session.SendWhisper("Change successful, you can now see speech from pets.");
}
示例15: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Please enter the username of the user you'd like to IP ban & account ban.");
return;
}
Habbo Habbo = PlusEnvironment.GetHabboByUsername(Params[1]);
if (Habbo == null)
{
Session.SendWhisper("An error occoured whilst finding that user in the database.");
return;
}
if (Habbo.GetPermissions().HasRight("mod_tool") && !Session.GetHabbo().GetPermissions().HasRight("mod_ban_any"))
{
Session.SendWhisper("Oops, you cannot ban that user.");
return;
}
String IPAddress = String.Empty;
Double Expire = PlusEnvironment.GetUnixTimestamp() + 78892200;
string Username = Habbo.Username;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `user_info` SET `bans` = `bans` + '1' WHERE `user_id` = '" + Habbo.Id + "' LIMIT 1");
dbClient.SetQuery("SELECT `ip_last` FROM `users` WHERE `id` = '" + Habbo.Id + "' LIMIT 1");
IPAddress = dbClient.getString();
}
string Reason = null;
if (Params.Length >= 3)
Reason = CommandManager.MergeParams(Params, 2);
else
Reason = "No reason specified.";
if (!string.IsNullOrEmpty(IPAddress))
PlusEnvironment.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.IP, IPAddress, Reason, Expire);
PlusEnvironment.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.USERNAME, Habbo.Username, Reason, Expire);
if (!string.IsNullOrEmpty(Habbo.MachineId))
PlusEnvironment.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.MACHINE, Habbo.MachineId, Reason, Expire);
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Username);
if (TargetClient != null)
TargetClient.Disconnect();
Session.SendWhisper("Success, you have machine, IP and account banned the user '" + Username + "' for '" + Reason + "'!");
}