mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-03 13:30:25 +07:00
Fixed some important crashes and multithreading issues
This commit is contained in:
parent
d948607039
commit
b9b34eea37
@ -14,10 +14,7 @@ import javax.lang.model.element.ExecutableElement;
|
||||
import javax.lang.model.element.Modifier;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
import javax.tools.Diagnostic.Kind;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@ -87,6 +84,9 @@ public class RemoteMethodAnnotationProcessor extends AbstractProcessor {
|
||||
//list of all method entries
|
||||
classes = new ArrayList<>();
|
||||
|
||||
List<Element> orderedElements = new ArrayList<>(elements);
|
||||
orderedElements.sort(Comparator.comparing(Object::toString));
|
||||
|
||||
//create methods
|
||||
for (Element element : elements) {
|
||||
Remote annotation = element.getAnnotation(Remote.class);
|
||||
|
@ -93,6 +93,11 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if(to == null){
|
||||
remove();
|
||||
return;
|
||||
}
|
||||
|
||||
super.update();
|
||||
current.set(from).interpolate(tovec.set(to.getX(), to.getY()), fin(), Interpolation.pow3);
|
||||
current.add(tovec.set(to.getX(), to.getY()).sub(from).nor().rotate90(1).scl(seed * fslope() * 10f));
|
||||
|
@ -27,6 +27,7 @@ import java.util.List;
|
||||
|
||||
import static io.anuke.mindustry.Vars.netClient;
|
||||
import static io.anuke.mindustry.Vars.port;
|
||||
import static io.anuke.mindustry.Vars.threads;
|
||||
|
||||
public class KryoClient implements ClientProvider{
|
||||
Client client;
|
||||
@ -64,14 +65,14 @@ public class KryoClient implements ClientProvider{
|
||||
c.id = connection.getID();
|
||||
if(connection.getRemoteAddressTCP() != null) c.addressTCP = connection.getRemoteAddressTCP().toString();
|
||||
|
||||
Gdx.app.postRunnable(() -> Net.handleClientReceived(c));
|
||||
threads.runDelay(() -> Net.handleClientReceived(c));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnected (Connection connection) {
|
||||
Disconnect c = new Disconnect();
|
||||
|
||||
Gdx.app.postRunnable(() -> Net.handleClientReceived(c));
|
||||
threads.runDelay(() -> Net.handleClientReceived(c));
|
||||
if(connection.getLastProtocolError() != null) Log.error("\n\n\n\nProtocol error: " + connection.getLastProtocolError() + "\n\n\n\n");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user