Changeset 57 for scripts/usr/local/lib/7dtd/monitor-log.sh
- Timestamp:
- Jun 9, 2014, 3:11:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/lib/7dtd/monitor-log.sh
r35 r57 58 58 echo "$(timestamp): $line" >> $LOG 59 59 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]*\)$') 61 64 sleep 1 62 handleConnect $playerId $entityId $playerName65 handleConnect "$playerId" "$entityId" "$playerName" 63 66 unset entityId playerId playerName unknown 64 67 fi 65 68 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" 68 72 unset playerId entityId 69 73 fi
Note:
See TracChangeset
for help on using the changeset viewer.