本文整理汇总了C#中HabboHotel.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# HabboHotel.SendMessage方法的具体用法?C# HabboHotel.SendMessage怎么用?C# HabboHotel.SendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HabboHotel
的用法示例。
在下文中一共展示了HabboHotel.SendMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
public void Handle(HabboHotel.GameClients.GameClient Session, global::Essential.Messages.ClientMessage Event)
{
using(DatabaseClient dbClient = Essential.GetDatabase().GetClient())
{
string username = Event.PopFixedString();
string password = Event.PopFixedString(); //TODO: Hash undso..
dbClient.AddParamWithValue("username", username);
string currentpassword = "";
try
{
currentpassword = dbClient.ReadString("SELECT password FROM users WHERE [email protected]");
}
catch { }
if (currentpassword == "")
{ Session.SendMessage(new ServerMessage(Outgoing.InvalidUsername)); return; }
if (currentpassword != password)
{ Session.SendMessage(new ServerMessage(Outgoing.InvalidPassword)); return; }
ServerMessage asdf = new ServerMessage(12345);
asdf.AppendBoolean(true);
asdf.AppendString("Hi");
asdf.AppendInt32(1337);
asdf.AppendUInt(12345);
Session.SendMessage(asdf);
Session.tryLogin(dbClient.ReadString("SELECT auth_ticket FROM users WHERE [email protected]"));
}
}
示例2: 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;
}
示例3: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().InRoom)
return;
int PetId = Packet.PopInt();
RoomUser Pet = null;
if (!Session.GetHabbo().CurrentRoom.GetRoomUserManager().TryGetPet(PetId, out Pet))
{
//Okay so, we've established we have no pets in this room by this virtual Id, let us check out users, maybe they're creeping as a pet?!
RoomUser User = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(PetId);
if (User == null)
return;
//Check some values first, please!
if (User.GetClient() == null || User.GetClient().GetHabbo() == null)
return;
//And boom! Let us send the information composer 8-).
Session.SendMessage(new PetInformationComposer(User.GetClient().GetHabbo()));
return;
}
//Continue as a regular pet..
if (Pet.RoomId != Session.GetHabbo().CurrentRoomId || Pet.PetData == null)
return;
Session.SendMessage(new PetInformationComposer(Pet.PetData));
}
示例4: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().GetMessenger() == null)
return;
int BuddyId = Packet.PopInt();
if (BuddyId == 0 || BuddyId == Session.GetHabbo().Id)
return;
GameClient Client = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(BuddyId);
if (Client == null || Client.GetHabbo() == null)
return;
if (!Client.GetHabbo().InRoom)
{
Session.SendMessage(new FollowFriendFailedComposer(2));
Session.GetHabbo().GetMessenger().UpdateFriend(Client.GetHabbo().Id, Client, true);
return;
}
else if (Session.GetHabbo().CurrentRoom != null && Client.GetHabbo().CurrentRoom != null)
{
if (Session.GetHabbo().CurrentRoom.RoomId == Client.GetHabbo().CurrentRoom.RoomId)
return;
}
Session.SendMessage(new RoomForwardComposer(Client.GetHabbo().CurrentRoomId));
}
示例5: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
string Category = Packet.PopString();
string Unknown = Packet.PopString();
if (!string.IsNullOrEmpty(Unknown))
{
Category = "hotel_view";
ICollection<SearchResultList> Test = new List<SearchResultList>();
SearchResultList Null = null;
if (PlusEnvironment.GetGame().GetNavigator().TryGetSearchResultList(0, out Null))
{
Test.Add(Null);
Session.SendMessage(new NavigatorSearchResultSetComposer(Category, Unknown, Test, Session));
}
}
else
{
//Fetch the categorys.
ICollection<SearchResultList> Test = PlusEnvironment.GetGame().GetNavigator().GetCategorysForSearch(Category);
if (Test.Count == 0)
{
ICollection<SearchResultList> SecondTest = PlusEnvironment.GetGame().GetNavigator().GetResultByIdentifier(Category);
if (SecondTest.Count > 0)
{
Session.SendMessage(new NavigatorSearchResultSetComposer(Category, Unknown, SecondTest, Session, 2, 100));
return;
}
}
Session.SendMessage(new NavigatorSearchResultSetComposer(Category, Unknown, Test, Session));
}
}
示例6: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, Messages.ClientMessage Packet)
{
Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
Session.SendMessage(new UserPerksComposer());
Session.GetHabbo().InitMessenger(); // Temporary fixxx
}
示例7: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
int GameId = Packet.PopInt();
Session.SendMessage(new GameAccountStatusComposer(GameId));
Session.SendMessage(new PlayableGamesComposer(GameId));
Session.SendMessage(new GameAchievementListComposer(Session, PlusEnvironment.GetGame().GetAchievementManager().GetGameAchievements(GameId), GameId));
}
示例8: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null)
return;
string Gender = Packet.PopString().ToUpper();
string Look = PlusEnvironment.GetGame().GetAntiMutant().RunLook(Packet.PopString());
if (Look == Session.GetHabbo().Look)
return;
if ((DateTime.Now - Session.GetHabbo().LastClothingUpdateTime).TotalSeconds <= 2.0)
{
Session.GetHabbo().ClothingUpdateWarnings += 1;
if (Session.GetHabbo().ClothingUpdateWarnings >= 25)
Session.GetHabbo().SessionClothingBlocked = true;
return;
}
if (Session.GetHabbo().SessionClothingBlocked)
return;
Session.GetHabbo().LastClothingUpdateTime = DateTime.Now;
string[] AllowedGenders = { "M", "F" };
if (!AllowedGenders.Contains(Gender))
{
Session.SendMessage(new BroadcastMessageAlertComposer("Sorry, you chose an invalid gender."));
return;
}
PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.PROFILE_CHANGE_LOOK);
Session.GetHabbo().Look = PlusEnvironment.FilterFigure(Look);
Session.GetHabbo().Gender = Gender.ToLower();
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE users SET look = @look, gender = @gender WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
dbClient.AddParameter("look", Look);
dbClient.AddParameter("gender", Gender);
dbClient.RunQuery();
}
PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(Session, "ACH_AvatarLooks", 1);
if (Session.GetHabbo().Look.Contains("ha-1006"))
PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.WEAR_HAT);
if (Session.GetHabbo().InRoom)
{
RoomUser RoomUser = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (RoomUser != null)
{
Session.SendMessage(new UserChangeComposer(RoomUser, true));
Session.GetHabbo().CurrentRoom.SendMessage(new UserChangeComposer(RoomUser, false));
}
}
}
示例9: 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!");
}
示例10: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null)
return;
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
return;
if (Session.GetHabbo().InRoom)
{
Room OldRoom;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out OldRoom))
return;
if (OldRoom.GetRoomUserManager() != null)
OldRoom.GetRoomUserManager().RemoveUserFromRoom(Session, false, false);
}
if (!Room.GetRoomUserManager().AddAvatarToRoom(Session))
{
Room.GetRoomUserManager().RemoveUserFromRoom(Session, false, false);
return;//TODO: Remove?
}
Room.SendObjects(Session);
//Status updating for messenger, do later as buggy.
try
{
if (Session.GetHabbo().GetMessenger() != null)
Session.GetHabbo().GetMessenger().OnStatusChanged(true);
}
catch { }
if (Session.GetHabbo().GetStats().QuestID > 0)
PlusEnvironment.GetGame().GetQuestManager().QuestReminder(Session, Session.GetHabbo().GetStats().QuestID);
Session.SendMessage(new RoomEntryInfoComposer(Room.RoomId, Room.CheckRights(Session, true)));
Session.SendMessage(new RoomVisualizationSettingsComposer(Room.WallThickness, Room.FloorThickness, PlusEnvironment.EnumToBool(Room.Hidewall.ToString())));
RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username);
if (ThisUser != null && Session.GetHabbo().PetId == 0)
Room.SendMessage(new UserChangeComposer(ThisUser, false));
Session.SendMessage(new RoomEventComposer(Room.RoomData, Room.RoomData.Promotion));
if (Room.GetWired() != null)
Room.GetWired().TriggerEvent(WiredBoxType.TriggerRoomEnter, Session.GetHabbo());
if (PlusEnvironment.GetUnixTimestamp() < Session.GetHabbo().FloodTime && Session.GetHabbo().FloodTime != 0)
Session.SendMessage(new FloodControlComposer((int)Session.GetHabbo().FloodTime - (int)PlusEnvironment.GetUnixTimestamp()));
}
示例11: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
ICollection<TopLevelItem> TopLevelItems = PlusEnvironment.GetGame().GetNavigator().GetTopLevelItems();
ICollection<SearchResultList> SearchResultLists = PlusEnvironment.GetGame().GetNavigator().GetSearchResultLists();
Session.SendMessage(new NavigatorMetaDataParserComposer(TopLevelItems));
Session.SendMessage(new NavigatorLiftedRoomsComposer());
Session.SendMessage(new NavigatorCollapsedCategoriesComposer());
Session.SendMessage(new NavigatorPreferencesComposer());
}
示例12: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
Room Instance = PlusEnvironment.GetGame().GetRoomManager().TryGetRandomLoadedRoom();
if (Instance != null)
{
Session.SendMessage(new FindFriendsProcessResultComposer(true));
Session.SendMessage(new RoomForwardComposer(Instance.Id));
}
else
{
Session.SendMessage(new FindFriendsProcessResultComposer(false));
}
}
示例13: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null)
return;
if (Session.GetHabbo().UsersRooms.Count >= 500)
{
Session.SendMessage(new CanCreateRoomComposer(true, 500));
return;
}
string Name = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
string Description = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
string ModelName = Packet.PopString();
int Category = Packet.PopInt();
int MaxVisitors = Packet.PopInt();//10 = min, 25 = max.
int TradeSettings = Packet.PopInt();//2 = All can trade, 1 = owner only, 0 = no trading.
if (Name.Length < 3)
return;
if (Name.Length > 25)
return;
RoomModel RoomModel = null;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetModel(ModelName, out RoomModel))
return;
SearchResultList SearchResultList = null;
if (!PlusEnvironment.GetGame().GetNavigator().TryGetSearchResultList(Category, out SearchResultList))
Category = 36;
if (SearchResultList.CategoryType != NavigatorCategoryType.CATEGORY || SearchResultList.RequiredRank > Session.GetHabbo().Rank)
Category = 36;
if (MaxVisitors < 10 || MaxVisitors > 25)
MaxVisitors = 10;
if (TradeSettings < 0 || TradeSettings > 2)
TradeSettings = 0;
RoomData NewRoom = PlusEnvironment.GetGame().GetRoomManager().CreateRoom(Session, Name, Description, ModelName, Category, MaxVisitors, TradeSettings);
if (NewRoom != null)
{
Session.SendMessage(new FlatCreatedComposer(NewRoom.Id, Name));
}
}
示例14: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool"))
return;
int UserId = Packet.PopInt();
GameClient Target = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(UserId);
if (Target == null)
return;
DataTable Table = null;
Dictionary<double, RoomData> Visits = new Dictionary<double, RoomData>();
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("SELECT room_id, `entry_timestamp` FROM `user_roomvisits` WHERE `user_id` [email protected] ORDER BY `entry_timestamp` DESC LIMIT 50");
dbClient.AddParameter("id", UserId);
Table = dbClient.getTable();
if (Table != null)
{
foreach (DataRow Row in Table.Rows)
{
RoomData RData = PlusEnvironment.GetGame().GetRoomManager().GenerateRoomData(Convert.ToInt32(Row["room_id"]));
if (RData == null)
return;
if (!Visits.ContainsKey(Convert.ToDouble(Row["entry_timestamp"])))
Visits.Add(Convert.ToDouble(Row["entry_timestamp"]), RData);
}
}
}
Session.SendMessage(new ModeratorUserRoomVisitsComposer(Target.GetHabbo(), Visits));
}
示例15: 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));
}