本文整理汇总了C#中ClientPacket.PopString方法的典型用法代码示例。如果您正苦于以下问题:C# ClientPacket.PopString方法的具体用法?C# ClientPacket.PopString怎么用?C# ClientPacket.PopString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClientPacket
的用法示例。
在下文中一共展示了ClientPacket.PopString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
}
示例2: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().GetPermissions().HasRight("mod_mute"))
return;
int UserId = Packet.PopInt();
string Message = Packet.PopString();
double Length = (Packet.PopInt() * 60);
string Unknown1 = Packet.PopString();
string Unknown2 = Packet.PopString();
Habbo Habbo = PlusEnvironment.GetHabboById(UserId);
if (Habbo == null)
{
Session.SendWhisper("An error occoured whilst finding that user in the database.");
return;
}
if (Habbo.GetPermissions().HasRight("mod_mute") && !Session.GetHabbo().GetPermissions().HasRight("mod_mute_any"))
{
Session.SendWhisper("Oops, you cannot mute that user.");
return;
}
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `users` SET `time_muted` = '" + Length + "' WHERE `id` = '" + Habbo.Id + "' LIMIT 1");
}
if (Habbo.GetClient() != null)
{
Habbo.TimeMuted = Length;
Habbo.GetClient().SendNotification("You have been muted by a moderator for " + Length + " seconds!");
}
}
示例3: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
int GroupId = Packet.PopInt();
string Name = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
string Desc = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
Group Group = null;
if (!PlusEnvironment.GetGame().GetGroupManager().TryGetGroup(GroupId, out Group))
return;
if (Group.CreatorId != Session.GetHabbo().Id)
return;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `groups` SET `name`= @name, `desc` = @desc WHERE `id` = '" + GroupId + "' LIMIT 1");
dbClient.AddParameter("name", Name);
dbClient.AddParameter("desc", Desc);
dbClient.RunQuery();
}
Group.Name = Name;
Group.Description = Desc;
Session.SendMessage(new GroupInfoComposer(Group, Session));
}
示例4: 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));
}
示例5: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null)
return;
if (PlusEnvironment.GetGame().GetModerationTool().UsersHasPendingTicket(Session.GetHabbo().Id))
{
Session.SendMessage(new BroadcastMessageAlertComposer("You currently already have a pending ticket, please wait for a response from a moderator."));
return;
}
string Message = Packet.PopString();
int Type = Packet.PopInt();
int ReportedUser = Packet.PopInt();
int Room = Packet.PopInt();
int Messagecount = Packet.PopInt();
List<string> Chats = new List<string>();
for (int i = 0; i < Messagecount; i++)
{
Packet.PopInt();
Chats.Add(Packet.PopString());
}
ModerationRoomChatLog Chat = new ModerationRoomChatLog(Packet.PopInt(), Chats);
PlusEnvironment.GetGame().GetModerationTool().SendNewTicket(Session, Type, ReportedUser, Message, Chats);
PlusEnvironment.GetGame().GetClientManager().ModAlert("A new support ticket has been submitted!");
}
示例6: 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));
}
}
示例7: 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));
}
}
}
示例8: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
string Junk = Packet.PopString();
string MachineId = Packet.PopString();
Session.MachineId = MachineId;
Session.SendMessage(new SetUniqueIdComposer(MachineId));
}
示例9: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().GetPermissions().HasRight("mod_soft_ban"))
return;
int UserId = Packet.PopInt();
string Message = Packet.PopString();
double Length = (Packet.PopInt() * 3600) + PlusEnvironment.GetUnixTimestamp();
string Unknown1 = Packet.PopString();
string Unknown2 = Packet.PopString();
bool IPBan = Packet.PopBoolean();
bool MachineBan = Packet.PopBoolean();
if (MachineBan)
IPBan = false;
Habbo Habbo = PlusEnvironment.GetHabboById(UserId);
if (Habbo == null)
{
Session.SendWhisper("An error occoured whilst finding that user in the database.");
return;
}
if (Habbo.GetPermissions().HasRight("mod_tool") && !Session.GetHabbo().GetPermissions().HasRight("mod_ban_any"))
{
Session.SendWhisper("Oops, you cannot ban that user.");
return;
}
Message = (Message != null ? Message : "No reason specified.");
string Username = Habbo.Username;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `user_info` SET `bans` = `bans` + '1' WHERE `user_id` = '" + Habbo.Id + "' LIMIT 1");
}
if (IPBan == false && MachineBan == false)
PlusEnvironment.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.USERNAME, Habbo.Username, Message, Length);
else if (IPBan == true)
PlusEnvironment.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.IP, Habbo.Username, Message, Length);
else if (MachineBan == true)
{
PlusEnvironment.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.IP, Habbo.Username, Message, Length);
PlusEnvironment.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.USERNAME, Habbo.Username, Message, Length);
PlusEnvironment.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.MACHINE, Habbo.Username, Message, Length);
}
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Habbo.Username);
if (TargetClient != null)
TargetClient.Disconnect();
}
示例10: 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));
}
}
示例11: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
Room Room = null;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
return;
if (!Room.CheckRights(Session))
return;
int itemID = Packet.PopInt();
string wallPositionData = Packet.PopString();
Item Item = Room.GetRoomItemHandler().GetItem(itemID);
if (Item == null)
return;
try
{
string WallPos = Room.GetRoomItemHandler().WallPositionCheck(":" + wallPositionData.Split(':')[1]);
Item.wallCoord = WallPos;
}
catch { return; }
Room.GetRoomItemHandler().UpdateItem(Item);
Room.SendMessage(new ItemUpdateComposer(Item, Room.OwnerId));
}
示例12: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
int itemId = Packet.PopInt();
string locationData = Packet.PopString();
if (!Session.GetHabbo().InRoom)
return;
Room Room;
if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
return;
if (!Room.CheckRights(Session))
return;
Item Item = Session.GetHabbo().GetInventoryComponent().GetItem(itemId);
if (Item == null)
return;
try
{
string WallPossition = WallPositionCheck(":" + locationData.Split(':')[1]);
Item RoomItem = new Item(Item.Id, Room.RoomId, Item.BaseItem, Item.ExtraData, 0, 0, 0, 0, Session.GetHabbo().Id, Item.GroupId, 0, 0, WallPossition, Room);
if (Room.GetRoomItemHandler().SetWallItem(Session, RoomItem))
Session.GetHabbo().GetInventoryComponent().RemoveItem(itemId);
}
catch
{
//TODO: Send a packet
return;
}
}
示例13: 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);
}
示例14: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
int ItemId = Packet.PopInt();//Item Id
string VideoId = Packet.PopString(); //Video ID
Session.SendMessage(new GetYouTubeVideoComposer(ItemId, VideoId));
}
示例15: 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();
}