Changeset 259 for scripts


Ignore:
Timestamp:
Mar 17, 2016, 6:16:40 PM (9 years ago)
Author:
alloc
Message:

v96

Location:
scripts/usr/local/lib/7dtd
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • scripts/usr/local/lib/7dtd/VERSION

    r257 r259  
    1 Version: 95
    2 Release: 2016-02-16
     1Version: 96
     2Release: 2016-03-17
    33
  • scripts/usr/local/lib/7dtd/commands/start.sh

    r258 r259  
    4747                rm -f $(getInstancePath $1)/logs/output_log.txt
    4848               
    49                 for H in $(getHooksFor serverPreStart); do
     49                for H in $(getHooksFor serverPreStart $1); do
    5050                        $H $1
    5151                done
     
    5858                OPTS="-logfile $LOG -configfile=$(getInstancePath $1)/config.xml"
    5959               
    60                 LC_ALL=C LD_LIBRARY_PATH=$SDTD_BASE/engine $SSD --start $SSD_PID $SSD_DAEMON $SSD_USER --chdir $SDTD_BASE/engine --exec $SDTD_BASE/engine/7DaysToDieServer.x86 -- $OPTS > $(getInstancePath $1)/logs/stdout.log 2>&1
     60#               if [ "$(uname -m)" = "x86_64" ]; then
     61#                       SERVER_EXE="7DaysToDieServer.x86_64"
     62#               else
     63                        SERVER_EXE="7DaysToDieServer.x86"
     64#               fi
     65
     66               
     67                LC_ALL=C LD_LIBRARY_PATH=$SDTD_BASE/engine $SSD --start $SSD_PID $SSD_DAEMON $SSD_USER --chdir $SDTD_BASE/engine --exec $SDTD_BASE/engine/$SERVER_EXE -- $OPTS > $(getInstancePath $1)/logs/stdout.log 2>&1
    6168                sleep 1
    6269
    63                 for H in $(getHooksFor serverPostStart); do
     70                for H in $(getHooksFor serverPostStart $1); do
    6471                        $H $1
    6572                done
  • scripts/usr/local/lib/7dtd/commands/stop.sh

    r258 r259  
    4242        res=$(isRunning $1)
    4343        if [ $res -eq 1 ]; then
    44                 for H in $(getHooksFor serverPreStop); do
     44                for H in $(getHooksFor serverPreStop $1); do
    4545                        $H $1
    4646                done
     
    6868                rm $(getInstancePath $1)/7dtd.pid
    6969
    70                 for H in $(getHooksFor serverPostStop); do
     70                for H in $(getHooksFor serverPostStop $1); do
    7171                        $H $1
    7272                done
  • scripts/usr/local/lib/7dtd/common.sh

    r258 r259  
    229229# Params:
    230230#   1: Hook name
     231#   2: Instance name
    231232# Returns:
    232233#   Names of hook files
    233234getHooksFor() {
     235        if [ -n $2 ]; then
     236                if [ -d $SDTD_BASE/$(getInstancePath $2)/hooks/$1 ]; then
     237                        local H
     238                        for H in $SDTD_BASE/$(getInstancePath $2)/hooks/$1/*.sh; do
     239                                echo "$H"
     240                        done
     241                fi
     242        fi
    234243        if [ -d $SDTD_BASE/hooks/$1 ]; then
    235244                local H
  • scripts/usr/local/lib/7dtd/monitor-log.sh

    r258 r259  
    4242        logPlayerConnect $INSTANCE "$entityId" "$name" "$steamId" "$ip"
    4343
    44         for H in $(getHooksFor playerConnect); do
     44        for H in $(getHooksFor playerConnect $INSTANCE); do
    4545                $H $INSTANCE "$entityId" "$name" "$steamId" "$ip"
    4646        done
     
    5353        logPlayerDisconnect $INSTANCE "$entityId"
    5454
    55         for H in $(getHooksFor playerDisconnect); do
     55        for H in $(getHooksFor playerDisconnect $INSTANCE); do
    5656                $H $INSTANCE "$playerId" "$entityId" "$NICKNAME" "$STEAMID"
    5757        done
     
    6161        echo "$(timestamp): $1" >> $CHATLOG
    6262       
    63         for H in $(getHooksFor chat); do
     63        for H in $(getHooksFor chat $INSTANCE); do
    6464                $H $INSTANCE "$1"
    6565        done
     
    7272        echo "$(timestamp): Player \"$name\" executed \"$cmd\"" >> $COMMANDLOG
    7373
    74         for H in $(getHooksFor remoteCommand); do
     74        for H in $(getHooksFor remoteCommand $INSTANCE); do
    7575                $H $INSTANCE "$cmd" "$name"
    7676        done
     
    8383        echo "$(timestamp): Telnet from \"$ip\" executed \"$cmd\"" >> $COMMANDLOG
    8484
    85         for H in $(getHooksFor telnetCommand); do
     85        for H in $(getHooksFor telnetCommand $INSTANCE); do
    8686                $H $INSTANCE "$cmd" "$ip"
    8787        done
Note: See TracChangeset for help on using the changeset viewer.