Skip to content

Commit 0009680

Browse files
committed
Changes in preparation for Alpha 3.0
1 parent 6c85ab2 commit 0009680

File tree

5 files changed

+35
-33
lines changed

5 files changed

+35
-33
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=lf

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 HarpNet Studios
3+
Copyright (c) 2020-2025 HarpNet Studios
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MainForm.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MainForm.cs

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public partial class mainForm : Form
2525
private bool success;
2626
private int pageSelected;
2727

28-
private bool use64bit;
28+
private bool use32bit;
2929

3030
private Config config;
3131

@@ -37,7 +37,7 @@ public partial class mainForm : Form
3737

3838
private DialogResult DisplayMessage(string text, string origin = null, MessageBoxButtons buttons = MessageBoxButtons.OK, MessageBoxIcon icon = MessageBoxIcon.None)
3939
{
40-
return MessageBox.Show(text, LauncherInfo.gameName+" Launcher" + (origin != null ? " - "+origin : ""), buttons, icon);
40+
return MessageBox.Show(text, $"{LauncherInfo.gameName} Launcher{(origin != null ? $" - {origin}" : "")}", buttons, icon);
4141
}
4242

4343
private void ValidateSteam()
@@ -49,9 +49,7 @@ private void ValidateSteam()
4949
if(!SteamClient.IsLoggedOn) return;
5050
var ticket = SteamUser.GetAuthSessionTicket(NetIdentity.LocalHost);
5151

52-
//Clipboard.SetText(BitConverter.ToString(ticket.Data).Replace("-", ""));
53-
54-
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(api_url+@"steam/AuthSession?ticket=" + BitConverter.ToString(ticket.Data).Replace("-", "") + "&id=" + LauncherInfo.gameId);
52+
HttpWebRequest request = (HttpWebRequest)WebRequest.Create($"{api_url}steam/AuthSession?ticket={BitConverter.ToString(ticket.Data).Replace("-", "")}&id={LauncherInfo.gameId}");
5553
request.Timeout = 15000; // hopefully will make the launcher more responsive when the servers are down
5654
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
5755
string content = new StreamReader(response.GetResponseStream()).ReadToEnd();
@@ -69,7 +67,7 @@ private void ValidateSteam()
6967
}
7068
catch (Exception e)
7169
{
72-
DisplayMessage("Steam login failed!\n\nException: " + e.Message);
70+
DisplayMessage($"Steam login failed!\n\nException: {e.Message}");
7371
return;
7472
}
7573
}
@@ -115,7 +113,7 @@ private void CheckVersion()
115113
{
116114
try
117115
{
118-
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(config.webUrl + "version?id=" + LauncherInfo.gameId);
116+
HttpWebRequest request = (HttpWebRequest)WebRequest.Create($"{config.webUrl}version?id={LauncherInfo.gameId}");
119117
request.Timeout = 15000; // hopefully will make the launcher more responsive when the servers are down
120118
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
121119
string content = new StreamReader(response.GetResponseStream()).ReadToEnd();
@@ -124,7 +122,7 @@ private void CheckVersion()
124122

125123
if (new Version(content).CompareTo(ver) > 0)
126124
{
127-
DisplayMessage(string.Format("Looks like your launcher is out of date!\n\nNew version available: {0}\nYour version: {1}", content, ver.ToString()), "Launcher Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
125+
DisplayMessage($"Looks like your launcher is out of date!\n\nNew version available: {content}\nYour version: {ver.ToString()}", "Launcher Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
128126
}
129127
}
130128
catch(WebException)
@@ -140,10 +138,10 @@ private bool GrabInfo(string token)
140138
if (token=="" || technicalIssues) return false;
141139
try
142140
{
143-
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(api_url+@"v1/game/login?game=" + LauncherInfo.gameId);
141+
HttpWebRequest request = (HttpWebRequest)WebRequest.Create($"{api_url}v1/game/login?game={LauncherInfo.gameId}");
144142
request.Timeout = 15000; // hopefully will make the launcher more responsive when the servers are down
145143
WebHeaderCollection whc = request.Headers;
146-
whc.Add("X-Game-Token: "+token);
144+
whc.Add($"X-Game-Token: {token}");
147145
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
148146
string content = new StreamReader(response.GetResponseStream()).ReadToEnd();
149147
UserInfo info = JsonConvert.DeserializeObject<UserInfo>(content);
@@ -156,7 +154,7 @@ private bool GrabInfo(string token)
156154
if(success)
157155
{
158156
config.gameToken = token;
159-
userAuthLabel.Text = "User: " + info.username;
157+
userAuthLabel.Text = $"User: {info.username}";
160158
}
161159
else
162160
{
@@ -168,16 +166,16 @@ private bool GrabInfo(string token)
168166
}
169167
catch(WebException e)
170168
{
171-
string text = "Exception! "+e.Message;
169+
string text = $"Exception! {e.Message}";
172170
if(e.Status == WebExceptionStatus.ProtocolError)
173171
{
174-
text = "Web Exception! " + e.Message+"\n";
175-
text += string.Format("\nStatus Code : {0}", ((int)((HttpWebResponse)e.Response).StatusCode));
176-
text += string.Format("\nStatus Description : {0}", ((HttpWebResponse)e.Response).StatusDescription);
177-
text += string.Format("\nServer : {0}", ((HttpWebResponse)e.Response).Server);
172+
text = $"Web Exception! {e.Message}\n";
173+
text += $"\nStatus Code : {(int)((HttpWebResponse)e.Response).StatusCode}";
174+
text += $"\nStatus Description : {((HttpWebResponse)e.Response).StatusDescription}";
175+
text += $"\nServer : {((HttpWebResponse)e.Response).Server}";
178176
}
179177
DisplayMessage(text,"Account Server - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
180-
throw e;
178+
//throw e; // why are we throwing the exception after catching it???
181179
}
182180

183181
return success;
@@ -237,9 +235,9 @@ public mainForm()
237235

238236
pageSelectCombo.SelectedIndex = 0; // HNID
239237

240-
this.Text = launcherTitle.Text = LauncherInfo.gameName + " Launcher";
241-
playButton.Text = "&Play " + LauncherInfo.gameName;
242-
versionLabel.Text = "Launcher Version " + typeof(Program).Assembly.GetName().Version;
238+
this.Text = launcherTitle.Text = $"{LauncherInfo.gameName} Launcher";
239+
playButton.Text = $"&Play {LauncherInfo.gameName}";
240+
versionLabel.Text = $"Launcher Version {typeof(Program).Assembly.GetName().Version}";
243241
}
244242

245243
public void PromptMigration()
@@ -256,7 +254,7 @@ public void PromptMigration()
256254
}
257255
catch (Exception e)
258256
{
259-
DisplayMessage(string.Format("Migration failed! Please report this in the Discord server.\n\nError details: {0}", e.Message), "Migration Wizard", MessageBoxButtons.OK, MessageBoxIcon.Error);
257+
DisplayMessage($"Migration failed! Please report this in the Discord server.\n\nError details: {e.Message}", "Migration Wizard", MessageBoxButtons.OK, MessageBoxIcon.Error);
260258
}
261259
}
262260

@@ -330,9 +328,9 @@ private void homeDirBtn_Click(object sender, EventArgs e)
330328
}
331329
}
332330

