Skip to content

Commit

Permalink
-Fixed property changes from 1.044
Browse files Browse the repository at this point in the history
-Fixed missing methods from 1.044
-Changed cube grid managers over to new manager manager
-Cleaned up compile warnings
  • Loading branch information
chessmaster42 committed Aug 21, 2014
1 parent a1fd9da commit c797258
Show file tree
Hide file tree
Showing 36 changed files with 193 additions and 143 deletions.
4 changes: 2 additions & 2 deletions SEConfigTool/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
//
// You can specify each value or set default values with '*', like showed below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.6.1")]
[assembly: AssemblyFileVersion("0.2.6.1")]
[assembly: AssemblyVersion("0.2.6.2")]
[assembly: AssemblyFileVersion("0.2.6.2")]
20 changes: 10 additions & 10 deletions SEConfigTool/SEConfigTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1587,8 +1587,8 @@ private void BTN_ContainerTypeConfig_Items_Apply_Click(object sender, EventArgs
ContainerTypeItem containerItem = containerType.Items[index];

containerItem.Id = (SerializableDefinitionId)CMB_ContainerTypeConfig_Items_Type.SelectedItem;
containerItem.AmountMin = Convert.ToInt32(TXT_ContainerTypeConfig_Item_AmountMin.Text, m_numberFormatInfo);
containerItem.AmountMax = Convert.ToInt32(TXT_ContainerTypeConfig_Item_AmountMax.Text, m_numberFormatInfo);
containerItem.AmountMin = TXT_ContainerTypeConfig_Item_AmountMin.Text;
containerItem.AmountMax = TXT_ContainerTypeConfig_Item_AmountMax.Text;
containerItem.Frequency = Convert.ToSingle(TXT_ContainerTypeConfig_Item_Frequency.Text, m_numberFormatInfo);

BTN_ContainerTypeConfig_Items_Apply.Enabled = false;
Expand Down Expand Up @@ -1630,8 +1630,8 @@ private void BTN_ContainerTypeConfig_Items_New_Click(object sender, EventArgs e)

//Set some default values for the new entry
containerItem.Id = new SerializableDefinitionId(new MyObjectBuilderType(typeof(MyObjectBuilder_Ore)), "Stone");
containerItem.AmountMin = 1;
containerItem.AmountMax = 1;
containerItem.AmountMin = "1";
containerItem.AmountMax = "1";

LST_ContainerTypeConfig_Details_Items.Items.Clear();
foreach (var def in containerType.Items)
Expand Down Expand Up @@ -1916,7 +1916,7 @@ private void LST_SpawnGroupConfig_Details_Prefabs_SelectedIndexChanged(object se
SpawnGroupDefinition spawnGroup = m_spawnGroupsDefinitionsManager.DefinitionOf(LST_SpawnGroupConfig.SelectedIndex);
SpawnGroupPrefab spawnGroupPrefab = spawnGroup.Prefabs[LST_SpawnGroupConfig_Details_Prefabs.SelectedIndex];

TXT_SpawnGroupConfig_Details_Prefabs_File.Text = spawnGroupPrefab.File;
TXT_SpawnGroupConfig_Details_Prefabs_File.Text = spawnGroupPrefab.SubtypeId;
TXT_SpawnGroupConfig_Details_Prefabs_Position.Text = spawnGroupPrefab.Position.ToString();
TXT_SpawnGroupConfig_Details_Prefabs_BeaconText.Text = spawnGroupPrefab.BeaconText;
TXT_SpawnGroupConfig_Details_Prefabs_Speed.Text = spawnGroupPrefab.Speed.ToString(m_numberFormatInfo);
Expand All @@ -1931,7 +1931,7 @@ private void BTN_SpawnGroupConfig_Prefabs_Apply_Click(object sender, EventArgs e
SpawnGroupDefinition spawnGroup = m_spawnGroupsDefinitionsManager.DefinitionOf(LST_SpawnGroupConfig.SelectedIndex);
SpawnGroupPrefab spawnGroupPrefab = spawnGroup.Prefabs[LST_SpawnGroupConfig_Details_Prefabs.SelectedIndex];

spawnGroupPrefab.File = TXT_SpawnGroupConfig_Details_Prefabs_File.Text;
spawnGroupPrefab.SubtypeId = TXT_SpawnGroupConfig_Details_Prefabs_File.Text;
spawnGroupPrefab.BeaconText = TXT_SpawnGroupConfig_Details_Prefabs_BeaconText.Text;
spawnGroupPrefab.Speed = Convert.ToSingle(TXT_SpawnGroupConfig_Details_Prefabs_Speed.Text, m_numberFormatInfo);

Expand Down Expand Up @@ -2298,7 +2298,7 @@ private void BTN_BlueprintConfig_Details_Result_Apply_Click(object sender, Event
SerializableDefinitionId selectedItem = (SerializableDefinitionId)CMB_BlueprintConfig_Details_Result_TypeId.SelectedValue;
blueprint.Result.TypeId = selectedItem.TypeId.ToString();
blueprint.Result.SubTypeId = selectedItem.SubtypeName;
blueprint.Result.Amount = Convert.ToDecimal(TXT_BlueprintConfig_Details_Result_Amount.Text, m_numberFormatInfo);
blueprint.Result.Amount = TXT_BlueprintConfig_Details_Result_Amount.Text;
blueprint.BaseProductionTimeInSeconds = Convert.ToSingle(TXT_BlueprintConfig_Details_Result_BaseProductionTime.Text, m_numberFormatInfo);

BTN_BlueprintConfig_Details_Result_Apply.Enabled = false;
Expand Down Expand Up @@ -2329,9 +2329,9 @@ private void BTN_BlueprintConfig_Details_Result_New_Click(object sender, EventAr
temp.Prerequisites[0] = new MyObjectBuilder_BlueprintDefinition.Item();
temp.Prerequisites[0].TypeId = selectedItem.TypeId.ToString();
temp.Prerequisites[0].SubtypeId = selectedItem.SubtypeName;
temp.Prerequisites[0].Amount = 1;
temp.Prerequisites[0].Amount = "1";
temp.Result = new MyObjectBuilder_BlueprintDefinition.Item();
temp.Result.Amount = 1;
temp.Result.Amount = "1";
temp.Result.TypeId = selectedItem.TypeId.ToString();
temp.Result.SubtypeId = selectedItem.SubtypeName;
BlueprintsDefinition blueprint = m_blueprintsDefinitionsManager.NewEntry(temp);
Expand Down Expand Up @@ -2401,7 +2401,7 @@ private void BTN_BlueprintConfig_Details_Prerequisites_Apply_Click(object sender
SerializableDefinitionId selectedItem = (SerializableDefinitionId)CMB_BlueprintConfig_Details_Prerequisites_TypeId.SelectedItem;
prereq.TypeId = selectedItem.TypeId.ToString();
prereq.SubTypeId = selectedItem.SubtypeName;
prereq.Amount = Convert.ToDecimal(TXT_BlueprintConfig_Details_Prerequisites_Amount.Text, m_numberFormatInfo);
prereq.Amount = TXT_BlueprintConfig_Details_Prerequisites_Amount.Text;

BTN_BlueprintConfig_Details_Prerequisites_Apply.Enabled = false;

Expand Down
3 changes: 1 addition & 2 deletions SEModAPI/API/Definitions/BlueprintsDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,11 @@ public BlueprintItemDefinition(MyObjectBuilder_BlueprintDefinition.Item definiti

#region "Properties"

public decimal Amount
public string Amount
{
get { return m_baseDefinition.Amount; }
set
{
if (value < 0) throw new ArgumentOutOfRangeException();
if (m_baseDefinition.Amount == value) return;
m_baseDefinition.Amount = value;
Changed = true;
Expand Down
4 changes: 2 additions & 2 deletions SEModAPI/API/Definitions/ContainerTypesDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public SerializableDefinitionId Id
}
}

public decimal AmountMin
public string AmountMin
{
get { return m_baseDefinition.AmountMin; }
set
Expand All @@ -150,7 +150,7 @@ public decimal AmountMin
}
}

public decimal AmountMax
public string AmountMax
{
get { return m_baseDefinition.AmountMax; }
set
Expand Down
2 changes: 1 addition & 1 deletion SEModAPI/API/Definitions/DedicatedConfigDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ public int AsteroidAmount
/// <summary>
/// Get or set the list of administrators of the server
/// </summary>
public List<ulong> Administrators
public List<string> Administrators
{
get { return m_definition.Administrators; }
set
Expand Down
8 changes: 4 additions & 4 deletions SEModAPI/API/Definitions/SpawnGroupsDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ public SpawnGroupPrefab(MyObjectBuilder_SpawnGroupDefinition.SpawnGroupPrefab my

#region "Properties"

public string File
public string SubtypeId
{
get { return m_baseDefinition.File; }
get { return m_baseDefinition.SubtypeId; }
set
{
if (m_baseDefinition.File == value) return;
m_baseDefinition.File = value;
if (m_baseDefinition.SubtypeId == value) return;
m_baseDefinition.SubtypeId = value;
Changed = true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions SEModAPI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
//
// You can specify each value or set default values with '*', like showed below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.6.3")]
[assembly: AssemblyFileVersion("0.2.6.3")]
[assembly: AssemblyVersion("0.2.6.4")]
[assembly: AssemblyFileVersion("0.2.6.4")]
6 changes: 6 additions & 0 deletions SEModAPIExtensions/API/BasicUnitTestManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ protected bool RunEntityReflectionUnitTests()
Console.WriteLine("CubeGridEntity reflection validation failed!");
}

if (!CubeGridManagerManager.ReflectionUnitTest())
{
result = false;
Console.WriteLine("CubeGridManagerManager reflection validation failed!");
}

if (!CubeGridNetworkManager.ReflectionUnitTest())
{
result = false;
Expand Down
2 changes: 1 addition & 1 deletion SEModAPIExtensions/API/CargoShipManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void SpawnCargoShipGroup(Vector3 startPosition, Vector3 stopPosition, ulo
Matrix orientation = Matrix.CreateLookAt(startPosition, stopPosition, new Vector3(0, 1, 0));
foreach (SpawnGroupPrefab entry in randomSpawnGroup.Prefabs)
{
FileInfo prefabFile = new FileInfo(Path.Combine(MyFileSystem.ContentPath, "Data", "Prefabs", entry.File + ".sbc"));
FileInfo prefabFile = new FileInfo(Path.Combine(MyFileSystem.ContentPath, "Data", "Prefabs", entry.SubtypeId + ".sbc"));
if (!prefabFile.Exists)
continue;

Expand Down
4 changes: 2 additions & 2 deletions SEModAPIExtensions/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.1.5.4")]
[assembly: AssemblyFileVersion("0.1.5.4")]
[assembly: AssemblyVersion("0.1.5.5")]
[assembly: AssemblyFileVersion("0.1.5.5")]
2 changes: 1 addition & 1 deletion SEModAPIInternal/API/Common/BlockRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected BlockRegistry()

#region "Properties"

public static BlockRegistry Instance
new public static BlockRegistry Instance
{
get
{
Expand Down
2 changes: 1 addition & 1 deletion SEModAPIInternal/API/Common/EntityRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected EntityRegistry()

#region "Properties"

public static EntityRegistry Instance
new public static EntityRegistry Instance
{
get
{
Expand Down
6 changes: 3 additions & 3 deletions SEModAPIInternal/API/Common/PlayerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,10 @@ public bool IsUserAdmin(ulong remoteUserId)
{
bool result = false;

List<ulong> adminUsers = SandboxGameAssemblyWrapper.Instance.GetServerConfig().Administrators;
foreach (ulong userId in adminUsers)
List<string> adminUsers = SandboxGameAssemblyWrapper.Instance.GetServerConfig().Administrators;
foreach (string userId in adminUsers)
{
if (remoteUserId == userId)
if (remoteUserId.ToString().Equals(userId))
{
result = true;
break;
Expand Down
2 changes: 1 addition & 1 deletion SEModAPIInternal/API/Entity/BaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ public class BaseEntityNetworkManager
public static string BaseEntityNetworkManagerNamespace = "5F381EA9388E0A32A8C817841E192BE8";
public static string BaseEntityNetworkManagerClass = "48D79F8E3C8922F14D85F6D98237314C";

public static string BaseEntityBroadcastRemovalMethod = "059822E72A1398A55B9CD2D8220517FA";
public static string BaseEntityBroadcastRemovalMethod = "F697CBD11E956415D8B314387B47FB26";

#endregion

Expand Down
33 changes: 0 additions & 33 deletions SEModAPIInternal/API/Entity/BaseObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,39 +1255,6 @@ public bool DeleteEntries<T>(Dictionary<long, T> entries) where T : BaseObject

#region "LoadContent"

public void Load(FileInfo sourceFile)
{
m_fileInfo = sourceFile;

//Get the definitions content from the file
MyObjectBuilder_Definitions definitionsContainer = LoadContentFile<MyObjectBuilder_Definitions, MyObjectBuilder_DefinitionsSerializer>(m_fileInfo);

if (m_definitionsContainerField == null)
throw new SEConfigurationException(SEConfigurationExceptionState.InvalidConfigurationFile, "Failed to find matching definitions field in the specified file.");

//Get the data from the definitions container
MyObjectBuilder_Base[] baseDefinitions = (MyObjectBuilder_Base[])m_definitionsContainerField.GetValue(definitionsContainer);

Load(baseDefinitions);
}

[Obsolete]
public void Load(MyObjectBuilder_Base[] source)
{
//Copy the data into the manager
GetInternalData().Clear();
foreach (var definition in source)
{
NewEntry<BaseObject>(definition);
}
}

[Obsolete]
public void Load(List<MyObjectBuilder_Base> source)
{
Load(source.ToArray());
}

public void Load<T>(T[] source) where T : BaseObject
{
//Copy the data into the manager
Expand Down
18 changes: 10 additions & 8 deletions SEModAPIInternal/API/Entity/InventoryEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
using SEModAPIInternal.API.Common;
using SEModAPIInternal.Support;

using VRage;

namespace SEModAPIInternal.API.Entity
{
[DataContract(Name = "InventoryEntityProxy")]
Expand Down Expand Up @@ -175,7 +177,7 @@ private set
result &= BaseObject.HasMethod(type, InventoryAddItemAmountMethod);

Type[] argTypes = new Type[3];
argTypes[0] = typeof(Decimal);
argTypes[0] = typeof(MyFixedPoint);
argTypes[1] = typeof(MyObjectBuilder_PhysicalObject);
argTypes[2] = typeof(bool);
result &= BaseObject.HasMethod(type, InventoryRemoveItemAmountMethod, argTypes);
Expand Down Expand Up @@ -293,13 +295,13 @@ protected void InternalUpdateItemAmount()
else
{
Type[] argTypes = new Type[3];
argTypes[0] = typeof(Decimal);
argTypes[0] = typeof(MyFixedPoint);
argTypes[1] = typeof(MyObjectBuilder_PhysicalObject);
argTypes[2] = typeof(bool);

method = BackingObject.GetType().GetMethod(InventoryRemoveItemAmountMethod, argTypes);
parameters = new object[] {
-delta,
(MyFixedPoint)(-delta),
m_itemToUpdate.ObjectBuilder.PhysicalContent,
Type.Missing
};
Expand Down Expand Up @@ -480,16 +482,16 @@ public uint ItemId
[Category("Container Item")]
public float Amount
{
get { return ObjectBuilder.Amount; }
get { return (float)ObjectBuilder.Amount; }
set
{
var baseEntity = ObjectBuilder;
if (baseEntity.Amount == value) return;
if ((float)baseEntity.Amount == value) return;

if(Container != null)
Container.UpdateItemAmount(this, (Decimal)value);

baseEntity.Amount = value;
baseEntity.Amount = (MyFixedPoint)value;
Changed = true;
}
}
Expand All @@ -514,15 +516,15 @@ public MyObjectBuilder_PhysicalObject PhysicalContent
[ReadOnly(true)]
public float TotalMass
{
get { return ObjectBuilder.Amount * m_itemMass; }
get { return (float)ObjectBuilder.Amount * m_itemMass; }
}

[IgnoreDataMember]
[Category("Container Item")]
[ReadOnly(true)]
public float TotalVolume
{
get { return ObjectBuilder.Amount * m_itemVolume; }
get { return (float)ObjectBuilder.Amount * m_itemVolume; }
}

[DataMember]
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 = "8423C9E35564E29E32B5C92CA8A43EF0";
public static string PowerProducerGetCurrentOutputMethod = "78A9BE3457EA670F4454CDFC00901C97";
public static string PowerProducerSetCurrentOutputMethod = "2D8329788C0824EA84F36DF8EA59E469";
public static string PowerProducerGetMaxPowerOutputMethod = "2D055C4B10A9429C81E1D145091516CA";
public static string PowerProducerGetCurrentOutputMethod = "E86AB8FEE976194868EC41F96B38A593";
public static string PowerProducerSetCurrentOutputMethod = "845BEE696F7E4854D8F76C77579A5364";

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class CharacterEntity : BaseEntity
public static string CharacterClass = "3B71F31E6039CAE9D8706B5F32FE468D";

public static string CharacterGetHealthMethod = "7047AFF5D44FC8A44572E92DBAD13011";
public static string CharacterDamageCharacterMethod = "CF6EEF37B5AE4047E65CA4A0BB43F774";
public static string CharacterDamageCharacterMethod = "DoDamage";
public static string CharacterSetHealthMethod = "92A0500FD8772AB1AC3A6F79FD2A1C72";
public static string CharacterGetBatteryMethod = "CF72A89940254CB8F535F177150FC743";
public static string CharacterGetInventoryMethod = "GetInventory";
Expand Down Expand Up @@ -92,7 +92,7 @@ public CharacterEntity(MyObjectBuilder_Character definition, Object backingObjec
[IgnoreDataMember]
[Browsable(false)]
[ReadOnly(true)]
internal static Type InternalType
new internal static Type InternalType
{
get
{
Expand Down Expand Up @@ -285,7 +285,7 @@ private set

#region "Methods"

public static bool ReflectionUnitTest()
new public static bool ReflectionUnitTest()
{
try
{
Expand Down
Loading

0 comments on commit c797258

Please sign in to comment.