Author Topic: Commands Manager GUI [My First Add-On Ever]  (Read 10536 times)

Some of the server commands on the GUI do not require restricted access (such as the dup, which has RTB prefs for admin-only usage), which should.

This could be a very nice GUI mod if it didn't bypass certain necessary restrictions.

Edit: Took another look at the code. Everything should still work normally, since most of the default server commands already have an admin check in the main function, but you always get a message in chat which is somewhat annoying. It would be nice if the admin-only commands had a check on them to return the function
« Last Edit: July 20, 2015, 01:02:15 AM by Goth77 »

You have short-cutted many main functions of Blockland via GUI without packaging, and have restricted basic admin abilities. I would suggest this to be fail-binned unless you package your functions and allow this mod to work without overwriting certain addon-default functionality. Some of the server commands on the GUI do not require restricted access (such as the dup, which has RTB prefs for client and server-side load, along with basic admin restriction), which should.

This could be a very nice GUI mod if it didn't bypass certain necessary restrictions.

Can you show where exactly that is, in the code? (provide examples)

You have short-cutted many main functions of Blockland via GUI without packaging, and have restricted basic admin abilities. I would suggest this to be fail-binned unless you package your functions and allow this mod to work without overwriting certain addon-default functionality. Some of the server commands on the GUI do not require restricted access (such as the dup, which has RTB prefs for client and server-side load, along with basic admin restriction), which should.
I have no idea what any of this means.
(provide examples)
Like... I read over that a few times, and I have no freaking idea what you were telling me

You have short-cutted many main functions of Blockland via GUI without packaging, and have restricted basic admin abilities. I would suggest this to be fail-binned unless you package your functions and allow this mod to work without overwriting certain addon-default functionality. Some of the server commands on the GUI do not require restricted access (such as the dup, which has RTB prefs for client and server-side load, along with basic admin restriction), which should.

This could be a very nice GUI mod if it didn't bypass certain necessary restrictions.
This add-on doesn't overwrite any default functions at all. The code looks perfectly fine OP, no need to fix anything as far as I can tell.

You have short-cutted many main functions of Blockland via GUI without packaging, and have restricted basic admin abilities. I would suggest this to be fail-binned unless you package your functions and allow this mod to work without overwriting certain addon-default functionality. Some of the server commands on the GUI do not require restricted access (such as the dup, which has RTB prefs for client and server-side load, along with basic admin restriction), which should.

This could be a very nice GUI mod if it didn't bypass certain necessary restrictions.
You're speaking half of this from your ass. I also too, reviewed the code and it doesn't overwrite any default functions.

You have short-cutted many main functions of Blockland via GUI without packaging, and have restricted basic admin abilities. I would suggest this to be fail-binned unless you package your functions and allow this mod to work without overwriting certain addon-default functionality. Some of the server commands on the GUI do not require restricted access (such as the dup, which has RTB prefs for client and server-side load, along with basic admin restriction), which should.

This could be a very nice GUI mod if it didn't bypass certain necessary restrictions.
please tell me which in this list are default
Code: [Select]
function CommandManager::onWake(%this)
function ToggleDragonGUI(%toggle)
function b_clearbricks()
function do_clearbricks()
function b_Avatar()
function b_love()
function b_alarm()
function b_hate()
function b_confusion()
function b_Duplicator()
function b_Wand()
function b_Fillprinter()
function b_Fillcan()
function b_clearallbricks()
function do_clearAllBricks()
function b_clearspambricks()
function do_clearSpamBricks()
function b_clearfloatingbricks()
function do_ClearFloatingBricks()
function b_ClearAllVehicles()
function do_ClearVehicles()
function b_ClearBots()
function do_ClearAllBots()
function b_ReloadBricks()
function do_ReloadBricks()
function b_ResetBots()
function b_ResetAllVehicles()
function b_Dwand()
function b_cancelload()
function B_RTBprefs()

I don't think ANY of those function names are default
if you think any are, feel free to run that list through a default version of BL and use isFunction or something on all of them

i'm starting to think goth doesn't actually know what he's talking about most of the time
have you tested it or looked at the code?

This add-on doesn't overwrite any default functions at all. The code looks perfectly fine OP, no need to fix anything as far as I can tell.
You're speaking half of this from your ass. I also too, reviewed the code and it doesn't overwrite any default functions.
please tell me which in this list are default

I don't think ANY of those function names are default
if you think any are, feel free to run that list through a default version of BL and use isFunction or something on all of them

i'm starting to think goth doesn't actually know what he's talking about most of the time
have you tested it or looked at the code?
Ah, ok. I got scared that I forgeted with blockland's default stuffs. Thanks!

I don't think ANY of those function names are default
Quote from: Goth77
Some of the server commands on the GUI do not require restricted access (such as the dup, which has RTB prefs for client and server-side load, along with basic admin restriction), which should.
They don't overwrite the default function NAMES, they shortcut default functionality. Certain functions like these have checks and sometimes go through other functions before being called directly.

