mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-22 21:57:58 +07:00
Log client commands before handling
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 298 B |
Binary file not shown.
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 232 B |
@ -198,6 +198,12 @@ public class NetClient implements ApplicationListener{
|
|||||||
|
|
||||||
Events.fire(new PlayerChatEvent(player, message));
|
Events.fire(new PlayerChatEvent(player, message));
|
||||||
|
|
||||||
|
//log commands before they are handled
|
||||||
|
if(message.startsWith(netServer.clientCommands.getPrefix())){
|
||||||
|
//log with brackets
|
||||||
|
Log.info("<&fi@: @&fr>", "&lk" + player.name, "&lw" + message);
|
||||||
|
}
|
||||||
|
|
||||||
//check if it's a command
|
//check if it's a command
|
||||||
CommandResponse response = netServer.clientCommands.handleMessage(message, player);
|
CommandResponse response = netServer.clientCommands.handleMessage(message, player);
|
||||||
if(response.type == ResponseType.noCommand){ //no command to handle
|
if(response.type == ResponseType.noCommand){ //no command to handle
|
||||||
@ -219,8 +225,6 @@ public class NetClient implements ApplicationListener{
|
|||||||
//this is required so other clients get the correct name even if they don't know who's sending it yet
|
//this is required so other clients get the correct name even if they don't know who's sending it yet
|
||||||
Call.sendMessage(message, colorizeName(player.id(), player.name), player);
|
Call.sendMessage(message, colorizeName(player.id(), player.name), player);
|
||||||
}else{
|
}else{
|
||||||
//log command to console but with brackets
|
|
||||||
Log.info("<&fi@: @&fr>", "&lk" + player.name, "&lw" + message);
|
|
||||||
|
|
||||||
//a command was sent, now get the output
|
//a command was sent, now get the output
|
||||||
if(response.type != ResponseType.valid){
|
if(response.type != ResponseType.valid){
|
||||||
|
@ -398,7 +398,7 @@ public class Generators{
|
|||||||
//if(icon.size == base.width) continue;
|
//if(icon.size == base.width) continue;
|
||||||
Image image = new Image(icon.size, icon.size);
|
Image image = new Image(icon.size, icon.size);
|
||||||
image.drawScaled(base);
|
image.drawScaled(base);
|
||||||
image.save(item.getContentType().name() + "-" + item.name + "-" + icon.name(), false);
|
image.save(item.getContentType().name() + "-" + item.name + "-" + icon.name(), !(item instanceof StatusEffect));
|
||||||
|
|
||||||
if(icon == Cicon.medium){
|
if(icon == Cicon.medium){
|
||||||
image.save("../ui/" + item.getContentType() + "-" + item.name + "-icon");
|
image.save("../ui/" + item.getContentType() + "-" + item.name + "-icon");
|
||||||
|
Reference in New Issue
Block a user