-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
magiclu550
committed
Sep 1, 2019
1 parent
0974f6d
commit 46412c2
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package cn.jsmod2.command; | ||
|
||
import cn.jsmod2.core.CommandSender; | ||
import cn.jsmod2.core.Powers; | ||
import cn.jsmod2.core.Server; | ||
import cn.jsmod2.core.command.NativeCommand; | ||
import cn.jsmod2.core.log.ServerLogger; | ||
|
||
import static cn.jsmod2.core.utils.Utils.contains; | ||
|
||
/** | ||
* 用于调试服务器而定义的命令格式 | ||
*/ | ||
public class ServerCommand extends NativeCommand { | ||
|
||
public ServerCommand() { | ||
super("server", Powers.ADMIN,"the server debug command"); | ||
} | ||
|
||
//-f getPlayers | ||
@Override | ||
public boolean execute(CommandSender commandSender, String[] strings) { | ||
if(contains(strings,"-p")){ | ||
ServerLogger.getLogger().multiInfo(getClass(),Server.getSender().getServer().getGameServer().getPlayers()==null?"isNull":"notNull","",""); | ||
}else if(contains(strings,"-ip")){ | ||
ServerLogger.getLogger().multiInfo(getClass(),Server.getSender().getServer().getGameServer().getIpAddress(),"",""); | ||
} | ||
return true; | ||
} | ||
} |