Changeset 506


Ignore:
Timestamp:
Jun 11, 2025, 7:06:11 PM (3 days ago)
Author:
alloc
Message:

28_36_50: 2.0 compatibility changes

Location:
binary-improvements
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/7dtd-server-fixes/ModInfo.xml

    r501 r506  
    55        <Description value="Common functions" />
    66        <Author value="Christian 'Alloc' Illy" />
    7         <Version value="35" />
     7        <Version value="36" />
    88        <Website value="https://7dtd.illy.bz" />
    99</xml>
  • binary-improvements/7dtd-server-fixes/src/API.cs

    r493 r506  
    1616                }
    1717
    18                 private static void GameAwake () {
     18                private static void GameAwake (ref ModEvents.SGameStartDoneData _data) {
    1919                        PersistentContainer.Load ();
    2020                }
    2121
    22                 private static void SavePlayerData (ClientInfo _cInfo, PlayerDataFile _playerDataFile) {
    23                         PersistentContainer.Instance.Players.GetOrCreate (_cInfo.InternalId, _cInfo.PlatformId, _cInfo.CrossplatformId).Update (_cInfo, _playerDataFile);
     22                private static void SavePlayerData (ref ModEvents.SSavePlayerDataData _data) {
     23                        PersistentContainer.Instance.Players.GetOrCreate (_data.ClientInfo.InternalId, _data.ClientInfo.PlatformId, _data.ClientInfo.CrossplatformId).Update (_data.ClientInfo, _data.PlayerDataFile);
    2424                }
    2525
    26                 private static void PlayerSpawning (ClientInfo _cInfo, int _chunkViewDim, PlayerProfile _playerProfile) {
     26                private static void PlayerSpawning (ref ModEvents.SPlayerSpawningData _data) {
    2727                        string owner = null;
    28                         if (_cInfo.PlatformId is UserIdentifierSteam identifierSteam) {
     28                        if (_data.ClientInfo.PlatformId is UserIdentifierSteam identifierSteam) {
    2929                                owner = identifierSteam.OwnerId.ToString ();
    3030                        }
    3131
    3232                        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}"
     33                                $"Player connected, entityid={_data.ClientInfo.entityId}, name={_data.ClientInfo.playerName}, pltfmid={_data.ClientInfo.PlatformId?.CombinedString ?? "<unknown>"}, crossid={_data.ClientInfo.CrossplatformId?.CombinedString ?? "<unknown/none>"}, steamOwner={owner ?? "<unknown/none>"}, ip={_data.ClientInfo.ip}"
    3434                        );
    3535                }
    3636
    37                 private static void PlayerDisconnected (ClientInfo _cInfo, bool _bShutdown) {
    38                         Player p = PersistentContainer.Instance.Players.GetByInternalId (_cInfo.InternalId);
     37                private static void PlayerDisconnected (ref ModEvents.SPlayerDisconnectedData _data) {
     38                        Player p = PersistentContainer.Instance.Players.GetByInternalId (_data.ClientInfo.InternalId);
    3939                        if (p != null) {
    4040                                p.SetOffline ();
     
    4646                }
    4747
    48                 private static void PlayerSpawned (ClientInfo _cInfo, RespawnType _respawnReason, Vector3i _spawnPos) {
    49                         if (_cInfo == null) {
     48                private static void PlayerSpawned (ref ModEvents.SPlayerSpawnedInWorldData _data) {
     49                        if (_data.ClientInfo == null) {
    5050                                return;
    5151                        }
    5252                       
    53                         PersistentContainer.Instance.Players.GetOrCreate (_cInfo.InternalId, _cInfo.PlatformId, _cInfo.CrossplatformId).SetOnline (_cInfo);
     53                        PersistentContainer.Instance.Players.GetOrCreate (_data.ClientInfo.InternalId, _data.ClientInfo.PlatformId, _data.ClientInfo.CrossplatformId).SetOnline (_data.ClientInfo);
    5454                        PersistentContainer.Instance.Save ();
    5555                }
     
    5757                private const string ANSWER = "     [ff0000]I[-] [ff7f00]W[-][ffff00]A[-][80ff00]S[-] [00ffff]H[-][0080ff]E[-][0000ff]R[-][8b00ff]E[-]";
    5858
    59                 private static bool ChatMessage (ClientInfo _cInfo, EChatType _type, int _senderId, string _msg, string _mainName,
    60                         List<int> _recipientEntityIds) {
    61                         if (string.IsNullOrEmpty (_msg) || !_msg.EqualsCaseInsensitive ("/alloc")) {
    62                                 return true;
     59                private static ModEvents.EModEventResult ChatMessage (ref ModEvents.SChatMessageData _data) {
     60                        if (string.IsNullOrEmpty (_data.Message) || !_data.Message.EqualsCaseInsensitive ("/alloc")) {
     61                                return ModEvents.EModEventResult.Continue;
    6362                        }
    6463
    65                         if (_cInfo != null) {
    66                                 Log.Out ($"Sent chat hook reply to {_cInfo.InternalId}");
    67                                 _cInfo.SendPackage (NetPackageManager.GetPackage<NetPackageChat> ().Setup (EChatType.Whisper, -1, ANSWER,  null, EMessageSender.Server));
     64                        if (_data.ClientInfo != null) {
     65                                Log.Out ($"Sent chat hook reply to {_data.ClientInfo.InternalId}");
     66                                _data.ClientInfo.SendPackage (NetPackageManager.GetPackage<NetPackageChat> ().Setup (EChatType.Whisper, -1, ANSWER,  null, EMessageSender.Server, GeneratedTextManager.BbCodeSupportMode.Supported));
    6867                        } else {
    69                                 Log.Error ($"ChatHookExample: Argument _cInfo null on message: {_msg}");
     68                                Log.Error ($"ChatHookExample: Argument _cInfo null on message: {_data.Message}");
    7069                        }
    7170
    72                         return false;
     71                        return ModEvents.EModEventResult.StopHandlersAndVanilla;
    7372                }
    7473        }
  • binary-improvements/AllocsCommands/ModInfo.xml

    r488 r506  
    55        <Description value="Additional commands for server operation" />
    66        <Author value="Christian 'Alloc' Illy" />
    7         <Version value="27" />
     7        <Version value="28" />
    88        <Website value="https://7dtd.illy.bz" />
    99</xml>
  • binary-improvements/MapRendering/ModInfo.xml

    r501 r506  
    55        <Description value="Render the game map to image map tiles as it is uncovered" />
    66        <Author value="Christian 'Alloc' Illy" />
    7         <Version value="49" />
     7        <Version value="50" />
    88        <Website value="https://7dtd.illy.bz" />
    99</xml>
  • binary-improvements/bin/Mods/Allocs_CommandExtensions/ModInfo.xml

    r488 r506  
    55        <Description value="Additional commands for server operation" />
    66        <Author value="Christian 'Alloc' Illy" />
    7         <Version value="27" />
     7        <Version value="28" />
    88        <Website value="https://7dtd.illy.bz" />
    99</xml>
  • binary-improvements/bin/Mods/Allocs_CommonFunc/ModInfo.xml

    r501 r506  
    55        <Description value="Common functions" />
    66        <Author value="Christian 'Alloc' Illy" />
    7         <Version value="35" />
     7        <Version value="36" />
    88        <Website value="https://7dtd.illy.bz" />
    99</xml>
  • binary-improvements/bin/Mods/Allocs_WebAndMapRendering/ModInfo.xml

    r501 r506  
    55        <Description value="Render the game map to image map tiles as it is uncovered" />
    66        <Author value="Christian 'Alloc' Illy" />
    7         <Version value="49" />
     7        <Version value="50" />
    88        <Website value="https://7dtd.illy.bz" />
    99</xml>
Note: See TracChangeset for help on using the changeset viewer.