mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-19 19:59:37 +00:00
Registered the rcon fake player in the swing active list.
This commit is contained in:
1 parent
3692055926
commit
6faaf46b80
3 files changed
+6
-3
No files matched your search
@@ -42,6 +42,9 @@ public enum PlayerTracker{
|
||||
}
|
||||
|
||||
public AccessLevel getPlayerAccessLevel(String name){
|
||||
|
||||
//TODO : This should be made proper. Right now, this is a security risk with mods changing names.
|
||||
//TODO : Maybe use uuid as a name and check here against the RconServer list of uuids ?
|
||||
if (name.startsWith("RConInboundHandler"))
|
||||
return AccessLevel.PRIVILEGED;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import mcp.mobius.opis.events.PlayerTracker;
|
||||
import mcp.mobius.opis.network.PacketBase;
|
||||
import mcp.mobius.opis.network.enums.Message;
|
||||
import mcp.mobius.opis.network.packets.client.PacketReqData;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
@@ -28,6 +29,8 @@ class RConInboundHandler extends ChannelInboundHandlerAdapter{
|
||||
FakePlayer fakePlayer = FakePlayerFactory.get(DimensionManager.getWorld(0), new GameProfile(fakeUUID, ctx.name()));
|
||||
RConServer.instance.fakePlayers.put(fakePlayer, ctx);
|
||||
|
||||
PlayerTracker.INSTANCE.playersSwing.add(fakePlayer);
|
||||
|
||||
modOpis.log.info(String.format("Connection to rcon detected. FakePlayer %s with uuid %s created.", ctx.name(), fakeUUID));
|
||||
|
||||
}
|
||||
|
||||
@@ -102,9 +102,6 @@ public class RConServer implements Runnable {
|
||||
buf.writeBytes(data);
|
||||
ctx.write(buf);
|
||||
ctx.flush();
|
||||
|
||||
modOpis.log.info("We should be sending back something here");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user