333-
private void archRadio64_CheckedChanged(object sender, EventArgs e)
331+
private void archRadio32_CheckedChanged(object sender, EventArgs e)
334332
{
335-
use64bit = archRadio64.Checked;
333+
use32bit = archRadio32.Checked;
336334
}
337335

338336
private void playButton_Click(object sender, EventArgs e)
@@ -354,10 +352,13 @@ private void playButton_Click(object sender, EventArgs e)
354352

355353
// Create new process definition
356354
ProcessStartInfo gameProcess = new ProcessStartInfo();
357-
gameProcess.FileName = Path.Combine("bin" + (use64bit ? "64" : ""), "cardboard_msvc.exe");
358-
gameProcess.Arguments = "-c" + launchToken + " -q\"" + config.homeDir + "\" -glog.txt" + (qConnectChkBox.Checked&&!playOfflineChkBox.Checked ? " -x\"connect "+config.qConnectServ+"\"" : "");
359-
360-
355+
gameProcess.FileName = Path.Combine("bin" + (use32bit ? "32" : ""), "cardboard.exe");
356+
gameProcess.Arguments = $"-c{launchToken} -q\"{config.homeDir}\" -glog.txt";
357+
if (qConnectChkBox.Checked && !playOfflineChkBox.Checked)
358+
{
359+
gameProcess.Arguments += $" -x\"connect {config.qConnectServ}\"";
360+
}
361+
361362
// Attempt to start process with correct arguments
362363
try
363364
{

Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("")]
1212
[assembly: AssemblyProduct("Cardboard Game Launcher")]
13-
[assembly: AssemblyCopyright("Copyright © HarpNet Studios 2023")]
13+
[assembly: AssemblyCopyright("Copyright © HarpNet Studios 2025")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -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("1.4.2.0")]
36-
[assembly: AssemblyFileVersion("1.4.2.0")]
35+
[assembly: AssemblyVersion("1.5.0.0")]
36+
[assembly: AssemblyFileVersion("1.5.0.0")]

0 commit comments

Comments
 (0)