Changeset 344 for scripts/usr/local/lib/7dtd/monitor-log.sh
- Timestamp:
- Jan 5, 2019, 1:12:17 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/lib/7dtd/monitor-log.sh
r308 r344 73 73 74 74 handleChat() { 75 echo "$(timestamp): $1: $2 " >> $CHATLOG75 echo "$(timestamp): $1: $2 (SteamID $3, EntityID $4, Target $5)" >> $CHATLOG 76 76 77 77 for H in $(getHooksFor chat $INSTANCE); do 78 $H $INSTANCE "$1" "$2" 78 $H $INSTANCE "$1" "$2" "$3" "$4" "$5" 79 79 done 80 80 } … … 167 167 handleGmsg "$msg" 168 168 unset msg 169 #Chat: 'name': .*$ 170 elif [ -n "$(echo "$line" | grep -E '^Chat: .+')" ]; then 171 name=$(expr "$line" : "Chat: '\(.*\)': .*$") 172 msg=$(expr "$line" : "Chat: '.*': \(.*\)$") 173 handleChat "$name" "$msg" 174 unset name msg 169 #Chat (from '<steamid>', entity id '<entityid>', to '<targettype>'): '<senderchatname>': <msg> 170 elif [ -n "$(echo "$line" | grep -E '^Chat .+')" ]; then 171 steamId=$(expr "$line" : "Chat (from '\(.+\)', entity id '[0-9]+', to '[a-fA-F:0-9.]+'): '.*': .*$") 172 entityId=$(expr "$line" : "Chat (from '.+', entity id '\([0-9]+\)', to '[a-fA-F:0-9.]+'): '.*': .*$") 173 targetType=$(expr "$line" : "Chat (from '.+', entity id '[0-9]+', to '\([a-fA-F:0-9.]+\)'): '.*': .*$") 174 name=$(expr "$line" : "Chat (from '.+', entity id '[0-9]+', to '[a-fA-F:0-9.]+'): '\(.*\)': .*$") 175 msg=$(expr "$line" : "Chat (from '.+', entity id '[0-9]+', to '[a-fA-F:0-9.]+'): '.*': \(.*\)$") 176 handleChat "$name" "$msg" "$steamId" "$entityId" "$targetType" 177 unset name msg steamId entityId targetType 175 178 #Executing command ".*" from client ".*"$ 176 179 elif [ -n "$(echo "$line" | grep '^Executing command '.*' from client')" ]; then
Note:
See TracChangeset
for help on using the changeset viewer.