Ignore:
Timestamp:
Oct 6, 2016, 4:45:58 PM (8 years ago)
Author:
alloc
Message:

Scripts 103

File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/usr/local/lib/7dtd/monitor-log.sh

    r275 r294  
    3939        local steamId="$3"
    4040        local ip="$4"
     41        local ownerId="$5"
    4142       
    42         logPlayerConnect $INSTANCE "$entityId" "$name" "$steamId" "$ip"
     43        logPlayerConnect $INSTANCE "$entityId" "$name" "$steamId" "$ip" "$ownerId"
    4344
    4445        for H in $(getHooksFor playerConnect $INSTANCE); do
    45                 $H $INSTANCE "$entityId" "$name" "$steamId" "$ip"
     46                $H $INSTANCE "$entityId" "$name" "$steamId" "$ip" "$ownerId"
    4647        done
    4748}
     
    121122while read line ; do
    122123        if [ -n "$line" ]; then
    123                 #Player connected, entityid=1278, name=termo2, steamid=76561197997439820, ip=178.203.27.140
    124                 #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.]*$
    125126                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.]*\)$')
    130132                        sleep 1
    131                         handleConnect "$entityId" "$playerName" "$steamId" "$ip"
    132                         unset entityId playerName steamId ip
     133                        handleConnect "$entityId" "$playerName" "$steamId" "$ip" "$steamOwner"
     134                        unset entityId playerName steamId steamOwner ip
    133135                else
    134136                #Player disconnected: EntityID=[0-9]*, PlayerID='[0-9]*', OwnerID='[0-9]*', PlayerName='.*'$
Note: See TracChangeset for help on using the changeset viewer.