Currently the developers are putting their own money into JC2-MP to keep the servers online.

Please take a few seconds of your time and disable your AdBlock plugin for our website.

Ad revenue is not going to developers, it is used purely for covering our hosting costs.

 

You are also free to donate, which removes all ads from our website!

Patch 0.3 was just released! Full changelog here: https://t.co/4A50m6IKen

3 years ago

Advertisement
May 25, 2020, 11:52:16 pm

Author Topic: [1.1.0.2] CommandManager & DatabaseManager  (Read 18870 times)

Ahrotahntee

  • JC2-MP Betatester
  • Jr. Member
  • *****
  • Posts: 63
    • View Profile
[1.1.0.2] CommandManager & DatabaseManager
« on: December 16, 2013, 04:56:10 pm »
You must upgrade your jcmp server to 0.1.1 in order to use this script.

DOWNLOAD (Offline)


1.1.0.2 Release Notes
Fixed a host of bugs and an unmet dependency.

1.1.0.1 Release Notes
Resolved some minor issues when adding a user in game
Added additional parameter checks to /access to prevent script warnings/errors

1.1.0.0 Release Notes
Command manager no longer starts in debug mode.

1.0.0.3 Release Notes
All version brought up to the same release #.
You must delete old versions of the script in order to use the new ones
This is now a set of scripts provided in discrete modules for those who wish to use only part of it. access is the part that keeps track of admins and provides AuthedCommand, command is the part that does the quote and parameter parsing and provides PlayerCommand, and database is the scheduler and provides DatabaseCommand.

AccessManager now fires a new event when any is module loaded called "AccessSync" where it pushes a table of all known admins. AccessManager also fires "AccessAdded" and "AccessRemoved" when an admin is added or removed, so other scripts can make use of the access list in other ways.

1.0.0.2 Release Notes
Added ban, unban and kick features to /access. The syntax is: /access (kick|ban|unban). This allows administrators to kick and ban players from the server (and unban them if they so choose).

