Skip to content

Commit e9a0888

Browse files
committed
Update for 11.0.0
1 parent 87e1631 commit e9a0888

File tree

5 files changed

+53
-36
lines changed

5 files changed

+53
-36
lines changed

AdvancedCustomRoles/AdvancedCustomRoles.csproj

+22-16
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,35 @@
3131
<WarningLevel>4</WarningLevel>
3232
</PropertyGroup>
3333
<ItemGroup>
34-
<Reference Include="0Harmony, Version=2.0.4.0, Culture=neutral, processorArchitecture=MSIL">
35-
<HintPath>..\packages\Lib.Harmony.2.0.4\lib\net472\0Harmony.dll</HintPath>
34+
<Reference Include="0Harmony, Version=2.1.1.0, Culture=neutral, processorArchitecture=MSIL">
35+
<HintPath>..\packages\Lib.Harmony.2.1.1\lib\net472\0Harmony.dll</HintPath>
3636
</Reference>
3737
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
38-
<HintPath>..\packages\SynapseSL.2.6.0\lib\net472\Assembly-CSharp.dll</HintPath>
38+
<HintPath>..\packages\SynapseSL.2.7.0-dev3\lib\net472\Assembly-CSharp.dll</HintPath>
3939
</Reference>
4040
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
41-
<HintPath>..\packages\SynapseSL.2.6.0\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
41+
<HintPath>..\packages\SynapseSL.2.7.0-dev3\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
4242
</Reference>
43-
<Reference Include="LiteDB, Version=5.0.9.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
44-
<HintPath>..\packages\LiteDB.5.0.9\lib\net45\LiteDB.dll</HintPath>
43+
<Reference Include="LiteDB, Version=5.0.11.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
44+
<HintPath>..\packages\LiteDB.5.0.11\lib\net45\LiteDB.dll</HintPath>
4545
</Reference>
4646
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
47-
<HintPath>..\packages\SynapseSL.2.6.0\lib\net472\Mirror.dll</HintPath>
47+
<HintPath>..\packages\SynapseSL.2.7.0-dev3\lib\net472\Mirror.dll</HintPath>
4848
</Reference>
49-
<Reference Include="Synapse, Version=2.6.0.0, Culture=neutral, processorArchitecture=MSIL">
50-
<HintPath>..\packages\SynapseSL.2.6.0\lib\net472\Synapse.dll</HintPath>
49+
<Reference Include="Swan.Lite, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
50+
<HintPath>..\packages\Unosquare.Swan.Lite.3.1.0\lib\net461\Swan.Lite.dll</HintPath>
51+
</Reference>
52+
<Reference Include="Synapse, Version=2.7.0.0, Culture=neutral, processorArchitecture=MSIL">
53+
<HintPath>..\packages\SynapseSL.2.7.0-dev3\lib\net472\Synapse.dll</HintPath>
5154
</Reference>
5255
<Reference Include="System" />
5356
<Reference Include="System.Core" />
5457
<Reference Include="System.Runtime" />
55-
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
56-
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
58+
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
59+
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0-preview.7.21377.19\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
60+
</Reference>
61+
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
62+
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
5763
</Reference>
5864
<Reference Include="System.Xml.Linq" />
5965
<Reference Include="System.Data.DataSetExtensions" />
@@ -62,16 +68,16 @@
6268
<Reference Include="System.Net.Http" />
6369
<Reference Include="System.Xml" />
6470
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
65-
<HintPath>..\packages\SynapseSL.2.6.0\lib\net472\UnityEngine.dll</HintPath>
71+
<HintPath>..\packages\SynapseSL.2.7.0-dev3\lib\net472\UnityEngine.dll</HintPath>
6672
</Reference>
6773
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
68-
<HintPath>..\packages\SynapseSL.2.6.0\lib\net472\UnityEngine.CoreModule.dll</HintPath>
74+
<HintPath>..\packages\SynapseSL.2.7.0-dev3\lib\net472\UnityEngine.CoreModule.dll</HintPath>
6975
</Reference>
7076
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
71-
<HintPath>..\packages\SynapseSL.2.6.0\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
77+
<HintPath>..\packages\SynapseSL.2.7.0-dev3\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
7278
</Reference>
73-
<Reference Include="YamlDotNet, Version=8.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
74-
<HintPath>..\packages\YamlDotNet.8.1.2\lib\net45\YamlDotNet.dll</HintPath>
79+
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
80+
<HintPath>..\packages\YamlDotNet.11.2.1\lib\net45\YamlDotNet.dll</HintPath>
7581
</Reference>
7682
</ItemGroup>
7783
<ItemGroup>

