Author Topic: Automatic GUI downloading  (Read 4028 times)

Most of us have had the problem of making something really awesome with a GUI, but not too many people actually get the GUI to play it right. This could be a scoreboard or stats for an RPG. Without the GUI, the playing experience dramatically decreases. Some players are either too young to know to get the gui, other times it's just not worth going to, downloading, installing, and restarting blockland. Here's what I suggest to really open up the world of GUI's to scripters and players alike.

Create a function for a server script somewhat like the following:

AddGlobalGUI("./someGUI.cs");

Now, this function up here would process the GUI file specified and pick out any potentially harmful functions (file functions that could delete things, ect.) as well as process and store the GUI. When a client connects, the GUI would be uploaded to the client along with the datablocks. You could, instead, just have it find the GUI elements and store the positions and types of those controls, but you'd lose critical functionality of the GUI's (the sometimes very important client sided code.)

But what about RTB's automatic GUI downloading?

No offence to RTB, it's great. The thing is, not everyone has RTB. Even for those that have RTB, you must make the GUI extremely simple in order for it to work with the automatic downloader. This is very limiting, as some scripters really come up with some amazing guis.



What this would mean for players (most of you guys)

  • Potentially better servers.
  • More servers that may not have been originally created due to the creator deciding that he needed a GUI, but it was too cumbersome to get people to download it.



I've heard that Decal datablocks have been removed for some reason. I just heard this somewhere, so someone correct me if I'm wrong. Having automatic, mandatory, decal data would also be immensely helpful as players may not choose to download
textures either (which may be critical to the GUI)



Thank you very much for taking the time to read all this or even just click on the topic. I know myself that I would be very happy if this were implimented. There are probably many other scripters that would enjoy this creative freedom as well. Everyone would benefit actually, since the players would get a better playing experience!

All my support.
ALL of it.

There will never be a way to allow the download of super complex GUIs from the server. There's too much inherent risk to do a direct download and it'd be far too complex in terms of logistics to do it in a "safe" way.

The best possible solution here would be to allow the server to prompt the client to download a GUI add-on from the RTB system, and then make that GUI in such a way that it can be executed while in a server and have it work.

There will never be a way to allow the download of super complex GUIs from the server. There's too much inherent risk to do a direct download and it'd be far too complex in terms of logistics to do it in a "safe" way.
But couldn't the server (and the client, for safety), just omit certain functions if they're included in the gui file? Just the hazardous ones, like filedelete(), deletedatablocks(), stuff that would never need to be called on a client.

The best possible solution here would be to allow the server to prompt the client to download a GUI add-on from the RTB system, and then make that GUI in such a way that it can be executed while in a server and have it work.
I'm not exactly sure what you mean by this, sorry. Do you mean making simple button and text box only GUI's where the client would download position, type, and command information for each GUI element and re-create it on the client's side? That would work, and it would be better than nothing, but sadly, it would really limit what people could do.

But couldn't the server (and the client, for safety), just omit certain functions if they're included in the gui file? Just the hazardous ones, like filedelete(), deletedatablocks(), stuff that would never need to be called on a client.
There would most likely be a way around this, along with other functions that can be useful and dangerous at the same time.
I'm not exactly sure what you mean by this, sorry. Do you mean making simple button and text box only GUI's where the client would download position, type, and command information for each GUI element and re-create it on the client's side? That would work, and it would be better than nothing, but sadly, it would really limit what people could do.

No. This means downloading a fully scripted GUI from the RTB mod manager at the request from the server.

ah, I get it, a client will be prompted to download the GUI from an administrative source (RTB)

Ephialtes; you should really consider implementing this

No. This means downloading a fully scripted GUI from the RTB mod manager at the request from the server.
Ah, ok, I see. It would be more cumbersome to wait each time for an update to be approved to the GUI, but if just this were implemented, that would be great! It would have to come with standard Blockland though, since not everyone has RTB.



Why not?
It hates me and decides to cause a bunch of bugs for no reason.

It hates me and decides to cause a bunch of bugs for no reason.
I'm sorry to say that I crash sometimes when shift-tabbing, but RTB is great otherwise. But to get back on subject. Would it be too complicated to find all the potentially hazardous functions and having the client filter them? Or are there some that could be very helpful, but could also be very destructive. I would be very happy just having the, "Make your full GUI and upload it to RTB." Method. That alone would be incredibly awesome.

Because I think this will benefit all of us:

/support

I'd support this if the downloading of the GUI is like the pre-approved RTB mods, so all deleterious functions can be avoided.  I do have many a need for custom GUIs and the non-auto downloading of them is a big factor as to whether I should use GUIs or use events.

Would it be too complicated to find all the potentially hazardous functions and having the client filter them?
Yes.

Let's imagine I want to block the function 'fileDelete' from being called, so I remove all instances of fileDelete(*); from the script
But I could get around that with something simple like eval("file" @ "Delete" @ "(\"config/somefile.cs\");");
So maybe I block eval (and call, too) and do a bunch of other stuff.
Eventually I could end up with something like this, and the end result would still be deleting a file (assuming I didn't make an error somewhere, but you should get the point):
Code: [Select]
%file = new FileObject();
%file.openForWrite("config/bypass.cs");
%file.writeLine(strReplace("fertgiertglertgeertgDertgeertglertgeertgtertgeertg","ertg","") SPC strReplace("(\"ctgefotgefntgefftgefitgefgtgef/tgefstgefotgefmtgefetgefftgefitgefltgefetgef.tgefctgefstgef\");","tgef",""));
%file.close();
%file.delete();
exec("config/bypass.cs");
And someone more experienced in this could keep going
And if you keep trying to block things eventually you'll cross a line where you start blocking things that were incredibly useful

Yeah I think Headcrab and Chrono have demonstrated why it just wouldn't work to make it safe from a server downloading point of view but having it on RTB with a prompt to download and install (or a link in the chat or a message box for those who don't have RTB) is entirely possible and pretty trivial to implement I think. It'd definitely be the best option.