本文整理汇总了C#中HabboHotel.GetHabbo方法的典型用法代码示例。如果您正苦于以下问题:C# HabboHotel.GetHabbo方法的具体用法?C# HabboHotel.GetHabbo怎么用?C# HabboHotel.GetHabbo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HabboHotel
的用法示例。
在下文中一共展示了HabboHotel.GetHabbo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null || !Room.CheckRights(Session, true))
return;
int ItemId = Packet.PopInt();
string Name = Packet.PopString();
Item Item = Session.GetHabbo().CurrentRoom.GetRoomItemHandler().GetItem(ItemId);
if (Item == null)
return;
if (Item.ExtraData.Contains(Convert.ToChar(5)))
{
string[] Flags = Item.ExtraData.Split(Convert.ToChar(5));
Item.ExtraData = Flags[0] + Convert.ToChar(5) + Flags[1] + Convert.ToChar(5) + Name;
}
else
Item.ExtraData = "m" + Convert.ToChar(5) + ".ch-210-1321.lg-285-92" + Convert.ToChar(5) + "Default Mannequin";
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `items` SET `extra_data` = @Ed WHERE id = '" + Item.Id + "' LIMIT 1");
dbClient.AddParameter("Ed", Item.ExtraData);
dbClient.RunQuery();
}
Item.UpdateState(true, true);
}
示例2: 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) || Room.MoodlightData == null)
return;
Item Item = Room.GetRoomItemHandler().GetItem(Room.MoodlightData.ItemId);
if (Item == null || Item.GetBaseItem().InteractionType != InteractionType.MOODLIGHT)
return;
int Preset = Packet.PopInt();
int BackgroundMode = Packet.PopInt();
string ColorCode = Packet.PopString();
int Intensity = Packet.PopInt();
bool BackgroundOnly = false;
if (BackgroundMode >= 2)
BackgroundOnly = true;
Room.MoodlightData.Enabled = true;
Room.MoodlightData.CurrentPreset = Preset;
Room.MoodlightData.UpdatePreset(Preset, ColorCode, Intensity, BackgroundOnly);
Item.ExtraData = Room.MoodlightData.GenerateExtraData();
Item.UpdateState();
}
示例3: Handle
public void Handle(HabboHotel.GameClients.GameClient Session, global::Essential.Messages.ClientMessage Event)
{
ServerMessage Message5_0 = new ServerMessage(Outgoing.Game2FullGameStatusMessageEvent);//Game2FullGameStatusMessageEvent
Message5_0.AppendInt32(1);
Message5_0.AppendInt32(1);
Message5_0.AppendInt32(1);
//SOMETHING
Message5_0.AppendInt32(1);
Message5_0.AppendInt32(1);
Message5_0.AppendInt32(1);
Message5_0.AppendInt32(1);
Message5_0.AppendInt32(3);
Habbo habbo = Session.GetHabbo();
Message5_0.AppendInt32(habbo.SnowUserId);
Message5_0.AppendInt32(habbo.SnowX);
Message5_0.AppendInt32(habbo.SnowY);
Message5_0.AppendInt32((int)(habbo.SnowX / 0xc80));
Message5_0.AppendInt32((int)(habbo.SnowY / 0xc80));
Message5_0.AppendInt32(habbo.SnowRot);
Message5_0.AppendInt32(0);
Message5_0.AppendInt32(0);
//SOMETHING2
Message5_0.AppendInt32(0);
Message5_0.AppendInt32(0);
Message5_0.AppendInt32(0);
Session.GetHabbo().SnowWar.SendToStorm(Message5_0);
}
示例4: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
int CreditsOwed = 0;
DataTable Table = null;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("SELECT `asking_price` FROM `catalog_marketplace_offers` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND state = '2'");
Table = dbClient.getTable();
}
if (Table != null)
{
foreach (DataRow row in Table.Rows)
{
CreditsOwed += Convert.ToInt32(row["asking_price"]);
}
if (CreditsOwed >= 1)
{
Session.GetHabbo().Credits += CreditsOwed;
Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
}
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("DELETE FROM `catalog_marketplace_offers` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND `state` = '2'");
}
}
}
示例5: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null)
return;
if (!Session.GetHabbo().InRoom)
return;
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
return;
RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null || !User.CanWalk)
return;
int MoveX = Packet.PopInt();
int MoveY = Packet.PopInt();
if (MoveX == User.X && MoveY == User.Y)
return;
if (User.RidingHorse)
{
RoomUser Horse = Room.GetRoomUserManager().GetRoomUserByVirtualId(User.HorseID);
if (Horse != null)
Horse.MoveTo(MoveX, MoveY);
}
User.MoveTo(MoveX, MoveY);
}
示例6: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().InRoom)
return;
Room Room = null;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
return;
int PetId = Packet.PopInt();
RoomUser Pet = null;
if (!Room.GetRoomUserManager().TryGetPet(PetId, out Pet))
return;
if (Pet.PetData.AnyoneCanRide == 1)
Pet.PetData.AnyoneCanRide = 0;
else
Pet.PetData.AnyoneCanRide = 1;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `bots_petdata` SET `anyone_ride` = '" + Pet.PetData.AnyoneCanRide + "' WHERE `id` = '" + PetId + "' LIMIT 1");
}
Room.SendMessage(new PetInformationComposer(Pet.PetData));
}
示例7: 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
}
示例8: 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));
}
示例9: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
int SlotId = Packet.PopInt();
string Look = PlusEnvironment.GetGame().GetAntiMutant().RunLook(Packet.PopString());
string Gender = Packet.PopString();
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("SELECT null FROM `user_wardrobe` WHERE `user_id` = " + Session.GetHabbo().Id + " AND `slot_id` = @slot");
dbClient.AddParameter("slot", SlotId);
if (dbClient.getRow() != null)
{
dbClient.SetQuery("UPDATE `user_wardrobe` SET `look` = @look, `gender` = @gender WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND `slot_id` = @slot LIMIT 1");
dbClient.AddParameter("slot", SlotId);
dbClient.AddParameter("look", Look);
dbClient.AddParameter("gender", Gender.ToUpper());
dbClient.RunQuery();
}
else
{
dbClient.SetQuery("INSERT INTO `user_wardrobe` (`user_id`,`slot_id`,`look`,`gender`) VALUES ('" + Session.GetHabbo().Id + "',@slot,@look,@gender)");
dbClient.AddParameter("slot", SlotId);
dbClient.AddParameter("look", Look);
dbClient.AddParameter("gender", Gender.ToUpper());
dbClient.RunQuery();
}
}
}
示例10: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().InRoom)
return;
Room Room = null;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
return;
RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
return;
RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Packet.PopInt());
if (TargetUser == null)
return;
if (!((Math.Abs((User.X - TargetUser.X)) >= 3) || (Math.Abs((User.Y - TargetUser.Y)) >= 3)) || Session.GetHabbo().GetPermissions().HasRight("mod_tool"))
{
if (User.CarryItemID > 0 && User.CarryTimer > 0)
{
if (User.CarryItemID == 8)
PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.GIVE_COFFEE);
TargetUser.CarryItem(User.CarryItemID);
User.CarryItem(0);
TargetUser.DanceId = 0;
}
}
}
示例11: 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 (Room.MoodlightData == null)
{
foreach (Item item in Room.GetRoomItemHandler().GetWall.ToList())
{
if (item.GetBaseItem().InteractionType == InteractionType.MOODLIGHT)
Room.MoodlightData = new MoodlightData(item.Id);
}
}
if (Room.MoodlightData == null)
return;
Session.SendMessage(new MoodlightConfigComposer(Room.MoodlightData));
}
示例12: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().InRoom)
return;
Room Room = null;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
return;
if (!Room.CheckRights(Session))
return;
Item Item = Room.GetRoomItemHandler().GetItem(Packet.PopInt());
if (Item == null)
return;
if (Item.GetBaseItem().InteractionType == InteractionType.POSTIT || Item.GetBaseItem().InteractionType == InteractionType.CAMERA_PICTURE)
{
Room.GetRoomItemHandler().RemoveFurniture(Session, Item.Id);
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + Item.Id + "' LIMIT 1");
}
}
}
示例13: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().InRoom)
return;
int BotId = Packet.PopInt();
int ActionId = Packet.PopInt();
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
return;
RoomUser BotUser = null;
if (!Room.GetRoomUserManager().TryGetBot(BotId, out BotUser))
return;
string BotSpeech = "";
foreach (RandomSpeech Speech in BotUser.BotData.RandomSpeech.ToList())
{
BotSpeech += (Speech.Message + "\n");
}
BotSpeech += ";#;";
BotSpeech += BotUser.BotData.AutomaticChat;
BotSpeech += ";#;";
BotSpeech += BotUser.BotData.SpeakingInterval;
BotSpeech += ";#;";
BotSpeech += BotUser.BotData.MixSentences;
if (ActionId == 2 || ActionId == 5)
Session.SendMessage(new OpenBotActionComposer(BotUser, ActionId, BotSpeech));
}
示例14: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null || !Room.CheckRights(Session, true))
return;
int ItemId = Packet.PopInt();
Item Item = Session.GetHabbo().CurrentRoom.GetRoomItemHandler().GetItem(ItemId);
if (Item == null)
return;
string Gender = Session.GetHabbo().Gender.ToLower();
string Figure = "";
foreach (string Str in Session.GetHabbo().Look.Split('.'))
{
if (Str.Contains("hr") || Str.Contains("hd") || Str.Contains("he") || Str.Contains("ea") || Str.Contains("ha"))
continue;
Figure += Str + ".";
}
Figure = Figure.TrimEnd('.');
if (Item.ExtraData.Contains(Convert.ToChar(5)))
{
string[] Flags = Item.ExtraData.Split(Convert.ToChar(5));
Item.ExtraData = Gender + Convert.ToChar(5) + Figure + Convert.ToChar(5) + Flags[2];
}
else
Item.ExtraData = Gender + Convert.ToChar(5) + Figure + Convert.ToChar(5) + "Default";
Item.UpdateState(true, true);
}
示例15: 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));
}