Permalink
Browse files

Update to new Rocket 3.2.0.1

  • Loading branch information...
1 parent 372512e commit f11e681dd1e17c9a368d3d9120cbcdbdfab0c992 @Zamirathe Zamirathe committed Apr 6, 2015
@@ -31,7 +31,7 @@ public string Help
}
}
- public void Execute(CSteamID playerid, string msg)
+ public void Execute(RocketPlayer playerid, string msg)
{
string message;
if (string.IsNullOrEmpty(msg))
@@ -91,7 +91,7 @@ public void Execute(CSteamID playerid, string msg)
name = ((VehicleAsset)Assets.find(EAssetType.Vehicle, id)).Name;
}
decimal cost = UconomyBasicShop.Instance.ShopDB.GetVehicleCost(id);
- decimal balance = Uconomy.Instance.Database.GetBalance(playerid);
+ decimal balance = Uconomy.Instance.Database.GetBalance(playerid.CSteamID);
if (cost <= 0m)
{
message = String.Format(UconomyBasicShop.Instance.Configuration.VehicleNotAvailable, name);
@@ -104,13 +104,12 @@ public void Execute(CSteamID playerid, string msg)
RocketChatManager.Say(playerid, message);
return;
}
- Player player = PlayerTool.getPlayer(playerid);
- if (!VehicleTool.giveVehicle(player, id))
+ if (!playerid.GiveVehicle(id))
{
RocketChatManager.Say(playerid, "There was an error giving you " + name + ". You have not been charged.");
return;
}
- decimal newbal = Uconomy.Instance.Database.IncreaseBalance(playerid, (cost * -1));
+ decimal newbal = Uconomy.Instance.Database.IncreaseBalance(playerid.CSteamID, (cost * -1));
message = String.Format(UconomyBasicShop.Instance.Configuration.VehicleBuyMsg, name, cost, Uconomy.Instance.Configuration.MoneyName, newbal, Uconomy.Instance.Configuration.MoneyName);
message = "You bought " + name + " for " + cost.ToString() + " " + Uconomy.Instance.Configuration.MoneyName + ".";
RocketChatManager.Say(playerid, message);
@@ -149,7 +148,7 @@ public void Execute(CSteamID playerid, string msg)
name = ((ItemAsset)Assets.find(EAssetType.Item, id)).Name;
}
cost = UconomyBasicShop.Instance.ShopDB.GetItemCost(id) * amttobuy;
- balance = Uconomy.Instance.Database.GetBalance(playerid);
+ balance = Uconomy.Instance.Database.GetBalance(playerid.CSteamID);
if (cost <= 0m)
{
message = String.Format(UconomyBasicShop.Instance.Configuration.ItemNotAvailable, name);
@@ -162,13 +161,12 @@ public void Execute(CSteamID playerid, string msg)
RocketChatManager.Say(playerid, message);
return;
}
- player = PlayerTool.getPlayer(playerid);
- if (!ItemTool.tryForceGiveItem(player, id, amttobuy))
+ if (!playerid.GiveItem(id, amttobuy))
{
RocketChatManager.Say(playerid, "There was an error giving you " + name + ". You have not been charged.");
return;
}
- newbal = Uconomy.Instance.Database.IncreaseBalance(playerid, (cost * -1));
+ newbal = Uconomy.Instance.Database.IncreaseBalance(playerid.CSteamID, (cost * -1));
message = String.Format(UconomyBasicShop.Instance.Configuration.ItemBuyMsg, name, cost, Uconomy.Instance.Configuration.MoneyName, newbal, Uconomy.Instance.Configuration.MoneyName, amttobuy);
RocketChatManager.Say(playerid, message);
break;
@@ -32,7 +32,7 @@ public string Help
}
}
- public void Execute(CSteamID playerid, string msg)
+ public void Execute(RocketPlayer playerid, string msg)
{
string message;
if (string.IsNullOrEmpty(msg))
@@ -32,15 +32,14 @@ public string Help
}
}
- public void Execute(CSteamID playerid, string msg)
+ public void Execute(RocketPlayer playerid, string msg)
{
- bool console = (!string.IsNullOrEmpty(playerid.ToString()) && playerid.ToString() != "0") ? false : true;
- SteamPlayer splayer = PlayerTool.getSteamPlayer(playerid);
+ bool console = (playerid == null) ? true : false;
string[] permnames = {"shop.*", "shop.add", "shop.rem", "shop.chng"};
bool[] perms = {false, false, false, false};
bool anyuse = false;
string message;
- string[] permlist = RocketPermissionManager.GetPermissions(playerid);
+ List<string> permlist = (console) ? new List<string>() : RocketPermissionManager.GetPermissions(playerid.CSteamID);
foreach (string s in permlist)
{
switch (s)
@@ -70,7 +69,7 @@ public void Execute(CSteamID playerid, string msg)
break;
}
}
- if (console || splayer.IsAdmin)
+ if (console || playerid.IsAdmin)
{
perms[0] = true;
perms[1] = true;
@@ -199,7 +198,7 @@ public void Execute(CSteamID playerid, string msg)
}
}
}
- private void sendMessage(CSteamID playerid, string message, bool console)
+ private void sendMessage(RocketPlayer playerid, string message, bool console)
{
if (console)
{
@@ -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.0.1.8")]
-[assembly: AssemblyFileVersion("1.0.1.8")]
+[assembly: AssemblyVersion("1.0.1.9")]
+[assembly: AssemblyFileVersion("1.0.1.9")]

0 comments on commit f11e681

Please sign in to comment.