[Server Scripting] ZVxScripts Server Scripts [Beta 10]

Discussion in 'Server and Client Scripting' started by ArchZombie, Jun 12, 2013.

  1. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    ZVxScripts
    Beta 10

    ZVxScripts are high-preformance, secure, configurable, and flexible scripts for your Pokemon Online server.

    Stable (ish):
    Code (text):
    1.  
    2. /*  ///////////////////////// LEGAL NOTICE ///////////////////////////////
    3.  
    4. This file is part of ZVxScripts,
    5. a modular script framework for Pokemon Online server scripting.
    6.  
    7. Copyright (C) 2013  Ryan P. Nicholl, aka "ArchZombie" / "ArchZombie0x", <archzombielord@gmail.com>
    8.  
    9. This program is free software: you can redistribute it and/or modify
    10. it under the terms of the GNU Affero General Public License as
    11. published by the Free Software Foundation, either version 3 of the
    12. License, or (at your option) any later version.
    13.  
    14. This program is distributed in the hope that it will be useful,
    15. but WITHOUT ANY WARRANTY; without even the implied warranty of
    16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17. GNU Affero General Public License for more details.
    18.  
    19. You should have received a copy of the GNU Affero General Public License
    20. along with this program.  If not, see <http://www.gnu.org/licenses/>.
    21.  
    22. /////////////////////// END LEGAL NOTICE /////////////////////////////// */
    23. (function () {
    24.      sys.write("webloader_package.js", sys.synchronousWebCall('https://raw.github.com/ArchZombie/ZVxScripts/master/bin/package-stable.js'));
    25.      return sys.exec("webloader_package.js");
    26.  })();
    Nightly:
    Code (text):
    1.  
    2. /*  ///////////////////////// LEGAL NOTICE ///////////////////////////////
    3.  
    4. This file is part of ZVxScripts,
    5. a modular script framework for Pokemon Online server scripting.
    6.  
    7. Copyright (C) 2013  Ryan P. Nicholl, aka "ArchZombie" / "ArchZombie0x", <archzombielord@gmail.com>
    8.  
    9. This program is free software: you can redistribute it and/or modify
    10. it under the terms of the GNU Affero General Public License as
    11. published by the Free Software Foundation, either version 3 of the
    12. License, or (at your option) any later version.
    13.  
    14. This program is distributed in the hope that it will be useful,
    15. but WITHOUT ANY WARRANTY; without even the implied warranty of
    16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17. GNU Affero General Public License for more details.
    18.  
    19. You should have received a copy of the GNU Affero General Public License
    20. along with this program.  If not, see <http://www.gnu.org/licenses/>.
    21.  
    22. /////////////////////// END LEGAL NOTICE /////////////////////////////// */
    23. (function () {
    24.      sys.write("webloader_package.js", sys.synchronousWebCall('https://raw.github.com/ArchZombie/ZVxScripts/master/bin/package.js'));
    25.      return sys.exec("webloader_package.js");
    26.  })();

    Dontate BTC: 1LDJjQHWvXWR3Rmw38DS1GiUiqwrCj7K3E

    Releases: https://github.com/ArchZombie/ZVxScripts/releases

    Github: https://github.com/ArchZombie/ZVxScripts

    Manual: https://github.com/ArchZombie/ZVxScripts/raw/master/manual.pdf



    Type this into the server to get started!

    Code (text):
    1. /usermod "Your user names goes inside these quotes!" --group=ServerOperator --add
    This will give you all permissions!

    Note: Most posts below are outdated, I tried tagging them but I got lazy.
     
    Last edited: Nov 6, 2013
  2. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Maybe you'd better make a list of features so people want to download it :o
     
  3. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    [post outdated]

    Well right now it's not ready for use. It's just gotten to the point I want feedback with the design. :) Although it has a few nice features, I don't think it's yet good enough to justify use on a server other than a testing server.

    But here's what I've done so far:


    • Flexible module system, for example, the script can load or unload individual modules at runtime. New components can be written in a single file, and loaded at runtime, thus offering minimal script-resets. And a server owner can choose individual modules to load or not.
    • Commands parsed optargs-style.
    • Highly flexible standard commands, for example: /ban "some one" --reason="Spamming" --time="4 hours and 3 seconds" actually works.
    • Profile system used to catch the bad ones and offer a minimal level of protection against stealing unregistered alts.
    • Framework is in place for a reputation system, this will allow for example, /votekick so the server can be moderated when no admins are online.
     
    Last edited: Oct 23, 2013
  4. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    I'm wondering what features are popular with other scripts that anyone would suggest I include?
     
  5. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Tournaments, various auth stuff (original commands could be great), various competitive stuff

    I've got plenty of other suggestions, but they may take time to code and aren't in other scripts anyway.
     
  6. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x

    What kind of auth features do you recommend? If you can make a list of as many suggestions as possible that would help, because I haven't had that many ideas. I believe this script will lend itself to super fast coding so I am not daunted by challenges. :)
     
    Last edited: Jun 13, 2013
  7. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    I like the short core of ~200 lines. However, the number of files is growing very fast as you make each command into separate file! I would suggest some grouping at least.
     
  8. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    [outdated post]

    There is some, such as /ban and /unban in the same file. :)
     
    Last edited: Oct 23, 2013
  9. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    maybe move a lot of the script files into a subfolder, so your po folder doesn't look like a cluster[****].
     
  10. NewDay

    NewDay Member

    Joined:
    Dec 16, 2011
    Messages:
    69
    Likes Received:
    0
    That's right.
    When removing the script it becomes difficult to search and remove all 40 files.
     
  11. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    [outdated post]

    Code (text):
    1. rm ./*.js
    ???
     
    Last edited: Oct 23, 2013
  12. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Not everyone is on linux. And it's a pain in the ass anyway, it's a lot easier to remove a folder, especially for people who use a GUI over command line. Also this would maybe mean only symlink the one folder instead of 40+ js files?

    When doing command line stuff, like checking the files in the directory with ls, it's a lot better to have all those files in their own module, otherwise they just clutter the list.

    Anyway, maybe you don't think it's a problem, but the ones who will use your script definitely will, and you seem to want your script to spread :o
     
  13. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Code (batch):
    1. del *.js
    Windows has a set of command line commands too, y'know.
     
  14. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    Updated first post
     
  15. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    Went ahead and did this to match the js_databases.
     
  16. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    [outdated post]

    Update, I will now continue updating the scripts anyway.

    Done but still in devel branch:

    /configure, e.g., /configure io.autosavetime = 60000
    Permission groups instead of auth levels, auth levels merely convey permission groups as per /configure user.segroups[0|1|2|3]
    For example, to allow all users on the server to use /eval, do /configure user.segroups0 << "EVALOP" (not recommended)
    /groupmod, for e.g., /groupmod ArchZombie0x*other admin:group=SERVEROP:add (in simple command parser, see manual for optargs) to add permissions to individual users.
    Note that groupmod acomplishes somewhat real invisible auth, as the auth level isn't transmitted in packets to the client, as it's actually 0! Note that usergroups are a bit buggy atm. (some parts of the script still read the auth level instead :( )

    Upcoming features:

    New command parser, choosable via /userconf command. You will be able to e.g., /userconf commandparser = "simple" or /userconf commandparser = "optargs" depending on your preference, this will affect the syntax for all the commands you use. I may also add a new method of command parsing that's more like other (simpler) scripts.
    Majorgroups. Users will be members of "MajorGroups", and each majorgroup has a set of associate usergroups, so instead of user, mod, admin, and owner permissions being a /configure option, User, Moderator, Administrator and Owner will be built-in majorgroups. You will also be able to add your own majorgroups, e.g., "TrialMod" etc.
     
    Last edited: Oct 23, 2013
  17. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    v1.2

    Updated to v1.2
     
  18. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    Added majorgroups, so you can have your own custom groups!... sort of!! Right now they can only be edited using /eval...

    Anyway, you can now add/remove users to/from majorgroups using /usermod.
    A new command called /groupmod will be added to manage groups later on (not the same as old /groupmod which is now /permmod)

    A note is that you can no longer edit the perms of the level groups using /configure, as they forward to majorgroups now, altho if you have this down you should be able to figure out /eval.
     
  19. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    I implemented /groupmod, now you can do, e.g.:

    (01:36:45) ~Script~: [#Main] ArchZombie0x: /groupmod --group=Testmasters --addperms=KICKOP --create --inherits=User --add ArchZombie0x
    (01:36:45) ~Script~: ArchZombie0x created the Testmasters group!
    (01:36:45) ~Script~: ArchZombie0x modified the Testmasters group by adding permissions: KICKOP
    (01:36:45) ~Script~: ArchZombie0x modified the Testmasters group by setting the inhertance prototype to: User
    (01:36:45) ~Script~: ArchZombie0x added ArchZombie0x to the Testmasters group!

    Can also manage regular groups:

    (01:40:25) ~Script~: [#Main] ArchZombie0x: /groupmod --group=Owner --addperms=EVALOP
    (01:40:25) ~Script~: ArchZombie0x modified the Owner group by adding permissions: EVALOP

    Major groups show up in /info:

    (01:41:09) ~Script~: [#Main] ArchZombie0x: /info ArchZombie0x
    (01:41:09) ~Script~:
    Info about profile #0:
    Last used name: ArchZombie0x
    Last used IP: 127.0.0.1
    Names: ["archzombie0x2","archzombie0x","archzombie0x3","archzombie0x5","archzombie0xo"]
    IP Addresses: ["127.0.0.1"]
    Info about user: ArchZombie0x
    Auth level: 0
    Major Groups: Registered, ServerOperator, User, Testmasters.
    Permissions: SERVEROP
    Registered: true


    Oh, and a fun one:

    (01:47:52) ~Script~: [#Main] ArchZombie0x: /groupmod --group=User --dropperms=CHAT
    (01:47:52) ~Script~: ArchZombie0x modified the User group by dropping permissions: CHAT

    (types into chatbox as regular user:)

    (01:49:13) ~Script~: Permission denied.

    >:D
     
    Last edited: Oct 5, 2013
  20. Jolteon.

    Jolteon. New Member

    Joined:
    Oct 5, 2013
    Messages:
    3
    Likes Received:
    0
    Hai Arch, It's tyrantrum here! Loving the scripts.
     
  21. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    Deleted the the old system where you had profiles for each user.

    Bans and mutes are redone.

    For these, you now have new features:

    /<ban/mute> <name> <ip_address> <regularexpression> <ip_subnet>
     
  22. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    Bump for self extracting scripts.js
     
  23. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    bump for beta 8
     
  24. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    Separated stable and nightly channels