本文整理汇总了C#中Uber.Messages.ServerPacket.AppendBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# ServerPacket.AppendBoolean方法的具体用法?C# ServerPacket.AppendBoolean怎么用?C# ServerPacket.AppendBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uber.Messages.ServerPacket
的用法示例。
在下文中一共展示了ServerPacket.AppendBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Trade
public Trade(uint UserOneId, uint UserTwoId, uint RoomId)
{
this.oneId = UserOneId;
this.twoId = UserTwoId;
this.Users = new List<TradeUser>(2);
this.Users.Add(new TradeUser(UserOneId, RoomId));
this.Users.Add(new TradeUser(UserTwoId, RoomId));
this.TradeStage = 1;
this.RoomId = RoomId;
foreach (TradeUser User in Users)
{
if (!User.GetRoomUser().Statusses.ContainsKey("trd"))
{
User.GetRoomUser().AddStatus("trd", "");
User.GetRoomUser().UpdateNeeded = true;
}
}
ServerPacket Message = new ServerPacket(104);
Message.AppendUInt(UserOneId);
Message.AppendBoolean(true);
Message.AppendUInt(UserTwoId);
Message.AppendBoolean(true);
SendMessageToUsers(Message);
}
示例2: parse
public void parse(GameClient Session, ClientPacket Packet)
{
CatalogPage Page = UberEnvironment.GetGame().GetCatalog().GetPage(Packet.PopWiredInt32());
if (Page == null || !Page.Enabled || !Page.Visible || Page.ComingSoon || Page.MinRank > Session.GetHabbo().Rank)
{
return;
}
if (Page.ClubOnly && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
{
Session.SendNotif("This page is for Club members only!");
return;
}
Session.SendPacket(UberEnvironment.GetGame().GetCatalog().SerializePage(Page));
if (Page.Layout == "recycler")
{
ServerPacket message = new ServerPacket(507);
message.AppendBoolean(true);
message.AppendBoolean(false);
Session.SendPacket(message);
}
}
示例3: parse
public void parse(GameClient Session, ClientPacket Packet)
{
ServerPacket packet = new ServerPacket(611);
packet.AppendBoolean(true);
packet.AppendInt32(99999);
Session.SendPacket(packet);
}
示例4: parse
public void parse(GameClient Session, ClientPacket Packet)
{
uint _id = Packet.PopWiredUInt();
DataRow Row = null;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
Row = dbClient.ReadDataRow("SELECT * FROM catalog_marketplace_offers WHERE offer_id = '" + _id + "' LIMIT 1");
}
if (Row == null || (uint)Row["user_id"] != Session.GetHabbo().Id || (string)Row["state"] != "1")
{
return;
}
Item Item = UberEnvironment.GetGame().GetItemManager().GetItem((uint)Row["item_id"]);
if (Item == null)
{
return;
}
UberEnvironment.GetGame().GetCatalog().DeliverItems(Session, Item, 1, (string)Row["extra_data"]);
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("DELETE FROM catalog_marketplace_offers WHERE offer_id = '" + _id + "' LIMIT 1");
}
ServerPacket packet = new ServerPacket(614);
packet.AppendUInt((uint)Row["offer_id"]);
packet.AppendBoolean(true);
Session.SendPacket(packet);
}
示例5: parse
public void parse(GameClient Session, ClientPacket Packet)
{
uint Id = Packet.PopWiredUInt();
RoomData Data = UberEnvironment.GetGame().GetRoomManager().GenerateRoomData(Id);
if (Data == null || Session.GetHabbo().FavoriteRooms.Count >= 30 || Session.GetHabbo().FavoriteRooms.Contains(Id) || Data.Type == "public")
{
ServerPacket packet = new ServerPacket(33);
packet.AppendInt32(-9001);
Session.SendPacket(packet);
return;
}
ServerPacket _packet = new ServerPacket(459);
_packet.AppendUInt(Id);
_packet.AppendBoolean(true);
Session.SendPacket(_packet);
Session.GetHabbo().FavoriteRooms.Add(Id);
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("INSERT INTO user_favorites (user_id,room_id) VALUES ('" + Session.GetHabbo().Id + "','" + Id + "')");
}
}
示例6: 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);
}
示例7: SellItem
public void SellItem(GameClient Session, uint ItemId, int SellingPrice)
{
UserItem Item = Session.GetHabbo().GetInventoryComponent().GetItem(ItemId);
if (Item == null || SellingPrice > 10000 || !CanSellItem(Item))
{
ServerPacket packet = new ServerPacket(610);
packet.AppendBoolean(false);
Session.SendPacket(packet);
return;
}
int Comission = CalculateComissionPrice(SellingPrice);
int TotalPrice = SellingPrice + Comission;
int ItemType = 1;
if (Item.GetBaseItem().Type == "i")
{
ItemType++;
}
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("public_name", Item.GetBaseItem().PublicName);
dbClient.AddParamWithValue("extra_data", Item.ExtraData);
dbClient.ExecuteQuery("INSERT INTO catalog_marketplace_offers (item_id,user_id,asking_price,total_price,public_name,sprite_id,item_type,timestamp,extra_data) VALUES ('" + Item.BaseItem + "','" + Session.GetHabbo().Id + "','" + SellingPrice + "','" + TotalPrice + "',@public_name,'" + Item.GetBaseItem().SpriteId + "','" + ItemType + "','" + UberEnvironment.GetUnixTimestamp() + "',@extra_data)");
}
Session.GetHabbo().GetInventoryComponent().RemoveItem(ItemId);
ServerPacket p610 = new ServerPacket(610);
p610.AppendBoolean(true);
Session.SendPacket(p610);
}
示例8: parse
public void parse(GameClient Session, ClientPacket Packet)
{
ServerPacket packet = new ServerPacket(512);
packet.AppendBoolean(false); // true = show error with number below
packet.AppendInt32(99999);
Session.SendPacket(packet);
// todo: room limit
}
示例9: parse
public void parse(GameClient Session, ClientPacket Packet)
{
uint RoomId = Packet.PopWiredUInt();
bool LoadingState = Packet.PopWiredBoolean();
bool Following = Packet.PopWiredBoolean();
RoomData Data = UberEnvironment.GetGame().GetRoomManager().GenerateRoomData(RoomId);
if (Data == null)
{
return;
}
ServerPacket packet = new ServerPacket(454);
packet.AppendBoolean(LoadingState);
Data.Serialize(packet, false);
packet.AppendBoolean(Following);
packet.AppendBoolean(LoadingState);
Session.SendPacket(packet);
}
示例10: 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);
}
示例11: 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);
}
}
示例12: parse
public void parse(GameClient Session, ClientPacket Packet)
{
uint Id = Packet.PopWiredUInt();
Session.GetHabbo().FavoriteRooms.Remove(Id);
ServerPacket packet = new ServerPacket(459);
packet.AppendUInt(Id);
packet.AppendBoolean(false);
Session.SendPacket(packet);
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("DELETE FROM user_favorites WHERE user_id = '" + Session.GetHabbo().Id + "' AND room_id = '" + Id + "' LIMIT 1");
}
}
示例13: parse
public void parse(GameClient Session, ClientPacket Packet)
{
uint Id = Packet.PopWiredUInt();
CatalogItem Item = UberEnvironment.GetGame().GetCatalog().FindItem(Id);
if (Item == null)
{
return;
}
ServerPacket packet = new ServerPacket(622);
packet.AppendUInt(Item.Id);
packet.AppendBoolean(Item.GetBaseItem().AllowGift);
Session.SendPacket(packet);
}
示例14: parse
public void parse(GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().InRoom)
{
return;
}
int itemCount = Packet.PopWiredInt32();
if (itemCount != 5)
{
return;
}
for (int i = 0; i < itemCount; i++)
{
UserItem Item = Session.GetHabbo().GetInventoryComponent().GetItem(Packet.PopWiredUInt());
if (Item != null && Item.GetBaseItem().AllowRecycle)
{
Session.GetHabbo().GetInventoryComponent().RemoveItem(Item.Id);
}
else
{
return;
}
}
uint newItemId = UberEnvironment.GetGame().GetCatalog().GenerateItemId();
EcotronReward Reward = UberEnvironment.GetGame().GetCatalog().GetRandomEcotronReward();
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("INSERT INTO user_items (id,user_id,base_item,extra_data) VALUES ('" + newItemId + "','" + Session.GetHabbo().Id + "','1478','" + DateTime.Now.ToLongDateString() + "')");
dbClient.ExecuteQuery("INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES ('" + newItemId + "','" + Reward.BaseId + "','1','')");
}
Session.GetHabbo().GetInventoryComponent().UpdateItems(true);
ServerPacket packet = new ServerPacket(508);
packet.AppendBoolean(true);
packet.AppendUInt(newItemId);
Session.SendPacket(packet);
}
示例15: parse
public void parse(GameClient Session, ClientPacket Packet)
{
string SubscriptionId = Packet.PopFixedString();
ServerPacket packet = new ServerPacket(7);
packet.AppendStringWithBreak(SubscriptionId.ToLower());
if (Session.GetHabbo().GetSubscriptionManager().HasSubscription(SubscriptionId))
{
Double Expire = Session.GetHabbo().GetSubscriptionManager().GetSubscription(SubscriptionId).ExpireTime;
Double TimeLeft = Expire - UberEnvironment.GetUnixTimestamp();
int TotalDaysLeft = (int)Math.Ceiling(TimeLeft / 86400);
int MonthsLeft = TotalDaysLeft / 31;
if (MonthsLeft >= 1) MonthsLeft--;
packet.AppendInt32(TotalDaysLeft - (MonthsLeft * 31));
packet.AppendBoolean(true);
packet.AppendInt32(MonthsLeft);
packet.AppendInt32(1);
packet.AppendInt32(1);
if (Session.GetHabbo().HasFuse("fuse_use_vip_outfits"))
{
packet.AppendInt32(2);
}
else
{
packet.AppendInt32(1);
}
}
else
{
for (int i = 0; i < 3; i++)
{
packet.AppendInt32(0);
}
}
Session.SendPacket(packet);
}