Permalink
Browse files

Update to Rocket 4.0

  • Loading branch information...
1 parent d6fc26d commit b8afd7f83e0225424b37752264787de5193f3442 @Zamirathe Zamirathe committed May 17, 2015
@@ -1,5 +1,7 @@
using System;
-using Rocket.RocketAPI;
+using Rocket.API;
+using Rocket.Unturned.Commands;
+using Rocket.Unturned.Player;
namespace UconomyBasicShop
{
@@ -1,6 +1,7 @@
using System;
-using Rocket.RocketAPI;
-using Rocket.Logging;
+using Rocket.API;
+using Rocket.Unturned.Commands;
+using Rocket.Unturned.Player;
using SDG;
using UnityEngine;
using unturned.ROCKS.Uconomy;
@@ -1,5 +1,7 @@
using System;
-using Rocket.RocketAPI;
+using Rocket.API;
+using Rocket.Unturned.Commands;
+using Rocket.Unturned.Player;
namespace UconomyBasicShop
{
@@ -1,7 +1,10 @@
using System;
using System.Collections.Generic;
-using Rocket.RocketAPI;
-using Rocket.Logging;
+using Rocket.API;
+using Rocket.Unturned;
+using Rocket.Unturned.Commands;
+using Rocket.Unturned.Logging;
+using Rocket.Unturned.Player;
using SDG;
using UnityEngine;
using Steamworks;
@@ -86,7 +89,7 @@ public void Execute(RocketPlayer playerid, string[] msg)
if (!anyuse)
{
// Assume this is a player
- RocketChatManager.Say(playerid, "You don't have permission to use the /shop command.");
+ RocketChat.Say(playerid, "You don't have permission to use the /shop command.");
return;
}
if (msg.Length == 0)
@@ -260,7 +263,7 @@ private void sendMessage(RocketPlayer playerid, string message, bool console)
}
else
{
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
}
}
}
@@ -1,7 +1,7 @@
using I18N.West;
using MySql.Data.MySqlClient;
-using Rocket.Logging;
-using Rocket.RocketAPI;
+using Rocket.Unturned.Logging;
+using Rocket.API;
using System;
using unturned.ROCKS.Uconomy;
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.1.0")]
-[assembly: AssemblyFileVersion("1.2.1.0")]
+[assembly: AssemblyVersion("1.2.2.0")]
+[assembly: AssemblyFileVersion("1.2.2.0")]
@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
-using Rocket.RocketAPI;
-using Rocket.Logging;
+using Rocket.API;
+using Rocket.Unturned;
+using Rocket.Unturned.Player;
+using Rocket.Unturned.Plugins;
using SDG;
using UnityEngine;
using unturned.ROCKS.Uconomy;
@@ -197,7 +199,7 @@ public void Buy(RocketPlayer playerid, string[] components0)
{
message = UconomyBasicShop.Instance.Translate("buy_command_usage", new object[] {});
// We are going to print how to use
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
byte amttobuy = 1;
@@ -210,7 +212,7 @@ public void Buy(RocketPlayer playerid, string[] components0)
{
message = UconomyBasicShop.Instance.Translate("buy_command_usage", new object[] { });
// We are going to print how to use
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
ushort id;
@@ -220,7 +222,7 @@ public void Buy(RocketPlayer playerid, string[] components0)
if (!UconomyBasicShop.Instance.Configuration.CanBuyVehicles)
{
message = UconomyBasicShop.Instance.Translate("buy_vehicles_off", new object[] { });
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
string name = "";
@@ -243,7 +245,7 @@ public void Buy(RocketPlayer playerid, string[] components0)
{
message = UconomyBasicShop.Instance.Translate("could_not_find", new object[] {
components[1]});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
else if (name == null && id != 0)
@@ -255,33 +257,33 @@ public void Buy(RocketPlayer playerid, string[] components0)
if (cost <= 0m)
{
message = UconomyBasicShop.Instance.Translate("vehicle_not_available", new object[] {name});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
if (balance < cost)
{
message = UconomyBasicShop.Instance.Translate("not_enough_currency_msg", new object[] {Uconomy.Instance.Configuration.MoneyName, name});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
if (!playerid.GiveVehicle(id))
{
message = UconomyBasicShop.Instance.Translate("error_giving_item", new object[] { name });
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
decimal newbal = Uconomy.Instance.Database.IncreaseBalance(playerid.CSteamID, (cost * -1));
message = UconomyBasicShop.Instance.Translate("vehicle_buy_msg", new object[] {name, cost, Uconomy.Instance.Configuration.MoneyName, newbal, Uconomy.Instance.Configuration.MoneyName});
if (UconomyBasicShop.Instance.OnShopBuy != null)
UconomyBasicShop.Instance.OnShopBuy(playerid, cost, 1, id, "vehicle");
playerid.Player.gameObject.SendMessage("ZaupShopOnBuy", new object[] { playerid, cost, amttobuy, id, "vehicle" }, SendMessageOptions.DontRequireReceiver);
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
break;
default:
if (!UconomyBasicShop.Instance.Configuration.CanBuyItems)
{
message = UconomyBasicShop.Instance.Translate("buy_items_off", new object[] { });
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
name = null;
@@ -303,7 +305,7 @@ public void Buy(RocketPlayer playerid, string[] components0)
if (name == null && id == 0)
{
message = UconomyBasicShop.Instance.Translate("could_not_find", new object[] {components[0]});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
@@ -316,13 +318,13 @@ public void Buy(RocketPlayer playerid, string[] components0)
if (cost <= 0m)
{
message = UconomyBasicShop.Instance.Translate("item_not_available", new object[] {name});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
if (balance < cost)
{
message = UconomyBasicShop.Instance.Translate("not_enough_currency_msg", new object[] {Uconomy.Instance.Configuration.MoneyName, amttobuy, name});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
playerid.GiveItem(id, amttobuy, false);
@@ -331,7 +333,7 @@ public void Buy(RocketPlayer playerid, string[] components0)
if (UconomyBasicShop.Instance.OnShopBuy != null)
UconomyBasicShop.Instance.OnShopBuy(playerid, cost, amttobuy, id);
playerid.Player.gameObject.SendMessage("ZaupShopOnBuy", new object[] { playerid, cost, amttobuy, id, "item" }, SendMessageOptions.DontRequireReceiver);
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
break;
}
}
@@ -342,14 +344,14 @@ public void Cost(RocketPlayer playerid, string[] components)
{
message = UconomyBasicShop.Instance.Translate("cost_command_usage", new object[] { });
// We are going to print how to use
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
if (components.Length == 2 && components[0] != "v")
{
message = UconomyBasicShop.Instance.Translate("cost_command_usage", new object[] { });
// We are going to print how to use
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
ushort id;
@@ -375,7 +377,7 @@ public void Cost(RocketPlayer playerid, string[] components)
if (name == null && id == 0)
{
message = UconomyBasicShop.Instance.Translate("could_not_find", new object[] {components[1]});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
else if (name == null && id != 0)
@@ -388,7 +390,7 @@ public void Cost(RocketPlayer playerid, string[] components)
{
message = UconomyBasicShop.Instance.Translate("error_getting_cost", new object[] {name});
}
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
break;
default:
name = null;
@@ -410,7 +412,7 @@ public void Cost(RocketPlayer playerid, string[] components)
if (name == null && id == 0)
{
message = UconomyBasicShop.Instance.Translate("could_not_find", new object[] {components[0]});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
else if (name == null && id != 0)
@@ -424,7 +426,7 @@ public void Cost(RocketPlayer playerid, string[] components)
{
message = UconomyBasicShop.Instance.Translate("error_getting_cost", new object[] {name});
}
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
break;
}
}
@@ -435,7 +437,7 @@ public void Sell(RocketPlayer playerid, string[] components)
{
message = UconomyBasicShop.Instance.Translate("sell_command_usage", new object[] { });
// We are going to print how to use
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
byte amttosell = 1;
@@ -448,7 +450,7 @@ public void Sell(RocketPlayer playerid, string[] components)
if (!UconomyBasicShop.Instance.Configuration.CanSellItems)
{
message = UconomyBasicShop.Instance.Translate("sell_items_off", new object[] { });
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
string name = null;
@@ -471,7 +473,7 @@ public void Sell(RocketPlayer playerid, string[] components)
if (name == null && id == 0)
{
message = UconomyBasicShop.Instance.Translate("could_not_find", new object[] {components[0]});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
else if (name == null && id != 0)
@@ -483,14 +485,14 @@ public void Sell(RocketPlayer playerid, string[] components)
if (playerid.Inventory.has(id) == null)
{
message = UconomyBasicShop.Instance.Translate("no_have_item_sell", new object[] {name});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
List<InventorySearch> list = playerid.Inventory.search(id, true, true);
if (list.Count == 0 || (vAsset.Amount == 1 && list.Count < amttosell))
{
message = UconomyBasicShop.Instance.Translate("not_enough_items_sell", new object[] {amttosell.ToString(), name});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
if (vAsset.Amount > 1)
@@ -503,7 +505,7 @@ public void Sell(RocketPlayer playerid, string[] components)
if (ammomagamt < amttosell)
{
message = UconomyBasicShop.Instance.Translate("not_enough_ammo_sell", new object[] {name});
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
}
@@ -513,7 +515,7 @@ public void Sell(RocketPlayer playerid, string[] components)
if (price <= 0.00m)
{
message = UconomyBasicShop.Instance.Translate("no_sell_price_set", new object[] { name });
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
return;
}
byte quality = 100;
@@ -576,7 +578,7 @@ public void Sell(RocketPlayer playerid, string[] components)
if (UconomyBasicShop.Instance.OnShopSell != null)
UconomyBasicShop.Instance.OnShopSell(playerid, addmoney, amt, id);
playerid.Player.gameObject.SendMessage("ZaupShopOnSell", new object[] { playerid, addmoney, amt, id }, SendMessageOptions.DontRequireReceiver);
- RocketChatManager.Say(playerid, message);
+ RocketChat.Say(playerid, message);
}
}
@@ -48,9 +48,14 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\UnturnedServer\Servers\testing13\Rocket\Libraries\MySql.Data.dll</HintPath>
</Reference>
- <Reference Include="RocketAPI, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\RocketAPI.dll</HintPath>
+ <Reference Include="Rocket.API">
+ <HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\Rocket.API.dll</HintPath>
+ </Reference>
+ <Reference Include="Rocket.Core">
+ <HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\Rocket.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Rocket.Unturned">
+ <HintPath>..\..\..\..\..\..\..\steamcmd\unturnedtesting13\Unturned_Data\Managed\Rocket.Unturned.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -1,10 +1,9 @@
using System;
-using Rocket.RocketAPI;
-using Rocket.Logging;
+using Rocket.API;
namespace UconomyBasicShop
{
- public class UconomyBasicShopConfiguration : IRocketConfiguration
+ public class UconomyBasicShopConfiguration : IRocketPluginConfiguration
{
public string ItemShopTableName;
public string VehicleShopTableName;
@@ -13,7 +12,7 @@ public class UconomyBasicShopConfiguration : IRocketConfiguration
public bool CanSellItems;
public bool QualityCounts;
- public IRocketConfiguration DefaultConfiguration
+ public IRocketPluginConfiguration DefaultConfiguration
{
get
{

0 comments on commit b8afd7f

Please sign in to comment.