Skip to content

Commit

Permalink
v3.6 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
slinksoft committed Feb 21, 2023
1 parent 2e79087 commit b8fc2fb
Show file tree
Hide file tree
Showing 21 changed files with 135 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,55 +265,76 @@ private void processHelp(String message, KailleraServerImpl server, KailleraUser
{
if(admin.getAccess() == AccessManager.ACCESS_MODERATOR)
return;
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpVersion"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpKick"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpSilence"))); //$NON-NLS-1$ //$NON-NLS-2$

clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "Admin Commands")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpBan"))); //$NON-NLS-1$ //$NON-NLS-2$
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "--------------")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}

if(admin.getAccess() == AccessManager.ACCESS_ADMIN){
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpClear"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
}

clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpCloseGame"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpAnnounce"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpAnnounceAll"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpAnnounceGame"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/finduser <Nick> to get a user's info. or /finduser * for all users info. eg. /finduser sli ...will return Slink info.")); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpBan"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/findgame <Name> to get game info. or /findgame * to get all game info.")); //$NON-NLS-1$ //$NON-NLS-2$
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/clear <IP Address> to remove any temp ban, silence, elevated, moderator or admin.")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/triviaon to start the trivia bot- /triviapause to pause the bot- /triviaresume to resume the bot after pause- /triviasave to save the bot's scores- /triviatime <#> to change the question delay")); //$NON-NLS-1$ //$NON-NLS-2$
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpCloseGame"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/triviaoff to stop the bot- /triviascores to show top 3 scores- /triviawin to show a winner- /triviaupdate <IP Address> <New IP Address> to update ip address")); //$NON-NLS-1$ //$NON-NLS-2$
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/findgame <Name> to get game info. or /findgame * to get all game info.")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/unscrambleon to start the unscramble bot- /unscramblepause to pause the bot- /unscrambleresume to resume the bot after pause- /unscramblesave to save the bot's scores- /unscrambletime <#> to change the question delay")); //$NON-NLS-1$ //$NON-NLS-2$
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/finduser <Nick> to get a user's info. or /finduser * for all users info. eg. /finduser sli ...will return Slink info.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/unscrambleoff to stop the bot- /unscramblescores to show top 3 scores- /unscramblewin to show a winner")); //$NON-NLS-1$ //$NON-NLS-2$
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpKick"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}

if(admin.getAccess() >= AccessManager.ACCESS_SUPERADMIN){
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/publicrules to display rules to everyone in main chat and game chat")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
}

clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpSilence"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/stealthon /stealthoff to join a room invisibly.")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}

if(admin.getAccess() >= AccessManager.ACCESS_SUPERADMIN){
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/tempadmin to grant a user temporary admin access")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/tempelevated <UserID> <min> to give a user temporary elevated access.")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/tempmod <UserID> <min> to give a user temporary moderator access.")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpTempAdmin"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/clear <IP Address> to remove any temp ban, silence, elevated, moderator or admin.")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/publicrules to display rules to everyone in main chat and game chat")); //$NON-NLS-1$ //$NON-NLS-2$
}

clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/triviaon to start the trivia bot- /triviapause to pause the bot- /triviaresume to resume the bot after pause- /triviasave to save the bot's scores- /triviatime <#> to change the question delay")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/triviaoff to stop the bot- /triviascores to show top 3 scores- /triviawin to show a winner- /triviaupdate <IP Address> <New IP Address> to update ip address")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}

clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/unscrambleon to start the unscramble bot- /unscramblepause to pause the bot- /unscrambleresume to resume the bot after pause- /unscramblesave to save the bot's scores- /unscrambletime <#> to change the question delay")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/unscrambleoff to stop the bot- /unscramblescores to show top 3 scores- /unscramblewin to show a winner")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}

clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpVersion"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}

clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "Regular User Commands")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "---------------------")); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}

/*
if(admin.getAccess() == AccessManager.ACCESS_ADMIN){
clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", EmuLang.getString("AdminCommandAction.HelpClear"))); //$NON-NLS-1$ //$NON-NLS-2$
try { Thread.sleep(20); } catch(Exception e) {}
}
*/


}