AdvancedCustomRoles/AdvancedRoleScript.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public override void Spawn()
2828
Player.RoleType = CustomRole.Spawnrole;
2929
Player.MaxHealth = CustomRole.MaxHealth;
3030
Player.Health = CustomRole.SpawnHealth;
31-
Player.GodMode = CustomRole.GodMode;
31+
if (CustomRole.GodMode)
32+
Player.GodMode = true;
3233
CustomRole.Inventory.Apply(Player);
3334

3435
if (!string.IsNullOrWhiteSpace(CustomRole.DisplayInfo))

AdvancedCustomRoles/CustomRoleHandler.cs

+21-13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Synapse.Config;
66
using System.IO;
77
using Synapse.Api.Roles;
8+
using System;
89

910
namespace AdvancedCustomRoles
1011
{
@@ -37,22 +38,29 @@ public void Load()
3738

3839
foreach(var file in files)
3940
{
40-
var syml = new SYML(file);
41-
syml.Load();
42-
if(syml.Sections.Count == 0)
41+
try
4342
{
44-
Logger.Get.Warn($"[AdvancedCustomRoles] No Section found in {file}");
45-
continue;
43+
var syml = new SYML(file);
44+
syml.Load();
45+
if (syml.Sections.Count == 0)
46+
{
47+
Logger.Get.Warn($"[AdvancedCustomRoles] No Section found in {file}");
48+
continue;
49+
}
50+
var section = syml.Sections.FirstOrDefault().Value;
51+
var role = section.LoadAs<CustomRole>();
52+
if (Server.Get.RoleManager.IsIDRegistered(role.RoleID))
53+
{
54+
Logger.Get.Warn($"[AdvancedCustomRoles] CustomRole: {role.Name} is invalid since it ID is already registered please use a different one");
55+
continue;
56+
}
57+
CustomRoles.Add(role);
58+
Server.Get.RoleManager.RegisterCustomRole(new RoleInformation(role.Name, role.RoleID, typeof(AdvancedRoleScript)));
4659
}
47-
var section = syml.Sections.FirstOrDefault().Value;
48-
var role = section.LoadAs<CustomRole>();
49-
if (Server.Get.RoleManager.IsIDRegistered(role.RoleID))
60+
catch(Exception e)
5061
{
51-
Logger.Get.Warn($"[AdvancedCustomRoles] CustomRole: {role.Name} is invalid since it ID is already registered please use a different one");
52-
continue;
62+
Logger.Get.Error($"Error while loading CustomRole: {file}\n\n{e}");
5363
}
54-
CustomRoles.Add(role);
55-
Server.Get.RoleManager.RegisterCustomRole(new RoleInformation(role.Name, role.RoleID, typeof(AdvancedRoleScript)));
5664
}
5765
}
5866

@@ -81,7 +89,7 @@ public void CreateExampleFile(string path)
8189
},
8290
Items = new List<SerializedPlayerItem>
8391
{
84-
new SerializedPlayerItem(0,0f,0,0,0,UnityEngine.Vector3.one,100,false)
92+
new SerializedPlayerItem(0, 0, 0, UnityEngine.Vector3.one, 100, false)
8593
}
8694
},
8795
RemoveRoleName = true,

AdvancedCustomRoles/PluginClass.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace AdvancedCustomRoles
1111
SynapseMajor = 2,
1212
SynapseMinor = 5,
1313
SynapsePatch = 3,
14-
Version = "v.1.0.0"
14+
Version = "v.1.0.1"
1515
)]
1616
public class PluginClass : AbstractPlugin
1717
{

AdvancedCustomRoles/packages.config

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Lib.Harmony" version="2.0.4" targetFramework="net472" />
4-
<package id="LiteDB" version="5.0.9" targetFramework="net472" />
5-
<package id="SynapseSL" version="2.6.0" targetFramework="net472" />
6-
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
7-
<package id="YamlDotNet" version="8.1.2" targetFramework="net472" />
3+
<package id="Lib.Harmony" version="2.1.1" targetFramework="net472" />
4+
<package id="LiteDB" version="5.0.11" targetFramework="net472" />
5+
<package id="SynapseSL" version="2.7.0-dev3" targetFramework="net472" />
6+
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0-preview.7.21377.19" targetFramework="net472" />
7+
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
8+
<package id="Unosquare.Swan.Lite" version="3.1.0" targetFramework="net472" />
9+
<package id="YamlDotNet" version="11.2.1" targetFramework="net472" />
810
</packages>

0 commit comments

Comments
 (0)