Removed "on" prefix from all remote methods
This commit is contained in:
@@ -210,11 +210,11 @@ public class BlockIndexer{
|
||||
}
|
||||
|
||||
public void notifyTileDamaged(Building entity){
|
||||
if(damagedTiles[(int)entity.team().id] == null){
|
||||
damagedTiles[(int)entity.team().id] = new TileArray();
|
||||
if(damagedTiles[entity.team().id] == null){
|
||||
damagedTiles[entity.team().id] = new TileArray();
|
||||
}
|
||||
|
||||
TileArray set = damagedTiles[(int)entity.team().id];
|
||||
TileArray set = damagedTiles[entity.team().id];
|
||||
set.add(entity.tile());
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ public class Control implements ApplicationListener, Loadable{
|
||||
state.stats.wavesLasted = state.wave;
|
||||
Effects.shake(5, 6, Core.camera.position.x, Core.camera.position.y);
|
||||
//the restart dialog can show info for any number of scenarios
|
||||
Call.onGameOver(event.winner);
|
||||
Call.gameOver(event.winner);
|
||||
});
|
||||
|
||||
//autohost for pvp maps
|
||||
|
||||
@@ -294,7 +294,7 @@ public class Logic implements ApplicationListener{
|
||||
}
|
||||
|
||||
@Remote(called = Loc.both)
|
||||
public static void onGameOver(Team winner){
|
||||
public static void gameOver(Team winner){
|
||||
state.stats.wavesLasted = state.wave;
|
||||
ui.restart.show(winner);
|
||||
netClient.setQuiet();
|
||||
|
||||
@@ -230,7 +230,7 @@ public class NetClient implements ApplicationListener{
|
||||
}
|
||||
|
||||
@Remote(called = Loc.client, variants = Variant.one)
|
||||
public static void onConnect(String ip, int port){
|
||||
public static void connect(String ip, int port){
|
||||
netClient.disconnectQuietly();
|
||||
logic.reset();
|
||||
|
||||
@@ -238,24 +238,24 @@ public class NetClient implements ApplicationListener{
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.client)
|
||||
public static void onPing(Player player, long time){
|
||||
Call.onPingResponse(player.con, time);
|
||||
public static void ping(Player player, long time){
|
||||
Call.pingResponse(player.con, time);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.one)
|
||||
public static void onPingResponse(long time){
|
||||
public static void pingResponse(long time){
|
||||
netClient.ping = Time.timeSinceMillis(time);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.one)
|
||||
public static void onTraceInfo(Player player, TraceInfo info){
|
||||
public static void traceInfo(Player player, TraceInfo info){
|
||||
if(player != null){
|
||||
ui.traces.show(player, info);
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.one, priority = PacketPriority.high)
|
||||
public static void onKick(KickReason reason){
|
||||
public static void kick(KickReason reason){
|
||||
netClient.disconnectQuietly();
|
||||
logic.reset();
|
||||
|
||||
@@ -270,7 +270,7 @@ public class NetClient implements ApplicationListener{
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.one, priority = PacketPriority.high)
|
||||
public static void onKick(String reason){
|
||||
public static void kick(String reason){
|
||||
netClient.disconnectQuietly();
|
||||
logic.reset();
|
||||
ui.showText("$disconnect", reason, Align.left);
|
||||
@@ -296,21 +296,21 @@ public class NetClient implements ApplicationListener{
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void onInfoMessage(String message){
|
||||
public static void infoMessage(String message){
|
||||
if(message == null) return;
|
||||
|
||||
ui.showText("", message);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void onInfoPopup(String message, float duration, int align, int top, int left, int bottom, int right){
|
||||
public static void infoPopup(String message, float duration, int align, int top, int left, int bottom, int right){
|
||||
if(message == null) return;
|
||||
|
||||
ui.showInfoPopup(message, duration, align, top, left, bottom, right);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void onLabel(String message, float duration, float worldx, float worldy){
|
||||
public static void label(String message, float duration, float worldx, float worldy){
|
||||
if(message == null) return;
|
||||
|
||||
ui.showLabel(message, duration, worldx, worldy);
|
||||
@@ -330,19 +330,19 @@ public class NetClient implements ApplicationListener{
|
||||
}*/
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void onInfoToast(String message, float duration){
|
||||
public static void infoToast(String message, float duration){
|
||||
if(message == null) return;
|
||||
|
||||
ui.showInfoToast(message, duration);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void onSetRules(Rules rules){
|
||||
public static void setRules(Rules rules){
|
||||
state.rules = rules;
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void onWorldDataBegin(){
|
||||
public static void worldDataBegin(){
|
||||
Groups.all.clear();
|
||||
netClient.removed.clear();
|
||||
logic.reset();
|
||||
@@ -360,17 +360,17 @@ public class NetClient implements ApplicationListener{
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.one)
|
||||
public static void onPositionSet(float x, float y){
|
||||
public static void setPosition(float x, float y){
|
||||
player.set(x, y);
|
||||
}
|
||||
|
||||
@Remote
|
||||
public static void onPlayerDisconnect(int playerid){
|
||||
public static void playerDisconnect(int playerid){
|
||||
Groups.player.removeByID(playerid);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.one, priority = PacketPriority.low, unreliable = true)
|
||||
public static void onEntitySnapshot(short amount, short dataLen, byte[] data){
|
||||
public static void entitySnapshot(short amount, short dataLen, byte[] data){
|
||||
try{
|
||||
netClient.byteStream.setBytes(net.decompressSnapshot(data, dataLen));
|
||||
DataInputStream input = netClient.dataStream;
|
||||
@@ -417,7 +417,7 @@ public class NetClient implements ApplicationListener{
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both, priority = PacketPriority.low, unreliable = true)
|
||||
public static void onBlockSnapshot(short amount, short dataLen, byte[] data){
|
||||
public static void blockSnapshot(short amount, short dataLen, byte[] data){
|
||||
try{
|
||||
netClient.byteStream.setBytes(net.decompressSnapshot(data, dataLen));
|
||||
DataInputStream input = netClient.dataStream;
|
||||
@@ -437,7 +437,7 @@ public class NetClient implements ApplicationListener{
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.one, priority = PacketPriority.low, unreliable = true)
|
||||
public static void onStateSnapshot(float waveTime, int wave, int enemies, boolean paused, short coreDataLen, byte[] coreData){
|
||||
public static void stateSnapshot(float waveTime, int wave, int enemies, boolean paused, short coreDataLen, byte[] coreData){
|
||||
try{
|
||||
if(wave > state.wave){
|
||||
state.wave = wave;
|
||||
@@ -565,7 +565,7 @@ public class NetClient implements ApplicationListener{
|
||||
|
||||
Unit unit = player.dead() ? Nulls.unit : player.unit();
|
||||
|
||||
Call.onClientShapshot(lastSent++,
|
||||
Call.clientShapshot(lastSent++,
|
||||
unit.x, unit.y,
|
||||
player.unit().aimX(), player.unit().aimY(),
|
||||
unit.rotation,
|
||||
@@ -579,7 +579,7 @@ public class NetClient implements ApplicationListener{
|
||||
}
|
||||
|
||||
if(timer.get(1, 60)){
|
||||
Call.onPing(Time.millis());
|
||||
Call.ping(Time.millis());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ public class NetServer implements ApplicationListener{
|
||||
info.lastName = packet.name;
|
||||
info.id = packet.uuid;
|
||||
admins.save();
|
||||
Call.onInfoMessage(con, "You are not whitelisted here.");
|
||||
Call.infoMessage(con, "You are not whitelisted here.");
|
||||
Log.info("&lcDo &lywhitelist-add @&lc to whitelist the player &lb'@'", packet.uuid, packet.name);
|
||||
con.kick(KickReason.whitelist);
|
||||
return;
|
||||
@@ -453,7 +453,7 @@ public class NetServer implements ApplicationListener{
|
||||
}
|
||||
|
||||
player.getInfo().lastSyncTime = Time.millis();
|
||||
Call.onWorldDataBegin(player.con);
|
||||
Call.worldDataBegin(player.con);
|
||||
netServer.sendWorldData(player);
|
||||
}
|
||||
});
|
||||
@@ -501,7 +501,7 @@ public class NetServer implements ApplicationListener{
|
||||
if(player.con.hasConnected){
|
||||
Events.fire(new PlayerLeave(player));
|
||||
if(Config.showConnectMessages.bool()) Call.sendMessage("[accent]" + player.name + "[accent] has disconnected.");
|
||||
Call.onPlayerDisconnect(player.id());
|
||||
Call.playerDisconnect(player.id());
|
||||
}
|
||||
|
||||
if(Config.showConnectMessages.bool()) Log.info("&lm[@] &lc@ has disconnected. &lg&fi(@)", player.uuid(), player.name, reason);
|
||||
@@ -526,7 +526,7 @@ public class NetServer implements ApplicationListener{
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.client, unreliable = true)
|
||||
public static void onClientShapshot(
|
||||
public static void clientShapshot(
|
||||
Player player,
|
||||
int snapshotID,
|
||||
float x, float y,
|
||||
@@ -633,7 +633,7 @@ public class NetServer implements ApplicationListener{
|
||||
newx = x;
|
||||
newy = y;
|
||||
}else if(!Mathf.within(x, y, newx, newy, correctDist)){
|
||||
Call.onPositionSet(player.con, newx, newy); //teleport and correct position when necessary
|
||||
Call.setPosition(player.con, newx, newy); //teleport and correct position when necessary
|
||||
}
|
||||
|
||||
//reset player to previous synced position so it gets interpolated
|
||||
@@ -666,7 +666,7 @@ public class NetServer implements ApplicationListener{
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.client, called = Loc.server)
|
||||
public static void onAdminRequest(Player player, Player other, AdminAction action){
|
||||
public static void adminRequest(Player player, Player other, AdminAction action){
|
||||
|
||||
if(!player.admin){
|
||||
Log.warn("ACCESS DENIED: Player @ / @ attempted to perform admin action without proper security access.",
|
||||
@@ -693,9 +693,9 @@ public class NetServer implements ApplicationListener{
|
||||
}else if(action == AdminAction.trace){
|
||||
TraceInfo info = new TraceInfo(other.con.address, other.uuid(), other.con.modclient, other.con.mobile);
|
||||
if(player.con != null){
|
||||
Call.onTraceInfo(player.con, other, info);
|
||||
Call.traceInfo(player.con, other, info);
|
||||
}else{
|
||||
NetClient.onTraceInfo(other, info);
|
||||
NetClient.traceInfo(other, info);
|
||||
}
|
||||
Log.info("&lc@ has requested trace info of @.", player.name, other.name);
|
||||
}
|
||||
@@ -785,7 +785,7 @@ public class NetServer implements ApplicationListener{
|
||||
if(syncStream.size() > maxSnapshotSize){
|
||||
dataStream.close();
|
||||
byte[] stateBytes = syncStream.toByteArray();
|
||||
Call.onBlockSnapshot(sent, (short)stateBytes.length, net.compressSnapshot(stateBytes));
|
||||
Call.blockSnapshot(sent, (short)stateBytes.length, net.compressSnapshot(stateBytes));
|
||||
sent = 0;
|
||||
syncStream.reset();
|
||||
}
|
||||
@@ -794,7 +794,7 @@ public class NetServer implements ApplicationListener{
|
||||
if(sent > 0){
|
||||
dataStream.close();
|
||||
byte[] stateBytes = syncStream.toByteArray();
|
||||
Call.onBlockSnapshot(sent, (short)stateBytes.length, net.compressSnapshot(stateBytes));
|
||||
Call.blockSnapshot(sent, (short)stateBytes.length, net.compressSnapshot(stateBytes));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ public class NetServer implements ApplicationListener{
|
||||
byte[] stateBytes = syncStream.toByteArray();
|
||||
|
||||
//write basic state data.
|
||||
Call.onStateSnapshot(player.con, state.wavetime, state.wave, state.enemies, state.serverPaused, (short)stateBytes.length, net.compressSnapshot(stateBytes));
|
||||
Call.stateSnapshot(player.con, state.wavetime, state.wave, state.enemies, state.serverPaused, (short)stateBytes.length, net.compressSnapshot(stateBytes));
|
||||
|
||||
viewport.setSize(player.con.viewWidth, player.con.viewHeight).setCenter(player.con.viewX, player.con.viewY);
|
||||
|
||||
@@ -832,7 +832,7 @@ public class NetServer implements ApplicationListener{
|
||||
if(syncStream.size() > maxSnapshotSize){
|
||||
dataStream.close();
|
||||
byte[] syncBytes = syncStream.toByteArray();
|
||||
Call.onEntitySnapshot(player.con, (short)sent, (short)syncBytes.length, net.compressSnapshot(syncBytes));
|
||||
Call.entitySnapshot(player.con, (short)sent, (short)syncBytes.length, net.compressSnapshot(syncBytes));
|
||||
sent = 0;
|
||||
syncStream.reset();
|
||||
}
|
||||
@@ -842,7 +842,7 @@ public class NetServer implements ApplicationListener{
|
||||
dataStream.close();
|
||||
|
||||
byte[] syncBytes = syncStream.toByteArray();
|
||||
Call.onEntitySnapshot(player.con, (short)sent, (short)syncBytes.length, net.compressSnapshot(syncBytes));
|
||||
Call.entitySnapshot(player.con, (short)sent, (short)syncBytes.length, net.compressSnapshot(syncBytes));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class Units{
|
||||
private static boolean boolResult;
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void onUnitDeath(Unit unit){
|
||||
public static void unitDeath(Unit unit){
|
||||
unit.killed();
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ abstract class BuilderComp implements Unitc{
|
||||
}else{
|
||||
if(entity.construct(base(), core, 1f / entity.buildCost * Time.delta() * type().buildSpeed * state.rules.buildSpeedMultiplier, current.hasConfig)){
|
||||
if(current.hasConfig){
|
||||
Call.onTileConfig(null, tile.build, current.config);
|
||||
Call.tileConfig(null, tile.build, current.config);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,12 +174,12 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
public void configure(Object value){
|
||||
//save last used config
|
||||
block.lastConfig = value;
|
||||
Call.onTileConfig(player, base(), value);
|
||||
Call.tileConfig(player, base(), value);
|
||||
}
|
||||
|
||||
/** Configure from a server. */
|
||||
public void configureAny(Object value){
|
||||
Call.onTileConfig(null, base(), value);
|
||||
Call.tileConfig(null, base(), value);
|
||||
}
|
||||
|
||||
/** Deselect this tile from configuration. */
|
||||
@@ -1128,6 +1128,30 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
return tile.build == base() && !dead();
|
||||
}
|
||||
|
||||
@Replace
|
||||
@Override
|
||||
public void kill(){
|
||||
Call.tileDestroyed(base());
|
||||
}
|
||||
|
||||
@Replace
|
||||
@Override
|
||||
public void damage(float damage){
|
||||
if(dead()) return;
|
||||
|
||||
if(Mathf.zero(state.rules.blockHealthMultiplier)){
|
||||
damage = health + 1;
|
||||
}else{
|
||||
damage /= state.rules.blockHealthMultiplier;
|
||||
}
|
||||
|
||||
Call.tileDamage(base(), health - handleDamage(damage));
|
||||
|
||||
if(health <= 0){
|
||||
Call.tileDestroyed(base());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(){
|
||||
if(sound != null){
|
||||
|
||||
@@ -262,6 +262,6 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
if(dead || net.client()) return;
|
||||
|
||||
//deaths are synced; this calls killed()
|
||||
Call.onUnitDeath(base());
|
||||
Call.unitDeath(base());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public class DesktopInput extends InputHandler{
|
||||
if(Core.input.keyDown(Binding.control) && Core.input.keyTap(Binding.select)){
|
||||
Unit on = selectedUnit();
|
||||
if(on != null){
|
||||
Call.onUnitControl(player, on);
|
||||
Call.unitControl(player, on);
|
||||
shouldShoot = false;
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ public class DesktopInput extends InputHandler{
|
||||
updateMovement(player.unit());
|
||||
|
||||
if(Core.input.keyDown(Binding.respawn) && !player.unit().spawnedByCore()){
|
||||
Call.onUnitClear(player);
|
||||
Call.unitClear(player);
|
||||
controlledType = null;
|
||||
}
|
||||
}
|
||||
@@ -621,7 +621,7 @@ public class DesktopInput extends InputHandler{
|
||||
if(unit instanceof Commanderc){
|
||||
|
||||
if(Core.input.keyTap(Binding.command)){
|
||||
Call.onUnitCommand(player);
|
||||
Call.unitCommand(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.both, called = Loc.server, forward = true)
|
||||
public static void onTileTapped(Player player, Building tile){
|
||||
public static void tileTapped(Player player, Building tile){
|
||||
if(tile == null || player == null) return;
|
||||
if(net.server() && (!Units.canInteract(player, tile) ||
|
||||
!netServer.admins.allowAction(player, ActionType.tapTile, tile.tile(), action -> {}))) throw new ValidateException(player, "Player cannot tap a tile.");
|
||||
@@ -165,7 +165,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.both, called = Loc.both, forward = true)
|
||||
public static void onTileConfig(Player player, Building tile, @Nullable Object value){
|
||||
public static void tileConfig(Player player, Building tile, @Nullable Object value){
|
||||
if(tile == null) return;
|
||||
if(net.server() && (!Units.canInteract(player, tile) ||
|
||||
!netServer.admins.allowAction(player, ActionType.configure, tile.tile(), action -> action.config = value))) throw new ValidateException(player, "Player cannot configure a tile.");
|
||||
@@ -174,7 +174,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.both, called = Loc.server, forward = true)
|
||||
public static void onUnitControl(Player player, @Nullable Unit unit){
|
||||
public static void unitControl(Player player, @Nullable Unit unit){
|
||||
//clear player unit when they possess a core
|
||||
if((unit instanceof BlockUnitc && ((BlockUnitc)unit).tile() instanceof CoreEntity)){
|
||||
Fx.spawn.at(player);
|
||||
@@ -193,7 +193,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.both, called = Loc.server, forward = true)
|
||||
public static void onUnitClear(Player player){
|
||||
public static void unitClear(Player player){
|
||||
//no free core teleports?
|
||||
if(!player.dead() && player.unit().spawnedByCore) return;
|
||||
|
||||
@@ -203,7 +203,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.both, called = Loc.server, forward = true)
|
||||
public static void onUnitCommand(Player player){
|
||||
public static void unitCommand(Player player){
|
||||
if(player.dead() || !(player.unit() instanceof Commanderc)) return;
|
||||
|
||||
Commanderc commander = (Commanderc)player.unit();
|
||||
@@ -263,7 +263,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
Unit unit = Units.closest(player.team(), player.x, player.y, u -> !u.isPlayer() && u.type() == controlledType);
|
||||
|
||||
if(unit != null){
|
||||
Call.onUnitControl(player, unit);
|
||||
Call.unitControl(player, unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -277,7 +277,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
if(unit != null){
|
||||
if(net.client()){
|
||||
Call.onUnitControl(player, unit);
|
||||
Call.unitControl(player, unit);
|
||||
}else{
|
||||
unit.controller(player);
|
||||
}
|
||||
@@ -695,7 +695,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
//call tapped event
|
||||
if(!consumed && tile.interactable(player.team())){
|
||||
Call.onTileTapped(player, tile);
|
||||
Call.tileTapped(player, tile);
|
||||
}
|
||||
|
||||
//consume tap event if necessary
|
||||
|
||||
@@ -138,7 +138,7 @@ public class Net{
|
||||
*/
|
||||
public void closeServer(){
|
||||
for(NetConnection con : getConnections()){
|
||||
Call.onKick(con, KickReason.serverClose);
|
||||
Call.kick(con, KickReason.serverClose);
|
||||
}
|
||||
|
||||
provider.closeServer();
|
||||
|
||||
@@ -46,7 +46,7 @@ public abstract class NetConnection{
|
||||
info.lastKicked = Math.max(Time.millis() + 30 * 1000, info.lastKicked);
|
||||
}
|
||||
|
||||
Call.onKick(this, reason);
|
||||
Call.kick(this, reason);
|
||||
|
||||
Time.runTask(2f, this::close);
|
||||
|
||||
@@ -66,7 +66,7 @@ public abstract class NetConnection{
|
||||
info.timesKicked++;
|
||||
info.lastKicked = Math.max(Time.millis() + kickDuration, info.lastKicked);
|
||||
|
||||
Call.onKick(this, reason);
|
||||
Call.kick(this, reason);
|
||||
|
||||
Time.runTask(2f, this::close);
|
||||
|
||||
|
||||
@@ -652,7 +652,7 @@ public class HudFragment extends Fragment{
|
||||
private void addPlayButton(Table table){
|
||||
table.right().button(Icon.play, Styles.righti, 30f, () -> {
|
||||
if(net.client() && player.admin){
|
||||
Call.onAdminRequest(player, AdminAction.wave);
|
||||
Call.adminRequest(player, AdminAction.wave);
|
||||
}else if(inLaunchWave()){
|
||||
ui.showConfirm("$confirm", "$launch.skip.confirm", () -> !canSkipWave(), () -> state.wavetime = 0f);
|
||||
}else{
|
||||
|
||||
@@ -116,11 +116,11 @@ public class PlayerListFragment extends Fragment{
|
||||
|
||||
t.button(Icon.hammer, Styles.clearPartiali,
|
||||
() -> {
|
||||
ui.showConfirm("$confirm", Core.bundle.format("confirmban", user.name()), () -> Call.onAdminRequest(user, AdminAction.ban));
|
||||
ui.showConfirm("$confirm", Core.bundle.format("confirmban", user.name()), () -> Call.adminRequest(user, AdminAction.ban));
|
||||
});
|
||||
t.button(Icon.cancel, Styles.clearPartiali,
|
||||
() -> {
|
||||
ui.showConfirm("$confirm", Core.bundle.format("confirmkick", user.name()), () -> Call.onAdminRequest(user, AdminAction.kick));
|
||||
ui.showConfirm("$confirm", Core.bundle.format("confirmkick", user.name()), () -> Call.adminRequest(user, AdminAction.kick));
|
||||
});
|
||||
|
||||
t.row();
|
||||
@@ -140,7 +140,7 @@ public class PlayerListFragment extends Fragment{
|
||||
.touchable(() -> net.client() ? Touchable.disabled : Touchable.enabled)
|
||||
.checked(user.admin);
|
||||
|
||||
t.button(Icon.zoom, Styles.clearPartiali, () -> Call.onAdminRequest(user, AdminAction.trace));
|
||||
t.button(Icon.zoom, Styles.clearPartiali, () -> Call.adminRequest(user, AdminAction.trace));
|
||||
|
||||
}).padRight(12).size(bs + 10f, bs);
|
||||
}else if(!user.isLocal() && !user.admin && net.client() && Groups.player.size() >= 3 && player.team() == user.team()){ //votekick
|
||||
|
||||
@@ -641,19 +641,19 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, unreliable = true)
|
||||
public static void onTileDamage(Tile tile, float health){
|
||||
if(tile.build != null){
|
||||
tile.build.health = health;
|
||||
public static void tileDamage(Building build, float health){
|
||||
if(build == null) return;
|
||||
|
||||
if(tile.build.damaged()){
|
||||
indexer.notifyTileDamaged(tile.build);
|
||||
}
|
||||
build.health = health;
|
||||
|
||||
if(build.damaged()){
|
||||
indexer.notifyTileDamaged(build);
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void onTileDestroyed(Tile tile){
|
||||
if(tile.build == null) return;
|
||||
tile.build.killed();
|
||||
public static void tileDestroyed(Building build){
|
||||
if(build == null) return;
|
||||
build.killed();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class BuildBlock extends Block{
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void onDeconstructFinish(Tile tile, Block block, int builderID){
|
||||
public static void deconstructFinish(Tile tile, Block block, int builderID){
|
||||
Team team = tile.team();
|
||||
Fx.breakBlock.at(tile.drawx(), tile.drawy(), block.size);
|
||||
Events.fire(new BlockBuildEndEvent(tile, Groups.unit.getByID(builderID), team, true));
|
||||
@@ -57,7 +57,7 @@ public class BuildBlock extends Block{
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void onConstructFinish(Tile tile, Block block, int builderID, byte rotation, Team team, boolean skipConfig){
|
||||
public static void constructFinish(Tile tile, Block block, int builderID, byte rotation, Team team, boolean skipConfig){
|
||||
if(tile == null) return;
|
||||
float healthf = tile.build.healthf();
|
||||
tile.setBlock(block, team, rotation);
|
||||
@@ -96,7 +96,7 @@ public class BuildBlock extends Block{
|
||||
}
|
||||
|
||||
public static void constructed(Tile tile, Block block, int builderID, byte rotation, Team team, boolean skipConfig){
|
||||
Call.onConstructFinish(tile, block, builderID, rotation, team, skipConfig);
|
||||
Call.constructFinish(tile, block, builderID, rotation, team, skipConfig);
|
||||
tile.build.placed();
|
||||
|
||||
Events.fire(new BlockBuildEndEvent(tile, Groups.unit.getByID(builderID), team, false));
|
||||
@@ -256,7 +256,7 @@ public class BuildBlock extends Block{
|
||||
builderID = builder.id();
|
||||
|
||||
if(progress <= 0 || state.rules.infiniteResources){
|
||||
Call.onDeconstructFinish(tile, this.cblock == null ? previous : this.cblock, builderID);
|
||||
Call.deconstructFinish(tile, this.cblock == null ? previous : this.cblock, builderID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class MassDriver extends Block{
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
Drawf.dashCircle(x * tilesize, y*tilesize, range, Pal.accent);
|
||||
Drawf.dashCircle(x * tilesize, y * tilesize, range, Pal.accent);
|
||||
|
||||
//check if a mass driver is selected while placing this driver
|
||||
if(!control.input.frag.config.isShown()) return;
|
||||
@@ -64,7 +64,7 @@ public class MassDriver extends Block{
|
||||
float sin = Mathf.absin(Time.time(), 6f, 1f);
|
||||
Tmp.v1.set(x * tilesize + offset(), y * tilesize + offset()).sub(selected.x, selected.y).limit((size / 2f + 1) * tilesize + sin + 0.5f);
|
||||
float x2 = x * tilesize - Tmp.v1.x, y2 = y * tilesize - Tmp.v1.y,
|
||||
x1 = selected.x + Tmp.v1.x, y1 = selected.y + Tmp.v1.y;
|
||||
x1 = selected.x + Tmp.v1.x, y1 = selected.y + Tmp.v1.y;
|
||||
int segs = (int)(selected.dst(x * tilesize, y * tilesize) / tilesize);
|
||||
|
||||
Lines.stroke(4f, Pal.gray);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class CoreBlock extends StorageBlock{
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void onPlayerSpawn(Tile tile, Player player){
|
||||
public static void playerSpawn(Tile tile, Player player){
|
||||
if(player == null || tile == null) return;
|
||||
|
||||
CoreEntity entity = tile.bc();
|
||||
@@ -171,7 +171,7 @@ public class CoreBlock extends StorageBlock{
|
||||
}
|
||||
|
||||
public void requestSpawn(Player player){
|
||||
Call.onPlayerSpawn(tile, player);
|
||||
Call.playerSpawn(tile, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,7 +25,7 @@ public class UnitBlock extends PayloadAcceptor{
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void onUnitBlockSpawn(Tile tile){
|
||||
public static void unitBlockSpawn(Tile tile){
|
||||
if(!(tile.build instanceof UnitBlockEntity)) return;
|
||||
tile.<UnitBlockEntity>bc().spawned();
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class UnitBlock extends PayloadAcceptor{
|
||||
|
||||
@Override
|
||||
public void dumpPayload(){
|
||||
Call.onUnitBlockSpawn(tile);
|
||||
Call.unitBlockSpawn(tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user