aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/OpenSimMain.cs
diff options
context:
space:
mode:
authorAdam Frisby2007-04-24 18:01:37 +0000
committerAdam Frisby2007-04-24 18:01:37 +0000
commit7dd98f30943f66e7f0c4c63db1190fad2f437185 (patch)
treef53b033628856a44d106e5fb08a166e674908c80 /OpenSim.RegionServer/OpenSimMain.cs
parentAdded mutex instead of lock for update (diff)
downloadopensim-SC_OLD-7dd98f30943f66e7f0c4c63db1190fad2f437185.zip
opensim-SC_OLD-7dd98f30943f66e7f0c4c63db1190fad2f437185.tar.gz
opensim-SC_OLD-7dd98f30943f66e7f0c4c63db1190fad2f437185.tar.bz2
opensim-SC_OLD-7dd98f30943f66e7f0c4c63db1190fad2f437185.tar.xz
Moved console input-handling function "RunTerrainCmd" into BasicTerrain itself, this allows independent versions of BasicTerrain to have different functionality exposed directly.
Diffstat (limited to 'OpenSim.RegionServer/OpenSimMain.cs')
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs85
1 files changed, 5 insertions, 80 deletions
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs
index 1c3454d..151ac51 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim.RegionServer/OpenSimMain.cs
@@ -522,7 +522,11 @@ namespace OpenSim
522 break; 522 break;
523 523
524 case "terrain": 524 case "terrain":
525 RunTerrainCmd(cmdparams); 525 string result = "";
526 if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams,ref result))
527 {
528 m_console.WriteLine(result);
529 }
526 break; 530 break;
527 531
528 case "shutdown": 532 case "shutdown":
@@ -536,85 +540,6 @@ namespace OpenSim
536 } 540 }
537 541
538 /// <summary> 542 /// <summary>
539 /// Processes a terrain-specific command
540 /// </summary>
541 /// <remarks>TODO: Move this into BasicTerrain directly (no need to hard limit what each terrain engine can support)</remarks>
542 /// <param name="args"></param>
543 public void RunTerrainCmd(string[] args)
544 {
545 string command = args[0];
546 switch (command)
547 {
548 case "help":
549 m_console.WriteLine("terrain regenerate - rebuilds the sims terrain using a default algorithm");
550 m_console.WriteLine("terrain seed <seed> - sets the random seed value to <seed>");
551 m_console.WriteLine("terrain load <type> <filename> - loads a terrain from disk, type can be 'F32', 'F64' or 'IMG'");
552 m_console.WriteLine("terrain save <type> <filename> - saves a terrain to disk, type can be 'F32' or 'F64'");
553 m_console.WriteLine("terrain rescale <min> <max> - rescales a terrain to be between <min> and <max> meters high");
554 m_console.WriteLine("terrain multiply <val> - multiplies a terrain by <val>");
555 break;
556
557 case "seed":
558 LocalWorld.Terrain.setSeed(Convert.ToInt32(args[1]));
559 break;
560
561 case "regenerate":
562 LocalWorld.Terrain.hills();
563 break;
564
565 case "rescale":
566 LocalWorld.Terrain.setRange(Convert.ToSingle(args[1]), Convert.ToSingle(args[2]));
567 break;
568
569 case "multiply":
570 LocalWorld.Terrain *= Convert.ToDouble(args[1]);
571 break;
572
573 case "load":
574 switch (args[1].ToLower())
575 {
576 case "f32":
577 LocalWorld.Terrain.loadFromFileF32(args[2]);
578 break;
579
580 case "f64":
581 LocalWorld.Terrain.loadFromFileF64(args[2]);
582 break;
583
584 case "img":
585 m_console.WriteLine("Error - IMG mode is presently unsupported.");
586 break;
587
588 default:
589 m_console.WriteLine("Unknown image or data format");
590 break;
591 }
592 break;
593
594 case "save":
595 switch (args[1].ToLower())
596 {
597 case "f32":
598 LocalWorld.Terrain.writeToFileF32(args[2]);
599 break;
600
601 case "f64":
602 LocalWorld.Terrain.writeToFileF64(args[2]);
603 break;
604
605 default:
606 m_console.WriteLine("Unknown image or data format");
607 break;
608 }
609 break;
610
611 default:
612 m_console.WriteLine("Unknown terrain command");
613 break;
614 }
615 }
616
617 /// <summary>
618 /// Outputs to the console information about the region 543 /// Outputs to the console information about the region
619 /// </summary> 544 /// </summary>
620 /// <param name="ShowWhat">What information to display (valid arguments are "uptime", "users")</param> 545 /// <param name="ShowWhat">What information to display (valid arguments are "uptime", "users")</param>