Skip to content

Commit 50f65c6

Browse files
committed
Update to Rocket 4.2.0.0
1 parent 031b063 commit 50f65c6

File tree

6 files changed

+43
-26
lines changed

6 files changed

+43
-26
lines changed

Zamirathe_HomeCommand/CommandHome.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using Rocket.RocketAPI;
1+
using Rocket.API;
2+
using Rocket.Unturned.Commands;
3+
using Rocket.Unturned.Player;
24
using SDG;
35
using Steamworks;
46
using UnityEngine;
@@ -29,6 +31,13 @@ public string Help
2931
return "Teleports you to your bed if you have one.";
3032
}
3133
}
34+
public string Syntax
35+
{
36+
get
37+
{
38+
return "";
39+
}
40+
}
3241
public void Execute(RocketPlayer playerid, string[] bed)
3342
{
3443
HomePlayer homeplayer = playerid.Player.transform.GetComponent<HomePlayer>();

Zamirathe_HomeCommand/HomeCommand.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
using System;
22
using System.Collections.Generic;
3-
using Rocket.RocketAPI;
3+
using Rocket.API;
4+
using Rocket.Unturned;
5+
using Rocket.Unturned.Plugins;
6+
using Rocket.Unturned.Player;
47
using SDG;
58
using UnityEngine;
69
using Steamworks;
@@ -34,14 +37,14 @@ public static object[] CheckConfig(RocketPlayer player)
3437
if (!HomeCommand.Instance.Configuration.Enabled)
3538
{
3639
// Command disabled.
37-
RocketChatManager.Say(player, String.Format(HomeCommand.Instance.Configuration.DisabledMsg, player.CharacterName));
40+
RocketChat.Say(player, String.Format(HomeCommand.Instance.Configuration.DisabledMsg, player.CharacterName));
3841
return returnv;
3942
}
4043
// It is enabled, but are they in a vehicle?
4144
if (player.Stance == EPlayerStance.DRIVING || player.Stance == EPlayerStance.SITTING)
4245
{
4346
// They are in a vehicle.
44-
RocketChatManager.Say(player, String.Format(HomeCommand.Instance.Configuration.NoVehicleMsg, player.CharacterName));
47+
RocketChat.Say(player, String.Format(HomeCommand.Instance.Configuration.NoVehicleMsg, player.CharacterName));
4548
return returnv;
4649
}
4750
// They aren't in a vehicle, so check if they have a bed.
@@ -50,7 +53,7 @@ public static object[] CheckConfig(RocketPlayer player)
5053
if (!BarricadeManager.tryGetBed(player.CSteamID, out bedPos, out bedRot))
5154
{
5255
// Bed not found.
53-
RocketChatManager.Say(player, String.Format(HomeCommand.Instance.Configuration.NoBedMsg, player.CharacterName));
56+
RocketChat.Say(player, String.Format(HomeCommand.Instance.Configuration.NoBedMsg, player.CharacterName));
5457
return returnv;
5558
}
5659
object[] returnv2 = { true, bedPos, bedRot };

Zamirathe_HomeCommand/HomeCommandConfiguration.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
using Rocket.RocketAPI;
1+
using Rocket.API;
2+
using Rocket.Core;
23
using System;
34
using System.Collections.Generic;
45

56
namespace Zamirathe_HomeCommand
67
{
7-
public class HomeCommandConfiguration : IRocketConfiguration
8+
public class HomeCommandConfiguration : IRocketPluginConfiguration
89
{
910
public bool Enabled;
1011
public string DisabledMsg;
@@ -19,7 +20,7 @@ public class HomeCommandConfiguration : IRocketConfiguration
1920
public string UnableMoveSinceMoveMsg;
2021
public string NoTeleportDiedMsg;
2122

22-
public IRocketConfiguration DefaultConfiguration
23+
public IRocketPluginConfiguration DefaultConfiguration
2324
{
2425
get
2526
{

Zamirathe_HomeCommand/HomePlayer.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
using Rocket.Components;
2-
using Rocket.RocketAPI;
3-
using Rocket.Logging;
1+
using Rocket.API;
2+
using Rocket.Unturned;
3+
using Rocket.Unturned.Logging;
4+
using Rocket.Unturned.Player;
45
using SDG;
56
using Steamworks;
67
using UnityEngine;
@@ -52,17 +53,15 @@ public void GoHome(Vector3 bedPos, byte bedRot, RocketPlayer player)
5253
else
5354
{
5455
// Either not an admin or they don't get special wait restrictions.
55-
List<Group> hg = player.Groups;
56+
List<Rocket.Core.Permissions.Group> hg = player.GetGroups(true);
5657
if (hg.Count <= 0)
5758
{
58-
Group group = new Group();
59-
group.Id = "default";
60-
hg.Add(group);
59+
Logger.Log("There was an error as a player has no groups!");
6160
}
6261
byte[] time2 = new byte[hg.Count];
6362
for (byte g=0;g<hg.Count;g++)
6463
{
65-
Group hgr = hg[g];
64+
Rocket.Core.Permissions.Group hgr = hg[g];
6665
HomeCommand.Instance.WaitGroups.TryGetValue(hgr.Id, out time2[g]);
6766
if (time2[g] <= 0)
6867
{
@@ -77,11 +76,11 @@ public void GoHome(Vector3 bedPos, byte bedRot, RocketPlayer player)
7776
if (this.movementrestricted)
7877
{
7978
this.LastCalledHomePos = this.transform.position;
80-
RocketChatManager.Say(player, String.Format(HomeCommand.Instance.Configuration.FoundBedWaitNoMoveMsg, player.CharacterName, this.waittime));
79+
RocketChat.Say(player, String.Format(HomeCommand.Instance.Configuration.FoundBedWaitNoMoveMsg, player.CharacterName, this.waittime));
8180
}
8281
else
8382
{
84-
RocketChatManager.Say(player, String.Format(HomeCommand.Instance.Configuration.FoundBedNowWaitMsg, player.CharacterName, this.waittime));
83+
RocketChat.Say(player, String.Format(HomeCommand.Instance.Configuration.FoundBedNowWaitMsg, player.CharacterName, this.waittime));
8584
}
8685
}
8786
else
@@ -94,7 +93,7 @@ public void GoHome(Vector3 bedPos, byte bedRot, RocketPlayer player)
9493
private void DoGoHome()
9594
{
9695
if (!this.cangohome) return;
97-
RocketChatManager.Say(this.p, String.Format(HomeCommand.Instance.Configuration.TeleportMsg, this.p.CharacterName));
96+
RocketChat.Say(this.p, String.Format(HomeCommand.Instance.Configuration.TeleportMsg, this.p.CharacterName));
9897
this.p.Teleport(this.bedPos, this.bedRot);
9998
this.cangohome = false;
10099
this.GoingHome = false;
@@ -105,7 +104,7 @@ public void FixedUpdate()
105104
if (this.p.Dead)
106105
{
107106
// Abort teleport, they died.
108-
RocketChatManager.Say(this.p, String.Format(HomeCommand.Instance.Configuration.NoTeleportDiedMsg, this.p.CharacterName));
107+
RocketChat.Say(this.p, String.Format(HomeCommand.Instance.Configuration.NoTeleportDiedMsg, this.p.CharacterName));
109108
this.GoingHome = false;
110109
this.cangohome = false;
111110
return;
@@ -115,7 +114,7 @@ public void FixedUpdate()
115114
if (Vector3.Distance(this.p.Position, this.LastCalledHomePos) > 0.1)
116115
{
117116
// Abort teleport, they moved.
118-
RocketChatManager.Say(this.p, String.Format(HomeCommand.Instance.Configuration.UnableMoveSinceMoveMsg, this.p.CharacterName));
117+
RocketChat.Say(this.p, String.Format(HomeCommand.Instance.Configuration.UnableMoveSinceMoveMsg, this.p.CharacterName));
119118
this.GoingHome = false;
120119
this.cangohome = false;
121120
return;

Zamirathe_HomeCommand/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.1.0.4")]
36-
[assembly: AssemblyFileVersion("2.1.0.4")]
35+
[assembly: AssemblyVersion("2.1.1.0")]
36+
[assembly: AssemblyFileVersion("2.1.1.0")]

Zamirathe_HomeCommand/Zamirathe_HomeCommand.csproj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@
3838
<SpecificVersion>False</SpecificVersion>
3939
<HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
4040
</Reference>
41-
<Reference Include="RocketAPI, Version=3.8.0.0, Culture=neutral, processorArchitecture=MSIL">
42-
<SpecificVersion>False</SpecificVersion>
43-
<HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\RocketAPI.dll</HintPath>
41+
<Reference Include="Rocket.API">
42+
<HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\Rocket.API.dll</HintPath>
43+
</Reference>
44+
<Reference Include="Rocket.Core">
45+
<HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\Rocket.Core.dll</HintPath>
46+
</Reference>
47+
<Reference Include="Rocket.Unturned">
48+
<HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\Rocket.Unturned.dll</HintPath>
4449
</Reference>
4550
<Reference Include="System" />
4651
<Reference Include="System.Core" />

0 commit comments

Comments
 (0)