The Command Not Found error message was removed from this version. (Although I don't remember releasing it with it in there.)

1.0.0.1 Release Notes
Changed the scripts to correctly reference the Steam ID based on last-minute changes to the API.

About These Scripts
These scripts are written to make it easier for scripters to parse chat commands. The CommandManager script handles quotes (and escaping) to break a chat command into its parameters. Unescaped quotes are stripped from the command so that the script does not need to handle them on the other end. Escaped quotes have their escaping character removed.

The CommandManager fires an event every time a chat command is invoked. The event name is "AuthedCommand" which includes a payload with the command name, the invoking player, and any parameters given.

Version 1.0 of CommandManager also includes an IsAdmin bit in the AuthedCommand payload to determine if the user is present on the User List.

CommandManager is bundled with an Authentication Manager that allows the console to add and remove player to the User List, and allow authenticated users in game to add other users to the list. The commands for the console are access add <target>, access del <target/name> and access list. The same commands are available to in-game users via /access add <target>, /access del <target>, and /access list.

For a good use example, please see Tycoonman500's PM script, although please note that the "PlayerCommand" event is deprecated and will be removed in a future release.

DatabaseManager is a simple script that takes "DatabaseCommand" events and queues them to be written to the SQL database in a single transaction, the purpose is to allow scripts to accumulate updates without having an impact on server performance. The AccessManager component of CommandManager is a good example of it in use.

Please report any bugs to this thread so I may resolve them. Do not quote this message in any replies.
« Last Edit: January 07, 2014, 02:10:49 pm by Ahrotahntee »

Drewlark

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: CommandManager & DatabaseManager
« Reply #1 on: December 17, 2013, 05:22:40 am »
AuthedCommand doesn't seem to be firing... neither is PlayerCommand

Code: Lua
  1. function IsCommand(args)
  2.     print("somethings happening")
  3. end
  4. Events:Subscribe("AuthedCommand", IsCommand)
nothing going on...

Philpax

  • Developer
  • Hero Member
  • *****
  • Posts: 563
    • View Profile
Re: CommandManager & DatabaseManager
« Reply #2 on: December 17, 2013, 07:01:40 am »
AuthedCommand doesn't seem to be firing... neither is PlayerCommand

Code: Lua
  1. function IsCommand(args)
  2.     print("somethings happening")
  3. end
  4. Events:Subscribe("AuthedCommand", IsCommand)
nothing going on...

You need to register for it: Events:Register("AuthedCommand")

Ahrotahntee

  • JC2-MP Betatester
  • Jr. Member
  • *****
  • Posts: 63
    • View Profile
Re: CommandManager & DatabaseManager
« Reply #3 on: December 17, 2013, 03:31:37 pm »
CommandManager updated to 1.0.0.2

FoulPhil

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: CommandManager & DatabaseManager
« Reply #4 on: December 17, 2013, 03:33:09 pm »
CommandManager updated to 1.0.0.2

404 Not Found

Ahrotahntee

  • JC2-MP Betatester
  • Jr. Member
  • *****
  • Posts: 63
    • View Profile
Re: CommandManager & DatabaseManager
« Reply #5 on: December 17, 2013, 03:37:47 pm »
Fixed. my bad.

FoulPhil

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: CommandManager & DatabaseManager
« Reply #6 on: December 17, 2013, 03:54:57 pm »

Ahrotahntee

  • JC2-MP Betatester
  • Jr. Member
  • *****
  • Posts: 63
    • View Profile
Re: CommandManager & DatabaseManager
« Reply #7 on: December 17, 2013, 04:09:14 pm »
I have released a new script Bookmarks, which replaces the /tp functionality in freeroam with something a little more manageable.

It is now a good example of hooking the AuthedCommand event and utilizing the parameters passed.

Cygnes

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: [1.0.0.2] CommandManager & DatabaseManager
« Reply #8 on: December 17, 2013, 11:55:24 pm »
This is great, but where do i add Steam ID's for Admins ?

thanks


ROODAY

  • Sr. Member
  • ****
  • Posts: 298
    • View Profile
Re: [1.0.0.2] CommandManager & DatabaseManager
« Reply #9 on: December 18, 2013, 12:26:24 am »
how do i remove the "this is not a command" chat popup, because it doesn't recognize a lot of commands that I use in other scripts that work.

Sable

  • Donator
  • Newbie
  • *****
  • Posts: 24
    • View Profile
Re: [1.0.0.2] CommandManager & DatabaseManager
« Reply #10 on: December 18, 2013, 02:21:20 am »
how do i remove the "this is not a command" chat popup, because it doesn't recognize a lot of commands that I use in other scripts that work.

I would also love to know how to actually set people up as admins!

Lorenc

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: [1.0.0.2] CommandManager & DatabaseManager
« Reply #11 on: December 18, 2013, 01:22:04 pm »
Really interested in the SQL portion especially. Thanks mate.

Ahrotahntee

  • JC2-MP Betatester
  • Jr. Member
  • *****
  • Posts: 63
    • View Profile
Re: [1.0.0.2] CommandManager & DatabaseManager
« Reply #12 on: December 18, 2013, 02:16:08 pm »
Admins are added via console or other admins with access add <target> (or in game with /access add <target>)

misterff1

  • Donator
  • Hero Member
  • *****
  • Posts: 582
    • View Profile
Re: [1.0.0.2] CommandManager & DatabaseManager
« Reply #13 on: December 19, 2013, 12:03:57 pm »
I already have a different admin script which i prefer more, but i need this script for the roadtrip script. Will these scripts have issues in combination?

beatles1

  • Donator
  • Jr. Member
  • *****
  • Posts: 56
    • View Profile
Re: [1.0.0.2] CommandManager & DatabaseManager
« Reply #14 on: December 19, 2013, 04:04:41 pm »
Download is just timing out for me.

EDIT: But thanks for writing this, will very quickly become central to almost all servers.