Skip to content

Commit eeb029e

Browse files
committed
Update to Synapse 2.9.0
1 parent e2e15d3 commit eeb029e

19 files changed

+83
-120
lines changed

PvPArena/HubAddonConfig.cs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
using Synapse.Config;
1+
using MapGeneration;
22
using SLHub.Teleporter;
3+
using Synapse.Config;
34
using System.Collections.Generic;
45
using System.ComponentModel;
56

@@ -8,9 +9,9 @@ namespace PvPArena
89
public class HubAddonConfig : IConfigSection
910
{
1011
[Description("A List of all Rooms in which Item Usage is allowed")]
11-
public List<RoomInformation.RoomType> PvpRooms { get; set; } = new List<RoomInformation.RoomType>
12+
public List<RoomName> PvpRooms { get; set; } = new List<RoomName>
1213
{
13-
RoomInformation.RoomType.SURFACE
14+
RoomName.Outside
1415
};
1516

1617
[Description("A list of Dummies that gives the players a Item and then tp them")]
@@ -29,10 +30,7 @@ public class HubAddonConfig : IConfigSection
2930
Item = new SerializedItem
3031
{
3132
ID = (int)ItemType.Medkit,
32-
Barrel = 0,
3333
Durabillity = 0,
34-
Other = 0,
35-
Sight = 0,
3634
XSize = 1,
3735
YSize = 1,
3836
ZSize = 1,

PvPArena/ItemHolder.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using SLHub.Interactable;
22
using SLHub.Teleporter;
3+
using Synapse.Api;
34
using Synapse.Config;
45
using UnityEngine;
5-
using Synapse.Api;
66

77
namespace PvPArena
88
{

PvPArena/PvPArena.csproj

+16-16
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@
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.2.0.0, Culture=neutral, processorArchitecture=MSIL">
35+
<HintPath>..\packages\Lib.Harmony.2.2.0\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.5.3\lib\net472\Assembly-CSharp.dll</HintPath>
38+
<HintPath>..\packages\SynapseSL.2.8.1\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.5.3\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
41+
<HintPath>..\packages\SynapseSL.2.8.1\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.5.3\lib\net472\Mirror.dll</HintPath>
47+
<HintPath>..\packages\SynapseSL.2.8.1\lib\net472\Mirror.dll</HintPath>
4848
</Reference>
4949
<Reference Include="SLHub">
5050
<HintPath>..\SLHub\bin\Release\SLHub.dll</HintPath>
5151
</Reference>
52-
<Reference Include="Synapse, Version=2.5.3.0, Culture=neutral, processorArchitecture=MSIL">
53-
<HintPath>..\packages\SynapseSL.2.5.3\lib\net472\Synapse.dll</HintPath>
52+
<Reference Include="Synapse, Version=2.8.1.0, Culture=neutral, processorArchitecture=MSIL">
53+
<HintPath>..\packages\SynapseSL.2.8.1\lib\net472\Synapse.dll</HintPath>
5454
</Reference>
5555
<Reference Include="System" />
5656
<Reference Include="System.Core" />
5757
<Reference Include="System.Runtime" />
58-
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
59-
<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.2-mauipre.1.22102.15\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
6060
</Reference>
6161
<Reference Include="System.Xml.Linq" />
6262
<Reference Include="System.Data.DataSetExtensions" />
@@ -65,16 +65,16 @@
6565
<Reference Include="System.Net.Http" />
6666
<Reference Include="System.Xml" />
6767
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
68-
<HintPath>..\packages\SynapseSL.2.5.3\lib\net472\UnityEngine.dll</HintPath>
68+
<HintPath>..\packages\SynapseSL.2.8.1\lib\net472\UnityEngine.dll</HintPath>
6969
</Reference>
7070
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
71-
<HintPath>..\packages\SynapseSL.2.5.3\lib\net472\UnityEngine.CoreModule.dll</HintPath>
71+
<HintPath>..\packages\SynapseSL.2.8.1\lib\net472\UnityEngine.CoreModule.dll</HintPath>
7272
</Reference>
7373
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
74-
<HintPath>..\packages\SynapseSL.2.5.3\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
74+
<HintPath>..\packages\SynapseSL.2.8.1\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
7575
</Reference>
76-
<Reference Include="YamlDotNet, Version=8.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
77-
<HintPath>..\packages\YamlDotNet.8.1.2\lib\net45\YamlDotNet.dll</HintPath>
76+
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
77+
<HintPath>..\packages\YamlDotNet.11.2.1\lib\net45\YamlDotNet.dll</HintPath>
7878
</Reference>
7979
</ItemGroup>
8080
<ItemGroup>

PvPArena/PvpArenaAddon.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Load()
2020
private void Micro(Synapse.Api.Events.SynapseEventArguments.PlayerUseMicroEventArgs ev)
2121
{
2222
if (!Config.PvpRooms.Contains(ev.Player.Room.RoomType))
23-
ev.State = MicroHID.MicroHidState.Idle;
23+
ev.State = InventorySystem.Items.MicroHID.HidState.Idle;
2424
}
2525

2626
private void Throw(Synapse.Api.Events.SynapseEventArguments.PlayerThrowGrenadeEventArgs ev)

PvPArena/packages.config

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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.5.3" 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.2.0" targetFramework="net472" />
4+
<package id="LiteDB" version="5.0.11" targetFramework="net472" />
5+
<package id="SynapseSL" version="2.8.1" targetFramework="net472" />
6+
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.2-mauipre.1.22102.15" targetFramework="net472" />
7+
<package id="YamlDotNet" version="11.2.1" targetFramework="net472" />
88
</packages>

SLHub/Addons/AddonHandler.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using System.Collections.Generic;
2-
using Synapse.Config;
1+
using Synapse.Config;
2+
using System;
3+
using System.Collections.Generic;
34
using System.IO;
4-
using System.Reflection;
55
using System.Linq;
6-
using System;
6+
using System.Reflection;
77

88
namespace SLHub.Addons
99
{

SLHub/Addons/IHubAddon.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using Synapse.Config;
2-
3-
namespace SLHub.Addons
1+
namespace SLHub.Addons
42
{
53
public interface IHubAddon
64
{

SLHub/CustomPluginConfig.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using System.ComponentModel;
1+
using Synapse.Api.Enum;
22
using Synapse.Config;
33
using System.Collections.Generic;
4-
using Synapse.Api.Enum;
4+
using System.ComponentModel;
55

66
namespace SLHub
77
{

SLHub/EventHandlers.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
using Synapse;
1+
using MEC;
2+
using Synapse;
23
using Synapse.Api;
3-
using MEC;
44
using System.Collections.Generic;
55
using System.Linq;
6-
using UnityEngine;
76

87
namespace SLHub
98
{

SLHub/Interactable/IEnterable.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using UnityEngine;
2-
using Synapse.Api;
1+
using Synapse.Api;
2+
using UnityEngine;
33

44
namespace SLHub.Interactable
55
{

SLHub/Interactable/IHubDummy.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using UnityEngine;
2-
using Synapse.Api;
32

43
namespace SLHub.Interactable
54
{

SLHub/Interactable/IShootable.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using UnityEngine;
2-
using Synapse.Api;
1+
using Synapse.Api;
2+
using UnityEngine;
33

44
namespace SLHub.Interactable
55
{

SLHub/PluginClass.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using Synapse.Api.Plugin;
2-
using Synapse.Config;
3-
using Synapse;
4-
using System.IO;
5-
using SLHub.Addons;
6-
using SLHub.ServerTeleporter;
1+
using SLHub.Addons;
72
using SLHub.Interactable;
8-
using SLHub.Teleporter;
93
using SLHub.MessageDummy;
4+
using SLHub.ServerTeleporter;
5+
using SLHub.Teleporter;
6+
using Synapse;
7+
using Synapse.Api.Plugin;
8+
using Synapse.Config;
9+
using System.IO;
1010

1111
namespace SLHub
1212
{
@@ -16,9 +16,9 @@ namespace SLHub
1616
Description = "A Plugin that allows to create a Hub Server in SL",
1717
LoadPriority = 0,
1818
SynapseMajor = 2,
19-
SynapseMinor = 5,
20-
SynapsePatch = 2,
21-
Version = "v.1.0.0"
19+
SynapseMinor = 9,
20+
SynapsePatch = 0,
21+
Version = "v.1.0.1"
2222
)]
2323
public class PluginClass : AbstractPlugin
2424
{

SLHub/SLHub.csproj

+18-18
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@
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.2.0.0, Culture=neutral, processorArchitecture=MSIL">
35+
<HintPath>..\packages\Lib.Harmony.2.2.0\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.5.2\lib\net472\Assembly-CSharp.dll</HintPath>
38+
<HintPath>..\packages\SynapseSL.2.8.3-pre3\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.5.2\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
41+
<HintPath>..\packages\SynapseSL.2.8.3-pre3\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.5.2\lib\net472\Mirror.dll</HintPath>
47+
<HintPath>..\packages\SynapseSL.2.8.3-pre3\lib\net472\Mirror.dll</HintPath>
4848
</Reference>
49-
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
50-
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
49+
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
50+
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
5151
</Reference>
52-
<Reference Include="Synapse, Version=2.5.2.0, Culture=neutral, processorArchitecture=MSIL">
53-
<HintPath>..\packages\SynapseSL.2.5.2\lib\net472\Synapse.dll</HintPath>
52+
<Reference Include="Synapse, Version=2.8.1.0, Culture=neutral, processorArchitecture=MSIL">
53+
<HintPath>..\packages\SynapseSL.2.8.3-pre3\lib\net472\Synapse.dll</HintPath>
5454
</Reference>
5555
<Reference Include="System" />
5656
<Reference Include="System.Core" />
5757
<Reference Include="System.Runtime" />
58-
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
59-
<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.2-mauipre.1.22102.15\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
6060
</Reference>
6161
<Reference Include="System.Xml.Linq" />
6262
<Reference Include="System.Data.DataSetExtensions" />
@@ -65,16 +65,16 @@
6565
<Reference Include="System.Net.Http" />
6666
<Reference Include="System.Xml" />
6767
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
68-
<HintPath>..\packages\SynapseSL.2.5.2\lib\net472\UnityEngine.dll</HintPath>
68+
<HintPath>..\packages\SynapseSL.2.8.3-pre3\lib\net472\UnityEngine.dll</HintPath>
6969
</Reference>
7070
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
71-
<HintPath>..\packages\SynapseSL.2.5.2\lib\net472\UnityEngine.CoreModule.dll</HintPath>
71+
<HintPath>..\packages\SynapseSL.2.8.3-pre3\lib\net472\UnityEngine.CoreModule.dll</HintPath>
7272
</Reference>
7373
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
74-
<HintPath>..\packages\SynapseSL.2.5.2\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
74+
<HintPath>..\packages\SynapseSL.2.8.3-pre3\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
7575
</Reference>
76-
<Reference Include="YamlDotNet, Version=8.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
77-
<HintPath>..\packages\YamlDotNet.8.1.2\lib\net45\YamlDotNet.dll</HintPath>
76+
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
77+
<HintPath>..\packages\YamlDotNet.11.2.1\lib\net45\YamlDotNet.dll</HintPath>
7878
</Reference>
7979
</ItemGroup>
8080
<ItemGroup>

SLHub/ServerTeleporter/ServerConfig.cs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using System.ComponentModel;
2-
using Synapse.Config;
1+
using Synapse.Config;
32
using System;
43
using System.Collections.Generic;
4+
using System.ComponentModel;
55

66
namespace SLHub.ServerTeleporter
77
{
@@ -58,9 +58,6 @@ public enum Api
5858
{
5959
None,
6060
Northwood,
61-
Anomalous,
6261
Custom,
63-
//The new Synapse networking System
64-
//Synapse,
6562
}
6663
}

SLHub/ServerTeleporter/ServerHandler.cs

+3-31
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using Synapse;
1+
using MEC;
2+
using Synapse;
23
using Synapse.Api;
34
using System.Collections.Generic;
4-
using System.Net.Http;
5-
using MEC;
65
using System.Linq;
6+
using System.Net.Http;
77

88
namespace SLHub.ServerTeleporter
99
{
@@ -93,27 +93,6 @@ private IEnumerator<float> UpdatePlayers()
9393
server.Value.Player.DisplayInfo = server.Key.DisplayName + "\n" + responseserver.Players;
9494
}
9595
break;
96-
97-
case Api.Anomalous:
98-
if (string.IsNullOrWhiteSpace(Config.Ip)) break;
99-
100-
response = client.GetAsync("http://api.slservers.eu/game").Result;
101-
102-
if (!response.IsSuccessStatusCode)
103-
{
104-
Logger.Get.Warn($"[SlHub] ErrorCode from AnomalousServer: {response.StatusCode}\n{response.Content.ReadAsStringAsync().Result}");
105-
break;
106-
}
107-
108-
var anomalousresult = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AnomalousServer>>(response.Content.ReadAsStringAsync().Result);
109-
110-
foreach (var server in Servers)
111-
{
112-
var responseserver = anomalousresult.FirstOrDefault(x => x.Address == $"{Config.Ip}:{server.Key.Port}");
113-
if (responseserver == null) continue;
114-
server.Value.Player.DisplayInfo = server.Key.DisplayName + "\n" + $"{responseserver.Players}/{responseserver.MaxPlayers}";
115-
}
116-
break;
11796
}
11897

11998
yield return Timing.WaitForSeconds(Config.Cooldown);
@@ -131,11 +110,4 @@ public class Server
131110
public string Players { get; set; }
132111
}
133112
}
134-
135-
public class AnomalousServer
136-
{
137-
public string Address { get; set; }
138-
public int Players { get; set; }
139-
public int MaxPlayers { get; set; }
140-
}
141113
}

SLHub/ServerTeleporter/ServerTeleporter.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using Synapse.Api;
1+
using SLHub.Interactable;
2+
using Synapse.Api;
23
using UnityEngine;
3-
using SLHub.Interactable;
44

55
namespace SLHub.ServerTeleporter
66
{

SLHub/Teleporter/TeleporterConfig.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using System.ComponentModel;
2-
using Synapse.Config;
1+
using Synapse.Config;
32
using System;
43
using System.Collections.Generic;
4+
using System.ComponentModel;
55

66
namespace SLHub.Teleporter
77
{

0 commit comments

Comments
 (0)