Skip to content

Commit 31c7588

Browse files
committed
Update to 3.1.0.0 Rocket
1 parent 0a03b48 commit 31c7588

File tree

5 files changed

+49
-31
lines changed

5 files changed

+49
-31
lines changed

Zamirathe_HomeCommand/CommandHome.cs

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,34 @@
66

77
namespace Zamirathe_HomeCommand
88
{
9-
public class CommandHome : Command
9+
public class CommandHome : IRocketCommand
1010
{
11-
public CommandHome()
11+
public bool RunFromConsole
1212
{
13-
this.commandName = "home";
14-
this.commandHelp = "Teleports you to your bed if you have one.";
15-
this.commandInfo = this.commandName + " - " + this.commandHelp;
13+
get
14+
{
15+
return false;
16+
}
1617
}
17-
18-
protected override void execute(SteamPlayerID playerid, string bed)
18+
public string Name
19+
{
20+
get
21+
{
22+
return "home";
23+
}
24+
}
25+
public string Help
26+
{
27+
get
28+
{
29+
return "Teleports you to your bed if you have one.";
30+
}
31+
}
32+
public void Execute(CSteamID playerid, string bed)
1933
{
20-
if (!RocketCommand.IsPlayer(playerid)) return;
21-
SteamPlayer player = PlayerTool.getSteamPlayer(playerid.CSteamID);
22-
HomePlayer homeplayer = player.Player.transform.GetComponent<HomePlayer>();
23-
object[] cont = HomeCommand.CheckConfig(player, homeplayer);
34+
Player player = PlayerTool.getPlayer(playerid);
35+
HomePlayer homeplayer = player.transform.GetComponent<HomePlayer>();
36+
object[] cont = HomeCommand.CheckConfig(player, playerid, homeplayer);
2437
if (!(bool)cont[0]) return;
2538
// A bed was found, so let's run a few checks.
2639
if (HomeCommand.Instance.Configuration.TeleportWait)
@@ -29,12 +42,12 @@ protected override void execute(SteamPlayerID playerid, string bed)
2942
if (HomeCommand.Instance.Configuration.MovementRestriction)
3043
{
3144
// Admin wants them not to move either. So let's send the appropriate msg and start the timer.
32-
RocketChatManager.Say(player.SteamPlayerID.CSteamID, String.Format(HomeCommand.Instance.Configuration.FoundBedWaitNoMoveMsg, player.Player.name, HomeCommand.Instance.Configuration.TeleportWaitTime));
45+
RocketChatManager.Say(playerid, String.Format(HomeCommand.Instance.Configuration.FoundBedWaitNoMoveMsg, player.name, HomeCommand.Instance.Configuration.TeleportWaitTime));
3346
}
3447
else
3548
{
3649
// Admin just wants them to wait but they can move.
37-
RocketChatManager.Say(player.SteamPlayerID.CSteamID, String.Format(HomeCommand.Instance.Configuration.FoundBedNowWaitMsg, player.Player.name, HomeCommand.Instance.Configuration.TeleportWaitTime));
50+
RocketChatManager.Say(playerid, String.Format(HomeCommand.Instance.Configuration.FoundBedNowWaitMsg, player.name, HomeCommand.Instance.Configuration.TeleportWaitTime));
3851
}
3952
}
4053
homeplayer.GoHome((Vector3)cont[1], (byte)cont[2], player);

Zamirathe_HomeCommand/HomeCommand.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Rocket.RocketAPI;
33
using SDG;
44
using UnityEngine;
5+
using Steamworks;
56

67
namespace Zamirathe_HomeCommand
78
{
@@ -16,30 +17,30 @@ protected override void Load()
1617
HomeCommand.Instance = this;
1718
}
1819
// All we are doing here is checking the config to see if anything like restricted movement or time restriction is enforced.
19-
public static object[] CheckConfig(SteamPlayer player, HomePlayer homeplayer)
20+
public static object[] CheckConfig(Player player, CSteamID playerid, HomePlayer homeplayer)
2021
{
2122
object[] returnv = { false, null, null };
2223
// First check if command is enabled.
2324
if (!HomeCommand.Instance.Configuration.Enabled)
2425
{
2526
// Command disabled.
26-
RocketChatManager.Say(player.SteamPlayerID.CSteamID, String.Format(HomeCommand.Instance.Configuration.DisabledMsg, player.SteamPlayerID.CharacterName));
27+
RocketChatManager.Say(playerid, String.Format(HomeCommand.Instance.Configuration.DisabledMsg, player.SteamChannel.SteamPlayer.SteamPlayerID.CharacterName));
2728
return returnv;
2829
}
2930
// It is enabled, but are they in a vehicle?
30-
if (player.Player.Stance.Stance == EPlayerStance.DRIVING || player.Player.Stance.Stance == EPlayerStance.SITTING)
31+
if (player.Stance.Stance == EPlayerStance.DRIVING || player.Stance.Stance == EPlayerStance.SITTING)
3132
{
3233
// They are in a vehicle.
33-
RocketChatManager.Say(player.SteamPlayerID.CSteamID, String.Format(HomeCommand.Instance.Configuration.NoVehicleMsg, player.SteamPlayerID.CharacterName));
34+
RocketChatManager.Say(playerid, String.Format(HomeCommand.Instance.Configuration.NoVehicleMsg, player.SteamChannel.SteamPlayer.SteamPlayerID.CharacterName));
3435
return returnv;
3536
}
3637
// They aren't in a vehicle, so check if they have a bed.
3738
Vector3 bedPos;
3839
byte bedRot;
39-
if (!BarricadeManager.tryGetBed(player.SteamPlayerID.CSteamID, out bedPos, out bedRot))
40+
if (!BarricadeManager.tryGetBed(playerid, out bedPos, out bedRot))
4041
{
4142
// Bed not found.
42-
RocketChatManager.Say(player.SteamPlayerID.CSteamID, String.Format(HomeCommand.Instance.Configuration.NoBedMsg, player.SteamPlayerID.CharacterName));
43+
RocketChatManager.Say(playerid, String.Format(HomeCommand.Instance.Configuration.NoBedMsg, player.SteamChannel.SteamPlayer.SteamPlayerID.CharacterName));
4344
return returnv;
4445
}
4546
object[] returnv2 = { true, bedPos, bedRot };

Zamirathe_HomeCommand/HomePlayer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ private void Load()
2525
this.GoingHome = false;
2626
this.cangohome = false;
2727
}
28-
public void GoHome(Vector3 bedPos, byte bedRot, SteamPlayer player)
28+
public void GoHome(Vector3 bedPos, byte bedRot, Player player)
2929
{
3030
this.waitrestricted = HomeCommand.Instance.Configuration.TeleportWait;
3131
this.waittime = HomeCommand.Instance.Configuration.TeleportWaitTime;
3232
this.movementrestricted = HomeCommand.Instance.Configuration.MovementRestriction;
33-
this.p = player.Player;
33+
this.p = player;
3434
this.bedPos = Vector3.up + bedPos;
3535
this.bedRot = bedRot;
3636

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.0.0.1")]
36-
[assembly: AssemblyFileVersion("2.0.0.1")]
35+
[assembly: AssemblyVersion("2.0.0.2")]
36+
[assembly: AssemblyFileVersion("2.0.0.2")]

Zamirathe_HomeCommand/Zamirathe_HomeCommand.csproj

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@
3030
<WarningLevel>4</WarningLevel>
3131
</PropertyGroup>
3232
<ItemGroup>
33-
<Reference Include="Assembly-CSharp">
34-
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\UnturnedServer\Unturned_Data\Managed\Assembly-CSharp.dll</HintPath>
33+
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
34+
<SpecificVersion>False</SpecificVersion>
35+
<HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\Assembly-CSharp.dll</HintPath>
3536
</Reference>
36-
<Reference Include="Assembly-CSharp-firstpass">
37-
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\UnturnedServer\Unturned_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
37+
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
38+
<SpecificVersion>False</SpecificVersion>
39+
<HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
3840
</Reference>
39-
<Reference Include="RocketAPI">
40-
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\UnturnedServer\Unturned_Data\Managed\RocketAPI.dll</HintPath>
41+
<Reference Include="RocketAPI, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
42+
<SpecificVersion>False</SpecificVersion>
43+
<HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\RocketAPI.dll</HintPath>
4144
</Reference>
4245
<Reference Include="System" />
4346
<Reference Include="System.Core" />
@@ -46,8 +49,9 @@
4649
<Reference Include="Microsoft.CSharp" />
4750
<Reference Include="System.Data" />
4851
<Reference Include="System.Xml" />
49-
<Reference Include="UnityEngine">
50-
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\UnturnedServer\Unturned_Data\Managed\UnityEngine.dll</HintPath>
52+
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
53+
<SpecificVersion>False</SpecificVersion>
54+
<HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\UnityEngine.dll</HintPath>
5155
</Reference>
5256
</ItemGroup>
5357
<ItemGroup>

0 commit comments

Comments
 (0)