本文整理汇总了C#中GameClients.SendNotification方法的典型用法代码示例。如果您正苦于以下问题:C# GameClients.SendNotification方法的具体用法?C# GameClients.SendNotification怎么用?C# GameClients.SendNotification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameClients
的用法示例。
在下文中一共展示了GameClients.SendNotification方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
return;
if (Room.Group == null)
{
Session.SendWhisper("Oops, there is no group here?");
return;
}
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("DELETE FROM `groups` WHERE `id` = '" + Room.Group.Id + "'");
dbClient.RunQuery("DELETE FROM `group_memberships` WHERE `group_id` = '" + Room.Group.Id + "'");
dbClient.RunQuery("DELETE FROM `group_requests` WHERE `group_id` = '" + Room.Group.Id + "'");
dbClient.RunQuery("UPDATE `rooms` SET `group_id` = '0' WHERE `group_id` = '" + Room.Group.Id + "' LIMIT 1");
dbClient.RunQuery("UPDATE `user_stats` SET `groupid` = '0' WHERE `groupid` = '" + Room.Group.Id + "' LIMIT 1");
dbClient.RunQuery("DELETE FROM `items_groups` WHERE `group_id` = '" + Room.Group.Id + "'");
}
PlusEnvironment.GetGame().GetGroupManager().DeleteGroup(Room.RoomData.Group.Id);
Room.Group = null;
Room.RoomData.Group = null;
PlusEnvironment.GetGame().GetRoomManager().UnloadRoom(Room, true);
Session.SendNotification("Success, group deleted.");
return;
}
示例2: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (ThisUser == null)
return;
Session.SendNotification("X: " + ThisUser.X + "\n - Y: " + ThisUser.Y + "\n - Z: " + ThisUser.Z + "\n - Rot: " + ThisUser.RotBody + ", sqState: " + Room.GetGameMap().GameMap[ThisUser.X, ThisUser.Y].ToString() + "\n\n - RoomID: " + Session.GetHabbo().CurrentRoomId);
}
示例3: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (!this.CanChangeName(Session.GetHabbo()))
{
Session.SendWhisper("Sorry, it seems you currently do not have the option to change your username!");
return;
}
Session.GetHabbo().ChangingName = true;
Session.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 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!");
Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
}
示例4: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendNotification("Are you sure you want to clear your inventory? You will lose all the furniture!\n" +
"To confirm, type \":emptyitems yes\". \n\nOnce you do this, there is no going back!\n(If you do not want to empty it, just ignore this message!)\n\n" +
"PLEASE NOTE! If you have more than 3000 items, the hidden items will also be DELETED.");
return;
}
else
{
if (Params.Length == 2 && Params[1].ToString() == "yes")
{
Session.GetHabbo().GetInventoryComponent().ClearItems();
Session.SendNotification("Your inventory has been cleared!");
return;
}
else if (Params.Length == 2 && Params[1].ToString() != "yes")
{
Session.SendNotification("To confirm, you must type in :emptyitems yes");
return;
}
}
}
示例5: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
double Minutes = Session.GetHabbo().GetStats().OnlineTime / 60;
double Hours = Minutes / 60;
int OnlineTime = Convert.ToInt32(Hours);
string s = OnlineTime == 1 ? "" : "s";
StringBuilder HabboInfo = new StringBuilder();
HabboInfo.Append("Your account stats:\r\r");
HabboInfo.Append("Currency Info:\r");
HabboInfo.Append("Credits: " + Session.GetHabbo().Credits + "\r");
HabboInfo.Append("Duckets: " + Session.GetHabbo().Duckets + "\r");
HabboInfo.Append("Diamonds: " + Session.GetHabbo().Diamonds + "\r");
HabboInfo.Append("Online Time: " + OnlineTime + " Hour" + s + "\r");
HabboInfo.Append("Respects: " + Session.GetHabbo().GetStats().Respect + "\r");
HabboInfo.Append("GOTW Points: " + Session.GetHabbo().GOTWPoints + "\r\r");
Session.SendNotification(HabboInfo.ToString());
}
示例6: 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 view.");
return;
}
DataRow UserData = null;
DataRow UserInfo = null;
string Username = Params[1];
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("SELECT `id`,`username`,`mail`,`rank`,`motto`,`credits`,`activity_points`,`vip_points`,`gotw_points`,`online`,`rank_vip` FROM users WHERE `username` = @Username LIMIT 1");
dbClient.AddParameter("Username", Username);
UserData = dbClient.getRow();
}
if (UserData == null)
{
Session.SendNotification("Oops, there is no user in the database with that username (" + Username + ")!");
return;
}
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("SELECT * FROM `user_info` WHERE `user_id` = '" + Convert.ToInt32(UserData["id"]) + "' LIMIT 1");
UserInfo = dbClient.getRow();
if (UserInfo == null)
{
dbClient.RunQuery("INSERT INTO `user_info` (`user_id`) VALUES ('" + Convert.ToInt32(UserData["id"]) + "')");
dbClient.SetQuery("SELECT * FROM `user_info` WHERE `user_id` = '" + Convert.ToInt32(UserData["id"]) + "' LIMIT 1");
UserInfo = dbClient.getRow();
}
}
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Username);
DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(Convert.ToDouble(UserInfo["trading_locked"]));
StringBuilder HabboInfo = new StringBuilder();
HabboInfo.Append(Convert.ToString(UserData["username"]) + "'s account:\r\r");
HabboInfo.Append("Generic Info:\r");
HabboInfo.Append("ID: " + Convert.ToInt32(UserData["id"]) + "\r");
HabboInfo.Append("Rank: " + Convert.ToInt32(UserData["rank"]) + "\r");
HabboInfo.Append("VIP Rank: " + Convert.ToInt32(UserData["rank_vip"]) + "\r");
HabboInfo.Append("Email: " + Convert.ToString(UserData["mail"]) + "\r");
HabboInfo.Append("Online Status: " + (TargetClient != null ? "True" : "False") + "\r\r");
HabboInfo.Append("Currency Info:\r");
HabboInfo.Append("Credits: " + Convert.ToInt32(UserData["credits"]) + "\r");
HabboInfo.Append("Duckets: " + Convert.ToInt32(UserData["activity_points"]) + "\r");
HabboInfo.Append("Diamonds: " + Convert.ToInt32(UserData["vip_points"]) + "\r");
HabboInfo.Append("GOTW Points: " + Convert.ToInt32(UserData["gotw_points"]) + "\r\r");
HabboInfo.Append("Moderation Info:\r");
HabboInfo.Append("Bans: " + Convert.ToInt32(UserInfo["bans"]) + "\r");
HabboInfo.Append("CFHs Sent: " + Convert.ToInt32(UserInfo["cfhs"]) + "\r");
HabboInfo.Append("Abusive CFHs: " + Convert.ToInt32(UserInfo["cfhs_abusive"]) + "\r");
HabboInfo.Append("Trading Locked: " + (Convert.ToInt32(UserInfo["trading_locked"]) == 0 ? "No outstanding lock" : "Expiry: " + (origin.ToString("dd/MM/yyyy")) + "") + "\r");
HabboInfo.Append("Amount of trading locks: " + Convert.ToInt32(UserInfo["trading_locks_count"]) + "\r\r");
if (TargetClient != null)
{
HabboInfo.Append("Current Session:\r");
if (!TargetClient.GetHabbo().InRoom)
HabboInfo.Append("Currently not in a room.\r");
else
{
HabboInfo.Append("Room: " + TargetClient.GetHabbo().CurrentRoom.Name + " (" + TargetClient.GetHabbo().CurrentRoom.RoomId + ")\r");
HabboInfo.Append("Room Owner: " + TargetClient.GetHabbo().CurrentRoom.OwnerName + "\r");
HabboInfo.Append("Current Visitors: " + TargetClient.GetHabbo().CurrentRoom.UserCount + "/" + TargetClient.GetHabbo().CurrentRoom.UsersMax);
}
}
Session.SendNotification(HabboInfo.ToString());
}
示例7: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
int TotalValue = 0;
try
{
DataTable Table = null;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("SELECT `id` FROM `items` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND (`room_id`= '0' OR `room_id` = '')");
Table = dbClient.getTable();
}
if (Table == null)
{
Session.SendWhisper("You currently have no items in your inventory!");
return;
}
foreach (DataRow Row in Table.Rows)
{
Item Item = Session.GetHabbo().GetInventoryComponent().GetItem(Convert.ToInt32(Row[0]));
if (Item == null)
continue;
if (!Item.GetBaseItem().ItemName.StartsWith("CF_") && !Item.GetBaseItem().ItemName.StartsWith("CFC_"))
continue;
if (Item.RoomId > 0)
continue;
string[] Split = Item.GetBaseItem().ItemName.Split('_');
int Value = int.Parse(Split[1]);
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + Item.Id + "' LIMIT 1");
}
Session.GetHabbo().GetInventoryComponent().RemoveItem(Item.Id);
TotalValue += Value;
if (Value > 0)
{
Session.GetHabbo().Credits += Value;
Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
}
}
if (TotalValue > 0)
Session.SendNotification("All credits have successfully been converted!\r\r(Total value: " + TotalValue + " credits!");
else
Session.SendNotification("It appears you don't have any exchangeable items!");
}
catch
{
Session.SendNotification("Oops, an error occoured whilst converting your credits!");
}
}
示例8: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Oops, you must choose a room option to disable.");
return;
}
if (!Room.CheckRights(Session, true))
{
Session.SendWhisper("Oops, only the room owner or staff can use this command.");
return;
}
string Option = Params[1];
switch (Option)
{
case "list":
{
StringBuilder List = new StringBuilder("");
List.AppendLine("Room Command List");
List.AppendLine("-------------------------");
List.AppendLine("Pet Morphs: " + (Room.PetMorphsAllowed == true ? "enabled" : "disabled"));
List.AppendLine("Pull: " + (Room.PullEnabled == true ? "enabled" : "disabled"));
List.AppendLine("Push: " + (Room.PushEnabled == true ? "enabled" : "disabled"));
List.AppendLine("Super Pull: " + (Room.SPullEnabled == true ? "enabled" : "disabled"));
List.AppendLine("Super Push: " + (Room.SPushEnabled == true ? "enabled" : "disabled"));
List.AppendLine("Respect: " + (Room.RespectNotificationsEnabled == true ? "enabled" : "disabled"));
List.AppendLine("Enables: " + (Room.EnablesEnabled == true ? "enabled" : "disabled"));
Session.SendNotification(List.ToString());
break;
}
case "push":
{
Room.PushEnabled = !Room.PushEnabled;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `push_enabled` = @PushEnabled WHERE `id` = '" + Room.Id +"' LIMIT 1");
dbClient.AddParameter("PushEnabled", PlusEnvironment.BoolToEnum(Room.PushEnabled));
dbClient.RunQuery();
}
Session.SendWhisper("Push mode is now " + (Room.PushEnabled == true ? "enabled!" : "disabled!"));
break;
}
case "spush":
{
Room.SPushEnabled = !Room.SPushEnabled;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `spush_enabled` = @PushEnabled WHERE `id` = '" + Room.Id + "' LIMIT 1");
dbClient.AddParameter("PushEnabled", PlusEnvironment.BoolToEnum(Room.SPushEnabled));
dbClient.RunQuery();
}
Session.SendWhisper("Super Push mode is now " + (Room.SPushEnabled == true ? "enabled!" : "disabled!"));
break;
}
case "spull":
{
Room.SPullEnabled = !Room.SPullEnabled;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `spull_enabled` = @PullEnabled WHERE `id` = '" + Room.Id + "' LIMIT 1");
dbClient.AddParameter("PullEnabled", PlusEnvironment.BoolToEnum(Room.SPullEnabled));
dbClient.RunQuery();
}
Session.SendWhisper("Super Pull mode is now " + (Room.SPullEnabled == true ? "enabled!" : "disabled!"));
break;
}
case "pull":
{
Room.PullEnabled = !Room.PullEnabled;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `pull_enabled` = @PullEnabled WHERE `id` = '" + Room.Id + "' LIMIT 1");
dbClient.AddParameter("PullEnabled", PlusEnvironment.BoolToEnum(Room.PullEnabled));
dbClient.RunQuery();
}
Session.SendWhisper("Pull mode is now " + (Room.PullEnabled == true ? "enabled!" : "disabled!"));
break;
}
case "enable":
case "enables":
{
Room.EnablesEnabled = !Room.EnablesEnabled;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `enables_enabled` = @EnablesEnabled WHERE `id` = '" + Room.Id + "' LIMIT 1");
dbClient.AddParameter("EnablesEnabled", PlusEnvironment.BoolToEnum(Room.EnablesEnabled));
dbClient.RunQuery();
}
//.........这里部分代码省略.........