Ignore:
Timestamp:
Jul 31, 2023, 4:06:13 PM (16 months ago)
Author:
alloc
Message:

25_30_44

  • Got rid (mostly) of custom JSON serialization
  • Some code cleanup
File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/AllocsCommands/Commands/RemoveLandProtection.cs

    r420 r455  
    22using System.Collections.Generic;
    33using AllocsFixes.PersistentData;
     4using JetBrains.Annotations;
    45
    56namespace AllocsFixes.CustomCommands {
     7        [UsedImplicitly]
    68        public class RemoveLandProtection : ConsoleCmdAbstract {
    79                protected override string getDescription () {
     
    4749                                GameManager.Instance.SetBlocksRPC (changes);
    4850
    49                                 SdtdConsole.Instance.Output ("Tried to remove #" + changes.Count +
    50                                                              " land protection blocks for player \"" + _id + "\". Note " +
    51                                                              "that only blocks in chunks that are currently loaded (close to any player) could be removed. " +
    52                                                              "Please check for remaining blocks by running:");
    53                                 SdtdConsole.Instance.Output ("  listlandprotection " + _id);
     51                                SdtdConsole.Instance.Output (
     52                                        $"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:");
     53                                SdtdConsole.Instance.Output ($"  listlandprotection {_id}");
    5454                        } catch (Exception e) {
    55                                 Log.Out ("Error in RemoveLandProtection.removeById: " + e);
     55                                Log.Out ($"Error in RemoveLandProtection.removeById: {e}");
    5656                        }
    5757                }
    5858
    59                 private void removeByPosition (List<string> _coords) {
     59                private void removeByPosition (IReadOnlyList<string> _coords) {
    6060                        int.TryParse (_coords [0], out int x);
    6161                        int.TryParse (_coords [1], out int y);
     
    8484                        GameManager.Instance.SetBlocksRPC (changes);
    8585
    86                         SdtdConsole.Instance.Output ("Land protection block at (" + v + ") removed");
     86                        SdtdConsole.Instance.Output ($"Land protection block at ({v}) removed");
    8787                }
    8888
     
    125125                                        } catch (Exception e) {
    126126                                                SdtdConsole.Instance.Output ("Error removing claims");
    127                                                 Log.Out ("Error in RemoveLandProtection.Run: " + e);
     127                                                Log.Out ($"Error in RemoveLandProtection.Run: {e}");
    128128                                        }
    129129                                } catch (Exception e) {
    130130                                        SdtdConsole.Instance.Output ("Error getting current player's position");
    131                                         Log.Out ("Error in RemoveLandProtection.Run: " + e);
     131                                        Log.Out ($"Error in RemoveLandProtection.Run: {e}");
    132132                                }
    133133                        } else if (_params.Count == 1) {
Note: See TracChangeset for help on using the changeset viewer.