Improvements to annotation code generation system, client RMI
This commit is contained in:
@@ -2,7 +2,8 @@ package io.anuke.mindustry.net;
|
||||
|
||||
import com.badlogic.gdx.utils.Pools;
|
||||
import io.anuke.annotations.Annotations.Local;
|
||||
import io.anuke.annotations.Annotations.Remote;
|
||||
import io.anuke.annotations.Annotations.RemoteClient;
|
||||
import io.anuke.annotations.Annotations.RemoteServer;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.SyncEntity;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
@@ -17,7 +18,7 @@ import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class NetEvents {
|
||||
|
||||
@Remote
|
||||
@RemoteClient
|
||||
@Local
|
||||
public static void friendlyFireChange(boolean enabled){
|
||||
state.friendlyFire = enabled;
|
||||
@@ -25,6 +26,17 @@ public class NetEvents {
|
||||
if(Net.server()) netCommon.sendMessage(enabled ? "[accent]Friendly fire enabled." : "[accent]Friendly fire disabled.");
|
||||
}
|
||||
|
||||
@RemoteServer
|
||||
public static void notifySomethingFromClient(Player player, int x, float y){
|
||||
|
||||
}
|
||||
|
||||
@RemoteClient
|
||||
@Local
|
||||
public static void notifySomethingFromServerLocal(int y, float x, boolean w){
|
||||
|
||||
}
|
||||
|
||||
public static void handleGameOver(){
|
||||
Net.send(Pools.obtain(GameOverPacket.class), SendMode.tcp);
|
||||
}
|
||||
@@ -116,7 +128,7 @@ public class NetEvents {
|
||||
Net.send(packet, SendMode.tcp);
|
||||
}
|
||||
|
||||
@Remote
|
||||
@RemoteClient
|
||||
@Local
|
||||
public static void adminSet(Player player, boolean admin){
|
||||
player.isAdmin = admin;
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.badlogic.gdx.utils.reflect.ReflectionException;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.SyncEntity;
|
||||
import io.anuke.mindustry.gen.CallEvent;
|
||||
import io.anuke.mindustry.gen.CallClient;
|
||||
import io.anuke.mindustry.io.Version;
|
||||
import io.anuke.mindustry.net.Packet.ImportantPacket;
|
||||
import io.anuke.mindustry.net.Packet.UnimportantPacket;
|
||||
@@ -43,9 +43,11 @@ public class Packets {
|
||||
type = buffer.get();
|
||||
|
||||
if(Net.client()){
|
||||
CallEvent.readPacket(buffer, type);
|
||||
CallClient.readPacket(buffer, type);
|
||||
}else{
|
||||
buffer.position(buffer.position() + writeLength);
|
||||
byte[] bytes = new byte[writeLength];
|
||||
buffer.get(bytes);
|
||||
writeBuffer = ByteBuffer.wrap(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user