Blockland Forums > Modification Help
how to make a gui only useable by the host?
(1/4) > >>
Ipquarx:
how would i make a gui host-only while still being dedicated-compatible?
in other words, how do i make a gui non-hackable. (by hack i mean mess with client-sided functions to make it work when its not supposed to)
BlockStar:
Make it client-sided.
Greek2me:
What's the purpose of the GUI?

If it interacts with the server, make everything it does be checked by the server to see if they're the host. This includes opening the GUI and any commands they might be able to do with it. Of course, they could change the client script to allow them to open the GUI, but the server prevents them from changing anything.

If the GUI is purely client-sided, I don't think you can block it.
Iban:
Let me make this clear:
There is absolutely nothing you can do to keep people from messing with client-sided scripts. Absolutely NOTHING. You can open your admin gui as a non-admin in Blockland, as well.

But you CAN make sure things are peachy server-side.

client.cs

--- Code: ---// $IAmAdmin can be manually altered or this check can be removed altogether.
function SomethingGUI::doSomething(%gui)
{
if($IAmAdmin)
commandToServer('doSomething');
}
--- End code ---

server.cs

--- Code: ---// This check cannot be forged unless the server admin does something stupid.
function serverCmdDoSomething(%client)
{
if(%client.isAdmin)
%client.doSomething();
}
--- End code ---
Ipquarx:
that sounds good, allright.
but i have a few questions:
1. do they have to be servercmds?
2. how do i make it dedicated compatible? in other words, how do i make it function properly without using canvas.
3. would makeing it dedicated compatible require client files?
Navigation
Message Index
Next page

Go to full version