Changeset 294 for scripts/usr/local/lib/7dtd/monitor-log.sh
- Timestamp:
- Oct 6, 2016, 4:45:58 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/lib/7dtd/monitor-log.sh
r275 r294 39 39 local steamId="$3" 40 40 local ip="$4" 41 local ownerId="$5" 41 42 42 logPlayerConnect $INSTANCE "$entityId" "$name" "$steamId" "$ip" 43 logPlayerConnect $INSTANCE "$entityId" "$name" "$steamId" "$ip" "$ownerId" 43 44 44 45 for H in $(getHooksFor playerConnect $INSTANCE); do 45 $H $INSTANCE "$entityId" "$name" "$steamId" "$ip" 46 $H $INSTANCE "$entityId" "$name" "$steamId" "$ip" "$ownerId" 46 47 done 47 48 } … … 121 122 while read line ; do 122 123 if [ -n "$line" ]; then 123 #Player connected, entityid=1278, name=termo2, steamid=76561197997439820, ip=178.203.27.140124 #Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, ip=[0-9.]*$124 #Player connected, entityid=1278, name=termo2, steamid=76561197997439820, steamOwner=76561197997439820, ip=178.203.27.140 125 #Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, steamOwner=[0-9]*, ip=[0-9.]*$ 125 126 if [ -n "$(echo "$line" | grep '^Player connected,')" ]; then 126 entityId=$(expr "$line" : 'Player connected, entityid=\([0-9]*\), name=.*, steamid=[0-9]*, ip=[0-9.]*$') 127 playerName=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=\(.*\), steamid=[0-9]*, ip=[0-9.]*$') 128 steamId=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=\([0-9]*\), ip=[0-9.]*$') 129 ip=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, ip=\([0-9.]*\)$') 127 entityId=$(expr "$line" : 'Player connected, entityid=\([0-9]*\), name=.*, steamid=[0-9]*, steamOwner=[0-9]*, ip=[0-9.]*$') 128 playerName=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=\(.*\), steamid=[0-9]*, steamOwner=[0-9]*, ip=[0-9.]*$') 129 steamId=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=\([0-9]*\), steamOwner=[0-9]*, ip=[0-9.]*$') 130 steamOwner=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, steamOwner=\([0-9]*\), ip=[0-9.]*$') 131 ip=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, steamOwner=[0-9]*, ip=\([0-9.]*\)$') 130 132 sleep 1 131 handleConnect "$entityId" "$playerName" "$steamId" "$ip" 132 unset entityId playerName steamId ip133 handleConnect "$entityId" "$playerName" "$steamId" "$ip" "$steamOwner" 134 unset entityId playerName steamId steamOwner ip 133 135 else 134 136 #Player disconnected: EntityID=[0-9]*, PlayerID='[0-9]*', OwnerID='[0-9]*', PlayerName='.*'$
Note:
See TracChangeset
for help on using the changeset viewer.