This GUI calls main functions directly. I guess it doesn't really matter because most of the server commands already have an admin check in place

One thing though, you always get a message in chat or the yes/no GUI popup even when not admin which is somewhat annoying. It would be nice if the admin-only commands had a check on them to return the function

Example:
Code: [Select]
//Admin Commands
function b_clearallbricks(%client)
{
 if(!%client.isAdmin)
 {
      return;
 }
 else
 {
   messageBoxYesNo("Clear All Bricks?", "\c0Clear All Bricks<br>\c6Are you sure?", "do_clearAllBricks();");
 }
}

Congrats on your first Add-on Dragonoid! I really do like the basic design of the GUI
« Last Edit: July 20, 2015, 01:15:08 AM by Goth77 »

Example:
Code: [Select]
//Admin Commands
function b_clearallbricks(%client)
{
 if(!%client.isAdmin)
 {
      return;
 }
 else
 {
   messageBoxYesNo("Clear All Bricks?", "\c0Clear All Bricks<br>\c6Are you sure?", "do_clearAllBricks();");
 }
}
Please don't give an example if you don't know what you're doing.

It'd be more like:
Code: [Select]
function doStuff()
{
      if($IAmAdmin)
      {
            messageBoxYesNo("Clear All Bricks?", "\c0Clear All Bricks<br>\c6Are you sure?", "do_clearAllBricks();");
      }

      else
      {
            messageBoxOk("Error", "You're not an admin.");
      }
}

function b_clearallbricks(%client)
where is this %client variable coming from?
pretty sure it's just about always going to be blank

where is this %client variable coming from?
pretty sure it's just about always going to be blank
When you do CommandToServer('b_clearallbricks'); the client is included automatically

Please don't give an example if you don't know what you're doing.

It'd be more like:
Code: [Select]
function doStuff()
{
      if($IAmAdmin)
      {
            messageBoxYesNo("Clear All Bricks?", "\c0Clear All Bricks<br>\c6Are you sure?", "do_clearAllBricks();");
      }
      else
      {
            messageBoxOk("Error", "You're not an admin.");
      }
}
Why use the global variable? Also, why include another useless messageBoxOK if they are not admin instead of simply returning the function...?
« Last Edit: July 20, 2015, 01:16:52 PM by Goth77 »

Why use the global variable?
Because it's client sided. Not server sided.
%client will never exist in your example.
Also, why include another useless messageBoxOK if they are not admin instead of simply returning the function...?
Because it makes more sense in my mind. When people push a button they want some kind of response. They just don't want it to do nothing without an explanation.

Because it's client sided. Not server sided.
%client will never exist in your example.
Quote from: Goth77
When you do CommandToServer('b_clearallbricks'); the client is included automatically
%client can still be used?
http://forum.blockland.us/index.php?topic=143486.0;

When people push a button they want some kind of response. They just don't want it to do nothing without an explanation.
That's true enough, but a messageBox would be slightly annoying for such a thing. How about a simple message instead?

Code: [Select]
function ServerCMDb_clearallbricks(%client)
{
 if(!%client.isAdmin)
 {
   messageClient(%client,'',"Admin Only Command");
   return;
 }
 else
 {
  messageBoxYesNo("Clear All Bricks?","\c0Clear All Bricks<br>\c6Are you sure?","CommandToServer('ClearAllBricks');");
 }
}
Then to call the function from the GUI button you do
Code: [Select]
command = "CommandToServer('B_Clearbricks');";

Still though, the admin check is practically useless since the default commands already have admin checks in their functionality
« Last Edit: July 20, 2015, 01:53:36 PM by Goth77 »

%client can still be used?
http://forum.blockland.us/index.php?topic=143486.0;
No it can't. That's wrong.
That's true enough, but a messageBox would be slightly annoying for such a thing. How about a simple message instead?
I wouldn't consider it annoying because you already have a GUI opened.
Code: [Select]
function ServerCMDb_clearallbricks(%client)
{
 if(!%client.isAdmin)
 {
   messageClient(%client,'',"Admin Only Command");
   return;
 }
 else
 {
  messageBoxYesNo("Clear All Bricks?","\c0Clear All Bricks<br>\c6Are you sure?","CommandToServer('ClearAllBricks');");
 }
}
Then to call the function from the GUI button you do
Code: [Select]
command = "CommandToServer('B_Clearbricks');";

Still though, the admin check is practically useless since the default commands already have admin checks in their functionality
This dude's add-on is supposed to be client sided. Not server and client sided. Your code won't work anyways.

No it can't. That's wrong.I wouldn't consider it annoying because you already have a GUI opened.This dude's add-on is supposed to be client sided. Not server and client sided. Your code won't work anyways.
Worked just fine for me.