recieve -> receive
This commit is contained in:
@@ -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<ItemStack> stacks = origin.getRecievedItems();
|
||||
Seq<ItemStack> 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
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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<Item> getCurrentItems(Sector sector){
|
||||
ObjectIntMap<Item> 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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 <T> void handleClient(Class<T> type, Cons<T> 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 <T> void handleServer(Class<T> type, Cons2<NetConnection, T> listener){
|
||||
serverListeners.put(type, (Cons2<NetConnection, Object>)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){
|
||||
|
||||
|
||||
@@ -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<BuildPlan> rejectedRequests = new Seq<>();
|
||||
|
||||
|
||||
@@ -148,12 +148,12 @@ public class Sector{
|
||||
}
|
||||
|
||||
//TODO this should be stored in a more efficient structure, and be updated each turn
|
||||
public Seq<ItemStack> getRecievedItems(){
|
||||
return Core.settings.getJson(key("recieved-items"), Seq.class, ItemStack.class, Seq::new);
|
||||
public Seq<ItemStack> getReceivedItems(){
|
||||
return Core.settings.getJson(key("received-items"), Seq.class, ItemStack.class, Seq::new);
|
||||
}
|
||||
|
||||
public void setRecievedItems(Seq<ItemStack> stacks){
|
||||
Core.settings.putJson(key("recieved-items"), ItemStack.class, stacks);
|
||||
public void setReceivedItems(Seq<ItemStack> 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
|
||||
|
||||
@@ -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<ItemStack> dest = state.secinfo.origin.getRecievedItems();
|
||||
Seq<ItemStack> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user