本文整理汇总了C#中BrickEmulator.HabboHotel.Users.Client.Notif方法的典型用法代码示例。如果您正苦于以下问题:C# Client.Notif方法的具体用法?C# Client.Notif怎么用?C# Client.Notif使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrickEmulator.HabboHotel.Users.Client
的用法示例。
在下文中一共展示了Client.Notif方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRoom
private void CreateRoom(Client Client, Request Request)
{
int Limit = BrickEngine.GetConfigureFile().CallIntKey("max.rooms.amount");
int RoomAmount = BrickEngine.GetRoomReactor().GetMe(Client.GetUser().HabboId).Count;
if (RoomAmount >= Limit)
{
Client.Notif("You're over the rooms limit, first delete a room before you create a new one.", false);
return;
}
string RawName = Request.PopFixedString();
string RawModel = Request.PopFixedString();
int RoomId = -1;
if ((RoomId = BrickEngine.GetRoomReactor().CreateRoom(Client, RawName, RawModel)) > 0)
{
Response Response = new Response(59);
Response.AppendInt32(RoomId);
Response.AppendStringWithBreak(BrickEngine.CleanString(RawName));
Client.SendResponse(Response);
}
else
{
CheckRoomCreate(Client, null);
}
}
示例2: AlertRoom
public void AlertRoom(Client Client, int RoomId, string Message, Boolean Warning)
{
if (Client.GetUser().Rank < 7)
{
Client.Notif("You need rank '7' to do this action.", false);
return;
}
if (BrickEngine.GetRoomReactor().RoomIsAlive(RoomId))
{
if (BrickEngine.GetRoomReactor().GetVirtualRoom(RoomId, Rooms.RoomRunningState.Alive).RoomUserAmount > 0)
{
foreach (VirtualRoomUser User in BrickEngine.GetRoomReactor().GetVirtualRoom(RoomId, Rooms.RoomRunningState.Alive).GetRoomEngine().GetUsers())
{
if (User.GetClient().GetUser().Rank > 1)
{
AlertUser(Client, User.HabboId, Message, false, false, true);
}
else
{
AlertUser(Client, User.HabboId, Message, Warning, false, true);
}
}
}
}
}
示例3: HandleCommand
public Boolean HandleCommand(string Command, Client Client, List<string> Params)
{
string Lowered = Command.ToLower();
foreach (KeyValuePair<KeyValuePair<string, string>, KeyValuePair<Handler, int>> kvp in Handlers)
{
if (kvp.Key.Key.ToLower().Equals(Command))
{
if (kvp.Value.Key != null && Client.GetUser().Rank >= kvp.Value.Value)
{
if (Client.GetUser().Rank >= kvp.Value.Value)
{
kvp.Value.Key.Invoke(Client, Params);
return true;
}
else
{
Client.Notif("You have no rights to do that command.", true);
return false;
}
}
}
}
return false;
}
示例4: BeginLoadRoom
public void BeginLoadRoom(Client Client, int RoomId, string Password)
{
if (Client.GetUser().PreparingRoomId == RoomId)
{
return;
}
VirtualRoom Room = BrickEngine.GetRoomReactor().GetVirtualRoom(RoomId, Rooms.RoomRunningState.Alive);
if (Room == null)
{
ClearLoading(Client, true);
return;
}
if (BrickEngine.GetRoomReactor().GetRoomModel(Room.ModelParam) == null)
{
Client.Notif("The RoomModel of this room is missing.", false);
ClearLoading(Client, true);
return;
}
if (!Room.BeginEnterRoom(Client, Password))
{
Client.GetUser().LeaveCurrentRoom();
ClearLoading(Client, false);
}
else
{
Client.GetUser().LeaveCurrentRoom();
Client.GetUser().PreparingRoomId = RoomId;
ContinueLoading(Client, null);
}
}
示例5: AlertUser
public void AlertUser(Client Client, int UserId, string Message, Boolean Warning, Boolean Kick, Boolean RoomAlert)
{
if (Client.GetUser().Rank < 6)
{
Client.Notif("You need rank '6' to do this action.", false);
return;
}
if (Client.GetUser().HabboId.Equals(UserId) && !RoomAlert)
{
Client.Notif("You can't message yourself.", false);
return;
}
if (BrickEngine.GetUserReactor().IsOnline(UserId))
{
if (Kick)
{
if (BrickEngine.GetSocketShield().GetSocketClientByHabboId(UserId).GetClient().GetUser().IsInRoom)
{
BrickEngine.GetSocketShield().GetSocketClientByHabboId(UserId).GetClient().GetUser().GetRoom().GetRoomEngine().HandleLeaveUser(UserId, true);
}
}
if (Message.Length > 0)
{
BrickEngine.GetSocketShield().GetSocketClientByHabboId(UserId).GetClient().Notif(Message, true);
}
}
if (Warning)
{
if (BrickEngine.GetUserReactor().IsOnline(UserId))
{
BrickEngine.GetSocketShield().GetSocketClientByHabboId(UserId).GetClient().GetUser().Warnings++;
}
using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
{
Reactor.SetQuery("UPDATE users SET warnings = warnings + 1 WHERE id = @habboid LIMIT 1");
Reactor.AddParam("habboid", UserId);
Reactor.ExcuteQuery();
}
}
}
示例6: CreateRoom
public int CreateRoom(Client Client, string RawName, string RawModel)
{
string FixedName = BrickEngine.CleanString(RawName);
string FixedModel = BrickEngine.CleanString(RawModel);
if (GetRoomModel(FixedModel) == null)
{
Client.Notif("RoomModel: " + FixedModel + " could not found in cache, try another.", false);
return -1;
}
if (FixedName.Length < 3)
{
Client.Notif("The name you typed in was to short, try again.",false);
return -1;
}
if (FixedName.Length > 25)
{
Client.Notif("The name you typed in was to long, try again.", false);
return -1;
}
int GeneratedId = RoomIdCounter.Next;
using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
{
Reactor.SetQuery("INSERT INTO private_rooms (id, name, owner_id, model_param) VALUES (@roomid, @name, @ownerid, @model)");
Reactor.AddParam("roomid", GeneratedId);
Reactor.AddParam("name", FixedName);
Reactor.AddParam("ownerid", Client.GetUser().HabboId);
Reactor.AddParam("model", FixedModel);
Reactor.ExcuteQuery();
}
return GeneratedId;
}
示例7: HandleTicket
private void HandleTicket(Client Client, Request Request)
{
string Ticket = Request.PopFixedString();
Client.ParseUser(BrickEngine.GetUserReactor().HandleTicket(Ticket));
if (Client.IsValidUser)
{
if (BrickEngine.GetToolReactor().IsBanned(Client.GetUser().HabboId, Client.IPAddress))
{
Client.Dispose();
return;
}
Response Userhash = new Response(439);
Userhash.AppendStringWithBreak(Client.GetUser().Hash);
Client.SendResponse(Userhash);
Client.SendResponse(new Response(3));
if (BrickEngine.GetConfigureFile().CallBooleanKey("welcomemessage.enabled"))
{
Client.LongNotif(string.Empty);
}
Client.SendResponse(Client.GetUser().GetLoginResponse());
Client.Authenticated = true;
Client.SendResponse(BrickEngine.GetToolReactor().GetResponse(Client));
}
else
{
Client.Notif("Invalid Ticket, try again!", false);
Client.Dispose();
}
}
示例8: UnloadRoom
private void UnloadRoom(Client Client, List<string> Params)
{
int RoomId = Client.GetUser().RoomId;
if (Params.Count == 1)
{
int.TryParse(Params[0], out RoomId);
}
BrickEngine.GetRoomReactor().DisposeRoom(RoomId);
Client.Notif(string.Format("Disposed room {0} fawlessly.", RoomId), false);
}
示例9: Teleport
private void Teleport(Client Client, List<string> Params)
{
if (!Client.GetUser().GetRoomUser().TeleportingEnabled)
{
Client.GetUser().GetRoomUser().TeleportingEnabled = true;
}
else
{
Client.GetUser().GetRoomUser().TeleportingEnabled = false;
}
Client.Notif(string.Format("Teleporting is setted {0}", (Client.GetUser().GetRoomUser().TeleportingEnabled) ? "enabled" : "disabled"), false);
}
示例10: Summon
private void Summon(Client Client, List<string> Params)
{
if (Params.Count != 1)
{
Client.Notif("Failed to summon user " + GetParams("summon"), false);
return;
}
string Username = Params[0];
if (Username.ToLower().Equals(Client.GetUser().Username))
{
Client.Notif("You cannot summon yourself.", false);
return;
}
int HabboId = BrickEngine.GetUserReactor().GetId(Username);
if (HabboId <= 0)
{
Client.Notif(string.Format("User {0} not found in database/cache.", Username), false);
return;
}
if (!BrickEngine.GetUserReactor().IsOnline(HabboId))
{
Client.Notif(string.Format("User {0} is offline.", Username), false);
return;
}
int CurrentRoomId = Client.GetUser().RoomId;
if (CurrentRoomId <= 0)
{
Client.Notif("You have to be in a room.", false);
return;
}
Client Target = BrickEngine.GetSocketShield().GetSocketClientByHabboId(HabboId).GetClient();
if (Target.GetUser().Rank > Client.GetUser().Rank)
{
Client.Notif("You cannot summon someone with a higher rank.", false);
return;
}
if (!Target.GetUser().IsInRoom)
{
return;
}
Target.Notif(string.Format("You have been summoned by {0}.", Client.GetUser().Username), true);
if (!Target.GetUser().RoomId.Equals(CurrentRoomId))
{
BrickEngine.GetPacketHandler().BeginLoadRoom(Target, CurrentRoomId, string.Empty);
}
else
{
VirtualRoomUser TargetUser = Client.GetUser().GetRoom().GetRoomEngine().GetUserByHabboId(HabboId);
VirtualRoomUser MyUser = Client.GetUser().GetRoomUser();
if (TargetUser != null && MyUser != null)
{
TargetUser.UnhandledGoalPoint = MyUser.FontPoint;
}
}
}
示例11: DisconnectUser
private void DisconnectUser(Client Client, List<string> Params)
{
if (Params.Count != 1)
{
Client.Notif("Failed to disconnect user " + GetParams("disconnect"), false);
return;
}
string Username = Params[0];
int HabboId = BrickEngine.GetUserReactor().GetId(Username);
if (HabboId <= 0)
{
Client.Notif("Failed to disconnect user " + GetParams("disconnect"), false);
return;
}
if (!BrickEngine.GetUserReactor().IsOnline(HabboId))
{
Client.Notif(string.Format("User {0} is offline.", Username), false);
return;
}
Client Target = BrickEngine.GetSocketShield().GetSocketClientByHabboId(HabboId).GetClient();
Target.Dispose();
Client.Notif(string.Format("Disconnected {0} fawlessly.", Username), true);
}
示例12: Empty
private void Empty(Client Client, List<string> Params)
{
foreach (PetInfo Item in BrickEngine.GetPetReactor().GetPetsForInventory(Client.GetUser().HabboId))
{
BrickEngine.GetPetReactor().RemovePet(Item.Id);
}
foreach (Item Item in BrickEngine.GetItemReactor().GetItemsForUser(Client.GetUser().HabboId))
{
BrickEngine.GetItemReactor().RemoveItem(Item.Id);
}
Client.SendResponse(new Response(101));
Client.Notif("Inventory Emptied.", true);
using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
{
Reactor.SetQuery("DELETE FROM items WHERE user_id = @habboid AND room_id <= 0");
Reactor.AddParam("habboid", Client.GetUser().HabboId);
Reactor.ExcuteQuery();
}
using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
{
Reactor.SetQuery("DELETE FROM user_pets WHERE user_id = @habboid AND room_id <= 0");
Reactor.AddParam("habboid", Client.GetUser().HabboId);
Reactor.ExcuteQuery();
}
}
示例13: MuteRoom
private void MuteRoom(Client Client, List<string> Params)
{
if (Params.Count != 1)
{
Client.Notif("Failed to mute room " + GetParams("muteroom"), false);
return;
}
int SecondsMuted = BrickEngine.GetConvertor().ObjectToInt32(Params[0]);
if (SecondsMuted > 3600)
{
Client.Notif("Limit of 1 hour " + GetParams("muteroom"), false);
return;
}
foreach (VirtualRoomUser User in Client.GetUser().GetRoom().GetRoomEngine().GetUsers())
{
if (BrickEngine.GetUserReactor().IsOnline(User.HabboId))
{
if (User.GetClient().GetUser().Rank == 1 && !Client.GetUser().GetRoom().GetRoomEngine().HasRights(User.HabboId, RightsType.Rights))
{
Mute(Client, new string[] { User.GetClient().GetUser().Username, SecondsMuted.ToString() }.ToList());
}
}
}
Client.Notif("Room muted fawlessly.", true);
}
示例14: IPBan
private void IPBan(Client Client, List<string> Params)
{
if (Params.Count != 2)
{
Client.Notif("Failed to ip-ban a user " + GetParams("ipban"), false);
return;
}
int HabboId = BrickEngine.GetUserReactor().GetId(Params[0]);
if (!BrickEngine.GetUserReactor().IsOnline(HabboId))
{
Client.Notif(string.Format("{0} is not in the hotel.", Params[0]), false);
return;
}
Client Target = BrickEngine.GetSocketShield().GetSocketClientByHabboId(HabboId).GetClient();
string IP = Target.IPAddress;
BrickEngine.GetToolReactor().BanUser(Client, HabboId, Params[1], 100000, true);
}
示例15: Mute
private void Mute(Client Client, List<string> Params)
{
if (Params.Count != 2)
{
Client.Notif("Failed to mute a user " + GetParams("mute"), false);
return;
}
string Username = Params[0];
int SecondsMuted = BrickEngine.GetConvertor().ObjectToInt32(Params[1]);
if (SecondsMuted > 3600)
{
Client.Notif("Limit of 1 hour " + GetParams("mute"), false);
return;
}
int HabboId = BrickEngine.GetUserReactor().GetId(Username);
if (BrickEngine.GetUserReactor().IsOnline(HabboId))
{
Client TargetClient = BrickEngine.GetSocketShield().GetSocketClientByHabboId(HabboId).GetClient();
TargetClient.GetUser().GetClient().GetUser().MutedStart = DateTime.Now;
TargetClient.GetUser().GetClient().GetUser().SecondsMuted = SecondsMuted;
Response Mute = new Response(27);
Mute.AppendInt32(SecondsMuted);
TargetClient.SendResponse(Mute);
TargetClient.Notif(string.Format("You've been muted by: {0}", Client.GetUser().Username), true);
}
}