Changeset 482 for scripts/usr/local/lib/7dtd/playerlog.sh
- Timestamp:
- Nov 14, 2023, 5:44:17 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/lib/7dtd/playerlog.sh
r294 r482 54 54 local ENTITYID="$2" 55 55 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" 59 60 60 echo "$(timestamp) +++ $ENTITYID $NICKNAME $ STEAMID $IP $OWNERID" >> "$PLAYERSLOG"61 echo "$(timestamp) +++ $ENTITYID $NICKNAME $PLATFORMID $CROSSID $IP $OWNERID" >> "$PLAYERSLOG" 61 62 62 63 createPlayerList 63 64 64 XPATHBASE="/Players/Player[@ steamid='$STEAMID']"65 XPATHBASE="/Players/Player[@platformid='$PLATFORMID']" 65 66 66 if [ -z $($XMLSTARLET sel -t -v "$XPATHBASE/@ steamid" "$PLAYERSXML") ]; then67 if [ -z $($XMLSTARLET sel -t -v "$XPATHBASE/@platformid" "$PLAYERSXML") ]; then 67 68 $XMLSTARLET ed -L \ 68 69 -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" \ 70 72 -i "$XPATHBASE" -t attr -n "nick" -v "$NICKNAME" \ 71 73 -i "$XPATHBASE" -t attr -n "playtime" -v "0" \ … … 104 106 105 107 if [ -f $PLAYERSXML ]; then 106 if [ ! -z $($XMLSTARLET sel -t -v "$XPATHBASE/@ steamid" "$PLAYERSXML") ]; then108 if [ ! -z $($XMLSTARLET sel -t -v "$XPATHBASE/@platformid" "$PLAYERSXML") ]; then 107 109 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") 109 114 LOGINTIME=$($XMLSTARLET sel -t -v "$XPATHBASE/@lastlogin" "$PLAYERSXML") 110 115 PLAYTIME=$($XMLSTARLET sel -t -v "$XPATHBASE/@playtime" "$PLAYERSXML") … … 118 123 fi 119 124 120 echo "$(timestamp) --- $ENTITYID $NICKNAME $ STEAMID" >> "$PLAYERSLOG"125 echo "$(timestamp) --- $ENTITYID $NICKNAME $PLATFORMID $CROSSID" >> "$PLAYERSLOG" 121 126 } 122 127
Note:
See TracChangeset
for help on using the changeset viewer.