Expand Down
28 changes: 19 additions & 9 deletions src/org/emulinker/kaillera/controller/v086/action/ChatAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -448,31 +448,41 @@ else if (((Chat) message).getMessage().equals("/rules")) {
}
}
else if(((Chat) message).getMessage().equals("/help")){
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/me <message> to make personal message eg. /me is bored ...Slink is bored.")); } catch(Exception e) {}
try { clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/alivecheck check to see if the server is still responsive with your client")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}

if(clientHandler.getUser().getAccess() < AccessManager.ACCESS_ADMIN){
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/finduser <Nick> to get a user's info. or /finduser * for all users info. eg. /finduser sli ...will return Slink info.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
}

try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/ignore <UserID> or /unignore <UserID> or /ignoreall or /unignoreall to ignore users.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}

if(clientHandler.getUser().getAccess() == AccessManager.ACCESS_MODERATOR) {
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/kick <UserID> to kick a user.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
}

try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/me <message> to make personal message eg. /me is bored ...Slink is bored.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/msg <UserID> <msg> to PM somebody. /msgoff or /msgon to turn pm off | on.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/myip to get your IP Address.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
try { clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/rules for the server's rule list.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
try { clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/alivecheck check to see if the server is still responsive with your client")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}

if(clientHandler.getUser().getAccess() == AccessManager.ACCESS_MODERATOR){
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/silence <UserID> <min> to silence a user. 15min max.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/kick <UserID> to kick a user.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
}

if(clientHandler.getUser().getAccess() < AccessManager.ACCESS_ADMIN){
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/version to get server version.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
try {clientHandler.send(new InformationMessage(clientHandler.getNextMessageNumber(), "server", "/finduser <Nick> to get a user's info. or /finduser * for all users info. eg. /finduser sli ...will return Slink info.")); } catch(Exception e) {}
try { Thread.sleep(20); } catch(Exception e) {}
return;
}
return;
}
else if(((Chat) message).getMessage().startsWith("/finduser") && clientHandler.getUser().getAccess() < AccessManager.ACCESS_ADMIN){
int space = ((Chat) message).getMessage().indexOf(' ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.emulinker.kaillera.model.exception.ActionException;
import org.emulinker.kaillera.model.exception.GameChatException;
import org.emulinker.kaillera.model.impl.KailleraUserImpl;
import org.emulinker.util.EmuLang;

public class GameChatAction implements V086Action, V086GameEventHandler
{
Expand Down Expand Up @@ -202,6 +203,11 @@ else if (((GameChat) message).getMessage().startsWith("/msg")){
user1.getGame().announce("User not found!", user1);
return;
}

if(user.getGame() != user1.getGame()) {
user1.getGame().announce("User not in this game!", user1);
return;
}

if(user == clientHandler.getUser()){
user1.getGame().announce("You can't private message yourself!", user1);
Expand Down Expand Up @@ -274,6 +280,11 @@ else if (((GameChat) message).getMessage().startsWith("/msg")){
user1.getGame().announce("User not found!", user1);
return;
}

if(user.getGame() != user1.getGame()) {
user1.getGame().announce("User not in this game!", user1);
return;
}

if(user == clientHandler.getUser()){
user1.getGame().announce("You can't private message yourself!", user1);
Expand Down Expand Up @@ -460,13 +471,17 @@ else if(((GameChat) message).getMessage().startsWith("/me")){
}
else if(((GameChat) message).getMessage().equals("/help")){
KailleraUserImpl user = (KailleraUserImpl) clientHandler.getUser();
user.getGame().announce("/me <message> to make personal message eg. /me is bored ...Slink is bored.", user);
try { Thread.sleep(20); } catch(Exception e) {}
user.getGame().announce("/msg <UserID> <msg> to PM somebody. /msgoff or /msgon to turn pm off | on.", user);

user.getGame().announce(EmuLang.getString("Gameroom Guests Commands"), user); //$NON-NLS-1$
try { Thread.sleep(20); } catch(Exception e) {}
user.getGame().announce(EmuLang.getString("-----------------------"), user); //$NON-NLS-1$
try { Thread.sleep(20); } catch(Exception e) {}

user.getGame().announce("/ignore <UserID> or /unignore <UserID> or /ignoreall or /unignoreall to ignore users.", user);
try { Thread.sleep(20); } catch(Exception e) {}
user.getGame().announce("/p2pon or /p2poff this option ignores all server activity during gameplay.", user);
user.getGame().announce("/me <message> to make personal message eg. /me is bored ...Slink is bored.", user);
try { Thread.sleep(20); } catch(Exception e) {}
user.getGame().announce("/msg <UserID> <msg> to PM somebody. /msgoff or /msgon to turn pm off | on.", user);
try { Thread.sleep(20); } catch(Exception e) {}
return;
}
Expand Down
Loading

0 comments on commit b8fc2fb

Please sign in to comment.