diff --git a/ShiftOS.Objects/EngineShiftnetSubscription.cs b/ShiftOS.Objects/EngineShiftnetSubscription.cs
index 1296a98..c319f18 100644
--- a/ShiftOS.Objects/EngineShiftnetSubscription.cs
+++ b/ShiftOS.Objects/EngineShiftnetSubscription.cs
@@ -10,7 +10,7 @@ namespace ShiftOS.Objects
{
public string Name { get; set; }
public string Description { get; set; }
- public int CostPerMonth { get; set; }
+ public uint CostPerMonth { get; set; }
public int DownloadSpeed { get; set; }
public string Company { get; set; }
}
diff --git a/ShiftOS.Objects/Save.cs b/ShiftOS.Objects/Save.cs
index 8675a35..0fef7b3 100644
--- a/ShiftOS.Objects/Save.cs
+++ b/ShiftOS.Objects/Save.cs
@@ -41,9 +41,9 @@ namespace ShiftOS.Objects
[Obsolete("This save variable is no longer used in Beta 2.4 and above of ShiftOS. Please use ShiftOS.Engine.SaveSystem.CurrentUser.Username to access the current user's username.")]
public string Username { get; set; }
- private long _cp = 0;
+ private ulong _cp = 0;
- public long Codepoints
+ public ulong Codepoints
{
get
{
diff --git a/ShiftOS.Objects/Shop.cs b/ShiftOS.Objects/Shop.cs
index 65f5746..c603523 100644
--- a/ShiftOS.Objects/Shop.cs
+++ b/ShiftOS.Objects/Shop.cs
@@ -42,7 +42,7 @@ namespace ShiftOS.Objects
{
public string Name { get; set; }
public string Description { get; set; }
- public int Cost { get; set; }
+ public ulong Cost { get; set; }
public int FileType { get; set; }
public byte[] MUDFile { get; set; }
}
diff --git a/ShiftOS.Objects/UniteClient.cs b/ShiftOS.Objects/UniteClient.cs
index d8e34b7..ccd721b 100644
--- a/ShiftOS.Objects/UniteClient.cs
+++ b/ShiftOS.Objects/UniteClient.cs
@@ -83,9 +83,9 @@ namespace ShiftOS.Unite
/// Get the Pong codepoint highscore for the current user.
///
/// The amount of Codepoints returned by the server
- public int GetPongCP()
+ public ulong GetPongCP()
{
- return Convert.ToInt32(MakeCall("/API/GetPongCP"));
+ return Convert.ToUInt64(MakeCall("/API/GetPongCP"));
}
///
@@ -110,7 +110,7 @@ namespace ShiftOS.Unite
/// Set the pong Codepoints record for the user
///
/// The amount of Codepoints to set the record to
- public void SetPongCP(int value)
+ public void SetPongCP(ulong value)
{
MakeCall("/API/SetPongCP/" + value.ToString());
}
@@ -182,16 +182,16 @@ namespace ShiftOS.Unite
/// Get the user's codepoints.
///
/// The amount of codepoints stored on the server for this user.
- public long GetCodepoints()
+ public ulong GetCodepoints()
{
- return Convert.ToInt64(MakeCall("/API/GetCodepoints"));
+ return Convert.ToUInt64(MakeCall("/API/GetCodepoints"));
}
///
/// Set the user's codepoints.
///
/// The amount of codepoints to set the user's codepoints value to.
- public void SetCodepoints(long value)
+ public void SetCodepoints(ulong value)
{
MakeCall("/API/SetCodepoints/" + value.ToString());
}
diff --git a/ShiftOS.WinForms/Applications/Pong.cs b/ShiftOS.WinForms/Applications/Pong.cs
index 84177b7..6d81c64 100644
--- a/ShiftOS.WinForms/Applications/Pong.cs
+++ b/ShiftOS.WinForms/Applications/Pong.cs
@@ -58,10 +58,10 @@ namespace ShiftOS.WinForms.Applications
double incrementy = 0.2;
int levelxspeed = 3;
int levelyspeed = 3;
- int beatairewardtotal;
- int beataireward = 1;
- int[] levelrewards = new int[50];
- int totalreward;
+ ulong beatairewardtotal;
+ ulong beataireward = 1;
+ ulong[] levelrewards = new ulong[50];
+ ulong totalreward;
int countdown = 3;
bool aiShouldIsbeEnabled = true;
@@ -297,11 +297,11 @@ namespace ShiftOS.WinForms.Applications
lblmissedout.Text = Localization.Parse("{YOU_MISSED_OUT_ON}:") + Environment.NewLine + lblstatscodepoints.Text.Replace(Localization.Parse("{CODEPOINTS}: "), "") + Localization.Parse(" {CODEPOINTS}");
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade_2"))
{
- totalreward = levelrewards[level - 1] + beatairewardtotal;
+ totalreward = (ulong)(levelrewards[level - 1] + beatairewardtotal);
double onePercent = (totalreward / 100);
lblbutyougained.Show();
lblbutyougained.Text = Localization.Parse("{BUT_YOU_GAINED}:") + Environment.NewLine + onePercent.ToString("") + (Localization.Parse(" {CODEPOINTS}"));
- SaveSystem.TransferCodepointsFrom("pong", (totalreward / 100));
+ SaveSystem.TransferCodepointsFrom("pong", (ulong)(totalreward / 100));
}
else
{
@@ -715,10 +715,10 @@ namespace ShiftOS.WinForms.Applications
{
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
{
- beataireward = level * 10;
+ beataireward = (ulong)(level * 10);
} else
{
- beataireward = level * 5;
+ beataireward = (ulong)(level * 5);
}
}
else
@@ -726,11 +726,11 @@ namespace ShiftOS.WinForms.Applications
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
{
double br = levelrewards[level - 1] / 10;
- beataireward = (int)Math.Round(br) * 10;
+ beataireward = (ulong)Math.Round(br) * 10;
} else
{
double br = levelrewards[level - 1] / 10;
- beataireward = (int)Math.Round(br) * 5;
+ beataireward = (ulong)Math.Round(br) * 5;
}
}
diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs
index 42e19f8..0e9f74a 100644
--- a/ShiftOS.WinForms/Applications/ShiftLetters.cs
+++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs
@@ -217,7 +217,7 @@ namespace ShiftOS.WinForms.Applications
if (!lblword.Text.Contains("_"))
{
int oldlives = lives;
- int cp = (word.Length * oldlives) * 2; //drunky michael made this 5x...
+ ulong cp = (ulong)(word.Length * oldlives) * 2; //drunky michael made this 5x...
SaveSystem.TransferCodepointsFrom("shiftletters", cp);
StartGame();
}
diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.cs b/ShiftOS.WinForms/Applications/ShiftLotto.cs
index 5ab8154..3f940c7 100644
--- a/ShiftOS.WinForms/Applications/ShiftLotto.cs
+++ b/ShiftOS.WinForms/Applications/ShiftLotto.cs
@@ -88,7 +88,7 @@ namespace ShiftOS.WinForms.Applications
}
else
{
- if (SaveSystem.CurrentSave.Codepoints - (codePoints * difficulty) <= 0)
+ if (SaveSystem.CurrentSave.Codepoints - (ulong)(codePoints * difficulty) <= 0)
{
Infobox.Show("Not enough Codepoints", "You do not have enough Codepoints to gamble this amount!");
}
@@ -102,7 +102,7 @@ namespace ShiftOS.WinForms.Applications
int winningNumber = rnd.Next(0, difficulty);
// Multiply CodePoints * Difficulty
- int jackpot = codePoints * difficulty;
+ ulong jackpot = (ulong)(codePoints * difficulty);
// Test the random ints
if (guessedNumber == winningNumber)
diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
index f23ed73..772ec26 100644
--- a/ShiftOS.WinForms/Applications/ShiftSweeper.cs
+++ b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
@@ -300,12 +300,12 @@ namespace ShiftOS.WinForms.Applications {
}
public void winGame() {
- int cp = 0;
- int origminecount = gameBombCount * 10;
+ ulong cp = 0;
+ ulong origminecount = (ulong)(gameBombCount * 10);
if (minetimer < 31) cp = (origminecount * 3);
- else if (minetimer < 61) cp = (Int32)(origminecount * 2.5);
+ else if (minetimer < 61) cp = (ulong)(origminecount * 2.5);
else if (minetimer < 91) cp = (origminecount * 2);
- else if (minetimer < 121) cp = (Int32)(origminecount * 1.5);
+ else if (minetimer < 121) cp = (ulong)(origminecount * 1.5);
else if (minetimer > 120) cp = (origminecount * 1);
SaveSystem.TransferCodepointsFrom("shiftsweeper", cp);
panelGameStatus.Image = Properties.Resources.SweeperWinFace;
diff --git a/ShiftOS.WinForms/Applications/Shifter.cs b/ShiftOS.WinForms/Applications/Shifter.cs
index 1a59c80..3b3a4f1 100644
--- a/ShiftOS.WinForms/Applications/Shifter.cs
+++ b/ShiftOS.WinForms/Applications/Shifter.cs
@@ -391,7 +391,7 @@ namespace ShiftOS.WinForms.Applications
}
- public int CodepointValue = 0;
+ public uint CodepointValue = 0;
public List settings = new List();
public Skin LoadedSkin = null;
diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
index 08e6c8f..d6b014d 100644
--- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
+++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
@@ -213,9 +213,9 @@ namespace ShiftOS.WinForms.Applications
private void btnbuy_Click(object sender, EventArgs e)
{
- long cpCost = 0;
+ ulong cpCost = 0;
backend.Silent = true;
- Dictionary UpgradesToBuy = new Dictionary();
+ Dictionary UpgradesToBuy = new Dictionary();
foreach (var itm in lbupgrades.SelectedItems)
{
cpCost += upgrades[itm.ToString()].Cost;
diff --git a/ShiftOS.WinForms/Applications/ShopItemCreator.cs b/ShiftOS.WinForms/Applications/ShopItemCreator.cs
index 61e7491..d2836ee 100644
--- a/ShiftOS.WinForms/Applications/ShopItemCreator.cs
+++ b/ShiftOS.WinForms/Applications/ShopItemCreator.cs
@@ -73,7 +73,7 @@ namespace ShiftOS.WinForms.Applications
Infobox.Show("No file chosen.", "Please select a file to sell.");
return;
}
- Item.Cost = Convert.ToInt32(txtcost.Text);
+ Item.Cost = Convert.ToUInt64(txtcost.Text);
Item.Description = txtdescription.Text;
Item.Name = txtitemname.Text;
Callback?.Invoke(Item);
@@ -101,7 +101,7 @@ namespace ShiftOS.WinForms.Applications
{
try
{
- Item.Cost = Convert.ToInt32(txtcost.Text);
+ Item.Cost = Convert.ToUInt64(txtcost.Text);
}
catch
{
diff --git a/ShiftOS.WinForms/HackerCommands.cs b/ShiftOS.WinForms/HackerCommands.cs
index 47b486d..f467eb2 100644
--- a/ShiftOS.WinForms/HackerCommands.cs
+++ b/ShiftOS.WinForms/HackerCommands.cs
@@ -504,7 +504,7 @@ namespace ShiftOS.WinForms
string usr = args["user"].ToString();
string sys = args["sys"].ToString();
string pass = args["pass"].ToString();
- long amount = (long)args["amount"];
+ ulong amount = (ulong)args["amount"];
if(amount < 0)
{
Console.WriteLine("--invalid codepoint amount - halting...");
diff --git a/ShiftOS.WinForms/JobTasks.cs b/ShiftOS.WinForms/JobTasks.cs
index 622e287..d862961 100644
--- a/ShiftOS.WinForms/JobTasks.cs
+++ b/ShiftOS.WinForms/JobTasks.cs
@@ -35,12 +35,12 @@ namespace ShiftOS.WinForms
{
public class AcquireCodepointsJobTask : JobTask
{
- public AcquireCodepointsJobTask(int amount)
+ public AcquireCodepointsJobTask(uint amount)
{
CodepointsRequired = SaveSystem.CurrentSave.Codepoints + amount;
}
- public long CodepointsRequired { get; private set; }
+ public ulong CodepointsRequired { get; private set; }
public override bool IsComplete
{
diff --git a/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs b/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs
index fa575f4..c7830d0 100644
--- a/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs
+++ b/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs
@@ -372,7 +372,7 @@ namespace ShiftOS.WinForms
///
public class AppscapeEntryAttribute : RequiresUpgradeAttribute
{
- public AppscapeEntryAttribute(string name, string description, int downloadSize, long cost, string dependencies = "", string category = "Misc") : base(name.ToLower().Replace(' ', '_'))
+ public AppscapeEntryAttribute(string name, string description, int downloadSize, ulong cost, string dependencies = "", string category = "Misc") : base(name.ToLower().Replace(' ', '_'))
{
Name = name;
Description = description;
@@ -385,7 +385,7 @@ namespace ShiftOS.WinForms
public string Name { get; private set; }
public string Description { get; private set; }
public string Category { get; private set; }
- public long Cost { get; private set; }
+ public ulong Cost { get; private set; }
public string DependencyString { get; private set; }
public int DownloadSize { get; private set; }
}
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs
index 85eab55..95e7c1a 100644
--- a/ShiftOS.WinForms/WinformsDesktop.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.cs
@@ -192,7 +192,7 @@ namespace ShiftOS.WinForms
SetupDesktop();
};
- long lastcp = 0;
+ ulong lastcp = 0;
var storythread = new Thread(() =>
{
diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs
index b97cd1d..ec89539 100644
--- a/ShiftOS_TheReturn/Commands.cs
+++ b/ShiftOS_TheReturn/Commands.cs
@@ -311,7 +311,7 @@ namespace ShiftOS.Engine
if (args.ContainsKey("amount"))
try
{
- long codepointsToAdd = Convert.ToInt64(args["amount"].ToString());
+ ulong codepointsToAdd = Convert.ToUInt64(args["amount"].ToString());
SaveSystem.CurrentSave.Codepoints += codepointsToAdd;
return true;
}
@@ -639,7 +639,7 @@ shiftorium.buy{{upgrade:""{upg.ID}""}}");
cat = args["cat"].ToString();
}
- Dictionary upgrades = new Dictionary();
+ Dictionary upgrades = new Dictionary();
int maxLength = 5;
IEnumerable upglist = Shiftorium.GetAvailable();
diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs
index d1b92fd..395db85 100644
--- a/ShiftOS_TheReturn/SaveSystem.cs
+++ b/ShiftOS_TheReturn/SaveSystem.cs
@@ -480,7 +480,7 @@ namespace ShiftOS.Engine
/// Deducts a set amount of Codepoints from the save file... and sends them to a place where they'll never be seen again.
///
/// The amount of Codepoints to deduct.
- public static void TransferCodepointsToVoid(long amount)
+ public static void TransferCodepointsToVoid(ulong amount)
{
if (amount < 0)
throw new ArgumentOutOfRangeException("We see what you did there. Trying to pull Codepoints from the void? That won't work.");
@@ -584,7 +584,7 @@ namespace ShiftOS.Engine
///
/// The character name
/// The amount of Codepoints.
- public static void TransferCodepointsFrom(string who, long amount)
+ public static void TransferCodepointsFrom(string who, ulong amount)
{
if (amount < 0)
throw new ArgumentOutOfRangeException("We see what you did there... You can't just give a fake character Codepoints like that. It's better if you transfer them to the void.");
diff --git a/ShiftOS_TheReturn/Scripting.cs b/ShiftOS_TheReturn/Scripting.cs
index 61c6676..5021f50 100644
--- a/ShiftOS_TheReturn/Scripting.cs
+++ b/ShiftOS_TheReturn/Scripting.cs
@@ -444,7 +444,7 @@ end");
/// Retrieves the user's Codepoints from the save file.
///
/// The user's Codepoints.
- public long getCodepoints() { return SaveSystem.CurrentSave.Codepoints; }
+ public ulong getCodepoints() { return SaveSystem.CurrentSave.Codepoints; }
///
/// Run a command in the Terminal.
@@ -462,7 +462,7 @@ end");
/// Adds the specified amount of Codepoints to the save flie.
///
/// The codepoints to add.
- public void addCodepoints(int cp)
+ public void addCodepoints(uint cp)
{
if (cp > 100 || cp <= 0)
{
diff --git a/ShiftOS_TheReturn/ServerManager.cs b/ShiftOS_TheReturn/ServerManager.cs
index abb674d..1439c0d 100644
--- a/ShiftOS_TheReturn/ServerManager.cs
+++ b/ShiftOS_TheReturn/ServerManager.cs
@@ -246,7 +246,7 @@ Ping: {ServerManager.DigitalSocietyPing} ms
var args = JsonConvert.DeserializeObject>(msg.Contents);
if(args["username"] as string == SaveSystem.CurrentUser.Username)
{
- SaveSystem.CurrentSave.Codepoints += (long)args["amount"];
+ SaveSystem.CurrentSave.Codepoints += (ulong)args["amount"];
Desktop.InvokeOnWorkerThread(new Action(() =>
{
Infobox.Show($"MUD Control Centre", $"Someone bought an item in your shop, and they have paid {args["amount"]}, and as such, you have been granted these Codepoints.");
diff --git a/ShiftOS_TheReturn/Shiftorium.cs b/ShiftOS_TheReturn/Shiftorium.cs
index bd7105f..975939f 100644
--- a/ShiftOS_TheReturn/Shiftorium.cs
+++ b/ShiftOS_TheReturn/Shiftorium.cs
@@ -112,7 +112,7 @@ namespace ShiftOS.Engine
/// The upgrade ID to buy
/// The amount of Codepoints to deduct
/// True if the upgrade was installed successfully, false if the user didn't have enough Codepoints or the upgrade wasn' found.
- public static bool Buy(string id, long cost)
+ public static bool Buy(string id, ulong cost)
{
if (SaveSystem.CurrentSave.Codepoints >= cost)
{
@@ -365,7 +365,7 @@ namespace ShiftOS.Engine
///
/// The upgrade ID to search
/// The codepoint value.
- public static long GetCPValue(string id)
+ public static ulong GetCPValue(string id)
{
foreach (var upg in GetDefaults())
{
@@ -520,7 +520,7 @@ namespace ShiftOS.Engine
{
public string Name { get; set; }
public string Description { get; set; }
- public long Cost { get; set; }
+ public ulong Cost { get; set; }
public string ID { get { return (this.Id != null ? this.Id : (Name.ToLower().Replace(" ", "_"))); } }
public string Id { get; set; }
public string Category { get; set; }
@@ -536,7 +536,7 @@ namespace ShiftOS.Engine
public class ShiftoriumUpgradeAttribute : RequiresUpgradeAttribute
{
- public ShiftoriumUpgradeAttribute(string name, long cost, string desc, string dependencies, string category) : base(name.ToLower().Replace(" ", "_"))
+ public ShiftoriumUpgradeAttribute(string name, ulong cost, string desc, string dependencies, string category) : base(name.ToLower().Replace(" ", "_"))
{
Name = name;
Description = desc;
@@ -547,7 +547,7 @@ namespace ShiftOS.Engine
public string Name { get; private set; }
public string Description { get; private set; }
- public long Cost { get; private set; }
+ public ulong Cost { get; private set; }
public string Dependencies { get; private set; }
public string Category { get; private set; }
}