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?
Having had this thing crash my own dedicated server...heres a few tips:
1) TEST it on a dedicated server (start a dedicated LAN server on your own pc, join it and go from there).
2) use a client.cs file to exec() the .gui files
3) use a /command to open the gui. The setup looks something like this:
in server.cs
function serverCmdOpenMyGui(%client)
{
if (%client== getNumKeyID() )
commandToClient(%client, 'openMyGui' );
}
in client.cs
exec("mygui.gui");
function clientCmdOpenMyGui()
{
Canvas.pushDialog(MyGui);
}
You can also try making completely seperate addons, and only distribute the client-sided one to those people you want.
Thats step 1
Once the gui is opened, you also have to check every single servercmd to make sure the client is the host. Like Iban said -- there is nothing to stop people from hacking the gui to open on their own client.
my own comments on what your trying to do:
I'm trying to use a server-sided console function that returns 1 blid associated with a specific number, and a onWake function (client-sided) that is supposed to get all the blids from that function and put them in the list. That's problem 1.
I'm using a clientcmd to open and close the GUI (client-sided). That works.
I'm using a clientcmd to refresh the GUI. I don't know if it works.
There is a text box to enter in blids which is stored in a variable, and a button to add that blid to the whitelist using a server-sided console function. That's problem 2.
I suspect a bad design of problem 1 is leading to problem #2
what I would do is this:
inside the onWake function you do 'commandToServer' and request the list of bl_ids from the server.
create a clientcmd to accept the bl_id and add it to your scrolling list in the gui
create a servercmd to loop through all your values and send them back to the client using the client cmd you just created. Send them to the client one at a time. This wont be a problem unless your whitelist includes more than 1,000 entries.
next create a servercmd that adds/creates a new entry in your global variable, and then sends that back to the client -- reuse your client cmd here as well.
Lastly -- in your gui, you just call the servercmd that creates a new entry. the servercmd then sends the result back to your client using the clientcmd you already created to add it to your scrolling list.
And in the 2 new server cmds you created, make sure to put in a check to make sure the client is the host.