本文整理汇总了C#中Uber.Messages.ServerPacket.AppendInt32方法的典型用法代码示例。如果您正苦于以下问题:C# ServerPacket.AppendInt32方法的具体用法?C# ServerPacket.AppendInt32怎么用?C# ServerPacket.AppendInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uber.Messages.ServerPacket
的用法示例。
在下文中一共展示了ServerPacket.AppendInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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);
}
}
示例3: 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);
}
示例4: Serialize
public void Serialize(ServerPacket Message)
{
Message.AppendInt32(BackgroundImage);
Message.AppendInt32(ForegroundImage);
Message.AppendInt32(Items.Count);
foreach (KeyValuePair<int, int> Item in Items)
{
Message.AppendInt32(Item.Key);
Message.AppendInt32(Item.Value);
}
}
示例5: AddEffect
public void AddEffect(int EffectId, int Duration)
{
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("INSERT INTO user_effects (user_id,effect_id,total_duration,is_activated,activated_stamp) VALUES ('" + UserId + "','" + EffectId + "','" + Duration + "','0','0')");
}
Effects.Add(new AvatarEffect(EffectId, Duration, false, 0));
ServerPacket packet = new ServerPacket(461);
packet.AppendInt32(EffectId);
packet.AppendInt32(Duration);
GetClient().SendPacket(packet);
}
示例6: parse
public void parse(GameClient Session, ClientPacket Packet)
{
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null || Session.GetHabbo().DailyRespectPoints <= 0)
{
return;
}
RoomUser User = Room.GetRoomUserByHabbo(Packet.PopWiredUInt());
if (User == null || User.GetClient().GetHabbo().Id == Session.GetHabbo().Id || User.IsBot)
{
return;
}
Session.GetHabbo().DailyRespectPoints--;
User.GetClient().GetHabbo().Respect++;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("UPDATE users SET respect = respect + 1 WHERE id = '" + User.GetClient().GetHabbo().Id + "' LIMIT 1");
dbClient.ExecuteQuery("UPDATE users SET daily_respect_points = daily_respect_points - 1 WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
}
// FxkqUzYP_
ServerPacket Message = new ServerPacket(440);
Message.AppendUInt(User.GetClient().GetHabbo().Id);
Message.AppendInt32(User.GetClient().GetHabbo().Respect);
Room.SendMessage(Message);
}
示例7: parse
public void parse(GameClient Session, ClientPacket Packet)
{
ServerPacket packet = new ServerPacket(611);
packet.AppendBoolean(true);
packet.AppendInt32(99999);
Session.SendPacket(packet);
}
示例8: 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 + "')");
}
}
示例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: 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);
}
}
示例11: 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
}
示例12: Serialize
public ServerPacket Serialize(GameClient Session)
{
ServerPacket Message = new ServerPacket(370);
Message.AppendStringWithBreak(Session.GetHabbo().Id + "");
Message.AppendStringWithBreak(Session.GetHabbo().Username);
Message.AppendStringWithBreak(RoomId + "");
Message.AppendInt32(Category);
Message.AppendStringWithBreak(Name);
Message.AppendStringWithBreak(Description);
Message.AppendStringWithBreak(StartTime);
Message.AppendInt32(Tags.Count);
foreach (string Tag in Tags)
{
Message.AppendStringWithBreak(Tag);
}
return Message;
}
示例13: 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"]);
}
示例14: parse
public void parse(GameClient Session, ClientPacket Packet)
{
if (Session.GetHabbo().LoadingRoom <= 0)
{
return;
}
ServerPacket packet = new ServerPacket(297);
packet.AppendInt32(0);
Session.SendPacket(packet);
}
示例15: 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(Session.GetHabbo().Id);
if (User == null)
{
return;
}
User.Unidle();
int _danceId = Packet.PopWiredInt32();
if (_danceId < 0 || _danceId > 4 || (!Session.GetHabbo().HasFuse("fuse_use_club_dance") && _danceId > 1))
{
_danceId = 0;
}
if (_danceId > 0 && User.CarryItemID > 0)
{
User.CarryItem(0);
}
User.DanceId = _danceId;
ServerPacket DanceMessageEventMessage = new ServerPacket(480);
DanceMessageEventMessage.AppendInt32(User.VirtualId);
DanceMessageEventMessage.AppendInt32(_danceId);
Room.SendMessage(DanceMessageEventMessage);
}