本文整理汇总了C#中Uber.Messages.ServerPacket.AppendStringWithBreak方法的典型用法代码示例。如果您正苦于以下问题:C# ServerPacket.AppendStringWithBreak方法的具体用法?C# ServerPacket.AppendStringWithBreak怎么用?C# ServerPacket.AppendStringWithBreak使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uber.Messages.ServerPacket
的用法示例。
在下文中一共展示了ServerPacket.AppendStringWithBreak方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: parse
public void parse(GameClient Session, ClientPacket Packet)
{
ServerPacket packet = new ServerPacket(267);
packet.AppendBoolean(Session.GetHabbo().HasFuse("fuse_use_wardrobe"));
if (Session.GetHabbo().HasFuse("fuse_use_wardrobe"))
{
DataTable WardrobeData = null;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("userid", Session.GetHabbo().Id);
WardrobeData = dbClient.ReadDataTable("SELECT * FROM user_wardrobe WHERE user_id = @userid");
}
if (WardrobeData == null)
{
packet.AppendInt32(0);
}
else
{
packet.AppendInt32(WardrobeData.Rows.Count);
foreach (DataRow Row in WardrobeData.Rows)
{
packet.AppendUInt((uint)Row["slot_id"]);
packet.AppendStringWithBreak((string)Row["look"]);
packet.AppendStringWithBreak((string)Row["gender"]);
}
}
}
Session.SendPacket(packet);
}
示例2: parse
public void parse(GameClient Session, ClientPacket Packet)
{
if (Session.GetHabbo().MutantPenalty)
{
Session.SendNotif("Because of a penalty or restriction on your account, you are not allowed to change your look.");
return;
}
string Gender = Packet.PopFixedString().ToUpper();
string Look = UberEnvironment.FilterInjectionChars(Packet.PopFixedString());
if (!AntiMutant.ValidateLook(Look, Gender))
{
return;
}
Session.GetHabbo().Look = Look;
Session.GetHabbo().Gender = Gender.ToLower();
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("look", Look);
dbClient.AddParamWithValue("gender", Gender);
dbClient.ExecuteQuery("UPDATE users SET look = @look, gender = @gender WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
}
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 1, 1);
ServerPacket packet = new ServerPacket(266);
packet.AppendInt32(-1);
packet.AppendStringWithBreak(Session.GetHabbo().Look);
packet.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
packet.AppendStringWithBreak(Session.GetHabbo().Motto);
Session.SendPacket(packet);
if (Session.GetHabbo().InRoom)
{
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
{
return;
}
RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
{
return;
}
ServerPacket RoomUpdate = new ServerPacket(266);
RoomUpdate.AppendInt32(User.VirtualId);
RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
Room.SendMessage(RoomUpdate);
}
}
示例3: parse
public void parse(GameClient Session, ClientPacket Packet)
{
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null || !Room.CheckRights(Session, true))
{
return;
}
UserItem Item = Session.GetHabbo().GetInventoryComponent().GetItem(Packet.PopWiredUInt());
if (Item == null)
{
return;
}
string type = "floor";
if (Item.GetBaseItem().Name.ToLower().Contains("wallpaper"))
{
type = "wallpaper";
}
else if (Item.GetBaseItem().Name.ToLower().Contains("landscape"))
{
type = "landscape";
}
switch (type)
{
case "floor":
Room.Floor = Item.ExtraData;
break;
case "wallpaper":
Room.Wallpaper = Item.ExtraData;
break;
case "landscape":
Room.Landscape = Item.ExtraData;
break;
}
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("UPDATE rooms SET " + type + " = '" + Item.ExtraData + "' WHERE id = '" + Room.RoomId + "' LIMIT 1");
}
Session.GetHabbo().GetInventoryComponent().RemoveItem(Item.Id);
ServerPacket Message = new ServerPacket(46);
Message.AppendStringWithBreak(type);
Message.AppendStringWithBreak(Item.ExtraData);
Room.SendMessage(Message);
}
示例4: parse
public void parse(GameClient Session, ClientPacket Packet)
{
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null || !Room.CheckRights(Session, true))
{
return;
}
RoomItem Present = Room.GetItem(Packet.PopWiredUInt());
if (Present == null)
{
return;
}
DataRow Data = null;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
Data = dbClient.ReadDataRow("SELECT base_id,amount,extra_data FROM user_presents WHERE item_id = '" + Present.Id + "' LIMIT 1");
}
if (Data == null)
{
return;
}
Item BaseItem = UberEnvironment.GetGame().GetItemManager().GetItem((uint)Data["base_id"]);
if (BaseItem == null)
{
return;
}
Room.RemoveFurniture(Session, Present.Id);
ServerPacket packet = new ServerPacket(219);
packet.AppendUInt(Present.Id);
Session.SendPacket(packet);
packet = new ServerPacket(129);
packet.AppendStringWithBreak(BaseItem.Type);
packet.AppendInt32(BaseItem.SpriteId);
packet.AppendStringWithBreak(BaseItem.Name);
Session.SendPacket(packet);
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("DELETE FROM user_presents WHERE item_id = '" + Present.Id + "' LIMIT 1");
}
UberEnvironment.GetGame().GetCatalog().DeliverItems(Session, BaseItem, (int)Data["amount"], (string)Data["extra_data"]);
}
示例5: parse
public void parse(GameClient Session, ClientPacket Packet)
{
uint ItemId = Packet.PopWiredUInt();
DataRow Row = null;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
Row = dbClient.ReadDataRow("SELECT * FROM catalog_marketplace_offers WHERE offer_id = '" + ItemId + "' LIMIT 1");
}
if (Row == null || (string)Row["state"] != "1" || (double)Row["timestamp"] <= UberEnvironment.GetGame().GetCatalog().GetMarketplace().FormatTimestamp())
{
Session.SendNotif("Sorry, this offer has expired.");
return;
}
Item Item = UberEnvironment.GetGame().GetItemManager().GetItem((uint)Row["item_id"]);
if (Item == null)
{
return;
}
if ((int)Row["total_price"] >= 1)
{
Session.GetHabbo().Credits -= (int)Row["total_price"];
Session.GetHabbo().UpdateCreditsBalance(true);
}
UberEnvironment.GetGame().GetCatalog().DeliverItems(Session, Item, 1, (string)Row["extra_data"]);
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("UPDATE catalog_marketplace_offers SET state = '2' WHERE offer_id = '" + ItemId + "' LIMIT 1");
}
ServerPacket packet = new ServerPacket(67);
packet.AppendUInt(Item.ItemId);
packet.AppendStringWithBreak(Item.Name);
packet.AppendInt32(0);
packet.AppendInt32(0);
packet.AppendInt32(1);
packet.AppendStringWithBreak(Item.Type.ToLower());
packet.AppendInt32(Item.SpriteId);
packet.AppendStringWithBreak("");
packet.AppendInt32(1);
packet.AppendInt32(-1);
packet.AppendStringWithBreak("");
Session.SendPacket(packet);
Session.SendPacket(UberEnvironment.GetGame().GetCatalog().GetMarketplace().SerializeOffers(-1, -1, "", 1));
}
示例6: parse
public void parse(GameClient Session, ClientPacket Packet)
{
Session.GetHabbo().GetBadgeComponent().ResetSlots();
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("UPDATE user_badges SET badge_slot = '0' WHERE user_id = '" + Session.GetHabbo().Id + "'");
}
while (Packet.RemainingLength > 0)
{
int Slot = Packet.PopWiredInt32();
string Badge = Packet.PopFixedString();
if (Badge.Length == 0)
{
continue;
}
if (!Session.GetHabbo().GetBadgeComponent().HasBadge(Badge) || Slot < 1 || Slot > 5)
{
// zomg haxx0r
return;
}
Session.GetHabbo().GetBadgeComponent().GetBadge(Badge).Slot = Slot;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("slotid", Slot);
dbClient.AddParamWithValue("badge", Badge);
dbClient.AddParamWithValue("userid", Session.GetHabbo().Id);
dbClient.ExecuteQuery("UPDATE user_badges SET badge_slot = @slotid WHERE badge_id = @badge AND user_id = @userid LIMIT 1");
}
}
ServerPacket Message = new ServerPacket(228);
Message.AppendUInt(Session.GetHabbo().Id);
Message.AppendInt32(Session.GetHabbo().GetBadgeComponent().EquippedCount);
foreach (Badge Badge in Session.GetHabbo().GetBadgeComponent().BadgeList)
{
if (Badge.Slot <= 0)
{
continue;
}
Message.AppendInt32(Badge.Slot);
Message.AppendStringWithBreak(Badge.Code);
}
if (Session.GetHabbo().InRoom && UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId) != null)
{
UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).SendMessage(Message);
}
else
{
Session.SendPacket(Message);
}
}
示例7: parse
public void parse(GameClient Session, ClientPacket Packet)
{
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null)
{
return;
}
RoomUser User = Room.GetRoomUserByHabbo(Packet.PopWiredUInt());
if (User == null || User.IsBot)
{
return;
}
ServerPacket packet = new ServerPacket(228);
packet.AppendUInt(User.GetClient().GetHabbo().Id);
packet.AppendInt32(User.GetClient().GetHabbo().GetBadgeComponent().EquippedCount);
foreach (Badge Badge in User.GetClient().GetHabbo().GetBadgeComponent().BadgeList)
{
if (Badge.Slot <= 0)
{
continue;
}
packet.AppendInt32(Badge.Slot);
packet.AppendStringWithBreak(Badge.Code);
}
Session.SendPacket(packet);
}
示例8: parse
public void parse(GameClient Session, ClientPacket Packet)
{
int count = Packet.PopWiredInt32();
List<uint> UserIds = new List<uint>();
for (int i = 0; i < count; i++)
{
UserIds.Add(Packet.PopWiredUInt());
}
string message = UberEnvironment.FilterInjectionChars(Packet.PopFixedString(), true);
ServerPacket Message = new ServerPacket(135);
Message.AppendUInt(Session.GetHabbo().Id);
Message.AppendStringWithBreak(message);
foreach (uint Id in UserIds)
{
if (!Session.GetHabbo().GetMessenger().FriendshipExists(Session.GetHabbo().Id, Id))
{
continue;
}
GameClient Client = UberEnvironment.GetGame().GetClientManager().GetClientByHabbo(Id);
if (Client == null)
{
return;
}
Client.SendPacket(Message);
}
}
示例9: parse
public void parse(GameClient Session, ClientPacket Packet)
{
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null)
{
return;
}
RoomUser User = Room.GetRoomUserByHabbo(Packet.PopWiredUInt());
if (User == null || User.IsBot)
{
return;
}
ServerPacket packet = new ServerPacket(350);
packet.AppendUInt(User.GetClient().GetHabbo().Id);
packet.AppendInt32(User.GetClient().GetHabbo().Tags.Count);
foreach (string Tag in User.GetClient().GetHabbo().Tags)
{
packet.AppendStringWithBreak(Tag);
}
Session.SendPacket(packet);
}
示例10: Serialize
public void Serialize(ServerPacket Request)
{
// [email protected]22033860
Request.AppendUInt(FromUser);
Request.AppendStringWithBreak(SenderUsername);
Request.AppendStringWithBreak(FromUser.ToString());
}
示例11: parse
public void parse(GameClient Session, ClientPacket Packet)
{
string Motto = UberEnvironment.FilterInjectionChars(Packet.PopFixedString());
if (Motto == Session.GetHabbo().Motto) // Prevents spam?
{
return;
}
Session.GetHabbo().Motto = Motto;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("motto", Motto);
dbClient.ExecuteQuery("UPDATE users SET motto = @motto WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
}
ServerPacket packet = new ServerPacket(484);
packet.AppendInt32(-1);
packet.AppendStringWithBreak(Session.GetHabbo().Motto);
Session.SendPacket(packet);
if (Session.GetHabbo().InRoom)
{
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
{
return;
}
RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
{
return;
}
ServerPacket RoomUpdate = new ServerPacket(266);
RoomUpdate.AppendInt32(User.VirtualId);
RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look); // Need this to reload User or they will be invisible
RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower()); // Need this to reload User or they will be invisible
RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Motto); // Update The User Motto
Room.SendMessage(RoomUpdate);
}
}
示例12: parse
public void parse(GameClient Session, ClientPacket Packet)
{
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null || !Room.CheckRights(Session, true))
{
return;
}
ServerPacket packet = new ServerPacket(465);
packet.AppendUInt(Room.RoomId);
packet.AppendStringWithBreak(Room.Name);
packet.AppendStringWithBreak(Room.Description);
packet.AppendInt32(Room.State);
packet.AppendInt32(Room.Category);
packet.AppendInt32(Room.UsersMax);
packet.AppendInt32(25);
packet.AppendInt32(Room.TagCount);
foreach (string Tag in Room.Tags)
{
packet.AppendStringWithBreak(Tag);
}
packet.AppendInt32(Room.UsersWithRights.Count); // users /w rights count
foreach (uint UserId in Room.UsersWithRights)
{
packet.AppendUInt(UserId);
packet.AppendStringWithBreak(UberEnvironment.GetGame().GetClientManager().GetNameById(UserId));
}
packet.AppendInt32(Room.UsersWithRights.Count); // users /w rights count
packet.AppendBoolean(Room.AllowPets); // allows pets in room - pet system lacking, so always off
packet.AppendBoolean(Room.AllowPetsEating); // allows pets to eat your food - pet system lacking, so always off
packet.AppendBoolean(Room.AllowWalkthrough);
packet.AppendBoolean(Room.Hidewall);
Session.SendPacket(packet);
}
示例13: parse
public void parse(GameClient Session, ClientPacket Packet)
{
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null)
{
return;
}
RoomItem Item = Room.GetItem(Packet.PopWiredUInt());
if (Item == null || Item.GetBaseItem().InteractionType.ToLower() != "postit")
{
return;
}
ServerPacket packet = new ServerPacket(48);
packet.AppendStringWithBreak(Item.Id.ToString());
packet.AppendStringWithBreak(Item.ExtraData);
Session.SendPacket(packet);
}
示例14: parse
public void parse(GameClient Session, ClientPacket Packet)
{
RoomAdvertisement Ad = UberEnvironment.GetGame().GetAdvertisementManager().GetRandomRoomAdvertisement();
ServerPacket packet = new ServerPacket(258);
if (Ad == null)
{
packet.AppendStringWithBreak("");
packet.AppendStringWithBreak("");
}
else
{
packet.AppendStringWithBreak(Ad.AdImage);
packet.AppendStringWithBreak(Ad.AdLink);
Ad.OnView();
}
Session.SendPacket(packet);
}
示例15: Serialize
public void Serialize(ServerPacket Message, Boolean Inventory)
{
Message.AppendUInt(Id);
Message.AppendInt32(0);
Message.AppendStringWithBreak(GetBaseItem().Type.ToUpper());
Message.AppendUInt(Id);
Message.AppendInt32(GetBaseItem().SpriteId);
if (GetBaseItem().Name.Contains("a2"))
{
Message.AppendInt32(3);
}
else if (GetBaseItem().Name.Contains("wallpaper"))
{
Message.AppendInt32(2);
}
else if (GetBaseItem().Name.Contains("landscape"))
{
Message.AppendInt32(4);
}
else
{
Message.AppendInt32(0);
}
Message.AppendStringWithBreak(ExtraData);
Message.AppendBoolean(GetBaseItem().AllowRecycle);
Message.AppendBoolean(GetBaseItem().AllowTrade);
Message.AppendBoolean(GetBaseItem().AllowInventoryStack);
Message.AppendBoolean(UberEnvironment.GetGame().GetCatalog().GetMarketplace().CanSellItem(this));
Message.AppendInt32(-1);
if (GetBaseItem().Type.ToLower() == "s")
{
Message.AppendStringWithBreak("");
Message.AppendInt32(-1);
}
}