Changeset 57 for scripts/usr/local


Ignore:
Timestamp:
Jun 9, 2014, 3:11:45 PM (11 years ago)
Author:
alloc
Message:

Version 16: Fixes #17

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

Legend:

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

    r53 r57  
    1 Version: 15
     1Version: 16
    22Release: 2014-06-09
  • scripts/usr/local/lib/7dtd/monitor-log.sh

    r35 r57  
    5858                echo "$(timestamp): $line" >> $LOG
    5959                if [ -n "$(echo "$line" | grep '^RequestToSpawnPlayer:')" ]; then
    60                         read entityId playerId playerName unknown <<< "$(echo $line | sed -r 's/^RequestToSpawnPlayer: (.*), (.*), (.*), (.*)$/\1 \2 \3 \4/')"
     60                        entityId=$(expr "$line" : 'RequestToSpawnPlayer: \([0-9]*\), [0-9]*, .*, [0-9]*$')
     61                        playerId=$(expr "$line" : 'RequestToSpawnPlayer: [0-9]*, \([0-9]*\), .*, [0-9]*$')
     62                        playerName=$(expr "$line" : 'RequestToSpawnPlayer: [0-9]*, [0-9]*, \(.*\), [0-9]*$')
     63                        unknown=$(expr "$line" : 'RequestToSpawnPlayer: [0-9]*, [0-9]*, .*, \([0-9]*\)$')
    6164                        sleep 1
    62                         handleConnect $playerId $entityId $playerName
     65                        handleConnect "$playerId" "$entityId" "$playerName"
    6366                        unset entityId playerId playerName unknown
    6467                fi
    6568                if [ -n "$(echo "$line" | grep '^Removing player with id ')" ]; then
    66                         read playerId entityId <<< "$(echo $line | sed -r 's/^Removing player with id clientId=(.*), entityId=(.*)$/\1 \2/')"
    67                         handleDisconnect $playerId $entityId
     69                        playerId=$(expr "$line" : 'Removing player with id clientId=\([0-9]*\), entityId=[0-9]*$')
     70                        entityId=$(expr "$line" : 'Removing player with id clientId=[0-9]*, entityId=\([0-9]*\)$')
     71                        handleDisconnect "$playerId" "$entityId"
    6872                        unset playerId entityId
    6973                fi
Note: See TracChangeset for help on using the changeset viewer.