Annotation system bugs fixed
This commit is contained in:
@@ -80,6 +80,7 @@ public class NetClient extends Module {
|
||||
|
||||
Net.handleClient(InvokePacket.class, packet -> {
|
||||
//TODO invoke it
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.utils.IntMap;
|
||||
import com.badlogic.gdx.utils.TimeUtils;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.gen.RemoteReadServer;
|
||||
import io.anuke.mindustry.net.Administration;
|
||||
import io.anuke.mindustry.net.Administration.PlayerInfo;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
@@ -49,7 +50,7 @@ public class NetServer extends Module{
|
||||
|
||||
Net.handleServer(InvokePacket.class, (id, packet) -> {
|
||||
//TODO implement
|
||||
//CallServer.readPacket(packet.writeBuffer, packet.type, connections.get(id));
|
||||
RemoteReadServer.readPacket(packet.writeBuffer, packet.type, connections.get(id));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
package io.anuke.mindustry.net;
|
||||
|
||||
import io.anuke.annotations.Annotations.Remote;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
|
||||
public class NetEvents {
|
||||
|
||||
@Remote(unreliable = true, one = true)
|
||||
public static void callClientMethod(int something, Player player, String str, boolean bool){
|
||||
System.out.println("Called " + something + " ? " + bool);
|
||||
}
|
||||
|
||||
@Remote(local = false)
|
||||
public static void someOtherMethod(Tile tile){
|
||||
System.out.println("Called with tile " + tile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.net;
|
||||
import com.badlogic.gdx.utils.TimeUtils;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.gen.RemoteReadClient;
|
||||
import io.anuke.mindustry.net.Packet.ImportantPacket;
|
||||
import io.anuke.mindustry.net.Packet.UnimportantPacket;
|
||||
|
||||
@@ -38,6 +39,7 @@ public class Packets {
|
||||
if(Net.client()){
|
||||
//TODO implement
|
||||
//CallClient.readPacket(buffer, type);
|
||||
RemoteReadClient.readPacket(buffer, type);
|
||||
}else{
|
||||
byte[] bytes = new byte[writeLength];
|
||||
buffer.get(bytes);
|
||||
|
||||
Reference in New Issue
Block a user