Skip to content

Commit

Permalink
Fixed invalid web servers, teleporter clearing, desktop input misplace
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Mar 9, 2018
1 parent b008608 commit 2a306d7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions core/assets/version.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Autogenerated file. Do not modify.
#Thu Mar 08 18:52:47 EST 2018
#Thu Mar 08 20:46:47 EST 2018
version=release
androidBuildCode=356
androidBuildCode=357
name=Mindustry
code=3.4
build=33
12 changes: 8 additions & 4 deletions core/src/io/anuke/mindustry/input/DesktopInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public class DesktopInput extends InputHandler{
private boolean beganBreak;
private boolean rotated = false, rotatedAlt, zoomed;

@Override public float getCursorEndX(){ return endx; }
@Override public float getCursorEndY(){ return endy; }
@Override public float getCursorX(){ return (int)(Graphics.screen(mousex, mousey).x + 2); }
@Override public float getCursorY(){ return (int)(Gdx.graphics.getHeight() - 1 - Graphics.screen(mousex, mousey).y); }
@Override public float getCursorEndX(){ return select() ? getCursorX() : endx; }
@Override public float getCursorEndY(){ return select() ? getCursorY() : endy; }
@Override public float getCursorX(){ return (int)(Graphics.screen(mousex, mousey).x); }
@Override public float getCursorY(){ return (int)(Gdx.graphics.getHeight() - Graphics.screen(mousex, mousey).y); }
@Override public boolean drawPlace(){ return !beganBreak; }

@Override
Expand Down Expand Up @@ -156,6 +156,10 @@ public void update(){

}

boolean select(){
return !Inputs.keyDown("select") && !Inputs.keyRelease("select");
}

public int tilex(){
return (recipe != null && recipe.result.isMultiblock() &&
recipe.result.width % 2 == 0) ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Arrays;

import static io.anuke.mindustry.Vars.syncBlockState;

Expand Down Expand Up @@ -55,6 +56,7 @@ public void configure(Tile tile, byte data) {
TeleporterEntity entity = tile.entity();
if(entity != null){
entity.color = data;
Arrays.fill(entity.items, 0);
}
}

Expand Down
8 changes: 6 additions & 2 deletions html/src/io/anuke/mindustry/client/WebsocketClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ public void onClose() {

@Override
public void onMessage(String msg) {
Host host = NetworkIO.readServerData(address, ByteBuffer.wrap(Base64Coder.decode(msg)));
valid.accept(host);
byte[] bytes = Base64Coder.decode(msg);
Host host = NetworkIO.readServerData(address, ByteBuffer.wrap(bytes));
if(bytes.length != 128)
valid.accept(new Host("Unknown", address, "Unknown", 0, 0, 0));
else
valid.accept(host);
accepted[0] = true;
socket.close();
}
Expand Down

0 comments on commit 2a306d7

Please sign in to comment.