@@ -25,7 +25,7 @@ public partial class mainForm : Form
25
25
private bool success ;
26
26
private int pageSelected ;
27
27
28
- private bool use64bit ;
28
+ private bool use32bit ;
29
29
30
30
private Config config ;
31
31
@@ -37,7 +37,7 @@ public partial class mainForm : Form
37
37
38
38
private DialogResult DisplayMessage ( string text , string origin = null , MessageBoxButtons buttons = MessageBoxButtons . OK , MessageBoxIcon icon = MessageBoxIcon . None )
39
39
{
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 ) ;
41
41
}
42
42
43
43
private void ValidateSteam ( )
@@ -49,9 +49,7 @@ private void ValidateSteam()
49
49
if ( ! SteamClient . IsLoggedOn ) return ;
50
50
var ticket = SteamUser . GetAuthSessionTicket ( NetIdentity . LocalHost ) ;
51
51
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 } ") ;
55
53
request . Timeout = 15000 ; // hopefully will make the launcher more responsive when the servers are down
56
54
HttpWebResponse response = ( HttpWebResponse ) request . GetResponse ( ) ;
57
55
string content = new StreamReader ( response . GetResponseStream ( ) ) . ReadToEnd ( ) ;
@@ -69,7 +67,7 @@ private void ValidateSteam()
69
67
}
70
68
catch ( Exception e )
71
69
{
72
- DisplayMessage ( "Steam login failed!\n \n Exception: " + e . Message ) ;
70
+ DisplayMessage ( $ "Steam login failed!\n \n Exception: { e . Message } " ) ;
73
71
return ;
74
72
}
75
73
}
@@ -115,7 +113,7 @@ private void CheckVersion()
115
113
{
116
114
try
117
115
{
118
- HttpWebRequest request = ( HttpWebRequest ) WebRequest . Create ( config . webUrl + " version?id=" + LauncherInfo . gameId ) ;
116
+ HttpWebRequest request = ( HttpWebRequest ) WebRequest . Create ( $ " { config . webUrl } version?id={ LauncherInfo . gameId } " ) ;
119
117
request . Timeout = 15000 ; // hopefully will make the launcher more responsive when the servers are down
120
118
HttpWebResponse response = ( HttpWebResponse ) request . GetResponse ( ) ;
121
119
string content = new StreamReader ( response . GetResponseStream ( ) ) . ReadToEnd ( ) ;
@@ -124,7 +122,7 @@ private void CheckVersion()
124
122
125
123
if ( new Version ( content ) . CompareTo ( ver ) > 0 )
126
124
{
127
- DisplayMessage ( string . Format ( "Looks like your launcher is out of date!\n \n New version available: {0 }\n Your version: {1}" , content , ver . ToString ( ) ) , "Launcher Update" , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
125
+ DisplayMessage ( $ "Looks like your launcher is out of date!\n \n New version available: { content } \n Your version: { ver . ToString ( ) } " , "Launcher Update" , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
128
126
}
129
127
}
130
128
catch ( WebException )
@@ -140,10 +138,10 @@ private bool GrabInfo(string token)
140
138
if ( token == "" || technicalIssues ) return false ;
141
139
try
142
140
{
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 } " ) ;
144
142
request . Timeout = 15000 ; // hopefully will make the launcher more responsive when the servers are down
145
143
WebHeaderCollection whc = request . Headers ;
146
- whc . Add ( "X-Game-Token: " + token ) ;
144
+ whc . Add ( $ "X-Game-Token: { token } " ) ;
147
145
HttpWebResponse response = ( HttpWebResponse ) request . GetResponse ( ) ;
148
146
string content = new StreamReader ( response . GetResponseStream ( ) ) . ReadToEnd ( ) ;
149
147
UserInfo info = JsonConvert . DeserializeObject < UserInfo > ( content ) ;
@@ -156,7 +154,7 @@ private bool GrabInfo(string token)
156
154
if ( success )
157
155
{
158
156
config . gameToken = token ;
159
- userAuthLabel . Text = "User: " + info . username ;
157
+ userAuthLabel . Text = $ "User: { info . username } " ;
160
158
}
161
159
else
162
160
{
@@ -168,16 +166,16 @@ private bool GrabInfo(string token)
168
166
}
169
167
catch ( WebException e )
170
168
{
171
- string text = "Exception! " + e . Message ;
169
+ string text = $ "Exception! { e . Message } " ;
172
170
if ( e . Status == WebExceptionStatus . ProtocolError )
173
171
{
174
- text = "Web Exception! " + e . Message + " \n ";
175
- text += string . Format ( "\n Status Code : {0}" , ( ( int ) ( ( HttpWebResponse ) e . Response ) . StatusCode ) ) ;
176
- text += string . Format ( "\n Status Description : {0}" , ( ( HttpWebResponse ) e . Response ) . StatusDescription ) ;
177
- text += string . Format ( "\n Server : {0}" , ( ( HttpWebResponse ) e . Response ) . Server ) ;
172
+ text = $ "Web Exception! { e . Message } \n ";
173
+ text += $ "\n Status Code : { ( int ) ( ( HttpWebResponse ) e . Response ) . StatusCode } " ;
174
+ text += $ "\n Status Description : { ( ( HttpWebResponse ) e . Response ) . StatusDescription } " ;
175
+ text += $ "\n Server : { ( ( HttpWebResponse ) e . Response ) . Server } " ;
178
176
}
179
177
DisplayMessage ( text , "Account Server - Error" , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
180
- throw e ;
178
+ // throw e; // why are we throwing the exception after catching it???
181
179
}
182
180
183
181
return success ;
@@ -237,9 +235,9 @@ public mainForm()
237
235
238
236
pageSelectCombo . SelectedIndex = 0 ; // HNID
239
237
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 } " ;
243
241
}
244
242
245
243
public void PromptMigration ( )
@@ -256,7 +254,7 @@ public void PromptMigration()
256
254
}
257
255
catch ( Exception e )
258
256
{
259
- DisplayMessage ( string . Format ( "Migration failed! Please report this in the Discord server.\n \n Error details: {0}" , e . Message ) , "Migration Wizard" , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
257
+ DisplayMessage ( $ "Migration failed! Please report this in the Discord server.\n \n Error details: { e . Message } " , "Migration Wizard" , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
260
258
}
261
259
}
262
260
@@ -330,9 +328,9 @@ private void homeDirBtn_Click(object sender, EventArgs e)
330
328
}
331
329
}
332
330
333
- private void archRadio64_CheckedChanged ( object sender , EventArgs e )
331
+ private void archRadio32_CheckedChanged ( object sender , EventArgs e )
334
332
{
335
- use64bit = archRadio64 . Checked ;
333
+ use32bit = archRadio32 . Checked ;
336
334
}
337
335
338
336
private void playButton_Click ( object sender , EventArgs e )
@@ -354,10 +352,13 @@ private void playButton_Click(object sender, EventArgs e)
354
352
355
353
// Create new process definition
356
354
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
+
361
362
// Attempt to start process with correct arguments
362
363
try
363
364
{
0 commit comments