本文整理汇总了C#中HabboHotel.SendNotification方法的典型用法代码示例。如果您正苦于以下问题:C# HabboHotel.SendNotification方法的具体用法?C# HabboHotel.SendNotification怎么用?C# HabboHotel.SendNotification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HabboHotel
的用法示例。
在下文中一共展示了HabboHotel.SendNotification方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
//0 = sent, 1 = blocked, 2 = no chat, 3 = already reported.
if (Session == null)
return;
int UserId = Packet.PopInt();
if (UserId == Session.GetHabbo().Id)//Hax
return;
if (Session.GetHabbo().AdvertisingReportedBlocked)
{
Session.SendMessage(new SubmitBullyReportComposer(1));//This user is blocked from reporting.
return;
}
GameClient Client = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(Convert.ToInt32(UserId));
if (Client == null)
{
Session.SendMessage(new SubmitBullyReportComposer(0));//Just say it's sent, the user isn't found.
return;
}
if (Session.GetHabbo().LastAdvertiseReport > PlusEnvironment.GetUnixTimestamp())
{
Session.SendNotification("Reports can only be sent per 5 minutes!");
return;
}
if (Client.GetHabbo().GetPermissions().HasRight("mod_tool"))//Reporting staff, nope!
{
Session.SendNotification("Sorry, you cannot report staff members via this tool.");
return;
}
//This user hasn't even said a word, nope!
if (!Client.GetHabbo().HasSpoken)
{
Session.SendMessage(new SubmitBullyReportComposer(2));
return;
}
//Already reported, nope.
if (Client.GetHabbo().AdvertisingReported && Session.GetHabbo().Rank < 2)
{
Session.SendMessage(new SubmitBullyReportComposer(3));
return;
}
if (Session.GetHabbo().Rank <= 1)
Session.GetHabbo().LastAdvertiseReport = PlusEnvironment.GetUnixTimestamp() + 300;
else
Session.GetHabbo().LastAdvertiseReport = PlusEnvironment.GetUnixTimestamp();
Client.GetHabbo().AdvertisingReported = true;
Session.SendMessage(new SubmitBullyReportComposer(0));
//PlusEnvironment.GetGame().GetClientManager().ModAlert("New advertising report! " + Client.GetHabbo().Username + " has been reported for advertising by " + Session.GetHabbo().Username +".");
PlusEnvironment.GetGame().GetClientManager().DoAdvertisingReport(Session, Client);
return;
}
示例2: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().InRoom)
return;
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
return;
int ItemId = Packet.PopInt();
Item Item = Room.GetRoomItemHandler().GetItem(ItemId);
if (Item == null)
return;
if (Item.Data == null)
return;
if (Item.UserID != Session.GetHabbo().Id)
return;
if (Item.Data.InteractionType != InteractionType.PURCHASABLE_CLOTHING)
{
Session.SendNotification("Oops, this item isn't set as a sellable clothing item!");
return;
}
if (Item.Data.ClothingId == 0)
{
Session.SendNotification("Oops, this item doesn't have a linking clothing configuration, please report it!");
return;
}
ClothingItem Clothing = null;
if (!PlusEnvironment.GetGame().GetCatalog().GetClothingManager().TryGetClothing(Item.Data.ClothingId, out Clothing))
{
Session.SendNotification("Oops, we couldn't find this clothing part!");
return;
}
//Quickly delete it from the database.
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("DELETE FROM `items` WHERE `id` = @ItemId LIMIT 1");
dbClient.AddParameter("ItemId", Item.Id);
dbClient.RunQuery();
}
//Remove the item.
Room.GetRoomItemHandler().RemoveFurniture(Session, Item.Id);
Session.GetHabbo().GetClothing().AddClothing(Clothing.ClothingName, Clothing.PartIds);
Session.SendMessage(new FigureSetIdsComposer(Session.GetHabbo().GetClothing().GetClothingAllParts));
Session.SendMessage(new RoomNotificationComposer("figureset.redeemed.success"));
Session.SendWhisper("If for some reason cannot see your new clothing, reload the hotel!");
}
示例3: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
Group Group = null;
if (!PlusEnvironment.GetGame().GetGroupManager().TryGetGroup(Packet.PopInt(), out Group))
{
Session.SendNotification("Oops, we couldn't find that group!");
return;
}
if (Group.CreatorId != Session.GetHabbo().Id && !Session.GetHabbo().GetPermissions().HasRight("group_delete_override"))//Maybe a FUSE check for staff override?
{
Session.SendNotification("Oops, only the group owner can delete a group!");
return;
}
if (Group.MemberCount >= PlusStaticGameSettings.GroupMemberDeletionLimit && !Session.GetHabbo().GetPermissions().HasRight("group_delete_limit_override"))
{
Session.SendNotification("Oops, your group exceeds the maximum amount of members (" + PlusStaticGameSettings.GroupMemberDeletionLimit + ") a group can exceed before being eligible for deletion. Seek assistance from a staff member.");
return;
}
Room Room = PlusEnvironment.GetGame().GetRoomManager().LoadRoom(Group.RoomId);
if (Room != null)
{
Room.Group = null;
Room.RoomData.Group = null;//I'm not sure if this is needed or not, becauseof inheritance, but oh well.
}
//Remove it from the cache.
PlusEnvironment.GetGame().GetGroupManager().DeleteGroup(Group.Id);
//Now the :S stuff.
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("DELETE FROM `groups` WHERE `id` = '" + Group.Id + "'");
dbClient.RunQuery("DELETE FROM `group_memberships` WHERE `group_id` = '" + Group.Id + "'");
dbClient.RunQuery("DELETE FROM `group_requests` WHERE `group_id` = '" + Group.Id + "'");
dbClient.RunQuery("UPDATE `rooms` SET `group_id` = '0' WHERE `group_id` = '" + Group.Id + "' LIMIT 1");
dbClient.RunQuery("UPDATE `user_stats` SET `groupid` = '0' WHERE `groupid` = '" + Group.Id + "' LIMIT 1");
dbClient.RunQuery("DELETE FROM `items_groups` WHERE `group_id` = '" + Group.Id + "'");
}
//Unload it last.
PlusEnvironment.GetGame().GetRoomManager().UnloadRoom(Room, true);
//Say hey!
Session.SendNotification("You have successfully deleted your group.");
return;
}
示例4: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
int GroupId = Packet.PopInt();
int UserId = Packet.PopInt();
Group Group = null;
if (!PlusEnvironment.GetGame().GetGroupManager().TryGetGroup(GroupId, out Group))
return;
if ((Session.GetHabbo().Id != Group.CreatorId && !Group.IsAdmin(Session.GetHabbo().Id)) && !Session.GetHabbo().GetPermissions().HasRight("fuse_group_accept_any"))
return;
if (!Group.HasRequest(UserId))
return;
Habbo Habbo = PlusEnvironment.GetHabboById(UserId);
if (Habbo == null)
{
Session.SendNotification("Oops, an error occurred whilst finding this user.");
return;
}
Group.HandleRequest(UserId, true);
Session.SendMessage(new GroupMemberUpdatedComposer(GroupId, Habbo, 4));
}
示例5: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
int RoomId = Packet.PopInt();
string Name = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
string Desc = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
RoomData Data = PlusEnvironment.GetGame().GetRoomManager().GenerateRoomData(RoomId);
if (Data == null)
return;
if (Data.OwnerId != Session.GetHabbo().Id)
return;//HAX
if (Data.Promotion == null)
{
Session.SendNotification("Oops, it looks like there isn't a room promotion in this room?");
return;
}
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `room_promotions` SET `title` = @title, `description` = @desc WHERE `room_id` = " + RoomId + " LIMIT 1");
dbClient.AddParameter("title", Name);
dbClient.AddParameter("desc", Desc);
dbClient.RunQuery();
}
Room Room;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Convert.ToInt32(RoomId), out Room))
return;
Data.Promotion.Name = Name;
Data.Promotion.Description = Desc;
Room.SendMessage(new RoomEventComposer(Data, Data.Promotion));
}
示例6: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool"))
return;
int UserId = Packet.PopInt();
DataRow User = null;
DataRow Info = null;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("SELECT `id`,`username`,`online`,`mail`,`ip_last`,`look`,`account_created`,`last_online` FROM `users` WHERE `id` = '" + UserId + "' LIMIT 1");
User = dbClient.getRow();
if (User == null)
{
Session.SendNotification(PlusEnvironment.GetGame().GetLanguageLocale().TryGetValue("user_not_found"));
return;
}
dbClient.SetQuery("SELECT `cfhs`,`cfhs_abusive`,`cautions`,`bans`,`trading_locked`,`trading_locks_count` FROM `user_info` WHERE `user_id` = '" + UserId + "' LIMIT 1");
Info = dbClient.getRow();
if (Info == null)
{
dbClient.RunQuery("INSERT INTO `user_info` (`user_id`) VALUES ('" + UserId + "')");
dbClient.SetQuery("SELECT `cfhs`,`cfhs_abusive`,`cautions`,`bans`,`trading_locked`,`trading_locks_count` FROM `user_info` WHERE `user_id` = '" + UserId + "' LIMIT 1");
Info = dbClient.getRow();
}
}
Session.SendMessage(new ModeratorUserInfoComposer(User, Info));
}
示例7: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null)
return;
if (!Session.GetHabbo().InRoom)
return;
int ItemId = Packet.PopInt();
Session.SendMessage(new HideWiredConfigComposer());
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
return;
Item SelectedItem = Room.GetRoomItemHandler().GetItem(ItemId);
if (SelectedItem == null)
return;
IWiredItem Box = null;
if (!Session.GetHabbo().CurrentRoom.GetWired().TryGet(ItemId, out Box))
return;
if (Box.Type == WiredBoxType.EffectGiveUserBadge && !Session.GetHabbo().GetPermissions().HasRight("room_item_wired_rewards"))
{
Session.SendNotification("You don't have the correct permissions to do this.");
return;
}
Box.HandleSave(Packet);
Session.GetHabbo().CurrentRoom.GetWired().SaveBox(Box);
}
示例8: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null)
return;
if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool"))
return;
int UserId = Packet.PopInt();
Habbo Habbo = PlusEnvironment.GetHabboById(UserId);
if (Habbo == null)
{
Session.SendNotification("Oops, we couldn't find this user.");
return;
}
try
{
Session.SendMessage(new ModeratorUserChatlogComposer(UserId));
}
catch { Session.SendNotification("Overflow :/"); }
}
示例9: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
string CipherPublickey = Packet.PopString();
BigInteger SharedKey = HabboEncryptionV2.CalculateDiffieHellmanSharedKey(CipherPublickey);
if (SharedKey != 0)
{
Session.RC4Client = new ARC4(SharedKey.getBytes());
Session.SendMessage(new SecretKeyComposer(HabboEncryptionV2.GetRsaDiffieHellmanPublicKey()));
}
else
{
Session.SendNotification("There was an error logging you in, please try again!");
return;
}
}
示例10: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().InRoom)
return;
Room Room;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
return;
if (!Room.CheckRights(Session, true))
return;
if (PlusEnvironment.GetDBConfig().DBData["exchange_enabled"] != "1")
{
Session.SendNotification("The hotel managers have temporarilly disabled exchanging!");
return;
}
Item Exchange = Room.GetRoomItemHandler().GetItem(Packet.PopInt());
if (Exchange == null)
return;
if (!Exchange.GetBaseItem().ItemName.StartsWith("CF_") && !Exchange.GetBaseItem().ItemName.StartsWith("CFC_"))
return;
string[] Split = Exchange.GetBaseItem().ItemName.Split('_');
int Value = int.Parse(Split[1]);
if (Value > 0)
{
Session.GetHabbo().Credits += Value;
Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
}
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + Exchange.Id + "' LIMIT 1");
}
Session.SendMessage(new FurniListUpdateComposer());
Room.GetRoomItemHandler().RemoveFurniture(null, Exchange.Id, false);
Session.GetHabbo().GetInventoryComponent().RemoveItem(Exchange.Id);
}
示例11: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session.GetHabbo().TimeMuted > 0)
{
Session.SendNotification("Oops, you're currently muted - you cannot send room invitations.");
return;
}
int Amount = Packet.PopInt();
if (Amount > 500)
return; // don't send at all
List<int> Targets = new List<int>();
for (int i = 0; i < Amount; i++)
{
int uid = Packet.PopInt();
if (i < 100) // limit to 100 people, keep looping until we fulfil the request though
{
Targets.Add(uid);
}
}
string Message = StringCharFilter.Escape(Packet.PopString());
if (Message.Length > 121)
Message = Message.Substring(0, 121);
foreach (int UserId in Targets)
{
if (!Session.GetHabbo().GetMessenger().FriendshipExists(UserId))
continue;
GameClient Client = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(UserId);
if (Client == null || Client.GetHabbo() == null || Client.GetHabbo().AllowMessengerInvites == true || Client.GetHabbo().AllowConsoleMessages == false)
continue;
Client.SendMessage(new RoomInviteComposer(Session.GetHabbo().Id, Message));
}
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("INSERT INTO `chatlogs_console_invitations` (`user_id`,`message`,`timestamp`) VALUES ('" + Session.GetHabbo().Id + "', @message, UNIX_TIMESTAMP())");
dbClient.AddParameter("message", Message);
dbClient.RunQuery();
}
}
示例12: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
int SellingPrice = Packet.PopInt();
int ComissionPrice = Packet.PopInt();
int ItemId = Packet.PopInt();
Item Item = Session.GetHabbo().GetInventoryComponent().GetItem(ItemId);
if (Item == null)
{
Session.SendMessage(new MarketplaceMakeOfferResultComposer(0));
return;
}
if (!ItemUtility.IsRare(Item))
{
Session.SendNotification("Sorry, only Rares & LTDs can go be auctioned off in the Marketplace!");
return;
}
if (SellingPrice > 70000000 || SellingPrice == 0)
{
Session.SendMessage(new MarketplaceMakeOfferResultComposer(0));
return;
}
int Comission = PlusEnvironment.GetGame().GetCatalog().GetMarketplace().CalculateComissionPrice((float)SellingPrice);
int TotalPrice = SellingPrice + Comission;
int ItemType = 1;
if (Item.GetBaseItem().Type == 'i')
ItemType++;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("INSERT INTO `catalog_marketplace_offers` (`furni_id`,`item_id`,`user_id`,`asking_price`,total_price,public_name,sprite_id,item_type,timestamp,extra_data,limited_number,limited_stack) VALUES ('" + ItemId + "','" + Item.BaseItem + "','" + Session.GetHabbo().Id + "','" + SellingPrice + "','" + TotalPrice + "',@public_name,'" + Item.GetBaseItem().SpriteId + "','" + ItemType + "','" + PlusEnvironment.GetUnixTimestamp() + "',@extra_data, '" + Item.LimitedNo + "', '" + Item.LimitedTot + "')");
dbClient.AddParameter("public_name", Item.GetBaseItem().PublicName);
dbClient.AddParameter("extra_data", Item.ExtraData);
dbClient.RunQuery();
dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + ItemId + "' AND `user_id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
}
Session.GetHabbo().GetInventoryComponent().RemoveItem(ItemId);
Session.SendMessage(new MarketplaceMakeOfferResultComposer(1));
}
示例13: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null)
return;
int UserId = Packet.PopInt();
Room Room = null;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
return;
if (!Room.CheckRights(Session, true))
return;
if (Room.UsersWithRights.Contains(UserId))
{
Session.SendNotification(PlusEnvironment.GetGame().GetLanguageLocale().TryGetValue("room_rights_has_rights_error"));
return;
}
Room.UsersWithRights.Add(UserId);
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("INSERT INTO `room_rights` (`room_id`,`user_id`) VALUES ('" + Room.RoomId + "','" + UserId + "')");
}
RoomUser RoomUser = Room.GetRoomUserManager().GetRoomUserByHabbo(UserId);
if (RoomUser != null && !RoomUser.IsBot)
{
RoomUser.SetStatus("flatctrl 1", "");
RoomUser.UpdateNeeded = true;
if (RoomUser.GetClient() != null)
RoomUser.GetClient().SendMessage(new YouAreControllerComposer(1));
Session.SendMessage(new FlatControllerAddedComposer(Room.RoomId, RoomUser.GetClient().GetHabbo().Id, RoomUser.GetClient().GetHabbo().Username));
}
else
{
UserCache User = PlusEnvironment.GetGame().GetCacheManager().GenerateUser(UserId);
if (User != null)
Session.SendMessage(new FlatControllerAddedComposer(Room.RoomId, User.Id, User.Username));
}
}
示例14: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null)
return;
if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool"))
return;
int Junk = Packet.PopInt();
Room Room = null;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Packet.PopInt(), out Room))
return;
try
{
Session.SendMessage(new ModeratorRoomChatlogComposer(Room));
}
catch { Session.SendNotification("Overflow :/"); }
}
示例15: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
ICollection<Item> FloorItems = Session.GetHabbo().GetInventoryComponent().GetFloorItems();
ICollection<Item> WallItems = Session.GetHabbo().GetInventoryComponent().GetWallItems();
if (Session.GetHabbo().InventoryAlert == false)
{
Session.GetHabbo().InventoryAlert = true;
int TotalCount = FloorItems.Count + WallItems.Count;
if (TotalCount >= 5000)
{
Session.SendNotification("Hey! Our system has detected that you have a very large inventory!\n\n" +
"The maximum an inventory can load is 8000 items, you have " + TotalCount + " items loaded now.\n\n" +
"If you have 8000 loaded now then you're probably over the limit and some items will be hidden until you free up space.\n\n" +
"Please note that we are not responsible for you crashing because of too large inventorys!");
}
}
Session.SendMessage(new FurniListComposer(FloorItems.ToList(), WallItems));
}