diff options
author | Charles Krinke | 2007-12-24 05:20:27 +0000 |
---|---|---|
committer | Charles Krinke | 2007-12-24 05:20:27 +0000 |
commit | a71050a2f834730ec841a9fbdb2e8ac43faa7792 (patch) | |
tree | dcd2c36d7d94966e1c03e38ca0f5b99983c59722 /OpenSim/Tools/OpenSim.GUI/Main.cs | |
parent | FOR http://opensimulator.org/mantis/view.php?id=226 I have a theory that an i... (diff) | |
download | opensim-SC_OLD-a71050a2f834730ec841a9fbdb2e8ac43faa7792.zip opensim-SC_OLD-a71050a2f834730ec841a9fbdb2e8ac43faa7792.tar.gz opensim-SC_OLD-a71050a2f834730ec841a9fbdb2e8ac43faa7792.tar.bz2 opensim-SC_OLD-a71050a2f834730ec841a9fbdb2e8ac43faa7792.tar.xz |
Thank you kindly, CharlieO for this update to the GUI tool for:
Adding a most all inclusive commandline switch and customizable path flags
for ease of operation for server and client in one nifty window.
on hitting of the start button, my 4 most used switches auto check
(can be unchecked before run). Otherwise can select various other switches
and add required data in entry fields. Or there is a raw cmd field that you
can pass what ever you want after the exe.
Great for setting and forgetting switches without having to use the cmd
prompt and /or editing a shortcut. Tedious constant restarts of the client made easier.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tools/OpenSim.GUI/Main.cs | 283 |
1 files changed, 275 insertions, 8 deletions
diff --git a/OpenSim/Tools/OpenSim.GUI/Main.cs b/OpenSim/Tools/OpenSim.GUI/Main.cs index 7f76f54..24e7bae 100644 --- a/OpenSim/Tools/OpenSim.GUI/Main.cs +++ b/OpenSim/Tools/OpenSim.GUI/Main.cs | |||
@@ -120,7 +120,10 @@ namespace OpenSim.GUI | |||
120 | 120 | ||
121 | private void btnStart_Click(object sender, EventArgs e) | 121 | private void btnStart_Click(object sender, EventArgs e) |
122 | { | 122 | { |
123 | 123 | noProbe1.Checked = true; | |
124 | multiple1.Checked = true; | ||
125 | loginuri1.Checked = true; | ||
126 | login1.Checked = true; | ||
124 | // | 127 | // |
125 | // THIS PART NEEDS TO BE MOVED TO A SEPARATE THREAD OR A TIMER OF SOME SORT | 128 | // THIS PART NEEDS TO BE MOVED TO A SEPARATE THREAD OR A TIMER OF SOME SORT |
126 | // should not block on wait | 129 | // should not block on wait |
@@ -200,34 +203,56 @@ namespace OpenSim.GUI | |||
200 | { | 203 | { |
201 | btnStart.Enabled = false; | 204 | btnStart.Enabled = false; |
202 | btnStop.Enabled = false; | 205 | btnStop.Enabled = false; |
206 | Stop(); | ||
207 | btnStart.Enabled = true; | ||
208 | btnStop.Enabled = false; | ||
209 | } | ||
210 | |||
211 | private void clear1_Click(object sender, EventArgs e) | ||
212 | { | ||
213 | noProbe1.Checked = false; multiple1.Checked = false; loginuri1.Checked = false; | ||
214 | noMultiple1.Checked = false; korean1.Checked = false; spanish1.Checked = false; | ||
215 | ignorepixeldepth1.Checked = false; nothread1.Checked = false; safe1.Checked = false; | ||
216 | noconsole1.Checked = false; log1.Checked = false; helperuri1.Checked = false; | ||
217 | autologin1.Checked = false; dialog1.Checked = false; previous1.Checked = false; | ||
218 | simple1.Checked = false; noinvlib1.Checked = false; noutc1.Checked = false; | ||
219 | debugst1.Checked = false; local1.Checked = false; purge1.Checked = false; | ||
220 | nofmod1.Checked = false; nosound1.Checked = false; noaudio1.Checked = false; | ||
221 | url1.Checked = false; port1.Checked = false; drop1.Checked = false; | ||
222 | inbw1.Checked = false; outbw1.Checked = false; settings1.Checked = false; | ||
223 | logfile1.Checked = false; yield1.Checked = false; techTag1.Checked = false; | ||
224 | quitAfter1.Checked = false; loginuri1.Checked = false; set1.Checked = false; | ||
225 | errmask1.Checked = false; raw1.Checked = false; skin1.Checked = false; | ||
226 | user1.Checked = false; login1.Checked = false; | ||
227 | } | ||
203 | 228 | ||
229 | private void Stop() | ||
230 | { | ||
204 | if (proc_UserServer != null) | 231 | if (proc_UserServer != null) |
205 | { | 232 | { |
206 | txtMainLog.AppendText("Shutting down UserServer. CPU time used: " + proc_UserServer.TotalProcessorTime.ToString() + "\r\n"); | 233 | txtMainLog.AppendText("Shutting down UserServer. CPU time used: " + proc_UserServer.TotalProcessorTime.ToString() + "\r\n"); |
207 | proc_UserServer.StopProcess(); | 234 | proc_UserServer.StopProcess(); |
235 | proc_UserServer = null; | ||
208 | } | 236 | } |
209 | if (proc_GridServer != null) | 237 | if (proc_GridServer != null) |
210 | { | 238 | { |
211 | txtMainLog.AppendText("Shutting down GridServer. CPU time used: " + proc_GridServer.TotalProcessorTime.ToString() + "\r\n"); | 239 | txtMainLog.AppendText("Shutting down GridServer. CPU time used: " + proc_GridServer.TotalProcessorTime.ToString() + "\r\n"); |
212 | proc_GridServer.StopProcess(); | 240 | proc_GridServer.StopProcess(); |
241 | proc_GridServer = null; | ||
213 | } | 242 | } |
214 | if (proc_AssetServer != null) | 243 | if (proc_AssetServer != null) |
215 | { | 244 | { |
216 | txtMainLog.AppendText("Shutting down AssetServer. CPU time used: " + proc_AssetServer.TotalProcessorTime.ToString() + "\r\n"); | 245 | txtMainLog.AppendText("Shutting down AssetServer. CPU time used: " + proc_AssetServer.TotalProcessorTime.ToString() + "\r\n"); |
217 | proc_AssetServer.StopProcess(); | 246 | proc_AssetServer.StopProcess(); |
247 | proc_AssetServer = null; | ||
218 | } | 248 | } |
219 | if (proc_OpenSim != null) | 249 | if (proc_OpenSim != null) |
220 | { | 250 | { |
221 | txtMainLog.AppendText("Shutting down OpenSim. CPU time used: " + proc_OpenSim.TotalProcessorTime.ToString() + "\r\n"); | 251 | txtMainLog.AppendText("Shutting down OpenSim. CPU time used: " + proc_OpenSim.TotalProcessorTime.ToString() + "\r\n"); |
222 | proc_OpenSim.StopProcess(); | 252 | proc_OpenSim.StopProcess(); |
253 | proc_OpenSim = null; | ||
223 | } | 254 | } |
224 | |||
225 | btnStart.Enabled = true; | ||
226 | btnStop.Enabled = false; | ||
227 | |||
228 | |||
229 | } | 255 | } |
230 | |||
231 | private void UpdateTabVisibility() | 256 | private void UpdateTabVisibility() |
232 | { | 257 | { |
233 | if (rbStandAloneMode.Checked) | 258 | if (rbStandAloneMode.Checked) |
@@ -248,7 +273,6 @@ namespace OpenSim.GUI | |||
248 | if (!tabLogs.TabPages.Contains(tabAssetServer)) | 273 | if (!tabLogs.TabPages.Contains(tabAssetServer)) |
249 | tabLogs.TabPages.Add(tabAssetServer); | 274 | tabLogs.TabPages.Add(tabAssetServer); |
250 | } | 275 | } |
251 | |||
252 | } | 276 | } |
253 | 277 | ||
254 | private void rbStandAloneMode_CheckedChanged(object sender, EventArgs e) | 278 | private void rbStandAloneMode_CheckedChanged(object sender, EventArgs e) |
@@ -266,5 +290,248 @@ namespace OpenSim.GUI | |||
266 | UpdateTabVisibility(); | 290 | UpdateTabVisibility(); |
267 | } | 291 | } |
268 | 292 | ||
293 | private int counter; | ||
294 | |||
295 | private void Exit() | ||
296 | { | ||
297 | counter = 0; | ||
298 | timer1.Interval = 600; | ||
299 | timer1.Enabled = true; | ||
300 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick); | ||
301 | } | ||
302 | |||
303 | private void timer1_Tick(object sender, System.EventArgs e) | ||
304 | { | ||
305 | if (counter >= 10) | ||
306 | { | ||
307 | timer1.Enabled = false; | ||
308 | counter = 0; | ||
309 | Application.Exit(); | ||
310 | } | ||
311 | else | ||
312 | { | ||
313 | counter = counter + 1; | ||
314 | } | ||
315 | } | ||
316 | |||
317 | private void exitToolStripMenuItem_Click(object sender, EventArgs e) | ||
318 | { | ||
319 | if (proc_UserServer != null || proc_GridServer != null || proc_AssetServer != null || proc_OpenSim != null) | ||
320 | { | ||
321 | label6.Text = "Stopping server(s) and waiting to safely close.............."; | ||
322 | Stop(); | ||
323 | Exit(); | ||
324 | } | ||
325 | else | ||
326 | { | ||
327 | Application.Exit(); | ||
328 | } | ||
329 | } | ||
330 | /// <summary> | ||
331 | /// CLIENT SECTION | ||
332 | /// </summary> | ||
333 | string exeString; | ||
334 | string exeArgs; | ||
335 | string usrsvr; | ||
336 | string error = "Reconsider your commandline choices, you have opposing values selected!"; | ||
337 | |||
338 | private void label6_Click(object sender, EventArgs e) | ||
339 | { | ||
340 | label6.Text = clientBox1.Text; | ||
341 | } | ||
342 | private void errorSwitches() | ||
343 | { | ||
344 | MessageBox.Show(error); | ||
345 | label6.Text = error; | ||
346 | } | ||
347 | bool exists; | ||
348 | private void Launch1_Click(object sender, EventArgs e) | ||
349 | { | ||
350 | if (exists = System.IO.File.Exists(clientBox1.Text + exeBox1.Text)) | ||
351 | { | ||
352 | executeClient(); | ||
353 | } | ||
354 | else | ||
355 | { | ||
356 | MessageBox.Show("FILE DOES NOT EXIST!!!"); | ||
357 | label6.Text = "FILE DOES NOT EXIST!!!"; | ||
358 | } | ||
359 | } | ||
360 | private void NATfix() | ||
361 | { | ||
362 | } | ||
363 | private void executeClient() | ||
364 | { | ||
365 | label6.Text = ""; | ||
366 | exeArgs = ""; | ||
367 | exeString = clientBox1.Text; | ||
368 | exeString = exeString += exeBox1.Text; | ||
369 | |||
370 | if (multiple1.Checked == true && noMultiple1.Checked == true) errorSwitches(); | ||
371 | else if (korean1.Checked == true && spanish1.Checked == true) errorSwitches(); | ||
372 | else | ||
373 | { | ||
374 | if (noProbe1.Checked == true) exeArgs = exeArgs += " -noprobe"; | ||
375 | if (multiple1.Checked == true) exeArgs = exeArgs += " -multiple"; | ||
376 | if (noMultiple1.Checked == true) exeArgs = exeArgs += " -nomultiple"; | ||
377 | if (korean1.Checked == true) exeArgs = exeArgs += " -korean"; | ||
378 | if (spanish1.Checked == true) exeArgs = exeArgs += " -spanish"; | ||
379 | if (ignorepixeldepth1.Checked == true) exeArgs = exeArgs += " -ignorepixeldepth"; | ||
380 | if (nothread1.Checked == true) exeArgs = exeArgs += " -nothread"; | ||
381 | if (safe1.Checked == true) exeArgs = exeArgs += " -safe"; | ||
382 | if (noconsole1.Checked == true) exeArgs = exeArgs += " -noconsole"; | ||
383 | if (log1.Checked == true) exeArgs = exeArgs += " -log"; | ||
384 | if (helperuri1.Checked == true) exeArgs = exeArgs += " -helperuri"; | ||
385 | if (autologin1.Checked == true) exeArgs = exeArgs += " --autologin"; | ||
386 | if (dialog1.Checked == true) exeArgs = exeArgs += " -dialog"; | ||
387 | if (previous1.Checked == true) exeArgs = exeArgs += " -previous"; | ||
388 | if (simple1.Checked == true) exeArgs = exeArgs += " -simple"; | ||
389 | if (noinvlib1.Checked == true) exeArgs = exeArgs += " -noinvlib"; | ||
390 | if (noutc1.Checked == true) exeArgs = exeArgs += " -noutc"; | ||
391 | if (debugst1.Checked == true) exeArgs = exeArgs += " -debugst"; | ||
392 | if (local1.Checked == true) exeArgs = exeArgs += " -local"; | ||
393 | if (purge1.Checked == true) exeArgs = exeArgs += " -purge"; | ||
394 | if (nofmod1.Checked == true) exeArgs = exeArgs += " -nofmod"; | ||
395 | if (nosound1.Checked == true) exeArgs = exeArgs += " -nosound"; | ||
396 | if (noaudio1.Checked == true) exeArgs = exeArgs += " -noaudio"; | ||
397 | if (url1.Checked == true) | ||
398 | { | ||
399 | exeArgs = exeArgs += " -url "; | ||
400 | exeArgs = exeArgs += simBox1.Text; | ||
401 | } | ||
402 | if (port1.Checked == true) | ||
403 | { | ||
404 | int aPort; | ||
405 | aPort = Convert.ToInt32(portBox1.Text); | ||
406 | if (aPort > 13050) | ||
407 | { | ||
408 | portBox1.Text = "13050"; | ||
409 | MessageBox.Show("Enter Usable port number, defaulting to 13050."); | ||
410 | } | ||
411 | if(aPort < 13000) | ||
412 | { | ||
413 | portBox1.Text = "13000"; | ||
414 | MessageBox.Show("Enter Usable port number, defaulting to 13000."); | ||
415 | } | ||
416 | else | ||
417 | { | ||
418 | } | ||
419 | exeArgs = exeArgs += " -port "; | ||
420 | exeArgs = exeArgs += portBox1.Text; | ||
421 | } | ||
422 | if (drop1.Checked == true) | ||
423 | { | ||
424 | int aPct; | ||
425 | aPct = Convert.ToInt32(dropBox1.Text); | ||
426 | if (aPct > 100) | ||
427 | { | ||
428 | dropBox1.Text = "100"; | ||
429 | MessageBox.Show("Enter Usable port number, defaulting to 100."); | ||
430 | } | ||
431 | if (aPct < 0) | ||
432 | { | ||
433 | dropBox1.Text = "0"; | ||
434 | MessageBox.Show("Enter Usable port number, defaulting to 0."); | ||
435 | } | ||
436 | else | ||
437 | { | ||
438 | } | ||
439 | exeArgs = exeArgs += " -drop "; | ||
440 | exeArgs = exeArgs += dropBox1.Text; | ||
441 | } | ||
442 | if (inbw1.Checked == true) | ||
443 | { | ||
444 | exeArgs = exeArgs += " -inbw "; | ||
445 | exeArgs = exeArgs += inbwBox1.Text; | ||
446 | } | ||
447 | if (outbw1.Checked == true) | ||
448 | { | ||
449 | exeArgs = exeArgs += " -outbw "; | ||
450 | exeArgs = exeArgs += outbwBox1.Text; | ||
451 | } | ||
452 | if (settings1.Checked == true) | ||
453 | { | ||
454 | exeArgs = exeArgs += " -settings "; | ||
455 | exeArgs = exeArgs += settingsBox1.Text; | ||
456 | } | ||
457 | if (logfile1.Checked == true) | ||
458 | { | ||
459 | exeArgs = exeArgs += " -logfile "; | ||
460 | exeArgs = exeArgs += logfileBox1.Text; | ||
461 | } | ||
462 | if (yield1.Checked == true) | ||
463 | { | ||
464 | exeArgs = exeArgs += " -yield "; | ||
465 | exeArgs = exeArgs += yieldBox1.Text; | ||
466 | } | ||
467 | if (techTag1.Checked == true) | ||
468 | { | ||
469 | exeArgs = exeArgs += " -techtag "; | ||
470 | exeArgs = exeArgs += techtagBox1.Text; | ||
471 | } | ||
472 | if (quitAfter1.Checked == true) | ||
473 | { | ||
474 | exeArgs = exeArgs += " -quitafter "; | ||
475 | exeArgs = exeArgs += quitafterBox1.Text; | ||
476 | } | ||
477 | if (loginuri1.Checked == true) | ||
478 | { | ||
479 | exeArgs = exeArgs += " -loginuri "; | ||
480 | exeArgs = exeArgs += loginuriBox1.Text; | ||
481 | } | ||
482 | if (set1.Checked == true) | ||
483 | { | ||
484 | exeArgs = exeArgs += " -set "; | ||
485 | exeArgs = exeArgs += setBox1.Text; | ||
486 | } | ||
487 | if (errmask1.Checked == true) | ||
488 | { | ||
489 | exeArgs = exeArgs += " -errmask "; | ||
490 | exeArgs = exeArgs += errmaskBox1.Text; | ||
491 | } | ||
492 | if (raw1.Checked == true) | ||
493 | { | ||
494 | exeArgs = exeArgs += " " + rawBox1.Text; | ||
495 | } | ||
496 | if (skin1.Checked == true) | ||
497 | { | ||
498 | bool exists; | ||
499 | if (exists = System.IO.File.Exists(skinBox1.Text + "skin.xml")) | ||
500 | { | ||
501 | exeArgs = exeArgs += " -skin "; | ||
502 | exeArgs = exeArgs += skinBox1.Text + "skin.xml"; | ||
503 | } | ||
504 | else | ||
505 | { | ||
506 | MessageBox.Show("SKIN FILE DOES NOT EXIST AT SPECIFIED LOCATION!!!"); | ||
507 | skin1.Checked = false; | ||
508 | executeClient(); | ||
509 | } | ||
510 | } | ||
511 | if (user1.Checked == true) | ||
512 | { | ||
513 | //find actual login urls | ||
514 | if (comboBox1.Text == "agni") { usrsvr = " -user " + "--agni"; } | ||
515 | if (comboBox1.Text == "colo") { usrsvr = " -user " + "--colo"; } | ||
516 | if (comboBox1.Text == "dmz") { usrsvr = " -user " + "--dmz"; } | ||
517 | if (comboBox1.Text == "durga") { usrsvr = " -user " + "--Durga"; } | ||
518 | if (comboBox1.Text == "siva") { usrsvr = " -user " + "--siva"; } | ||
519 | exeArgs = exeArgs += usrsvr; | ||
520 | } | ||
521 | if (login1.Checked == true) | ||
522 | { | ||
523 | exeArgs = exeArgs += " -login "; | ||
524 | exeArgs = exeArgs += firstBox1.Text + " " + lastBox1.Text + " " + passBox1.Text; | ||
525 | } | ||
526 | label6.Text = exeString + exeArgs; | ||
527 | System.Diagnostics.Process proc = new System.Diagnostics.Process(); | ||
528 | proc.StartInfo.FileName = exeString; | ||
529 | proc.StartInfo.Arguments = exeArgs; | ||
530 | proc.StartInfo.UseShellExecute = false; | ||
531 | proc.StartInfo.RedirectStandardOutput = false; | ||
532 | proc.StartInfo.WorkingDirectory = clientBox1.Text; | ||
533 | proc.Start(); | ||
534 | } | ||
535 | } | ||
269 | } | 536 | } |
270 | } | 537 | } |