satoshinm / WebSandboxMC

Bukkit plugin providing a web-based interface with an interactive WebGL 3D preview or glimpse of your server 🕷⏳📦 ⛺
https://www.spigotmc.org/resources/websandboxmc.39415/
MIT License
19 stars 5 forks source link

Teleport web clients who exit the sandbox back to within it? #63

Open satoshinm opened 7 years ago

satoshinm commented 7 years ago
--- a/src/main/java/io/github/satoshinm/WebSandboxMC/bridge/WebPlayerBridge.java
+++ b/src/main/java/io/github/satoshinm/WebSandboxMC/bridge/WebPlayerBridge.java
@@ -120,6 +120,8 @@ public class WebPlayerBridge {

         if (constrainToSandbox && !webSocketServerThread.blockBridge.withinSandboxRange(location)) {
             webSocketServerThread.log(Level.FINEST, "client tried to move outside of sandbox: "+location);
+            webSocketServerThread.sendLine(channel, "P,"+entity.getEntityId()+","+
+                    webSocketServerThread.playersBridge.encodeLocation(webSocketServerThread.blockBridge.spawnLocation));
             return;
         }

has no apparent effect

satoshinm commented 7 years ago

Or now that barrier blocks https://github.com/satoshinm/WebSandboxMC/issues/55 are implemented, they could be spawned around the sandbox for an invisible wall