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