From f9b6b8e5b70eaa38a8f6e1645a65b63ca43d9a12 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 14 Jul 2020 11:16:32 -0400 Subject: [PATCH] recieve -> receive --- core/src/mindustry/core/Logic.java | 16 ++++++++-------- core/src/mindustry/core/NetClient.java | 4 ++-- core/src/mindustry/core/NetServer.java | 10 +++++----- .../entities/bullet/MassDriverBolt.java | 2 +- core/src/mindustry/game/EventType.java | 6 +++--- core/src/mindustry/game/SectorInfo.java | 6 +++--- core/src/mindustry/net/ArcNetProvider.java | 2 +- core/src/mindustry/net/Net.java | 12 ++++++------ core/src/mindustry/net/NetConnection.java | 8 ++++---- core/src/mindustry/type/Sector.java | 8 ++++---- .../world/blocks/campaign/LaunchPad.java | 4 ++-- .../world/blocks/distribution/MassDriver.java | 4 ++-- .../mindustry/world/modules/LiquidModule.java | 2 +- desktop/src/mindustry/desktop/steam/SNet.java | 2 +- desktop/src/mindustry/desktop/steam/SStats.java | 4 ++-- gradle.properties | 2 +- server/src/mindustry/server/ServerControl.java | 2 +- 17 files changed, 47 insertions(+), 47 deletions(-) diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index ef09b2046d..82afbd483f 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -103,16 +103,16 @@ public class Logic implements ApplicationListener{ if(state.rules.sector.save != null && core != null){ //add produced items - //TODO move to recieved items + //TODO move to received items state.rules.sector.save.meta.secinfo.production.each((item, stat) -> { core.items.add(item, (int)(stat.mean * seconds)); }); - //add recieved items - state.rules.sector.getRecievedItems().each(stack -> core.items.add(stack.item, stack.amount)); + //add received items + state.rules.sector.getReceivedItems().each(stack -> core.items.add(stack.item, stack.amount)); - //clear recieved items - state.rules.sector.setRecievedItems(new Seq<>()); + //clear received items + state.rules.sector.setReceivedItems(new Seq<>()); //validation for(Item item : content.items()){ @@ -274,15 +274,15 @@ public class Logic implements ApplicationListener{ Time.runTask(30f, () -> { Sector origin = sector.save.meta.secinfo.origin; if(origin != null){ - Seq stacks = origin.getRecievedItems(); + Seq stacks = origin.getReceivedItems(); //add up all items into list for(Building entity : state.teams.playerCores()){ entity.items.each((item, amount) -> ItemStack.insert(stacks, item, amount)); } - //save recieved items - origin.setRecievedItems(stacks); + //save received items + origin.setReceivedItems(stacks); } //remove all the cores diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index 25d80e6194..cf9a784829 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -118,7 +118,7 @@ public class NetClient implements ApplicationListener{ }); net.handleClient(WorldStream.class, data -> { - Log.info("Recieved world data: @ bytes.", data.stream.available()); + Log.info("Received world data: @ bytes.", data.stream.available()); NetworkIO.loadWorld(new InflaterInputStream(data.stream)); finishConnecting(); @@ -172,7 +172,7 @@ public class NetClient implements ApplicationListener{ } } - //called when a server recieves a chat message from a player + //called when a server receives a chat message from a player @Remote(called = Loc.server, targets = Loc.client) public static void sendChatMessage(Player player, String message){ if(message.length() > maxTextLength){ diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index d3c3f38cff..5c6b403773 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -540,11 +540,11 @@ public class NetServer implements ApplicationListener{ float viewX, float viewY, float viewWidth, float viewHeight ){ NetConnection con = player.con; - if(con == null || snapshotID < con.lastRecievedClientSnapshot) return; + if(con == null || snapshotID < con.lastReceivedClientSnapshot) return; boolean verifyPosition = !player.dead() && netServer.admins.getStrict() && headless; - if(con.lastRecievedClientTime == 0) con.lastRecievedClientTime = Time.millis() - 16; + if(con.lastReceivedClientTime == 0) con.lastReceivedClientTime = Time.millis() - 16; con.viewX = viewX; con.viewY = viewY; @@ -606,7 +606,7 @@ public class NetServer implements ApplicationListener{ Unit unit = player.unit(); unit.vel.set(xVelocity, yVelocity).limit(unit.type().speed); - long elapsed = Time.timeSinceMillis(con.lastRecievedClientTime); + long elapsed = Time.timeSinceMillis(con.lastReceivedClientTime); float maxSpeed = player.unit().type().speed; float maxMove = elapsed / 1000f * 60f * maxSpeed * 1.1f; @@ -663,8 +663,8 @@ public class NetServer implements ApplicationListener{ player.y = y; } - con.lastRecievedClientSnapshot = snapshotID; - con.lastRecievedClientTime = Time.millis(); + con.lastReceivedClientSnapshot = snapshotID; + con.lastReceivedClientTime = Time.millis(); } @Remote(targets = Loc.client, called = Loc.server) diff --git a/core/src/mindustry/entities/bullet/MassDriverBolt.java b/core/src/mindustry/entities/bullet/MassDriverBolt.java index 61c6d4c2bc..70d3c6de9b 100644 --- a/core/src/mindustry/entities/bullet/MassDriverBolt.java +++ b/core/src/mindustry/entities/bullet/MassDriverBolt.java @@ -73,7 +73,7 @@ public class MassDriverBolt extends BulletType{ //if on course and it's in range of the target if(Math.abs(dst1 + dst2 - baseDst) < 4f && dst2 <= hitDst){ intersect = true; - } //else, bullet has gone off course, does not get recieved. + } //else, bullet has gone off course, does not get received. if(intersect){ data.to.handlePayload(b, data); diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index 8915a6917b..e3915e4b45 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -48,9 +48,9 @@ public class EventType{ public static class TurnEvent{} /** Called when the player places a line, mobile or desktop.*/ public static class LineConfirmEvent{} - /** Called when a turret recieves ammo, but only when the tutorial is active! */ + /** Called when a turret receives ammo, but only when the tutorial is active! */ public static class TurretAmmoDeliverEvent{} - /** Called when a core recieves ammo, but only when the tutorial is active! */ + /** Called when a core receives ammo, but only when the tutorial is active! */ public static class CoreItemDeliverEvent{} /** Called when the player opens info for a specific block.*/ public static class BlockInfoEvent{} @@ -307,7 +307,7 @@ public class EventType{ } } - /** Called after connecting; when a player recieves world data and is ready to play.*/ + /** Called after connecting; when a player receives world data and is ready to play.*/ public static class PlayerJoin{ public final Player player; diff --git a/core/src/mindustry/game/SectorInfo.java b/core/src/mindustry/game/SectorInfo.java index b9d7502e6a..9101bfc4b4 100644 --- a/core/src/mindustry/game/SectorInfo.java +++ b/core/src/mindustry/game/SectorInfo.java @@ -140,14 +140,14 @@ public class SectorInfo{ } } - /** @return the items in this sector now, taking into account production and items recieved. */ + /** @return the items in this sector now, taking into account production and items received. */ public ObjectIntMap getCurrentItems(Sector sector){ ObjectIntMap map = new ObjectIntMap<>(); map.putAll(coreItems); long seconds = sector.getSecondsPassed(); production.each((item, stat) -> map.increment(item, (int)(stat.mean * seconds))); - //increment based on recieved items - sector.getRecievedItems().each(stack -> map.increment(stack.item, stack.amount)); + //increment based on received items + sector.getReceivedItems().each(stack -> map.increment(stack.item, stack.amount)); return map; } diff --git a/core/src/mindustry/net/ArcNetProvider.java b/core/src/mindustry/net/ArcNetProvider.java index ea30157955..eff7c3e95d 100644 --- a/core/src/mindustry/net/ArcNetProvider.java +++ b/core/src/mindustry/net/ArcNetProvider.java @@ -85,7 +85,7 @@ public class ArcNetProvider implements NetProvider{ Connect c = new Connect(); c.addressTCP = ip; - Log.debug("&bRecieved connection: @", c.addressTCP); + Log.debug("&bReceived connection: @", c.addressTCP); connections.add(kn); Core.app.post(() -> net.handleServerReceived(kn, c)); diff --git a/core/src/mindustry/net/Net.java b/core/src/mindustry/net/Net.java index 5101d237ee..cd25c44143 100644 --- a/core/src/mindustry/net/Net.java +++ b/core/src/mindustry/net/Net.java @@ -85,7 +85,7 @@ public class Net{ } /** - * Sets the client loaded status, or whether it will recieve normal packets from the server. + * Sets the client loaded status, or whether it will receive normal packets from the server. */ public void setClientLoaded(boolean loaded){ clientLoaded = loaded; @@ -205,21 +205,21 @@ public class Net{ } /** - * Registers a client listener for when an object is recieved. + * Registers a client listener for when an object is received. */ public void handleClient(Class type, Cons listener){ clientListeners.put(type, listener); } /** - * Registers a server listener for when an object is recieved. + * Registers a server listener for when an object is received. */ public void handleServer(Class type, Cons2 listener){ serverListeners.put(type, (Cons2)listener); } /** - * Call to handle a packet being recieved for the client. + * Call to handle a packet being received for the client. */ public void handleClientReceived(Object object){ @@ -231,7 +231,7 @@ public class Net{ StreamChunk c = (StreamChunk)object; StreamBuilder builder = streams.get(c.id); if(builder == null){ - throw new RuntimeException("Recieved stream chunk without a StreamBegin beforehand!"); + throw new RuntimeException("Received stream chunk without a StreamBegin beforehand!"); } builder.add(c.data); if(builder.isDone()){ @@ -256,7 +256,7 @@ public class Net{ } /** - * Call to handle a packet being recieved for the server. + * Call to handle a packet being received for the server. */ public void handleServerReceived(NetConnection connection, Object object){ diff --git a/core/src/mindustry/net/NetConnection.java b/core/src/mindustry/net/NetConnection.java index d3f6ff051f..2cad7d40e8 100644 --- a/core/src/mindustry/net/NetConnection.java +++ b/core/src/mindustry/net/NetConnection.java @@ -22,10 +22,10 @@ public abstract class NetConnection{ public @Nullable Unitc lastUnit; public Vec2 lastPosition = new Vec2(); - /** ID of last recieved client snapshot. */ - public int lastRecievedClientSnapshot = -1; - /** Timestamp of last recieved snapshot. */ - public long lastRecievedClientTime; + /** ID of last received client snapshot. */ + public int lastReceivedClientSnapshot = -1; + /** Timestamp of last received snapshot. */ + public long lastReceivedClientTime; /** Build requests that have been recently rejected. This is cleared every snapshot. */ public Seq rejectedRequests = new Seq<>(); diff --git a/core/src/mindustry/type/Sector.java b/core/src/mindustry/type/Sector.java index f694358e9b..579b687417 100644 --- a/core/src/mindustry/type/Sector.java +++ b/core/src/mindustry/type/Sector.java @@ -148,12 +148,12 @@ public class Sector{ } //TODO this should be stored in a more efficient structure, and be updated each turn - public Seq getRecievedItems(){ - return Core.settings.getJson(key("recieved-items"), Seq.class, ItemStack.class, Seq::new); + public Seq getReceivedItems(){ + return Core.settings.getJson(key("received-items"), Seq.class, ItemStack.class, Seq::new); } - public void setRecievedItems(Seq stacks){ - Core.settings.putJson(key("recieved-items"), ItemStack.class, stacks); + public void setReceivedItems(Seq stacks){ + Core.settings.putJson(key("received-items"), ItemStack.class, stacks); } //TODO these methods should maybe move somewhere else and/or be contained in a data object diff --git a/core/src/mindustry/world/blocks/campaign/LaunchPad.java b/core/src/mindustry/world/blocks/campaign/LaunchPad.java index 9bf9d6bc2b..b67589769e 100644 --- a/core/src/mindustry/world/blocks/campaign/LaunchPad.java +++ b/core/src/mindustry/world/blocks/campaign/LaunchPad.java @@ -177,7 +177,7 @@ public class LaunchPad extends Block{ //actually launch the items upon removal if(team() == state.rules.defaultTeam && state.secinfo.origin != null){ - Seq dest = state.secinfo.origin.getRecievedItems(); + Seq dest = state.secinfo.origin.getReceivedItems(); for(ItemStack stack : stacks){ ItemStack sto = dest.find(i -> i.item == stack.item); @@ -192,7 +192,7 @@ public class LaunchPad extends Block{ Events.fire(new LaunchItemEvent(stack)); } - state.secinfo.origin.setRecievedItems(dest); + state.secinfo.origin.setReceivedItems(dest); } } } diff --git a/core/src/mindustry/world/blocks/distribution/MassDriver.java b/core/src/mindustry/world/blocks/distribution/MassDriver.java index af243a54e9..eeb4b639a5 100644 --- a/core/src/mindustry/world/blocks/distribution/MassDriver.java +++ b/core/src/mindustry/world/blocks/distribution/MassDriver.java @@ -29,7 +29,7 @@ public class MassDriver extends Block{ public float bulletLifetime = 200f; public Effect shootEffect = Fx.shootBig2; public Effect smokeEffect = Fx.shootBigSmoke2; - public Effect recieveEffect = Fx.mineBig; + public Effect receiveEffect = Fx.mineBig; public float shake = 3f; public @Load("@-base") TextureRegion baseRegion; @@ -281,7 +281,7 @@ public class MassDriver extends Block{ } Effects.shake(shake, shake, this); - recieveEffect.at(bullet); + receiveEffect.at(bullet); reload = 1f; bullet.remove(); diff --git a/core/src/mindustry/world/modules/LiquidModule.java b/core/src/mindustry/world/modules/LiquidModule.java index 067278df04..b746b57b0c 100644 --- a/core/src/mindustry/world/modules/LiquidModule.java +++ b/core/src/mindustry/world/modules/LiquidModule.java @@ -51,7 +51,7 @@ public class LiquidModule extends BlockModule{ return total; } - /** Last recieved or loaded liquid. Only valid for liquid modules with 1 type of liquid. */ + /** Last received or loaded liquid. Only valid for liquid modules with 1 type of liquid. */ public Liquid current(){ return current; } diff --git a/desktop/src/mindustry/desktop/steam/SNet.java b/desktop/src/mindustry/desktop/steam/SNet.java index b18272e652..ab12f0718e 100644 --- a/desktop/src/mindustry/desktop/steam/SNet.java +++ b/desktop/src/mindustry/desktop/steam/SNet.java @@ -67,7 +67,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, Connect c = new Connect(); c.addressTCP = "steam:" + from.getAccountID(); - Log.info("&bRecieved STEAM connection: @", c.addressTCP); + Log.info("&bReceived STEAM connection: @", c.addressTCP); steamConnections.put(from.getAccountID(), con); connections.add(con); diff --git a/desktop/src/mindustry/desktop/steam/SStats.java b/desktop/src/mindustry/desktop/steam/SStats.java index 48b24c45ee..60b85912b0 100644 --- a/desktop/src/mindustry/desktop/steam/SStats.java +++ b/desktop/src/mindustry/desktop/steam/SStats.java @@ -283,9 +283,9 @@ public class SStats implements SteamUserStatsCallback{ registerEvents(); if(result != SteamResult.OK){ - Log.err("Failed to recieve steam stats: @", result); + Log.err("Failed to receive steam stats: @", result); }else{ - Log.info("Recieved steam stats."); + Log.info("Received steam stats."); } } diff --git a/gradle.properties b/gradle.properties index 8c888693d8..69847eca70 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=1fa9e78b9a7a83090ec942fbc3c3ff6d8a25ebcf +archash=16be283e409ce6ddcc96f20b57c67ced35d418d4 diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index 177b16fc51..863e7763f8 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -989,7 +989,7 @@ public class ServerControl implements ApplicationListener{ serverSocket.bind(new InetSocketAddress(Config.socketInputAddress.string(), Config.socketInputPort.num())); while(true){ Socket client = serverSocket.accept(); - info("&lmRecieved command socket connection: &lb@", serverSocket.getLocalSocketAddress()); + info("&lmReceived command socket connection: &lb@", serverSocket.getLocalSocketAddress()); BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream())); socketOutput = new PrintWriter(client.getOutputStream(), true); String line;