Changeset 230 for binary-improvements/7dtd-server-fixes/src
- Timestamp:
- Apr 18, 2015, 4:27:57 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src
- Files:
-
- 1 added
- 6 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/AllocsLogFunctions.cs
r228 r230 8 8 public class AllocsLogFunctions 9 9 { 10 public static void RequestToSpawnPlayer ( GameManager manager,int _clientId, string _name, int _chunkViewDim, PlayerProfile _playerProfile)10 public static void RequestToSpawnPlayer (int _clientId, string _name, int _chunkViewDim, PlayerProfile _playerProfile) 11 11 { 12 12 try { 13 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromClientID (_clientId); 14 int entityId = CommonMappingFunctions.GetEntityID (ci); 15 EntityPlayer ep = CommonMappingFunctions.GetEntityPlayer (ci); 16 string steamId = CommonMappingFunctions.GetSteamID (ci); 17 18 string ip = ci.ip; 19 string name = string.Empty; 20 21 if (ep != null) 22 name = ep.EntityName; 13 ClientInfo ci = ConnectionManager.Instance.GetClient (_clientId); 23 14 24 15 Log.Out ("Player connected, clientid=" + _clientId + 25 ", entityid=" + entityId +26 ", name=" + name +27 ", steamid=" + steamId +28 ", ip=" + ip16 ", entityid=" + ci.entityId + 17 ", name=" + ci.playerName + 18 ", steamid=" + ci.playerId + 19 ", ip=" + ci.ip 29 20 ); 30 21 31 PersistentContainer.Instance.Players [ steamId].SetOnline (ci);22 PersistentContainer.Instance.Players [ci.playerId].SetOnline (ci); 32 23 PersistentData.PersistentContainer.Instance.Save (); 33 34 Mods.CallRequestToSpawnPlayer (_clientId, _name, _chunkViewDim, _playerProfile);35 24 } catch (Exception e) { 36 25 Log.Out ("Error in AllocsLogFunctions.RequestToSpawnPlayer: " + e); … … 38 27 } 39 28 40 public static void PlayerDisconnected (C onnectionManager manager, ClientInfo _cInfo, bool _bShutdown)29 public static void PlayerDisconnected (ClientInfo _cInfo, bool _bShutdown) 41 30 { 42 31 try { … … 48 37 } 49 38 PersistentData.PersistentContainer.Instance.Save (); 50 51 Mods.CallPlayerDisconnected (_cInfo, _bShutdown);52 39 } catch (Exception e) { 53 40 Log.Out ("Error in AllocsLogFunctions.PlayerDisconnected: " + e); -
binary-improvements/7dtd-server-fixes/src/AssemblyInfo.cs
r228 r230 18 18 // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 19 20 [assembly: AssemblyVersion("0.11 2.*")]20 [assembly: AssemblyVersion("0.113.*")] 21 21 22 22 // The following attributes are used to specify the signing key for the assembly, -
binary-improvements/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs
r146 r230 54 54 return true; 55 55 } catch (Exception e) { 56 Log.Out ("Exception in PersistentContainer.Load: " + e.Message); 56 Log.Error ("Exception in PersistentContainer.Load"); 57 Log.Exception (e); 57 58 } 58 59 } -
binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs
r228 r230 59 59 get { 60 60 if (IsOnline) { 61 return CommonMappingFunctions.GetEntityPlayer (clientInfo);61 return GameManager.Instance.World.Players.dict [clientInfo.entityId]; 62 62 } else { 63 63 return null; … … 116 116 Log.Out ("Player set to online: " + steamId); 117 117 clientInfo = ci; 118 entityId = CommonMappingFunctions.GetEntityID (ci);119 name = CommonMappingFunctions.GetPlayerName (ci);118 entityId = ci.entityId; 119 name = ci.playerName; 120 120 ip = ci.ip; 121 121 } -
binary-improvements/7dtd-server-fixes/src/PlayerDataStuff.cs
r224 r230 11 11 { 12 12 try { 13 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromClientID(_clientId); 14 string steamId = CommonMappingFunctions.GetSteamID(ci); 15 PersistentContainer.Instance.Players[steamId].Inventory.Update(_playerDataFile); 16 Mods.CallSavePlayerData (_clientId, _playerDataFile); 13 ClientInfo ci = ConnectionManager.Instance.GetClient (_clientId); 14 PersistentContainer.Instance.Players[ci.playerId].Inventory.Update(_playerDataFile); 17 15 } catch (Exception e) { 18 16 Log.Out ("Error in GM_SavePlayerData: " + e); -
binary-improvements/7dtd-server-fixes/src/StateManager.cs
r224 r230 1 using AllocsFixes.NetConnections.Servers.Telnet;2 1 using System; 3 2 using System.Reflection; … … 7 6 public class StateManager 8 7 { 9 public static void Awake ( GameManager manager)8 public static void Awake () 10 9 { 11 10 try { 12 11 Log.Out ("[7dtd-server-fixes by Alloc] Version: " + Assembly.GetExecutingAssembly ().GetName ().Version); 13 14 Mods.LoadMods ();15 Mods.CallGameAwake ();16 CommandExtensions.InitCommandExtensions (manager);17 18 new Telnet ();19 12 20 13 ItemList.Instance.Init (); … … 26 19 } 27 20 28 public static void Shutdown ( GameManager manager)21 public static void Shutdown () 29 22 { 30 23 try { 31 24 Log.Out ("Server shutting down!"); 32 Mods.CallGameShutdown ();33 25 PersistentData.PersistentContainer.Instance.Save (); 34 26 } catch (Exception e) {
Note:
See TracChangeset
for help on using the changeset viewer.