Changeset 146
- Timestamp:
- Aug 30, 2014, 8:08:25 PM (10 years ago)
- Location:
- binary-improvements
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r144 r146 99 99 <Compile Include="src\PersistentData\Players.cs" /> 100 100 <Compile Include="src\PersistentData\Player.cs" /> 101 <Compile Include="src\CustomCommands\ListKnownPlayers.cs" /> 101 102 </ItemGroup> 102 103 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
binary-improvements/7dtd-server-fixes/src/AllocsLogFunctions.cs
r144 r146 30 30 31 31 PersistentContainer.Instance.Players[steamId].SetOnline(ci); 32 PersistentData.PersistentContainer.Instance.Save (); 32 33 } catch (Exception e) { 33 34 Log.Out ("Error in AllocsLogFunctions.RequestToSpawnPlayer: " + e); … … 42 43 if (players.SteamIDs.Contains(steamId)) 43 44 players[steamId].SetOffline(); 45 PersistentData.PersistentContainer.Instance.Save (); 44 46 } catch (Exception e) { 45 47 Log.Out ("Error in AllocsLogFunctions.PlayerDisconnected: " + e); -
binary-improvements/7dtd-server-fixes/src/CommandExtensions.cs
r140 r146 17 17 manager.m_GUIConsole.AddCommand (new Kill (manager.m_GUIConsole)); 18 18 manager.m_GUIConsole.AddCommand (new ListItems (manager.m_GUIConsole)); 19 manager.m_GUIConsole.AddCommand (new ListKnownPlayers (manager.m_GUIConsole)); 19 20 manager.m_GUIConsole.AddCommand (new ListLandProtection (manager.m_GUIConsole)); 20 21 manager.m_GUIConsole.AddCommand (new ListPlayersExtended (manager.m_GUIConsole)); -
binary-improvements/7dtd-server-fixes/src/CustomCommands/ListLandProtection.cs
r139 r146 59 59 foreach (KeyValuePair<PersistentPlayerData, List<Vector3i>> kvp in owners) { 60 60 if (steamIdFilter.Length == 0 || kvp.Key.PlayerId.Equals (steamIdFilter)) { 61 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromEntityID (kvp.Key.EntityId); 62 string name = string.Empty; 63 if (ci != null) { 64 name = CommonMappingFunctions.GetPlayerName (ci); 65 } 61 string name = PersistentData.PersistentContainer.Instance.Players[kvp.Key.PlayerId].Name; 66 62 name += " (" + kvp.Key.PlayerId + ")"; 67 63 -
binary-improvements/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs
r144 r146 45 45 { 46 46 if (File.Exists (StaticDirectories.GetSaveGameDir () + "/AllocsPeristentData.bin")) { 47 PersistentContainer obj; 48 Stream stream = File.Open (StaticDirectories.GetSaveGameDir () + "/AllocsPeristentData.bin", FileMode.Open); 49 BinaryFormatter bFormatter = new BinaryFormatter (); 50 obj = (PersistentContainer)bFormatter.Deserialize (stream); 51 stream.Close (); 52 instance = obj; 53 return true; 54 } else 55 return false; 47 try { 48 PersistentContainer obj; 49 Stream stream = File.Open (StaticDirectories.GetSaveGameDir () + "/AllocsPeristentData.bin", FileMode.Open); 50 BinaryFormatter bFormatter = new BinaryFormatter (); 51 obj = (PersistentContainer)bFormatter.Deserialize (stream); 52 stream.Close (); 53 instance = obj; 54 return true; 55 } catch (Exception e) { 56 Log.Out ("Exception in PersistentContainer.Load: " + e.Message); 57 } 58 } 59 return false; 56 60 } 57 61 -
binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs
r145 r146 13 13 private string ip; 14 14 private long totalPlayTime; 15 [OptionalField] 16 private DateTime 17 lastOnline; 15 18 private Inventory inventory; 16 19 [NonSerialized] … … 70 73 } 71 74 75 public DateTime LastOnline { 76 get { 77 if (IsOnline) 78 return DateTime.Now; 79 else 80 return lastOnline; 81 } 82 } 83 72 84 public void SetOffline () 73 85 { 74 86 Log.Out ("Player set to offline: " + steamId); 75 87 totalPlayTime += (long)(Time.timeSinceLevelLoad - Entity.CreationTimeSinceLevelLoad); 88 lastOnline = DateTime.Now; 76 89 clientInfo = null; 77 90 } -
binary-improvements/7dtd-server-fixes/src/PersistentData/Players.cs
r145 r146 29 29 public List<string> SteamIDs { 30 30 get { return new List<string> (players.Keys); } 31 } 32 33 public int Count { 34 get { return players.Count; } 31 35 } 32 36 -
binary-improvements/bin/Release/7dtd-server-fixes_version.txt
r145 r146 1 Version: 0.91.5355.3 33741 Version: 0.91.5355.36217
Note:
See TracChangeset
for help on using the changeset viewer.