1. 15th of October, 2019: SMD is currently under maintenance, the site may go down while we are working on it. Apologies for the inconvenience.
    2. We've removed some functionality from SMD in preparation for a migration to new forum software.

    Shadow - A server side modification for Starmade

    Discussion in 'WIP' started by Doomsider, Apr 26, 2015.

    1. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      [​IMG]

      I would like to present the WIP known as Shadow.

      https://github.com/doomsider/shadow

      Shadow is the evolution and spiritual successor to DTSD which was a script written in BASH based off the original Minecraft Control Script. Shadow is designed to collect output from the server and issue console commands based on any number of scripted conditions.

      Shadow seeks to aid administrators in the running and maintenance tasks for a server. It is designed to be modular in nature so additional scripts can be added without the need to modify existing scripts. Mysql is integrated to handle storage of information and complex retrieval and cross-referencing that BASH alone cannot handle.

      Shadow effectively creates a scripted server side modification that is a complete solution for running a server. Shadow is in pre-alpha testing phase at the moment. The Shadow team is looking for other modders/scripters as well as ideas to implement into the script.

      If you are interested in helping out or just offering suggestions or ideas you would like to see happen please feel free to respond.

      Target install for pre-Alpha: Ubuntu 14.04 with Mysql 5.5

      At the request of several people I have automated install with a script.

      Install Easy:

      wget https://raw.githubusercontent.com/doomsider/shadow/master/install.sh in the directory Starmade is or will be.

      chmod +x install.sh

      ./install.sh

      Follow the on screen instructions and be sure to go through all the steps
       
      #1 Doomsider, Apr 26, 2015
      Last edited: Jul 18, 2015
      • Like Like x 9
    2. zuch0698o

      Joined:
      Mar 4, 2015
      Messages:
      14
      so. i hate to ask and be a bother is shadow done now?
       
    3. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      It is in working condition for sure. I have a a couple of pages of features still to add but it works as is.
       
    4. zuch0698o

      Joined:
      Mar 4, 2015
      Messages:
      14
      that is fantastic thank you for the quick response. i know i asked before id love to donate a few bux for all your hard work!
       
    5. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      Looking to get an Alpha release by the end of the month or at the begging of next month depending on work and life :D
       
      #5 Doomsider, Jun 16, 2015
      Last edited: Jun 23, 2015
      • Like Like x 1
    6. zuch0698o

      Joined:
      Mar 4, 2015
      Messages:
      14
      well i know im happy it took a while before i figured out how to run the setup... (i am not a smart man)
       
    7. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      Ok moving right along, lots more work to do to get to Alpha so maybe towards the end of this month. I would encourage anyone who is interested in testing at this point to go ahead.
       
    8. Xoza

      Joined:
      Mar 3, 2014
      Messages:
      13
      Does it include all the previous commands / tools (or at least some of the most commonly used ones) already? Because we'll adopt and test for you immediately if so.
       
    9. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      Yes it includes most of the functions plus some more stuff. I am working on several interesting projects. For instance Arenas, Duelling, and AI gaurds are some of the more interesting ones I will have finished before Alpha is released
       
    10. Xoza

      Joined:
      Mar 3, 2014
      Messages:
      13
      Installed via your guide/readme and ran with ./shadow.dtsd, everything seemed to go well, ingame commands however don't seem to do anything.
       
    11. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      Well I don't know what could be wrong offhand. You can't issue a !help command and get a response then take a look at CONFIGDTSD_SCRIPTSCREEN.log to see what the script is doing. You should see things like vote checks and server checks going on.

      Also did you get all the way through the setup?
       
    12. Xoza

      Joined:
      Mar 3, 2014
      Messages:
      13
      Yep, everything installed without a hitch. The backup took a while, but that was the only issue that piqued my curiosity because it took so long, but it finished, just had to be patient.

      /home/starmade is my StarMade-Starter.Jar directory, it's where I put Shadow's files.
      /home/starmade/StarMade is where all of the files actually exist.
      (I wasn't sure about this via the readme by how it was phrased, so I went for the least 'dirty' route so it was a 50/50 chance, I suspect this could be what I have that's backwards, however it backed it up correctly and said it found and updated it properly.)

      CONFIGDTSD_SCRIPTSCREEN.log (last modification, 12 hrs ago, is it possible to add a timestamp for future releases?)
      Code:
      Script started on Mon Jul 13 03:04:28 2015
      root@sm:/home/starmade# /home/starmade/shadow.dtsd mycreate
      /home/starmade/shadow.dtsd setranks
      /home/starmade/shadow.dtsd makesearchdb
      /home/starmade/shadow.dtsd addevents
      /home/starmade/shadow.dtsd taillog &
      /home/starmade/shadow.dtsd searchlog &
      /home/starmade/shadow.dtsd executelog
      ERROR 1060 (42S21) at line 1: Duplicate column name 'COMMAND'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'TIME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CURRENTSECTOR'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LASTPOSITION'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'BOUNTY'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'DEATHS'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'KILLEDBY'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'KILLS'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LASTKILL'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'AMOUNT'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'POSTER'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'TIME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'WANTED'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CHATSTRING'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LOGDATE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'RECIEVER'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'SENDER'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'COMMAND'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LOGDATE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'PARAMETER'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'DESTROYTIME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'TYPE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'PLAYER'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'SHIP'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'IP'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'STATUS'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'TIME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'IDNUMBER'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'KILLER'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'KILLTIME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'VICTIM'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'BANKCREDITS'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CONTROLLING'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CONTROLTYPE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CREDITS'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CURRENTIP'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CURRENTSECTOR'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CURRENTVOTE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'FACTION'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LASTCORE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LASTPOSITION'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LASTUPDATE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'ONLINE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'RANK'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'TOTALVOTE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'COMMANDSALLOWED'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'SEARCHFUNCTION'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'SEARCHSTRING'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'PEACE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'PROTECTED'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'TYPE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LOGDATE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LOGSTRING'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'STATUS'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'TIME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'ATTACHED'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'BLOCK'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CREATOR'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CURRENTSECTOR'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'DOCKED'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'ENTITYTYPE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'FACTION'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LASTCONTROLLER'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LASTPOSITION'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LASTUPDATE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'MASS'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CURRENTSECTOR'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'ATTACHED'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'BLOCK'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CREATOR'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'CURRENTSECTOR'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'DOCKED'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'ENTITYTYPE'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'FACTION'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LASTCONTROLLER'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'LASTPOSITION'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'MASS'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'NAME'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'VALUE1'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'VALUE2'
      ERROR 1060 (42S21) at line 1: Duplicate column name 'VALUE3'
      root@sm:/home/starmade# /home/starmade/shadow.dtsd setranks
      The current array COMMANDLIST_RANK1
      Here is rank name Ensign
      CORE HELP
      The current array COMMANDLIST_RANK2
      Here is rank name Lieutenant
      CORE HELP
      The current array COMMANDLIST_RANK3
      Here is rank name Commander
      CORE HELP
      The current array COMMANDLIST_RANK4
      Here is rank name Captain
      CORE HELP
      The current array COMMANDLIST_RANK5
      Here is rank name Admiral
      BALANCE BANPLAYER BANSTOP CLEAR CORE CREDITS DESPAWN DEPOSIT EXPORT GARAGE GIVE GIVEMETA GIVENAME GODON GODOFF HELP KILL IMPORT INVISION INVISIOFF KICK KILL LISTBOUNTY LOADSHIP POSTBOUNTY PROTECTSTART PROTECTSTOP RESTART RANKME RANKREQUEST RANKSET RANKUSER SHUTDOWN SPAWNSTART SPAWNSTOP STARTERSHIP UNPROTECT TELEPORT TRANSFER WHITEADD WITHDRAW VOTEEXCHANGE VOTEPOINTS
      root@sm:/home/starmade# /home/starmade/shadow.dtsd makesearchdb
      root@sm:/home/starmade# /home/starmade/shadow.dtsd addevents
      this is SCHEDULETYPE REPEAT TIMEVALUE 300 TIMEQUANTITY SECOND SCHEDULECOMMAND EVENT_SERVERSTATUS & EVENTNAME SERVERSTATUS
      ERROR 1539 (HY000) at line 1: Unknown event 'SERVERSTATUS'
      this is SCHEDULETYPE REPEAT TIMEVALUE 3600 TIMEQUANTITY SECOND SCHEDULECOMMAND EVENT_SERVERVERSION EVENTNAME SERVERVERSION
      ERROR 1539 (HY000) at line 1: Unknown event 'SERVERVERSION'
      this is SCHEDULETYPE REPEAT TIMEVALUE 43200 TIMEQUANTITY SECOND SCHEDULECOMMAND EVENT_SERVERRESTART EVENTNAME SERVERRESTART
      ERROR 1539 (HY000) at line 1: Unknown event 'SERVERRESTART'
      this is SCHEDULETYPE REPEAT TIMEVALUE 600 TIMEQUANTITY SECOND SCHEDULECOMMAND EVENT_SERVERMESSAGE EVENTNAME SERVERMESSAGE
      ERROR 1539 (HY000) at line 1: Unknown event 'SERVERMESSAGE'
      this is SCHEDULETYPE REPEAT TIMEVALUE 60 TIMEQUANTITY SECOND SCHEDULECOMMAND ONINTERVAL_60_VOTECHECK EVENTNAME VOTECHECK
      ERROR 1539 (HY000) at line 1: Unknown event 'VOTECHECK'
      root@sm:/home/starmade# /home/starmade/shadow.dtsd taillog &
      [1] 3470
      root@sm:/home/starmade# /home/starmade/shadow.dtsd searchlog &
      [2] 3471
      root@sm:/home/starmade# /home/starmade/shadow.dtsd executelog
      executing ONINTERVAL_60_VOTECHECK
      d 

      Is there a better place you'd prefer to discuss / resolve / communicate about testing?
       
    13. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      Since this is pre-alpha WIP you can post stuff here. If you are feeling inclined and you have a reproducible bug the best place would be Github. From the log it looks as if everything is running correctly. You can tail -f this log file to watch it or just re-open it after you have done a few commands like !help. It should register receiving the command. If not then there is an issue there.

      The backup zips the entire directory so depending on universe size this can take a long time.

      Be sure you update the script with every new release from Github. Being pre-alpha bugs are being fixed and systems changed at such a high rate that if you not running the latest release I won't be able to help much.

      Also on a side note did you edit ranks.dtsd to allow ranks other than Admiral to use chat commands? by default rank is Ensign and they can only use !help and !core
       
    14. Xoza

      Joined:
      Mar 3, 2014
      Messages:
      13
      After installing I tested several !commands, so those should show up in the CONFIGDTSD_SCRIPTSCREEN.log ?

      Yeah, I watched it count up, so I knew it was working.

      I will definitely keep with it, always enjoyed your work and here to help out if you need it.

      I've not changed any files.
       
    15. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      Yeah so the default setup would only allow you to use !core and !help, no other command would work until you gave yourself admiral rank or edited the ranks.dtsd file to allow Ensigns to do more commands than just those two.

      You should be able to see all this happening in the script log. Since this is a pre-Alpha production it is the primary place to go when wondering if something is or is not working with the script. Also if you are familiar with Mysql the Serverstatus table shows a running series of events based on what the server is doing.
       
    16. Xoza

      Joined:
      Mar 3, 2014
      Messages:
      13
      I did give myself the Admiral rank and that was without error. (error did happen because I didn't log in after the install yet, so that's working).

      Not entirely familiar with MySQL much yet, mostly server management / setup. Where's the default storage location usually? I can research it and look it over.
       
    17. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      Well you can log into mysql command line with mysql -u username -ppassword (no space between password and -p)

      Select a database with "use dtsddb;"

      Show all the tables "show tables;"

      Show a whole table "select * from tablename;"

      Really puzzling that chat commands are not working for you, do you see them being received in CONFIGDTSD_SCRIPTSCREEN.log?
       
    18. zuch0698o

      Joined:
      Mar 4, 2015
      Messages:
      14
      i am having the exact same issue all of a sudden and no they are not showing up under dtsdscreen or smscreen like the command was even being cast
       
    19. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      If it is not showing up then likely there is an issue with Mysql. You can look in coreloops.dtsd to see how the system works. One function feeds the log into the database, the next function matches log lines between lines numbers and dumps it into another table. The last step is this table is executed line by line. If you not seeing any commands it is likely there problem would be there. You can also send me logs to look at or I can troubleshoot if you want.
       
      • Like Like x 1
    20. Doomsider

      Doomsider Server scriptologist

      Joined:
      Jan 21, 2013
      Messages:
      215
      Just found an issue with Mysql 5.6+. It does not work right with the script. Since 5.5 is default for 14.04 I am not going to address this issue right away because it would make the script incompatible with 5.5 or require a major rewrite in how Mysql is called throughout the script. I am punting this issue to Alpha.
       
    Loading...