本文整理汇总了C#中Yupi.Game.GameClients.Interfaces.GameClient.SendWhisper方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.SendWhisper方法的具体用法?C# GameClient.SendWhisper怎么用?C# GameClient.SendWhisper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Yupi.Game.GameClients.Interfaces.GameClient
的用法示例。
在下文中一共展示了GameClient.SendWhisper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override bool Execute(GameClient session, string[] pms)
{
Habbo user = Yupi.GetHabboForName(pms[0]);
if (user == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor())
{
adapter.SetQuery("DELETE FROM users_bans WHERE value = @name");
adapter.AddParameter("name", user.UserName);
adapter.RunQuery();
Yupi.GetGame()
.GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName, user.UserName, "Unban",
$"User has been Unbanned [{pms[0]}]");
return true;
}
}
示例2: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (client == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (client.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
int time;
if (!int.TryParse(pms[1], out time))
{
session.SendWhisper(Yupi.GetLanguage().GetVar("enter_numbers"));
return true;
}
client.GetHabbo().FloodTime = Yupi.GetUnixTimeStamp() + Convert.ToInt32(pms[1]);
ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("FloodFilterMessageComposer"));
serverMessage.AppendInteger(Convert.ToInt32(pms[1]));
client.SendMessage(serverMessage);
return true;
}
示例3: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null || user.GetHabbo() == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
try
{
user.GetConnection().Dispose();
Yupi.GetGame()
.GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName, user.GetHabbo().UserName, "dc",
$"Disconnect User[{pms[1]}]");
}
catch
{
}
return true;
}
示例4: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
string userName = pms[0];
string rank = pms[1];
using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor())
{
adapter.SetQuery("UPDATE users SET [email protected] WHERE [email protected] LIMIT 1");
adapter.AddParameter("user", userName);
adapter.AddParameter("rank", rank);
adapter.RunQuery();
}
session.SendWhisper(Yupi.GetLanguage().GetVar("user_rank_update"));
return true;
}
示例5: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (client == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
uint amount;
if (!uint.TryParse(pms[1], out amount))
{
session.SendWhisper(Yupi.GetLanguage().GetVar("enter_numbers"));
return true;
}
client.GetHabbo().Diamonds += amount;
client.GetHabbo().UpdateSeasonalCurrencyBalance();
client.SendNotif(string.Format(Yupi.GetLanguage().GetVar("staff_gives_diamonds"), session.GetHabbo().UserName, amount));
return true;
}
示例6: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
try
{
Yupi.GetGame()
.GetBanManager()
.BanUser(user, session.GetHabbo().UserName, 788922000.0, string.Join(" ", pms.Skip(2)),
true, false);
}
catch
{
ServerLogManager.LogException($"An error occurred when {session.GetHabbo().UserName} tried to ban {user.GetHabbo().UserName}");
}
return true;
}
示例7: Execute
public override bool Execute(GameClient session, string[] pms)
{
Room room = session.GetHabbo().CurrentRoom;
RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (user == null) return true;
if (room.RoomData.DisablePull)
{
session.SendWhisper("Realizar Pull Foi Desativado pelo Dono do Quarto");
return true;
}
GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (client == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (client.GetHabbo().Id == session.GetHabbo().Id)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("command_pull_error_own"));
return true;
}
RoomUser user2 = room.GetRoomUserManager().GetRoomUserByHabbo(client.GetHabbo().Id);
if (user2 == null) return true;
if (user2.TeleportEnabled)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("command_error_teleport_enable"));
return true;
}
if (PathFinder.GetDistance(user.X, user.Y, user2.X, user2.Y) > 2)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("command_pull_error_far_away"));
return true;
}
if (user.RotBody%2 != 0) user.RotBody--;
switch (user.RotBody)
{
case 0:
user2.MoveTo(user.X, user.Y - 1);
break;
case 2:
user2.MoveTo(user.X + 1, user.Y);
break;
case 4:
user2.MoveTo(user.X, user.Y + 1);
break;
case 6:
user2.MoveTo(user.X - 1, user.Y);
break;
}
return true;
}
示例8: Execute
public override bool Execute(GameClient session, string[] pms)
{
string userName = pms[0];
GameClient userSession = Yupi.GetGame().GetClientManager().GetClientByUserName(userName);
if (userSession == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (session.GetHabbo().Rank <= userSession.GetHabbo().Rank)
{
session.SendNotif(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
if (userSession.GetHabbo().CurrentRoomId < 1)
{
session.SendNotif(Yupi.GetLanguage().GetVar("command_kick_user_not_in_room"));
return true;
}
Room room = Yupi.GetGame().GetRoomManager().GetRoom(userSession.GetHabbo().CurrentRoomId);
if (room == null) return true;
room.GetRoomUserManager().RemoveUserFromRoom(userSession, true, false);
userSession.CurrentRoomUserId = -1;
if (pms.Length > 1)
{
userSession.SendNotif(
string.Format(Yupi.GetLanguage().GetVar("command_kick_user_mod_default") + "{0}.",
string.Join(" ", pms.Skip(1))));
}
else userSession.SendNotif(Yupi.GetLanguage().GetVar("command_kick_user_mod_default"));
return true;
}
示例9: Execute
public override bool Execute(GameClient session, string[] pms)
{
Room room = session.GetHabbo().CurrentRoom;
if (!session.GetHabbo().CurrentRoom.RoomMuted)
{
session.SendWhisper("Room isn't muted.");
return true;
}
session.GetHabbo().CurrentRoom.RoomMuted = false;
/*
var message = new ServerMessage();
message.Load(LibraryParser.OutgoingRequest("AlertNotificationMessageComposer"));
message.AppendString("Room is now UnMuted.");
message.AppendString("");
room.SendMessage(message);*/
room.SendMessage(GameClient.GetBytesNotif("Este quarto foi des-selenciado."));
Yupi.GetGame()
.GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty,
"Room Unmute", "Room UnMuted");
return true;
}
示例10: Execute
public override bool Execute(GameClient session, string[] pms)
{
Room room = session.GetHabbo().CurrentRoom;
if (room.RoomMuted)
{
session.SendWhisper("Room is already muted.");
return true;
}
session.GetHabbo().CurrentRoom.RoomMuted = true;
/*
var message = new ServerMessage(LibraryParser.OutgoingRequest("AlertNotificationMessageComposer"));
message.AppendString(string.Format("The room was muted due to:\r{0}", string.Join(" ", pms)));
message.AppendString(string.Empty);
room.SendMessage(message);*/
room.SendMessage(GameClient.GetBytesNotif(
$"Este quarto foi silenciado pelo motivo:\r{string.Join(" ", pms)}"));
Yupi.GetGame()
.GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty,
"Room Mute", "Room muted");
return true;
}
示例11: Execute
public override bool Execute(GameClient session, string[] pms)
{
Room room = session.GetHabbo().CurrentRoom;
RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (user == null) return true;
GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (client == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (client.GetHabbo().Id == session.GetHabbo().Id)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("command_pull_error_own"));
return true;
}
RoomUser user2 = room.GetRoomUserManager().GetRoomUserByHabbo(client.GetHabbo().Id);
if (user2 == null) return true;
if (user2.TeleportEnabled)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("command_error_teleport_enable"));
return true;
}
if (user.RotBody % 2 != 0) user.RotBody--;
switch (user.RotBody)
{
case 0:
user2.MoveTo(user.X, user.Y - 1);
break;
case 2:
user2.MoveTo(user.X + 1, user.Y);
break;
case 4:
user2.MoveTo(user.X, user.Y + 1);
break;
case 6:
user2.MoveTo(user.X - 1, user.Y);
break;
}
return true;
}
示例12: Execute
public override bool Execute(GameClient session, string[] pms)
{
uint speed;
if (uint.TryParse(pms[0], out speed)) session.GetHabbo().CurrentRoom.GetRoomItemHandler().SetSpeed(speed);
else session.SendWhisper(Yupi.GetLanguage().GetVar("command_setspeed_error_numbers"));
return true;
}
示例13: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (client == null || client.GetHabbo() == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (client.GetHabbo().Rank >= 4)
{
session.SendWhisper("You are not allowed to mute that user.");
}
Yupi.GetGame()
.GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, client.GetHabbo().UserName,
"Unmute", "Unmuted user");
client.GetHabbo().UnMute();
return true;
}
示例14: Execute
public override bool Execute(GameClient session, string[] pms)
{
RoomUser user = session.GetHabbo()
.CurrentRoom.GetRoomUserManager()
.GetRoomUserByHabbo(pms[0]);
if (user == null) session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
else user.Frozen = !user.Frozen;
return true;
}
示例15: Execute
public override bool Execute(GameClient session, string[] pms)
{
string mode = pms[0];
pms = pms.Skip(1).ToArray();
switch (mode.ToLower())
{
case "info":
{
if (pms.Length == 0) session.SendWhisper("Usage :developer info [items/user/users/cache]");
else return GetInfo(session, pms);
break;
}
case "set":
{
if (pms.Length < 2) session.SendWhisper("Usage :developer set [item/baseItem] id");
else return Set(session, pms);
break;
}
case "copy":
{
return Copy(session);
}
case "paste":
{
return Paste(session);
}
case "delete":
{
return Delete(session);
}
default:
{
session.SendWhisper("Usage :developer [info/set/copy/paste/delete]");
break;
}
}
return true;
}