Changeset 306 for binary-improvements/7dtd-server-fixes/src
- Timestamp:
- Aug 2, 2017, 6:46:15 PM (7 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/JSON/JSONString.cs
r279 r306 33 33 case '\\': 34 34 case '"': 35 case '/':35 // case '/': 36 36 sb.Append ('\\'); 37 37 sb.Append (c); -
binary-improvements/7dtd-server-fixes/src/LiveData/Animals.cs
r252 r306 6 6 public class Animals 7 7 { 8 public static List<EntityAnimal> List { 9 get { 10 List<EntityAnimal> lst = new List<EntityAnimal> (); 8 public static void Get (List<EntityAnimal> _list) { 9 _list.Clear (); 10 try { 11 List<Entity> entities = GameManager.Instance.World.Entities.list; 12 for (int i = 0; i < entities.Count; i++) { 13 Entity entity = entities [i]; 11 14 12 try { 13 foreach (object base_entity in GameManager.Instance.World.Entities.list) { 14 try { 15 Entity entity = (Entity)base_entity; 15 // Kind of hack-ish, but the game is legitimately setting the base type of animals ('entityType') to enum 0 ('EntityType.Unknown'). 16 if ((entity.entityType == EntityType.Animal) || (entity is EntityAnimal)) { 17 EntityAnimal ea = (EntityAnimal)entity; 16 18 17 // Kind of hack-ish, but the game is legitimately setting the base type of animals ('entityType') to enum 0 ('EntityType.Unknown'). 18 if ((entity.entityType == EntityType.Animal) || (base_entity.GetType ().ToString ().ToLower ().Contains ("animal"))) { 19 EntityAnimal ea = (EntityAnimal)entity; 19 if (ea.IsAlive ()) 20 _list.Add (ea); 21 } 22 } 23 } 24 catch (Exception e) { 25 Log.Exception (e); 26 } 27 } 20 28 21 if (ea.IsAlive ()) 22 lst.Add (ea); 23 } 24 } 25 catch { } 26 } 27 } 28 catch { } 29 public static int GetCount () { 30 int count = 0; 31 try { 32 List<Entity> entities = GameManager.Instance.World.Entities.list; 33 for (int i = 0; i < entities.Count; i++) { 34 Entity entity = entities [i]; 29 35 30 return lst; 31 } 32 } 36 // Kind of hack-ish, but the game is legitimately setting the base type of animals ('entityType') to enum 0 ('EntityType.Unknown'). 37 if ((entity.entityType == EntityType.Animal) || (entity is EntityAnimal)) { 38 EntityAnimal ea = (EntityAnimal)entity; 33 39 40 if (ea.IsAlive ()) 41 count++; 42 } 43 } 44 } 45 catch (Exception e) { 46 Log.Exception (e); 47 } 48 return count; 49 } 34 50 35 public static int Count {36 get { return List.Count; }37 }38 51 } 39 52 } -
binary-improvements/7dtd-server-fixes/src/LiveData/Hostiles.cs
r252 r306 4 4 namespace AllocsFixes.LiveData 5 5 { 6 public class Hostiles 7 { 8 public static List<EntityEnemy> List { 9 get { 10 List<EntityEnemy> lst = new List<EntityEnemy> (); 6 public class Hostiles 7 { 8 public static void Get (List<EntityEnemy> _list) { 9 _list.Clear (); 10 try { 11 List<Entity> entities = GameManager.Instance.World.Entities.list; 12 for (int i = 0; i < entities.Count; i++) { 13 Entity entity = entities [i]; 11 14 12 try { 13 foreach (int ent_id in GameManager.Instance.World.Entities.dict.Keys) { 14 try { 15 Entity entity = GameManager.Instance.World.Entities.dict [ent_id]; 15 if (entity is EntityEnemy) { 16 if (entity.IsAlive ()) 17 _list.Add (entity as EntityEnemy); 18 } 19 } 20 } 21 catch (Exception e) { 22 Log.Exception (e); 23 } 24 } 16 25 17 if (entity.entityType == EntityType.Zombie) { 18 EntityEnemy ee = (EntityEnemy)entity; 26 public static int GetCount () { 27 int count = 0; 28 try { 29 List<Entity> entities = GameManager.Instance.World.Entities.list; 30 for (int i = 0; i < entities.Count; i++) { 31 Entity entity = entities [i]; 19 32 20 if (ee.IsAlive ()) 21 lst.Add (ee); 22 } 23 } 24 catch { } 25 } 26 } 27 catch { } 33 if (entity.entityType == EntityType.Zombie) { 34 EntityEnemy ee = (EntityEnemy)entity; 28 35 29 return lst; 30 } 31 } 32 33 public static int Count { 34 get { return List.Count; } 35 } 36 } 36 if (ee.IsAlive ()) 37 count++; 38 } 39 } 40 } 41 catch (Exception e) { 42 Log.Exception (e); 43 } 44 return count; 45 } 46 } 37 47 } 38 48 -
binary-improvements/7dtd-server-fixes/src/StateManager.cs
r232 r306 9 9 { 10 10 try { 11 ItemList.Instance.Init ();12 13 11 PersistentData.PersistentContainer.Load (); 14 12 } catch (Exception e) {
Note:
See TracChangeset
for help on using the changeset viewer.