mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-04-18 03:22:50 -07:00
Bugfixes
This commit is contained in:
parent
7655b65363
commit
1e0067d64b
5 changed files with 19 additions and 5 deletions
|
|
@ -481,8 +481,7 @@ public class NetClient implements ApplicationListener{
|
|||
connecting = false;
|
||||
ui.join.hide();
|
||||
net.setClientLoaded(true);
|
||||
//TODO connect confirm
|
||||
//Core.app.post(Call::connectConfirm);
|
||||
Core.app.post(Call::connectConfirm);
|
||||
Time.runTask(40f, platform::updateRPC);
|
||||
Core.app.post(() -> ui.loadfrag.hide());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import arc.math.*;
|
|||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import arc.util.CommandHandler.*;
|
||||
import arc.util.io.*;
|
||||
import arc.util.serialization.*;
|
||||
|
|
@ -501,7 +502,7 @@ public class NetServer implements ApplicationListener{
|
|||
float xVelocity, float yVelocity,
|
||||
Tile mining,
|
||||
boolean boosting, boolean shooting, boolean chatting,
|
||||
BuildRequest[] requests,
|
||||
@Nullable BuildRequest[] requests,
|
||||
float viewX, float viewY, float viewWidth, float viewHeight
|
||||
){
|
||||
NetConnection connection = player.con();
|
||||
|
|
|
|||
|
|
@ -100,7 +100,12 @@ public class MusicControl{
|
|||
/** Plays and fades in a music track. This must be called every frame.
|
||||
* If something is already playing, fades out that track and fades in this new music.*/
|
||||
private void play(@Nullable Music music){
|
||||
if(!shouldPlay()) return;
|
||||
if(!shouldPlay()){
|
||||
if(current != null){
|
||||
current.setVolume(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//update volume of current track
|
||||
if(current != null){
|
||||
|
|
|
|||
|
|
@ -119,6 +119,11 @@ public class TypeIO{
|
|||
}
|
||||
|
||||
public static void writeRequests(Writes write, BuildRequest[] requests){
|
||||
if(requests == null){
|
||||
write.s(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
write.s((short)requests.length);
|
||||
for(BuildRequest request : requests){
|
||||
write.b(request.breaking ? (byte)1 : 0);
|
||||
|
|
@ -134,6 +139,10 @@ public class TypeIO{
|
|||
|
||||
public static BuildRequest[] readRequests(Reads read){
|
||||
short reqamount = read.s();
|
||||
if(reqamount == -1){
|
||||
return null;
|
||||
}
|
||||
|
||||
BuildRequest[] reqs = new BuildRequest[reqamount];
|
||||
for(int i = 0; i < reqamount; i++){
|
||||
byte type = read.b();
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public class Packets{
|
|||
type = buffer.get();
|
||||
priority = buffer.get();
|
||||
short writeLength = buffer.getShort();
|
||||
byte[] bytes = new byte[writeLength];
|
||||
bytes = new byte[writeLength];
|
||||
buffer.get(bytes);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue