Annotation system bugs fixed

This commit is contained in:
Anuken
2018-06-06 20:56:59 -04:00
parent 9e136bad94
commit c443eee15d
9 changed files with 60 additions and 35 deletions

View File

@@ -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);
}
}

View File

@@ -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);