Ignore:
Timestamp:
Jan 27, 2023, 7:28:00 PM (22 months ago)
Author:
alloc
Message:
  • Major refactoring
  • Using Utf8Json for (de)serialization
  • Moving APIs to REST
  • Removing dependencies from WebServer and MapRenderer to ServerFixes
Location:
binary-improvements2/7dtd-server-fixes/src
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements2/7dtd-server-fixes/src/ModApi.cs

    r391 r402  
    3030                        }
    3131
    32                         Log.Out ("Player connected" +
    33                                  ", entityid=" + _cInfo.entityId +
    34                                  ", name=" + _cInfo.playerName +
    35                                  ", pltfmid=" + (_cInfo.PlatformId?.CombinedString ?? "<unknown>") +
    36                                  ", crossid=" + (_cInfo.CrossplatformId?.CombinedString ?? "<unknown/none>") +
    37                                  ", steamOwner=" + (owner ?? "<unknown/none>") +
    38                                  ", ip=" + _cInfo.ip
     32                        Log.Out (
     33                                $"Player connected, entityid={_cInfo.entityId}, name={_cInfo.playerName}, pltfmid={_cInfo.PlatformId?.CombinedString ?? "<unknown>"}, crossid={_cInfo.CrossplatformId?.CombinedString ?? "<unknown/none>"}, steamOwner={owner ?? "<unknown/none>"}, ip={_cInfo.ip}"
    3934                        );
    4035                }
     
    6661
    6762                        if (_cInfo != null) {
    68                                 Log.Out ("Sent chat hook reply to {0}", _cInfo.InternalId);
     63                                Log.Out ($"Sent chat hook reply to {_cInfo.InternalId}");
    6964                                _cInfo.SendPackage (NetPackageManager.GetPackage<NetPackageChat> ().Setup (EChatType.Whisper, -1, testChatAnswer, "", false, null));
    7065                        } else {
    71                                 Log.Error ("ChatHookExample: Argument _cInfo null on message: {0}", _msg);
     66                                Log.Error ($"ChatHookExample: Argument _cInfo null on message: {_msg}");
    7267                        }
    7368
  • binary-improvements2/7dtd-server-fixes/src/PersistentData/Inventory.cs

    r351 r402  
    6767
    6868                        if (_count > maxAllowed) {
    69                                 Log.Out ("Player with ID " + _playerId + " has stack for \"" + name + "\" greater than allowed (" +
    70                                          _count + " > " + maxAllowed + ")");
     69                                Log.Out ($"Player with ID {_playerId} has stack for \"{name}\" greater than allowed ({_count} > {maxAllowed})");
    7170                        }
    7271
     
    8079                        item.icon = itemClass.GetIconName ();
    8180
    82                         item.iconcolor = AllocsUtils.ColorToHex (itemClass.GetIconTint ());
     81                        item.iconcolor = itemClass.GetIconTint ().ToHexCode ();
    8382
    8483                        return item;
  • binary-improvements2/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs

    r391 r402  
    2222
    2323                public void Save () {
    24                         Stream stream = File.Open (GameIO.GetSaveGameDir () + "/AllocsPeristentData.bin", FileMode.Create);
     24                        Stream stream = File.Open ($"{GameIO.GetSaveGameDir ()}/AllocsPeristentData.bin", FileMode.Create);
    2525                        BinaryFormatter bFormatter = new BinaryFormatter ();
    2626                        bFormatter.Serialize (stream, this);
     
    2929
    3030                public static bool Load () {
    31                         if (!File.Exists (GameIO.GetSaveGameDir () + "/AllocsPeristentData.bin")) {
     31                        if (!File.Exists ($"{GameIO.GetSaveGameDir ()}/AllocsPeristentData.bin")) {
    3232                                return false;
    3333                        }
    3434
    3535                        try {
    36                                 Stream stream = File.Open (GameIO.GetSaveGameDir () + "/AllocsPeristentData.bin", FileMode.Open);
     36                                Stream stream = File.Open ($"{GameIO.GetSaveGameDir ()}/AllocsPeristentData.bin", FileMode.Open);
    3737                                BinaryFormatter bFormatter = new BinaryFormatter ();
    3838                                PersistentContainer obj = (PersistentContainer) bFormatter.Deserialize (stream);
  • binary-improvements2/7dtd-server-fixes/src/PersistentData/Player.cs

    r369 r402  
    117117                        }
    118118
    119                         Log.Out ("Player set to offline: " + platformId);
     119                        Log.Out ($"Player set to offline: {platformId}");
    120120                        lastOnline = DateTime.Now;
    121121                        try {
     
    133133
    134134                public void SetOnline (ClientInfo _ci) {
    135                         Log.Out ("Player set to online: " + platformId);
     135                        Log.Out ($"Player set to online: {platformId}");
    136136                        clientInfo = _ci;
    137137            entityId = _ci.entityId;
  • binary-improvements2/7dtd-server-fixes/src/PersistentData/Players.cs

    r391 r402  
    2222                                }
    2323
    24                                 Log.Out ("Created new player entry for ID: " + _platformId);
     24                                Log.Out ($"Created new player entry for ID: {_platformId}");
    2525                                Player p = new Player (_platformId);
    2626                                Dict.Add (_platformId, p);
Note: See TracChangeset for help on using the changeset viewer.