Ignore:
Timestamp:
Nov 14, 2023, 5:44:17 PM (12 months ago)
Author:
alloc
Message:

Scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/usr/local/lib/7dtd/playerlog.sh

    r294 r482  
    5454        local ENTITYID="$2"
    5555        local NICKNAME="$3"
    56         local STEAMID="$4"
    57         local IP="$5"
    58         local OWNERID="$6"
     56        local PLATFORMID="$4"
     57        local CROSSID="$5"
     58        local IP="$6"
     59        local OWNERID="$7"
    5960
    60         echo "$(timestamp) +++ $ENTITYID $NICKNAME $STEAMID $IP $OWNERID" >> "$PLAYERSLOG"
     61        echo "$(timestamp) +++ $ENTITYID $NICKNAME $PLATFORMID $CROSSID $IP $OWNERID" >> "$PLAYERSLOG"
    6162
    6263        createPlayerList
    6364       
    64         XPATHBASE="/Players/Player[@steamid='$STEAMID']"
     65        XPATHBASE="/Players/Player[@platformid='$PLATFORMID']"
    6566
    66         if [ -z $($XMLSTARLET sel -t -v "$XPATHBASE/@steamid" "$PLAYERSXML") ]; then
     67        if [ -z $($XMLSTARLET sel -t -v "$XPATHBASE/@platformid" "$PLAYERSXML") ]; then
    6768                $XMLSTARLET ed -L \
    6869                        -s "/Players" -t elem -n "Player" -v "" \
    69                         -i "/Players/Player[not(@steamid)]" -t attr -n "steamid" -v "$STEAMID" \
     70                        -i "/Players/Player[not(@platformid)]" -t attr -n "platformid" -v "$PLATFORMID" \
     71                        -i "$XPATHBASE" -t attr -n "crossid" -v "$CROSSID" \
    7072                        -i "$XPATHBASE" -t attr -n "nick" -v "$NICKNAME" \
    7173                        -i "$XPATHBASE" -t attr -n "playtime" -v "0" \
     
    104106
    105107        if [ -f $PLAYERSXML ]; then
    106                 if [ ! -z $($XMLSTARLET sel -t -v "$XPATHBASE/@steamid" "$PLAYERSXML") ]; then
     108                if [ ! -z $($XMLSTARLET sel -t -v "$XPATHBASE/@platformid" "$PLAYERSXML") ]; then
    107109                        NICKNAME=$($XMLSTARLET sel -t -v "$XPATHBASE/@nick" "$PLAYERSXML")
    108                         STEAMID=$($XMLSTARLET sel -t -v "$XPATHBASE/@steamid" "$PLAYERSXML")
     110                        PLATFORMID=$($XMLSTARLET sel -t -v "$XPATHBASE/@platformid" "$PLAYERSXML")
     111                        CROSSID=$($XMLSTARLET sel -t -v "$XPATHBASE/@crossid" "$PLAYERSXML")
     112                        IP=$($XMLSTARLET sel -t -v "$XPATHBASE/@lastIp" "$PLAYERSXML")
     113                        OWNERID=$($XMLSTARLET sel -t -v "$XPATHBASE/@steamOwner" "$PLAYERSXML")
    109114                        LOGINTIME=$($XMLSTARLET sel -t -v "$XPATHBASE/@lastlogin" "$PLAYERSXML")
    110115                        PLAYTIME=$($XMLSTARLET sel -t -v "$XPATHBASE/@playtime" "$PLAYERSXML")
     
    118123        fi
    119124
    120         echo "$(timestamp) --- $ENTITYID $NICKNAME $STEAMID" >> "$PLAYERSLOG"
     125        echo "$(timestamp) --- $ENTITYID $NICKNAME $PLATFORMID $CROSSID" >> "$PLAYERSLOG"
    121126}
    122127
Note: See TracChangeset for help on using the changeset viewer.