Skip to content

Commit

Permalink
-Fixed missing methods from 1.042.020
Browse files Browse the repository at this point in the history
-Removed use of a couple internal fields that weren't necessary
  • Loading branch information
chessmaster42 committed Aug 8, 2014
1 parent 89c4909 commit da4e81e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
25 changes: 6 additions & 19 deletions SEModAPIInternal/API/Entity/BaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public class BaseEntity : BaseObject
public static string BaseEntityGetIsDisposedMethod = "6D8F627C1C0F9F166031C3B600FEDA60";
public static string BaseEntityGetOrientationMatrixMethod = "FD50436D896ACC794550210055349FE0";
public static string BaseEntityGetNetManagerMethod = "F4456F82186EC3AE6C73294FA6C0A11D";
public static string BaseEntityGetEntityIdMethod = "D375F9CCBD9813573075E664DE71537C";
public static string BaseEntitySetEntityIdMethod = "D3D6702587D6336FEE37725E8D2C52CD";

public static string BaseEntityEntityIdField = "F7E51DBA5F2FD0CCF8BBE66E3573BEAC";
Expand Down Expand Up @@ -516,7 +515,6 @@ public static bool ReflectionUnitTest()
result &= HasMethod(type, BaseEntityGetIsDisposedMethod);
result &= HasMethod(type, BaseEntityGetOrientationMatrixMethod);
result &= HasMethod(type, BaseEntityGetNetManagerMethod);
result &= HasMethod(type, BaseEntityGetEntityIdMethod);
result &= HasMethod(type, BaseEntitySetEntityIdMethod);
result &= HasField(type, BaseEntityEntityIdField);

Expand Down Expand Up @@ -590,25 +588,14 @@ internal static long GetEntityId(Object entity)
try
{
long entityId = 0L;
bool oldDebuggingSetting = SandboxGameAssemblyWrapper.IsDebugging;
SandboxGameAssemblyWrapper.IsDebugging = false;
bool hasGetter = HasMethod(InternalType, BaseEntityGetEntityIdMethod);
SandboxGameAssemblyWrapper.IsDebugging = oldDebuggingSetting;
if (hasGetter)
try
{
entityId = (long)InvokeEntityMethod(entity, BaseEntityGetEntityIdMethod);
FieldInfo field = GetEntityField(entity, BaseEntityEntityIdField);
entityId = (long)field.GetValue(entity);
}
else
catch (Exception ex)
{
try
{
FieldInfo field = GetEntityField(entity, BaseEntityEntityIdField);
entityId = (long)field.GetValue(entity);
}
catch (Exception ex)
{
LogManager.ErrorLog.WriteLine(ex);
}
LogManager.ErrorLog.WriteLine(ex);
}
return entityId;
}
Expand Down Expand Up @@ -787,7 +774,7 @@ public class BaseEntityNetworkManager
public static string BaseEntityNetworkManagerNamespace = "5F381EA9388E0A32A8C817841E192BE8";
public static string BaseEntityNetworkManagerClass = "48D79F8E3C8922F14D85F6D98237314C";

public static string BaseEntityBroadcastRemovalMethod = "F9B21909ACDD17B83644D733770FBD1F";
public static string BaseEntityBroadcastRemovalMethod = "0FB4C6258DADADC26F68B0E66F5F8880";

#endregion

Expand Down
6 changes: 3 additions & 3 deletions SEModAPIInternal/API/Entity/PowerProducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class PowerProducer
public static string PowerProducerNamespace = "FB8C11741B7126BD9C97FE76747E087F";
public static string PowerProducerClass = "7E69388ED0DB47818FB7AFF9F16C6EDA";

public static string PowerProducerGetMaxPowerOutputMethod = "9A2DDABB596ECE77D1081FF94A01C6FE";
public static string PowerProducerGetCurrentOutputMethod = "594151486E89E3FBDF938E4ED45E4101";
public static string PowerProducerSetCurrentOutputMethod = "EC340CC4708DAAD61CAECEFED53F1FE9";
public static string PowerProducerGetMaxPowerOutputMethod = "76FD8E0B2EFDFCA3480DCB00C0AA2818";
public static string PowerProducerGetCurrentOutputMethod = "225CE0D4BF4EE7A1ECCCA6574B34B214";
public static string PowerProducerSetCurrentOutputMethod = "B7380636860CA1CC479BAD06EE8033E0";

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class CharacterEntity : BaseEntity
public static string CharacterBatteryNamespace = "FB8C11741B7126BD9C97FE76747E087F";
public static string CharacterBatteryClass = "328929D5EC05DF770D51383F6FC0B025";

public static string CharacterBatteryGetBatteryCapacityMethod = "801FC39A6BCF0D54870FF69685C9FB74";
public static string CharacterBatterySetBatteryCapacityMethod = "C3BF60F3540A8A48CB8FEE0CDD3A95C6";

public static string CharacterBatteryCapacityField = "0BAEC0F968A4BEAE30E7C46D9406765C";
Expand Down Expand Up @@ -300,7 +299,6 @@ public static bool ReflectionUnitTest()
Type type2 = SandboxGameAssemblyWrapper.Instance.GetAssemblyType(CharacterBatteryNamespace, CharacterBatteryClass);
if (type2 == null)
throw new Exception("Could not find battery type for CharacterEntity");
result &= BaseObject.HasMethod(type2, CharacterBatteryGetBatteryCapacityMethod);
result &= BaseObject.HasMethod(type2, CharacterBatterySetBatteryCapacityMethod);
result &= BaseObject.HasField(type2, CharacterBatteryCapacityField);

Expand Down

0 comments on commit da4e81e

Please sign in to comment.