mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-02-02 06:17:34 +00:00
pong highscores are semi-fixed
This commit is contained in:
parent
0c2f232911
commit
99eede4118
3 changed files with 48 additions and 0 deletions
|
@ -285,6 +285,16 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
secondsleft = 60;
|
||||
level = level + 1;
|
||||
if (SaveSystem.CurrentSave.UniteAuthToken != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var unite = new ShiftOS.Unite.UniteClient("http://getshiftos.ml", SaveSystem.CurrentSave.UniteAuthToken);
|
||||
if (unite.GetPongLevel() < level)
|
||||
unite.SetPongLevel(level);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
generatenextlevel();
|
||||
pnlgamestats.Show();
|
||||
pnlgamestats.BringToFront();
|
||||
|
@ -544,6 +554,14 @@ namespace ShiftOS.WinForms.Applications
|
|||
lblfinalcomputerreward.Text = beatairewardtotal.ToString();
|
||||
lblfinalcodepoints.Text = totalreward + Localization.Parse(" {CODEPOINTS_SHORT}");
|
||||
SaveSystem.TransferCodepointsFrom("pong", totalreward);
|
||||
if (!string.IsNullOrWhiteSpace(SaveSystem.CurrentSave.UniteAuthToken))
|
||||
{
|
||||
var unite = new ShiftOS.Unite.UniteClient("http://getshiftos.ml", SaveSystem.CurrentSave.UniteAuthToken);
|
||||
if (unite.GetPongCP() < totalreward)
|
||||
{
|
||||
unite.SetPongCP(totalreward);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void newgame()
|
||||
|
|
|
@ -34,6 +34,26 @@ namespace ShiftOS.Unite
|
|||
}
|
||||
}
|
||||
|
||||
public int GetPongCP()
|
||||
{
|
||||
return Convert.ToInt32(MakeCall("/API/GetPongCP"));
|
||||
}
|
||||
|
||||
public int GetPongLevel()
|
||||
{
|
||||
return Convert.ToInt32(MakeCall("/API/GetPongLevel"));
|
||||
}
|
||||
|
||||
public void SetPongLevel(int value)
|
||||
{
|
||||
MakeCall("/API/SetPongLevel/" + value.ToString());
|
||||
}
|
||||
|
||||
public void SetPongCP(int value)
|
||||
{
|
||||
MakeCall("/API/SetPongCP/" + value.ToString());
|
||||
}
|
||||
|
||||
public string GetEmail()
|
||||
{
|
||||
return MakeCall("/API/GetEmail");
|
||||
|
|
|
@ -10,6 +10,16 @@ namespace ShiftOS.Engine
|
|||
[Namespace("unite")]
|
||||
public static class UniteTestCommands
|
||||
{
|
||||
[Command("setdisplayname")]
|
||||
[RequiresArgument("name")]
|
||||
public static bool SetDisplayName(Dictionary<string, object> args)
|
||||
{
|
||||
string dname = args["name"].ToString();
|
||||
var unite = new ShiftOS.Unite.UniteClient("http://getshiftos.ml", SaveSystem.CurrentSave.UniteAuthToken);
|
||||
unite.SetDisplayName(dname);
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("login")]
|
||||
[RequiresArgument("username")]
|
||||
[RequiresArgument("password")]
|
||||
|
|
Loading…
Add table
Reference in a new issue