Changeset 402 for binary-improvements2/CommandExtensions/src
- Timestamp:
- Jan 27, 2023, 7:28:00 PM (22 months ago)
- Location:
- binary-improvements2/CommandExtensions/src
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/CommandExtensions/src/ChatHelpers.cs
r391 r402 10 10 } 11 11 12 _receiver.SendPackage (NetPackageManager.GetPackage<NetPackageChat> ().Setup (EChatType.Whisper, -1, _message, senderName + " (PM)", false, null)); 12 _receiver.SendPackage (NetPackageManager.GetPackage<NetPackageChat> ().Setup (EChatType.Whisper, -1, _message, 13 $"{senderName} (PM)", false, null)); 13 14 string receiverName = _receiver.playerName; 14 SdtdConsole.Instance.Output (15 $"Message to player {(receiverName != null ? "\"" + receiverName + "\"" : "unknownName")} sent with sender \"{senderName}\"");15 receiverName = receiverName != null ? $"\"{receiverName}\"" : "unknownName"; 16 SdtdConsole.Instance.Output ($"Message to player {receiverName} sent with sender \"{senderName}\""); 16 17 } 17 18 } -
binary-improvements2/CommandExtensions/src/Commands/Give.cs
r391 r402 27 27 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) { 28 28 if (_params.Count != 3 && _params.Count != 4) { 29 SdtdConsole.Instance.Output ("Wrong number of arguments, expected 3 or 4, found " + _params.Count + 30 "."); 29 SdtdConsole.Instance.Output ($"Wrong number of arguments, expected 3 or 4, found {_params.Count}."); 31 30 return; 32 31 } -
binary-improvements2/CommandExtensions/src/Commands/ListItems.cs
r391 r402 39 39 } 40 40 41 SdtdConsole.Instance.Output ( " " + s);41 SdtdConsole.Instance.Output ($" {s}"); 42 42 listed++; 43 43 } 44 44 45 SdtdConsole.Instance.Output ( "Listed " + listed + "matching items.");45 SdtdConsole.Instance.Output ($"Listed {listed} matching items."); 46 46 } 47 47 } -
binary-improvements2/CommandExtensions/src/Commands/ListLandProtection.cs
r391 r402 60 60 userIdFilter = ci.InternalId; 61 61 } else { 62 SdtdConsole.Instance.Output ( "Player name or entity id \"" + _params [0] + "\" not found.");62 SdtdConsole.Instance.Output ($"Player name or entity id \"{_params [0]}\" not found."); 63 63 return; 64 64 } … … 82 82 } catch (Exception e) { 83 83 SdtdConsole.Instance.Output ("Error getting current player's position"); 84 Log.Out ( "Error in ListLandProtection.Run: " + e);84 Log.Out ($"Error in ListLandProtection.Run: {e}"); 85 85 return; 86 86 } … … 114 114 foreach (Vector3i v in claimPositions) { 115 115 if (parseableOutput) { 116 SdtdConsole.Instance.Output ( "LandProtectionOf: id=" + claimOwner.PlatformId +117 ", playerName=" + claimOwner.Name + ", location=" + v);116 SdtdConsole.Instance.Output ( 117 $"LandProtectionOf: id={claimOwner.PlatformId}, playerName={claimOwner.Name}, location={v}"); 118 118 } else { 119 SdtdConsole.Instance.Output ( " (" + v + ")");119 SdtdConsole.Instance.Output ($" ({v})"); 120 120 } 121 121 } … … 123 123 124 124 if (userIdFilter == null) { 125 SdtdConsole.Instance.Output ( "Total of " + ppl.m_lpBlockMap.Count + "keystones in the game");125 SdtdConsole.Instance.Output ($"Total of {ppl.m_lpBlockMap.Count} keystones in the game"); 126 126 } 127 127 } -
binary-improvements2/CommandExtensions/src/Commands/RemoveLandProtection.cs
r391 r402 50 50 GameManager.Instance.SetBlocksRPC (changes); 51 51 52 SdtdConsole.Instance.Output ("Tried to remove #" + changes.Count + 53 " land protection blocks for player \"" + _id + "\". Note " + 54 "that only blocks in chunks that are currently loaded (close to any player) could be removed. " + 55 "Please check for remaining blocks by running:"); 56 SdtdConsole.Instance.Output (" listlandprotection " + _id); 52 SdtdConsole.Instance.Output ( 53 $"Tried to remove #{changes.Count} land protection blocks for player \"{_id}\". Note that only blocks in chunks that are currently loaded (close to any player) could be removed. Please check for remaining blocks by running:"); 54 SdtdConsole.Instance.Output ($" listlandprotection {_id}"); 57 55 } catch (Exception e) { 58 Log.Out ( "Error in RemoveLandProtection.removeById: " + e);56 Log.Out ($"Error in RemoveLandProtection.removeById: {e}"); 59 57 } 60 58 } … … 87 85 GameManager.Instance.SetBlocksRPC (changes); 88 86 89 SdtdConsole.Instance.Output ( "Land protection block at (" + v + ") removed");87 SdtdConsole.Instance.Output ($"Land protection block at ({v}) removed"); 90 88 } 91 89 … … 128 126 } catch (Exception e) { 129 127 SdtdConsole.Instance.Output ("Error removing claims"); 130 Log.Out ( "Error in RemoveLandProtection.Run: " + e);128 Log.Out ($"Error in RemoveLandProtection.Run: {e}"); 131 129 } 132 130 } catch (Exception e) { 133 131 SdtdConsole.Instance.Output ("Error getting current player's position"); 134 Log.Out ( "Error in RemoveLandProtection.Run: " + e);132 Log.Out ($"Error in RemoveLandProtection.Run: {e}"); 135 133 } 136 134 } else if (_params.Count == 1) { -
binary-improvements2/CommandExtensions/src/Commands/ShowInventory.cs
r391 r402 47 47 48 48 if (tag == null) { 49 SdtdConsole.Instance.Output ( "Belt of player " + p.Name + ":");49 SdtdConsole.Instance.Output ($"Belt of player {p.Name}:"); 50 50 } 51 51 … … 56 56 57 57 if (tag == null) { 58 SdtdConsole.Instance.Output ( "Bagpack of player " + p.Name + ":");58 SdtdConsole.Instance.Output ($"Bagpack of player {p.Name}:"); 59 59 } 60 60 … … 65 65 66 66 if (tag == null) { 67 SdtdConsole.Instance.Output ( "Equipment of player " + p.Name + ":");67 SdtdConsole.Instance.Output ($"Equipment of player {p.Name}:"); 68 68 } 69 69 … … 71 71 72 72 if (tag != null) { 73 SdtdConsole.Instance.Output ("tracker_item id=" + p.EntityID + ", tag=" + tag + 74 ", SHOWINVENTORY DONE"); 73 SdtdConsole.Instance.Output ($"tracker_item id={p.EntityID}, tag={tag}, SHOWINVENTORY DONE"); 75 74 } 76 75 } … … 94 93 // Tag defined -> parseable output 95 94 string partsMsg = DoParts (_inv [i].parts, 1, ""); 96 string msg = "tracker_item id=" + _entityId + ", tag=" + _tag + ", location=" + _location + 97 ", slot=" + i + ", item=" + _inv [i].itemName + ", qnty=" + _inv [i].count + 98 ", quality=" + _inv [i].quality + ", parts=(" + partsMsg + ")"; 95 string msg = 96 $"tracker_item id={_entityId}, tag={_tag}, location={_location}, slot={i}, item={_inv [i].itemName}, qnty={_inv [i].count}, quality={_inv [i].quality}, parts=({partsMsg})"; 99 97 SdtdConsole.Instance.Output (msg); 100 98 } … … 140 138 // Tag defined -> parseable output 141 139 string partsMsg = DoParts (_items [slotindices [i]].parts, 1, ""); 142 string msg = "tracker_item id=" + _entityId + ", tag=" + _tag + ", location=" + _location + 143 ", slot=" + _slotname + ", item=" + item.itemName + ", qnty=1, quality=" + 144 item.quality + ", parts=(" + partsMsg + ")"; 140 string msg = 141 $"tracker_item id={_entityId}, tag={_tag}, location={_location}, slot={_slotname}, item={item.itemName}, qnty=1, quality={item.quality}, parts=({partsMsg})"; 145 142 SdtdConsole.Instance.Output (msg); 146 143 } … … 176 173 } 177 174 178 _currentMessage += _parts [i].itemName + "@" + _parts [i].quality;175 _currentMessage += $"{_parts [i].itemName}@{_parts [i].quality}"; 179 176 _currentMessage = DoParts (_parts [i].parts, _indent + 1, _currentMessage); 180 177 }
Note:
See TracChangeset
for help on using the changeset viewer.