本文整理汇总了C#中Uber.HabboHotel.GameClients.GameClient.SendNotif方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.SendNotif方法的具体用法?C# GameClient.SendNotif怎么用?C# GameClient.SendNotif使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uber.HabboHotel.GameClients.GameClient
的用法示例。
在下文中一共展示了GameClient.SendNotif方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AlertUser
public void AlertUser(GameClient ModSession, uint UserId, string Message, Boolean Caution)
{
GameClient Client = UberEnvironment.GetGame().GetClientManager().GetClientByHabbo(UserId);
if (Client == null || Client.GetHabbo().Id == ModSession.GetHabbo().Id)
{
return;
}
if (Caution && Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
{
ModSession.SendNotif("You do not have permission to caution that user, sending as a regular message instead.");
Caution = false;
}
Client.SendNotif(Message, Caution);
if (Caution)
{
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("UPDATE user_info SET cautions = cautions + 1 WHERE user_id = '" + UserId + "' LIMIT 1");
}
}
}
示例2: parse
public void parse(GameClient Session, ClientPacket Packet)
{
if (Session.GetHabbo().LoadingRoom <= 0)
{
return;
}
RoomData Data = UberEnvironment.GetGame().GetRoomManager().GenerateRoomData(Session.GetHabbo().LoadingRoom);
if (Data == null)
{
return;
}
if (Data.Model == null)
{
Session.SendNotif("Sorry, model data is missing from this room and therefore cannot be loaded.");
Session.SendPacket(new ServerPacket(18));
Session.ClearRoomLoading();
return;
}
Session.SendPacket(Data.Model.SerializeHeightmap());
Session.SendPacket(Data.Model.SerializeRelativeHeightmap());
}
示例3: 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);
}
}
示例4: 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);
}
}
示例5: parse
public void parse(GameClient Session, ClientPacket Packet)
{
if (Session.GetHabbo() == null)
{
Session.Login(Packet.PopFixedString());
}
else
{
Session.SendNotif("You are already logged in!");
}
}
示例6: CreateRoom
public RoomData CreateRoom(GameClient Session, string Name, string Model)
{
Name = UberEnvironment.FilterInjectionChars(Name);
if (!Models.ContainsKey(Model))
{
Session.SendNotif("Sorry, this room model has not been added yet. Try again later.");
return null;
}
if (Models[Model].ClubOnly && !Session.GetHabbo().HasFuse("fuse_use_special_room_layouts"))
{
Session.SendNotif("You must be an Club member to use that room layout.");
return null;
}
if (Name.Length < 3)
{
Session.SendNotif("Room name is too short for room creation!");
return null;
}
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("caption", Name);
dbClient.AddParamWithValue("model", Model);
dbClient.AddParamWithValue("username", Session.GetHabbo().Username);
dbClient.ExecuteQuery("INSERT INTO rooms (roomtype,caption,owner,model_name) VALUES ('private',@caption,@username,@model)");
}
uint RoomId = 0;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("caption", Name);
dbClient.AddParamWithValue("username", Session.GetHabbo().Username);
RoomId = (uint)dbClient.ReadDataRow("SELECT id FROM rooms WHERE owner = @username AND caption = @caption ORDER BY id DESC")[0];
}
return GenerateRoomData(RoomId);
}
示例7: 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));
}
示例8: parse
public void parse(GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().HasFuse("fuse_mod"))
{
return;
}
uint UserId = Packet.PopWiredUInt();
if (UberEnvironment.GetGame().GetClientManager().GetNameById(UserId) != "Unknown User")
{
Session.SendPacket(UberEnvironment.GetGame().GetModerationTool().SerializeUserInfo(UserId));
}
else
{
Session.SendNotif("Could not load user info; invalid user.");
}
}
示例9: BanUser
public void BanUser(GameClient ModSession, uint UserId, int Length, string Message)
{
GameClient Client = UberEnvironment.GetGame().GetClientManager().GetClientByHabbo(UserId);
if (Client == null || Client.GetHabbo().Id == ModSession.GetHabbo().Id)
{
return;
}
if (Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
{
ModSession.SendNotif("You do not have permission to ban that user.");
return;
}
Double dLength = Length;
UberEnvironment.GetGame().GetBanManager().BanUser(Client, ModSession.GetHabbo().Username, dLength, Message, false);
}
示例10: parse
public void parse(GameClient Session, ClientPacket Packet)
{
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null || (!Room.AllowPets && !Room.CheckRights(Session, true)))
{
return;
}
uint PetId = Packet.PopWiredUInt();
Pet Pet = Session.GetHabbo().GetInventoryComponent().GetPet(PetId);
if (Pet == null || Pet.PlacedInRoom)
{
return;
}
int X = Packet.PopWiredInt32();
int Y = Packet.PopWiredInt32();
if (!Room.CanWalk(X, Y, 0, true))
{
return;
}
if (Room.PetCount >= UberEnvironment.GetGame().GetRoomManager().MAX_PETS_PER_ROOM)
{
Session.SendNotif("There are too many pets in this room. A room may only contain up to " + UberEnvironment.GetGame().GetRoomManager().MAX_PETS_PER_ROOM + " pets.");
return;
}
Pet.PlacedInRoom = true;
Pet.RoomId = Room.RoomId;
RoomUser PetUser = Room.DeployBot(new HabboHotel.RoomBots.RoomBot(Pet.PetId, Pet.RoomId, "pet", "freeroam", Pet.Name, "", Pet.Look, X, Y, 0, 0, 0, 0, 0, 0), Pet);
if (Room.CheckRights(Session, true))
{
Session.GetHabbo().GetInventoryComponent().MovePetToRoom(Pet.PetId, Room.RoomId);
}
}
示例11: parse
public void parse(GameClient Session, ClientPacket Packet)
{
uint UserId = Packet.PopWiredUInt();
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
RoomUser RoomUser = Room.GetRoomUserByHabbo(UserId);
if (Room == null || !Room.CheckRights(Session, true) || RoomUser == null || RoomUser.IsBot)
{
return;
}
if (Room.UsersWithRights.Contains(UserId))
{
// todo: fix silly bug
Session.SendNotif("User already has rights! (There appears to be a bug with the rights button, we are looking into it - for now rely on 'Advanced settings')");
return;
}
Room.UsersWithRights.Add(UserId);
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("INSERT INTO room_rights (room_id,user_id) VALUES ('" + Room.RoomId + "','" + UserId + "')");
}
ServerPacket packet = new ServerPacket(510);
packet.AppendUInt(Room.RoomId);
packet.AppendUInt(UserId);
packet.AppendStringWithBreak(RoomUser.GetClient().GetHabbo().Username);
Session.SendPacket(packet);
RoomUser.AddStatus("flatcrtl", "");
RoomUser.UpdateNeeded = true;
RoomUser.GetClient().SendPacket(new ServerPacket(42));
}
示例12: KickUser
public void KickUser(GameClient ModSession, uint UserId, string Message, Boolean Soft)
{
GameClient Client = UberEnvironment.GetGame().GetClientManager().GetClientByHabbo(UserId);
if (Client == null || Client.GetHabbo().CurrentRoomId < 1 || Client.GetHabbo().Id == ModSession.GetHabbo().Id)
{
return;
}
if (Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
{
ModSession.SendNotif("You do not have permission to kick that user.");
return;
}
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Client.GetHabbo().CurrentRoomId);
if (Room == null)
{
return;
}
Room.RemoveUserFromRoom(Client, true, false);
if (!Soft)
{
Client.SendNotif(Message);
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("UPDATE user_info SET cautions = cautions + 1 WHERE user_id = '" + UserId + "' LIMIT 1");
}
}
}
示例13: Parse
public static Boolean Parse(GameClient Session, string Input)
{
string[] Params = Input.Split(' ');
string TargetUser = null;
GameClient TargetClient = null;
Room TargetRoom = null;
RoomUser TargetRoomUser = null;
try
{
switch (Params[0].ToLower())
{
#region Debugging/Development
case "update_inventory":
if (Session.GetHabbo().HasFuse("fuse_sysadmin"))
{
Session.GetHabbo().GetInventoryComponent().UpdateItems(true);
return true;
}
return false;
case "update_bots":
if (Session.GetHabbo().HasFuse("fuse_sysadmin"))
{
UberEnvironment.GetGame().GetBotManager().LoadBots();
return true;
}
return false;
case "update_catalog":
if (Session.GetHabbo().HasFuse("fuse_sysadmin"))
{
UberEnvironment.GetGame().GetCatalog().Initialize();
UberEnvironment.GetGame().GetClientManager().BroadcastMessage(new ServerPacket(441));
return true;
}
return false;
case "update_help":
if (Session.GetHabbo().HasFuse("fuse_sysadmin"))
{
UberEnvironment.GetGame().GetHelpTool().LoadCategories();
UberEnvironment.GetGame().GetHelpTool().LoadTopics();
Session.SendNotif("Reloaded help categories and topics successfully.");
return true;
}
return false;
case "update_navigator":
if (Session.GetHabbo().HasFuse("fuse_sysadmin"))
{
UberEnvironment.GetGame().GetNavigator().Initialize();
Session.SendNotif("Re-initialized navigator successfully.");
return true;
}
return false;
/*case "idletime":
if (Session.GetHabbo().HasFuse("fuse_sysadmin"))
{
TargetRoom = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
TargetRoomUser.IdleTime = 600;
return true;
}
return false;*/
case "t":
if (Session.GetHabbo().HasFuse("fuse_sysadmin"))
{
TargetRoom = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (TargetRoom == null)
{
return false;
}
TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
if (TargetRoomUser == null)
{
//.........这里部分代码省略.........
示例14: 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;
}
int Id = Packet.PopWiredInt32();
string Name = UberEnvironment.FilterInjectionChars(Packet.PopFixedString());
string Description = UberEnvironment.FilterInjectionChars(Packet.PopFixedString());
int State = Packet.PopWiredInt32();
string Password = UberEnvironment.FilterInjectionChars(Packet.PopFixedString());
int MaxUsers = Packet.PopWiredInt32();
int CategoryId = Packet.PopWiredInt32();
int TagCount = Packet.PopWiredInt32();
List<string> Tags = new List<string>();
StringBuilder formattedTags = new StringBuilder();
for (int i = 0; i < TagCount; i++)
{
if (i > 0)
{
formattedTags.Append(",");
}
string tag = UberEnvironment.FilterInjectionChars(Packet.PopFixedString().ToLower());
Tags.Add(tag);
formattedTags.Append(tag);
}
int AllowPets = 0;
int AllowPetsEat = 0;
int AllowWalkthrough = 0;
int Hidewall = 0;
string _AllowPets = Packet.PlainReadBytes(1)[0].ToString();
Packet.AdvancePointer(1);
string _AllowPetsEat = Packet.PlainReadBytes(1)[0].ToString();
Packet.AdvancePointer(1);
string _AllowWalkthrough = Packet.PlainReadBytes(1)[0].ToString();
Packet.AdvancePointer(1);
string _Hidewall = Packet.PlainReadBytes(1)[0].ToString();
Packet.AdvancePointer(1);
if (Name.Length < 1)
{
return;
}
if (State < 0 || State > 2)
{
return;
}
if (MaxUsers != 10 && MaxUsers != 15 && MaxUsers != 20 && MaxUsers != 25)
{
return;
}
FlatCat FlatCat = UberEnvironment.GetGame().GetNavigator().GetFlatCat(CategoryId);
if (FlatCat == null)
{
return;
}
if (FlatCat.MinRank > Session.GetHabbo().Rank)
{
Session.SendNotif("You are not allowed to use this category. Your room has been moved to no category instead.");
CategoryId = 0;
}
if (TagCount > 2)
{
return;
}
if (State < 0 || State > 2)
{
return;
}
if (_AllowPets == "65")
{
AllowPets = 1;
Room.AllowPets = true;
}
else
{
Room.AllowPets = false;
}
if (_AllowPetsEat == "65")
//.........这里部分代码省略.........
示例15: parse
public void parse(GameClient Session, ClientPacket Packet)
{
Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null || !Room.CheckRights(Session))
{
return;
}
string PlacementData = Packet.PopFixedString();
string[] DataBits = PlacementData.Split(' ');
uint ItemId = uint.Parse(DataBits[0]);
UserItem Item = Session.GetHabbo().GetInventoryComponent().GetItem(ItemId);
if (Item == null)
{
return;
}
switch (Item.GetBaseItem().InteractionType.ToLower())
{
case "dimmer":
if (Room.ItemCountByType("dimmer") >= 1)
{
Session.SendNotif("You can only have one moodlight in a room.");
return;
}
break;
}
// Wall Item
if (DataBits[1].StartsWith(":"))
{
string WallPos = Room.WallPositionCheck(":" + PlacementData.Split(':')[1]);
if (WallPos == null)
{
ServerPacket packet = new ServerPacket(516);
packet.AppendInt32(11);
Session.SendPacket(packet);
return;
}
RoomItem RoomItem = new RoomItem(Item.Id, Room.RoomId, Item.BaseItem, Item.ExtraData, 0, 0, 0.0, 0, WallPos);
if (Room.SetWallItem(Session, RoomItem))
{
Session.GetHabbo().GetInventoryComponent().RemoveItem(ItemId);
}
}
// Floor Item
else
{
int X = int.Parse(DataBits[1]);
int Y = int.Parse(DataBits[2]);
int Rot = int.Parse(DataBits[3]);
RoomItem RoomItem = new RoomItem(Item.Id, Room.RoomId, Item.BaseItem, Item.ExtraData, 0, 0, 0, 0, "");
if (Room.SetFloorItem(Session, RoomItem, X, Y, Rot, true))
{
Session.GetHabbo().GetInventoryComponent().RemoveItem(ItemId);
}
}
}