本文整理汇总了C#中Uber.Messages.ServerPacket.AppendUInt方法的典型用法代码示例。如果您正苦于以下问题:C# ServerPacket.AppendUInt方法的具体用法?C# ServerPacket.AppendUInt怎么用?C# ServerPacket.AppendUInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uber.Messages.ServerPacket
的用法示例。
在下文中一共展示了ServerPacket.AppendUInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
foreach (uint UserId in Room.UsersWithRights)
{
RoomUser User = Room.GetRoomUserByHabbo(UserId);
if (User != null && !User.IsBot)
{
User.GetClient().SendPacket(new ServerPacket(43));
}
ServerPacket packet = new ServerPacket(511);
packet.AppendUInt(Room.RoomId);
packet.AppendUInt(UserId);
Session.SendPacket(packet);
}
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("DELETE FROM room_rights WHERE room_id = '" + Room.RoomId + "'");
}
Room.UsersWithRights.Clear();
}
示例2: 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);
}
示例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: DeliverInstantMessage
public void DeliverInstantMessage(string Message, uint ConversationId)
{
ServerPacket InstantMessage = new ServerPacket(134);
InstantMessage.AppendUInt(ConversationId);
InstantMessage.AppendString(Message);
GetClient().SendPacket(InstantMessage);
}
示例5: 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);
}
示例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 || 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);
}
示例8: Serialize
public void Serialize(ServerPacket Message)
{
// PMYoNktchn_stovesKHI[bKIM
if (IsDeal)
{
// 8 328 deal01 [] 5 0 2 s [] 26 [] 3 -1
// PBXRAdeal01QAHJsRFKMsQEIM
throw new NotImplementedException("Multipile item ids set for catalog item #" + Id + ", but this is usupported at this point");
}
else
{
Message.AppendUInt(Id);
Message.AppendStringWithBreak(Name);
Message.AppendInt32(CreditsCost);
Message.AppendInt32(PixelsCost);
Message.AppendInt32(0); // R63 fix
Message.AppendInt32(1);
Message.AppendStringWithBreak(GetBaseItem().Type);
Message.AppendInt32(GetBaseItem().SpriteId);
Message.AppendStringWithBreak("");
Message.AppendInt32(Amount);
Message.AppendInt32(-1);
}
}
示例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)
{
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);
}
}
示例11: 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 + "')");
}
}
示例12: 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);
}
示例13: parse
public void parse(GameClient Session, ClientPacket Packet)
{
uint Id = Packet.PopWiredUInt();
RoomData Data = UberEnvironment.GetGame().GetRoomManager().GenerateRoomData(Id);
if (Data == null || Data.Type != "public")
{
return;
}
ServerPacket packet = new ServerPacket(453);
packet.AppendUInt(Data.Id);
packet.AppendStringWithBreak(Data.CCTs);
packet.AppendUInt(Data.Id);
Session.SendPacket(packet);
}
示例14: Serialize
public void Serialize(ServerPacket Request)
{
// [email protected]22033860
Request.AppendUInt(FromUser);
Request.AppendStringWithBreak(SenderUsername);
Request.AppendStringWithBreak(FromUser.ToString());
}
示例15: parse
public void parse(GameClient Session, ClientPacket Packet)
{
ServerPacket packet = new ServerPacket(506);
packet.AppendInt32(5);
for (uint i = 5; i >= 1; i--)
{
packet.AppendUInt(i);
if (i <= 1)
{
packet.AppendInt32(0);
}
else if (i == 2)
{
packet.AppendInt32(4);
}
else if (i == 3)
{
packet.AppendInt32(40);
}
else if (i == 4)
{
packet.AppendInt32(200);
}
else if (i >= 5)
{
packet.AppendInt32(2000);
}
List<EcotronReward> Rewards = UberEnvironment.GetGame().GetCatalog().GetEcotronRewardsForLevel(i);
packet.AppendInt32(Rewards.Count);
foreach (EcotronReward Reward in Rewards)
{
packet.AppendStringWithBreak(Reward.GetBaseItem().Type.ToLower());
packet.AppendUInt(Reward.DisplayId);
}
}
Session.SendPacket(packet);
}