Spigot WebSandboxMC v2.0.0

Web-based client providing an interactive glimpse of a part of your server using WebGL/HTML5

  1. satoshinm submitted a new resource:

    WebSandboxMC - Web-based client providing an interactive glimpse of a part of your server using WebGL/HTML5

    Read more about this resource...
  2. WAS


    Going to be giving this a go in the morning. From first glance and reading over things and snooping, this looks incredibly cool and unique(citation needed lol). I could see this being a cool feature for a small "interaction" area for users on mobile with WebGL/HTML on the go. Really like the prospect here.

    Okay I stayed up to give it a test and I really like it! Here is some stuff I came back with

    • When you do not have permission to edit terrain the direction of view snaps around and eventuallys points directly down at the ground. I'm sure you are aware of this.
      • If you continue clicking when it makes you look down it will let you dig down
    • When you log into the client, it shows the scripten page which looks scary at first glance (in a just unfamiliar sort of way) Is there a way to mask this with your own loading page? Maybe div z-index injection.
    • When you visit localhost:4081 you get a handshake error. Maybe forward the user to the index.html or a info page that has a means to get to index.html

    Suggestions (Most of which you may have planned already)
    1. Maybe add a Hologram API support so information could be displayed to webusers within the web view.
    2. Possibly sound support? (Is that even possible to stream and decode the packets for WebGL?)
    3. (Personal) Maybe we can figure out a way we can direct web users to my WeChat plugin so their messages come to a pre-defined room such as "WebSandbox". If interested we could chat.
    Again, great plugin going to keep track of it.
    #3 WAS, Apr 14, 2017
    Last edited: Apr 14, 2017
  3. @WAS Thanks for the positive feedback! Short answer is much of these issues/enhancements should be fixable/possible, my notes and comments inline below:

    Are you using Mozilla Firefox, if so is this issue not reproducible with Google Chrome? There is an issue in NetCraft I haven't tracked down yet where the camera retargets when clicking, but only in Firefox -- it is not intentional (https://github.com/satoshinm/NetCraft/issues/56).

    Yes I can change the Emscripten shell page arbitrarily (checked in at https://github.com/satoshinm/NetCraft/blob/master/src/shell.html), right now it is mostly the stock page but this does have the nice feature of showing the spinning progress indicator while the JavaScript downloads and starts to run. Maybe allow the administrator to override the .html page with their own customized copy?

    Fixed in 0.4, there were some complications with the WebSocket path but now visiting http://localhost:4081/ should show the app itself, and the WebSocket path is moved to /craftws (https://github.com/satoshinm/WebSandboxMC/issues/8 and https://github.com/satoshinm/NetCraft/issues/60)

    Sound support should be possible, emscripten bridges various C audio APIs to HTML5 WebAudio, bigger issue is finding freely redistributable audio clips for various sound effects (any recommendations? note to self: http://freesound.org). Hologram API looks interesting, I assume you mean this? https://www.spigotmc.org/resources/api-hologramapi-1-7-1-8-1-9-1-10.6766/ - at a glance, seems it is using protocol hacks to send packets for rendering text. If it is possible to get this text with the Bukkit API (entity or ?), could be supportable. In general, larger picture long-term, I'd like to add more support for extending game content "mods" (there is a limited form of this in WebSandboxMC 0.3+, it is possible for web players to place 32 different colored blocks, other users on the web will see the 32 variants:

    ). Perhaps WebSandboxMC could implement the Hologram API or somehow hook into it for translating it to NetCraft. Fortuitously, Craft already does support writing text on any block (not only "signs"), but not clear how it could handle free-standing floating text (entity tracking?).

    I'd be interested in improving chat, right now I bridge it using Bukkit.getServer().broadcastMessage() (source in PlayersBridge), is there a better way to synthesize chat which would allow other plugins to interoperate freely?
  4. WAS


    Yes I am using Firefox. Additionally though, the user can remove blocks in their Web Sandbox when they don't have permission if they keep clicking.

    That would probably be the best means to provide this functionality.

    I saw that yesterday. :D

    Hmm. I am not sure. I haven't even used Hologram API yet, I just figured if it could be used within the web client it would be a easy means to display info without interfering with the sandbox world.

    This I am actually not to sure on. If we could generate a mock Player entity it wouldn't be too hard to force the Async chat event to fire with the desired information, IE, the mock Player and format and message and recipients list (all players on server or for like WeChat in a targeted room)

    This may be of some relevence https://gist.github.com/aadnk/9017880

    If we had some sort of interface or created Fake Player entity it wouldn't be hard to use that to access most of Bukkit API as said fake player.
    #6 WAS, Apr 15, 2017
    Last edited: Apr 15, 2017
  5. satoshinm updated WebSandboxMC with a new update entry:

    WebSandboxMC v0.5

    Read the rest of this update entry...
  6. satoshinm updated WebSandboxMC with a new update entry:

    WebSandboxMC v0.6

    Read the rest of this update entry...
    • Like Like x 1
  7. Fixed in WebSandboxMC v0.7 finally, there was some unusual behavior with mouse events but I added a workaround so the camera should no longer rotate when clicking.

    Currently there are no permission checks, could you point me to resources to read up on how to implement this, or I can check into it later. Right now I am just calling block.setType(), not checking for any permissions. Although the web users shouldn't be able to modify outside of the sandbox area, due to range checks, I concur respecting permissions would be useful (so you could build an unmodifiable structure in the "sandbox", then allow web users to modify a smaller subset of blocks within).

    Looked into this some more while implementing signs, turns out the same functionality can be used to render floating text anywhere (since Craft lets you write on any block, not only signs, but in actuality it lets you render text at any coordinate). Maybe an API in WebSandboxMC for other plugins to hook into? I'm thinking an API could also help address the chat integration issues (have this plugin send a cancellable event for chat, other plugins could listen for and process accordingly).

    Added in 0.6, you can now place a "craft.html" in plugins/WebSandboxMC to have it override the embedded craft.html (to get the original copy to start with, either extract from the jar or save from http://localhost:4081/). I removed some clutter from the default shell page, too (no more resize/lock/fullscreen controls, only the loading spinner, graphical console, and text console). You can also include craft.js and craft.html.mem to manually update beyond the embedded version of NetCraft, if needed.
  8. NullBlox


    This needs more Hype!
    • Like Like x 3
    • Agree Agree x 1
  9. WAS


    Wow this plugin is really coming along.
    I was already pre-thinking this. And again I can't seem to grasp any way to get the web client users into the Bukkit API as a player. Probably just my limitation of the API. I know that you can change the UUID of a player. I'm wondering if it's possible to clone a player instance, and than change the information to make it "unique" to pass around the API as a fake player. Changing the Name and UUID with a UUID.randomUUID() would probably suffice. Than you could add permissions, check permissions, etc.
    Wow I didn't even know that. And yeah in light of that it all it probably would be good to just wait for an API to implement the customizations on a per-server basis.
    :D Yay! Didn't even realize that was added. Going to give it a try later tonight or in the morning.
  10. NullBlox


    This is a Concept icon for "WebSandboxMc"
    I was not asked to do this but if you like the concept/idea I would love to work on it further.
    (no charges, just would like to do what I can to help promote your work.)

    The concept icon is based off that the plugin is connecting to a Sandbox, but allows you to Connect through a Window aka browser.
    So the icon is to represent that WebSandboxMC will allow you to do.
    IE: connect through a web window (browser) to your sandbox (server).

    ~NullBlox / ZachryWilsn
    • Friendly Friendly x 2
  11. WAS


    It could use some work for sure but I super duper love the idea. Like thats super unique for the plugin. +Kudos I could help ya if ya want. Would give me an excuse to use Photoshop. Seasoned vet of 15+ years of use. Just been so busy with life to do anything business wise with my artistic side.
  12. NullBlox


    I think would depend on if the Developer likes the idea or not.
    Your more than welcome to create a design/logo/icon based off my concept. (Mainly I just wanted to help Hype this plugin.)
    I honestly do better with Modeling 3D for Minecraft but have fun using photoshop also.
  13. Tried the plugin and I really love it! Though it misses alot of blocks, tested in 1.11.2 (Paper) and it works awesome! Though, when I specify a custom area, I see my land flying XD

    Also, I've noticed while I press TAB to disable fly-mode, I go through the ground and while I see the sheep ingame, it suffocates and die.

    Then the webguest can't move, refreshing the page fixes it, but it happens again and adds another webguest. It seems not to eliminate inactive webguests. Players can kill those sheep (the ones who are logged in the Java one)

    Sorry if its unclear, my english sucks :C
    • Informative Informative x 2
  14. @NullBlox Thanks for the icon, looks great! I like it much better than my quick resized screenshot of Google Chrome :). Added it as the plugin resource's icon.
    • Like Like x 1
  15. i went the the co ordinates in the config but i can't see where my net player is in my game. what am i missing? please help me.
  16. satoshinm updated WebSandboxMC with a new update entry:

    WebSandboxMC v0.9

    Read the rest of this update entry...
    • Like Like x 1