Changeset 403
- Timestamp:
- Feb 16, 2023, 3:46:14 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/7dtd-server-fixes/src/ModApi.cs
r402 r403 21 21 22 22 private void SavePlayerData (ClientInfo _cInfo, PlayerDataFile _playerDataFile) { 23 if (_cInfo == null) { 24 return; 25 } 26 23 27 PersistentContainer.Instance.Players [_cInfo.InternalId, true].Update (_playerDataFile); 24 28 } 25 29 26 30 private void PlayerSpawning (ClientInfo _cInfo, int _chunkViewDim, PlayerProfile _playerProfile) { 31 if (_cInfo == null) { 32 return; 33 } 34 27 35 string owner = null; 28 36 if (_cInfo.PlatformId is UserIdentifierSteam identifierSteam) { … … 36 44 37 45 private void PlayerDisconnected (ClientInfo _cInfo, bool _bShutdown) { 46 if (_cInfo == null) { 47 return; 48 } 49 38 50 Player p = PersistentContainer.Instance.Players [_cInfo.InternalId, false]; 39 51 if (p != null) { … … 47 59 48 60 private void PlayerSpawned (ClientInfo _cInfo, RespawnType _respawnReason, Vector3i _spawnPos) { 61 if (_cInfo == null) { 62 return; 63 } 64 49 65 PersistentContainer.Instance.Players [_cInfo.InternalId, true].SetOnline (_cInfo); 50 66 PersistentContainer.Instance.Save (); … … 56 72 private bool ChatMessage (ClientInfo _cInfo, EChatType _type, int _senderId, string _msg, string _mainName, 57 73 bool _localizeMain, List<int> _recipientEntityIds) { 74 if (_cInfo == null) { 75 return true; 76 } 77 58 78 if (string.IsNullOrEmpty (_msg) || !_msg.EqualsCaseInsensitive ("/alloc")) { 59 79 return true; 60 80 } 61 81 62 if (_cInfo != null) { 63 Log.Out ($"Sent chat hook reply to {_cInfo.InternalId}"); 64 _cInfo.SendPackage (NetPackageManager.GetPackage<NetPackageChat> ().Setup (EChatType.Whisper, -1, testChatAnswer, "", false, null)); 65 } else { 66 Log.Error ($"ChatHookExample: Argument _cInfo null on message: {_msg}"); 67 } 82 Log.Out ($"Sent chat hook reply to {_cInfo.InternalId}"); 83 _cInfo.SendPackage (NetPackageManager.GetPackage<NetPackageChat> ().Setup (EChatType.Whisper, -1, testChatAnswer, "", false, null)); 68 84 69 85 return false;
Note:
See TracChangeset
for help on using the changeset viewer.