mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 21:25:52 +12:00
Add %BAN
This commit is contained in:
parent
9f44620fd7
commit
49522e9fef
8 changed files with 165 additions and 6 deletions
|
@ -62,6 +62,34 @@ namespace HISP.Game.Chat
|
|||
user.LoggedinClient.SendPacket(chatPacket);
|
||||
return true;
|
||||
}
|
||||
public static bool Ban(string message, string[] args, User user)
|
||||
{
|
||||
if (args.Length <= 0)
|
||||
return false;
|
||||
if(!user.Administrator || !user.Moderator)
|
||||
return false;
|
||||
try{
|
||||
string userName = args[0];
|
||||
int id = Database.GetUserid(userName);
|
||||
string ip = Database.GetIpAddress(id);
|
||||
string reason = "NONE SPECIFIED";
|
||||
if (args.Length >= 2)
|
||||
{
|
||||
reason = string.Join(" ", args, 1, args.Length - 1);
|
||||
}
|
||||
|
||||
Database.BanUser(id, ip, reason);
|
||||
User bannedUser = GameServer.GetUserByName(args[0]);
|
||||
bannedUser.LoggedinClient.Kick(Messages.KickReasonBanned);
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool Stickbug(string message, string[] args, User user)
|
||||
{
|
||||
if (args.Length <= 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue