mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-22 20:55:52 +12:00
Add messages for 2player
This commit is contained in:
parent
1acba870c6
commit
30e7250a48
6 changed files with 90 additions and 41 deletions
|
@ -52,10 +52,9 @@ namespace HISP.Game.Chat
|
|||
string[] args = message.Split(' ').Skip(1).ToArray();
|
||||
|
||||
if (user.Administrator || user.Moderator)
|
||||
{
|
||||
if (message[0] == '%')
|
||||
{
|
||||
if(message.StartsWith("%STICKBUG"))
|
||||
return Command.Stickbug(message, args, user);
|
||||
if (message.StartsWith("%GIVE"))
|
||||
return Command.Give(message, args, user);
|
||||
if (message.StartsWith("%GOTO"))
|
||||
|
@ -72,6 +71,8 @@ namespace HISP.Game.Chat
|
|||
return Command.Escape(message, args, user);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
if (message[0] == '!')
|
||||
{
|
||||
// Alias for !MUTE
|
||||
|
@ -108,7 +109,7 @@ namespace HISP.Game.Chat
|
|||
}
|
||||
return false;
|
||||
}
|
||||
public static Object FilterMessage(string message) // Handles chat filtering and violation stuffs returns
|
||||
public static Object FilterMessage(string message) // Handles chat filtering and violation stuffs
|
||||
{
|
||||
if (!ConfigReader.BadWords) // Freedom of Speech Mode
|
||||
return null;
|
||||
|
|
|
@ -144,44 +144,6 @@ namespace HISP.Game.Chat
|
|||
user.LoggedinClient.SendPacket(chatPacket);
|
||||
return true;
|
||||
}
|
||||
public static bool Stickbug(string message, string[] args, User user)
|
||||
{
|
||||
if (args.Length <= 0)
|
||||
return false;
|
||||
if (!user.Administrator)
|
||||
return false;
|
||||
|
||||
if(args[0] == "ALL")
|
||||
{
|
||||
foreach(GameClient client in GameServer.ConnectedClients)
|
||||
{
|
||||
if(client.LoggedIn)
|
||||
{
|
||||
byte[] swfModulePacket = PacketBuilder.CreateSwfModulePacket("fun/stickbug.swf", PacketBuilder.PACKET_SWF_MODULE_GENTLE);
|
||||
client.SendPacket(swfModulePacket);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
User victimUser = GameServer.GetUserByName(args[0]);
|
||||
byte[] swfModulePacket = PacketBuilder.CreateSwfModulePacket("fun/stickbug.swf", PacketBuilder.PACKET_SWF_MODULE_GENTLE);
|
||||
victimUser.LoggedinClient.SendPacket(swfModulePacket);
|
||||
}
|
||||
catch(KeyNotFoundException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
byte[] chatPacket = PacketBuilder.CreateChat(Messages.FormatAdminCommandCompleteMessage(message.Substring(1)), PacketBuilder.CHAT_BOTTOM_LEFT);
|
||||
user.LoggedinClient.SendPacket(chatPacket);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool NoClip(string message, string[] args, User user)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue