• CAT - Cats' Administration Tools
    48 replies, posted
[U][B]C.A.T [/B][/U]Cat's Administration Tools [U][B]What is it? [/B][/U]- C.A.T is my administration tool , that took me about a week at first to make, and has grown into this. It functions like other admin-mods do like ASSMod, ULX, etc. I'm posting this here because I'd like to know how this functions on a bigger scale (provided anyone uses it). My sandbox server only gets so much traffic, and I can't test every situation. I'd also like to hear other people's input on it. It's still a WIP, so be sure to check the Github for the latest version. [U][B]Features [/B][/U] [I][B]Screencap[/B][/I] -- More common now a days, but still nice. "Grab" a player's screen directly, and you can see everything that's in their game window, even while you're in game. If you accidently close the window, it's still saved on the server's data folder. [I][B]An easy UI [/B][/I][IMG]http://i.imgur.com/59YU2Tj.png[/IMG] [I][B]A (99% if your smart) unbreakable config [/B][/I] -- Most, if not all, sections of the config for C.A.T is labeled. No confusions! No mistakes! Only goals! [I][B]No Clutter! [/B][/I] -- If there was one thing I didn't like, it was the cluttered menu that ULX uses. This takes cue from a G12 admin mod ASSMod, with its simplistic menu. [U][B]Okay, sounds good! Where can I get it? [/B][/U] [URL="https://github.com/LolcatsV2/CATpublic"][IMG]http://i.imgur.com/eAleQSm.png[/IMG][/URL] Remember to [B]READ THE README. [/B]There's stuff in there you need to know! [U][B]Okay, I got it. But I have a few questions... [/B][/U] Q. [I]I got it installed, but how do I open the menu?[/I] A. In console (clientside) do "bind <key> +cat_menu" without the quotes, of course. And with your own keyboard key. Q. [I]I'm new to running servers. How do I install this?[/I] A. Just drag the "catv1" folder into your addons. Q. [I]Help me! On my DarkRP/TTT normal people can fly![/I] A. By default, the config is set up for a classic sandbox server. If you're running a DarkRP or something else that ISN'T SANDBOX, you're going to want to go into the config and change some stuff (such as not allowing users and vip to noclip). All of the possible "cando" options are listed in the "CAT_Config.ownerCan" table. Q. [I]I got some questions that aren't listed here (DarkRP VIP Jobs, finding ranks). Help me![/I] A. You can add me on steam [URL="http://steamcommunity.com/profiles/76561198013224619/"]here[/URL] for help. Q. [I]How do I give myself my rank?[/I] Q. Open your console/srcds depending on your host, and do "cat_setaccess userid owner". To find your userid, type status in console on either server or client, and it will be the first number on the left. [B][U] Thanks to:[/U][/B] [URL="http://steamcommunity.com/profiles/76561198038479821/"]Nano[/URL] - Pushing me through my anxiety to post this, and making the first draft. [URL="http://steamcommunity.com/profiles/76561198078299555/"]Dead[/URL] - Guinea Pig/ "willing" tester. ASSMod - Idea for the UI, code help. ULX - Code help. I'm really open to suggestions, since this is the first thing I've ever really finished. I know the whole thing about "never release your first project", but as I said, I'm just looking for input on how to optimize this.
GUI looks like ASSMod. Also ASSMod have more features.
Looking through the code, it seems like a lot of things are hard-coded so it seems like it takes more effort to add new commands.
At least he isn't over-writing hooks and shit like ULX does it's such a bitch
[QUOTE=AirBlack;44654968]GUI looks like ASSMod. Also ASSMod have more features.[/QUOTE] Because assmod uses default menus, just like this does.
[QUOTE=code_gs;44655402]Because assmod uses default menus, just like this does.[/QUOTE] Yeah, i see [LUA]rightadminmenu = vgui.Create("DMenu")[/LUA]
It looks fantastic considering it's your first project, hopefully you'll keep on updating/working on it in the future. One pet peeve of mine though: Why are you highlighting an rcon command as a big selling feature? I've yet to see an administration mod that doesn't have an rcon command. It's pretty basic. [lua] concommand.Add( "rbreslow_rcon", "RCon Command", function( arg ) table.remove( arg[1] ) if ( table.concat( arg, " " ) != "" ) then cmd = table.concat( arg, " " ) return game.ConsoleCommand( cmd .. "\n" ) end return false end ) -- i didn't test this so it probably won't work [/lua]
Hey guys, thanks for the responses. It took me a while to come and read them because I have an anxiety about these kinds of things. Fortunately, your replies weren't as bad as I had thought. It's an honor to have some of you guys reply. The GUI does look like ASSMod, because I personally love ASSMod's GUI. It's easy to use, and there's no menu clutter. I tried to get as many features into it as I could. I wasn't expecting people to necessarily be making new commands for this. Really, if you wanted to do so, I would hope you would have knowledge about how to create a DMenu suboption (although the icons might be annoying). I didn't write the OP (anxiety), although I changed it a bit from what a friend gave me. RCon is a pretty basic feature, so I guess it doesn't really need to be there. (That's quite an odd way to make an RCon concommand, though...)
Perhaps you could write an alternative for adding menus and options? That way it would be easier for people to add their own or whatever rather than them all being hardcoded into one function. Just a suggestion. Other than that, nice work. I like it :)
for a first project, fantastic work :)! i took a look at the menu code and do you know you can do [LUA]local option = menu:AddOption( "option" ) option:SetIcon( "icon16/tick.png" )[/LUA] ? instead of stuff like [URL=https://github.com/LolcatsV2/CATpublic/blob/master/catv1/lua/cat_menu.lua#L59]this[/URL] here. plus, you should use the icon16/ path instead of gui/silkicons, as they are shipped with gmod in the materials/icon16 folder now. also try to use localized variables instead of global (unless you need to, then you should probably just make a global table) just nitpicking :v:
[QUOTE=Lolcats;44655646]Text and asking about suboption[/QUOTE] Maybe [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index1781.html"]that[/URL] will help you.
I used the icons like that because I couldn't find a function to draw an icon on a submenu. If there is one, be sure to tell me. I didnt know if icon16 had all the icons I was going to use, so I used my own. Also, i tried to keep , my variables localized when I could, but if you see one standing out, tell me! Also, AirBlack, I wasnt asking anything about Submenus. I actually think I would be pretty good at making Dmenus after making this :v:
hopefully with all these admin mods coming out ulx will take a hike
[QUOTE=Lolcats;44656707]I used the icons like that because I couldn't find a function to draw an icon on a submenu. If there is one, be sure to tell me. I didnt know if icon16 had all the icons I was going to use, so I used my own. Also, i tried to keep , my variables localized when I could, but if you see one standing out, tell me! Also, AirBlack, I wasnt asking anything about Submenus. I actually think I would be pretty good at making Dmenus after making this :v:[/QUOTE]To set the icon of a sub menu, you have to do it a little differently as AddSubMenu returns 2 values rather than one, and you need to use the second value for doing that. For example: [code] local menu = DermaMenu() local submenu, pnl = menu:AddSubMenu( "Test" ) pnl:SetIcon( "icon16/add.png" ) [/code] Just in case you need it, here's all the icon16 silkicons: [url]http://www.famfamfam.com/lab/icons/silk/previews/index_abc.png[/url]
[QUOTE=rbreslow;44655528]It looks fantastic considering it's your first project, hopefully you'll keep on updating/working on it in the future. One pet peeve of mine though: Why are you highlighting an rcon command as a big selling feature? I've yet to see an administration mod that doesn't have an rcon command. It's pretty basic. [lua] concommand.Add( "rbreslow_rcon", "RCon Command", function( arg ) table.remove( arg[1] ) if ( table.concat( arg, " " ) != "" ) then cmd = table.concat( arg, " " ) return game.ConsoleCommand( cmd .. "\n" ) end return false end ) -- i didn't test this so it probably won't work [/lua][/QUOTE] This might be slightly off-topic, but you should check out the 4th parameter given to concommand callbacks. It's surprisingly under-used. [lua] concommand.Add("rbreslow_rcon", "", function(ply, _, _, cmd) if ply has permissions then game.ConsoleCommand(cmd .. "\n") end end) [/lua]
Okay, I was playing about with this for a while on my testing server and I found a few things - I don't have access to unban as the owner. - I can't pick up props or other players. - A lot of this is hard coded - Manually adding menu entries? Not a good idea. - You're not using the built in silkicons, but including a pack which comes with GMod anyway. Use the icon16/ folder. - It would be better to make your own function which adds a menu item and run commands, than defining a console command each time. - Perhaps add pre-defined options (just like assmod's) for things like health and armour. - Add an unban menu, rather than telling the user to input the SteamID. This would allow people to view existing bans with their reasons and lengths. - Prop cleanup is not working. - A basic plugin system would be ideal for a mod like this. All in all though, it's nice to see another person making an admin mod for GMod. One day perhaps, the variety will bury ULX.
Thanks for the stuff guys. A lot of the issues that Mors posted have been fixed, (1, 2, 4, 7), and I took ShadowRanger's suggestion. No more dumb icons. I'll probably be working on the unban menu next, then seeing what I can do to make this a little more mod friendly.
You would just need a table of commands. [lua] -- The following is shared. CAT_Commands = {} -- Perhaps somewhere else in another file (e.g. your plugins) CAT_Commands.kick = { name = "Kick Player", icon = "icon16/door_open.png", onRun = function(client, command, arguments) -- Implement something here when ran. -- Probably accomplish this by making a console command. end } -- On the server, you can loop through the commands and make a new console command: for command, info in pairs(CAT_Commands) do concommand.Add("cat_"..command, info.onRun) end -- This is clientside. For your menu: local menu = DermaMenu() -- You can use DermaMenu() to create a DMenu for convenience. for k, v in SortedPairs(CAT_Commands) do menu:AddOption(v.name, function() RunConsoleCommand("cat_"..k) end):SetImage(v.icon) end menu:Open() [/lua] Hope this helps.
We're happy with Evolve so I won't personally use this but I think it's great to see people making more admin mods and I am completely supportive of it! Like, there's so many people who think ULX is the only admin mod.
[QUOTE=NiandraLades;44665216]We're happy with Evolve so I won't personally use this but I think it's great to see people making more admin mods and I am completely supportive of it! Like, there's so many people who think ULX is the only admin mod.[/QUOTE] If most GSPs are like NFOServers, then there's a very good reason for that. [img]http://ss.infd.us/linux/2014-04-28@16-28-25.png[/img]
[QUOTE=Mors Quaedam;44667188]If most GSPs are like NFOServers, then there's a very good reason for that. [img]http://ss.infd.us/linux/2014-04-28@16-28-25.png[/img][/QUOTE] Why exactly?
[QUOTE=Johnny Guitar;44667280]Why exactly?[/QUOTE] Because it's an addon which you can install directly from the control panel?
[QUOTE=BlackVoid;44667839]Because it's an addon which you can install directly from the control panel?[/QUOTE] Ah, forgot GSPs offered features like that. Been ages since I've used a game server host.
Good luck with this man, it looks pretty promising!
As a tip, for screencapping it's a lot faster to use HTTP to put the image on a service like Imgur and then simply pass on the link and deletion link to the client requesting it. -snip- Looks like there's a public addon that already does this, read below. As a note, ViLayer also only offers ULX for auto-install. [img]http://i.imgur.com/zDyLw9s.png[/img]
Damn that's some bad proof reading. "do not [B]installs[/B] this mod" "It is up to [B]your[/B] to configure it." On topic - Looks good Cat, keep up the good work. If I ever run a server I might use this.
[t]http://i.imgur.com/wfxcWD6.png[/t] Same at HC-Servers. [QUOTE=MuteTM;44675050]As a tip, for screencapping it's a lot faster to use HTTP to put the image on a service like Imgur and then simply pass on the link and deletion link to the client requesting it. My code is spaghetti, so I won't put in a pull request but I can provide code if you'd like. As a note, ViLayer also only offers ULX for auto-install. [img]http://i.imgur.com/zDyLw9s.png[/img][/QUOTE] Without trying to derail the thread, you realise that there are tools (such as ShareX) that allow you to screencap and upload the file using any image host / your own host using FTP or a custom POST uploader, right? As for CAT though. Looks really promising. I'm not that decent at Lua and I honestly get sick of ULX, so I might consider this. MySQL support? Then another piece of feedback, I honestly do not understand why people want "Rocket" as an admin command. I mean, does an admin mod that is there for the purpose of administration, really need a command to annoy people with, classed as "Fun" by admin mods such as ULX? Gimping makes people spam shitty lines of text defined by the owner of the server, if you want people to stop talking, muting them would be more effective than letting them say rediculous phrases, don't you think?
Alright guys. I made the unban thing a little less painful. There's now a menu. (You have to press the refresh button twice to get it to properly reload; anyone have some input about that?) [thumb]https://i.imgur.com/FIDFLvL.jpgp[/thumb] In response to a few of your replies: I didn't realize how, uh, slightly widespread ULX was disliked. ULX is good at what it does, which is being an admin mod. I've ran about 4 servers with ULX, and it served it's purpose, fairly bug free. The only reason I say I disliked it is because I personally find the menu cluttered. I never really got too far into modding around with ULX, so I couldn't really speak on the technical aspects of it. About the screen capture: I never really expected it to go very far. It was more of a novelty aspect to me, seeing as how the image quality isn't the greatest. I'll take your words though, and think about how I can improve it. There's no SQL support for this so far. Everything is basically written into files in data. I get what you're saying about the whole "Fun" commands thing, but if you really look at it, the average maturity level of certain server owners/admins isn't high. If I were to release an admin mod with 0 additional commands, just Kick, Ban, Unban, and other strictly administrative functions, it wouldn't garner as much support among communities. Of course, this is just me talking about my experience with Garry's Mod communities. (Also, is that Cockwork and all of it's derivatives for free from a GSP? That's... interesting if it is that way...) As for my next thing to work on with this, Mors gave me some advice on how to color chat messages, so I'll see if I can easily implement that into a global function. After that, as a slightly more long term (3-5 days?) thing, I'll be redoing the code to make the menu (as suggested by Chessnut [thanks~]). It should make making your own plugins for this... easier?
[QUOTE=Lolcats;44682884]Alright guys. I made the unban thing a little less painful. There's now a menu. (You have to press the refresh button twice to get it to properly reload; anyone have some input about that?) [thumb]https://i.imgur.com/FIDFLvL.jpgp[/thumb] In response to a few of your replies: I didn't realize how, uh, slightly widespread ULX was disliked. ULX is good at what it does, which is being an admin mod. I've ran about 4 servers with ULX, and it served it's purpose, fairly bug free. The only reason I say I disliked it is because I personally find the menu cluttered. I never really got too far into modding around with ULX, so I couldn't really speak on the technical aspects of it. [/QUOTE] ULX re-writes the hook library to give itself priority. They've written functions for the sake of writing functions. (ULib.FileWrite(), anyone?) [QUOTE=Lolcats;44682884] About the screen capture: I never really expected it to go very far. It was more of a novelty aspect to me, seeing as how the image quality isn't the greatest. I'll take your words though, and think about how I can improve it. There's no SQL support for this so far. Everything is basically written into files in data. I get what you're saying about the whole "Fun" commands thing, but if you really look at it, the average maturity level of certain server owners/admins isn't high. If I were to release an admin mod with 0 additional commands, just Kick, Ban, Unban, and other strictly administrative functions, it wouldn't garner as much support among communities. Of course, this is just me talking about my experience with Garry's Mod communities. (Also, is that Cockwork and all of it's derivatives for free from a GSP? That's... interesting if it is that way...) [/QUOTE] You need a clockwork serial key for it to actually work. [QUOTE=Lolcats;44682884] As for my next thing to work on with this, Mors gave me some advice on how to color chat messages, so I'll see if I can easily implement that into a global function. After that, as a slightly more long term (3-5 days?) thing, I'll be redoing the code to make the menu (as suggested by Chessnut [thanks~]). It should make making your own plugins for this... easier?[/QUOTE] Nice to see you're going to make a good plugin system for this. [code]if SERVER then local PLAYER = FindMetaTable("Player") util.AddNetworkString( "ColoredMessage" ) function BroadcastMsg(...) local args = {...} net.Start("ColoredMessage") net.WriteTable(args) net.Broadcast() end function PLAYER:PlayerMsg(...) local args = {...} net.Start("ColoredMessage") net.WriteTable(args) net.Send(self) end elseif CLIENT then net.Receive("ColoredMessage",function(len) local msg = net.ReadTable() chat.AddText(unpack(msg)) chat.PlaySound() end) end[/code] Here's the code I sent you over Steam, in case you forgot to save it.
What is really needed to replace admin mods like ULX is something that provides the following (in my oppinion) MODULAR DATA SOURCES: by this I mean you have the same interface to fetch data from text files as from sqlite as from mysql. This way you can instantly interchange data sources without having to write seperate code for each mode. This can be implemented by simply implementing call backs for every data request and calling them instantly for things like text files and sqlite. MENU FRAMEWORK: menu tabs should be loaded as a plugin system which allows for easy layout generation for plugins that want to implement their own menu tabs. Btw please don't be annoying like evolve and force one file per plugin, allow users to create their own tables to fill with plugin vars and then register with the plugin system. (they may have changed this but that's what I remember from evolve) PLUGIN FRAMEWORK: ideally plugins should be loaded as a table of properties that the admin mod can load and interpret to define settings. In a really well defined system the user would actually be able to make plugins that modify how properties are interpreted for further extensibility, but that could be asking a bit much. Anyway that's sorta my admin mod wish list. I'm hoping to create my own mod this summer (jumping on the bandwagon... oh god) though I'd love to see someone beat me to it and save me the work if you're up to it. This is just sorta my wish list, it should be noted that it's not necessarily representative of what everyone wants, though I think it should be fairly encompassing. Ohp lastly, userinterface should load registered commands, registered commands shouldn't have to register themselves into the UI (ideally) ULX does have a fairly impressive coding style just they got a bit too full of themselves and I think a couple of stupidish devs managed to get access at some point or other.
Sorry, you need to Log In to post a reply to this thread.