aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer
diff options
context:
space:
mode:
authorAdam Frisby2007-04-20 05:39:01 +0000
committerAdam Frisby2007-04-20 05:39:01 +0000
commit258e62679aca6fa74a20a5275cb0f172402352e8 (patch)
treef0e6c267e11078b8e2e03ca9bf7ca67513208438 /OpenSim.RegionServer
parent(no commit message) (diff)
downloadopensim-SC_OLD-258e62679aca6fa74a20a5275cb0f172402352e8.zip
opensim-SC_OLD-258e62679aca6fa74a20a5275cb0f172402352e8.tar.gz
opensim-SC_OLD-258e62679aca6fa74a20a5275cb0f172402352e8.tar.bz2
opensim-SC_OLD-258e62679aca6fa74a20a5275cb0f172402352e8.tar.xz
Console:
* Reorganised and added default handlers to main functions * Removed "regenerate" command, use "terrain regenerate" instead. * Added new "terrain seed" command to set the random seed * Added new "terrain load" command to load a terrain from disk * Added new "terrain save" command to save a terrain to disk Terrain: * Added new export and import functions for some common formats * Added new setSeed function to allow customising the random seed
Diffstat (limited to 'OpenSim.RegionServer')
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs78
1 files changed, 75 insertions, 3 deletions
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs
index 48eff1b..b2ee3b6 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim.RegionServer/OpenSimMain.cs
@@ -505,20 +505,92 @@ namespace OpenSim
505 case "help": 505 case "help":
506 m_console.WriteLine("show users - show info about connected users"); 506 m_console.WriteLine("show users - show info about connected users");
507 m_console.WriteLine("shutdown - disconnect all clients and shutdown"); 507 m_console.WriteLine("shutdown - disconnect all clients and shutdown");
508 m_console.WriteLine("regenerate - regenerate the sim's terrain");
509 break; 508 break;
510 509
511 case "show": 510 case "show":
512 Show(cmdparams[0]); 511 Show(cmdparams[0]);
513 break; 512 break;
514 513
515 case "regenerate": 514 case "terrain":
516 LocalWorld.RegenerateTerrain(); 515 RunTerrainCmd(cmdparams);
517 break; 516 break;
518 517
519 case "shutdown": 518 case "shutdown":
520 Shutdown(); 519 Shutdown();
521 break; 520 break;
521
522 default:
523 m_console.WriteLine("Unknown command");
524 break;
525 }
526 }
527
528 /// <summary>
529 /// Processes a terrain-specific command
530 /// </summary>
531 /// <remarks>TODO: Move this into BasicTerrain directly (no need to hard limit what each terrain engine can support)</remarks>
532 /// <param name="args"></param>
533 public void RunTerrainCmd(string[] args)
534 {
535 string command = args[0];
536 switch (command)
537 {
538 case "help":
539 m_console.WriteLine("terrain regenerate - rebuilds the sims terrain using a default algorithm");
540 m_console.WriteLine("terrain seed <seed> - sets the random seed value to <seed>");
541 m_console.WriteLine("terrain load <type> <filename> - loads a terrain from disk, type can be 'F32', 'F64' or 'IMG'");
542 m_console.WriteLine("terrain save <type> <filename> - saves a terrain to disk, type can be 'F32' or 'F64'");
543 break;
544
545 case "seed":
546 LocalWorld.Terrain.setSeed(Convert.ToInt32(args[1]));
547 break;
548
549 case "regenerate":
550 LocalWorld.Terrain.hills();
551 break;
552
553 case "load":
554 switch (args[1].ToLower())
555 {
556 case "f32":
557 LocalWorld.Terrain.loadFromFileF32(args[2]);
558 break;
559
560 case "f64":
561 LocalWorld.Terrain.loadFromFileF64(args[2]);
562 break;
563
564 case "img":
565 m_console.WriteLine("Error - IMG mode is presently unsupported.");
566 break;
567
568 default:
569 m_console.WriteLine("Unknown image or data format");
570 break;
571 }
572 break;
573
574 case "save":
575 switch (args[1].ToLower())
576 {
577 case "f32":
578 LocalWorld.Terrain.writeToFileF32(args[2]);
579 break;
580
581 case "f64":
582 LocalWorld.Terrain.writeToFileF64(args[2]);
583 break;
584
585 default:
586 m_console.WriteLine("Unknown image or data format");
587 break;
588 }
589 break;
590
591 default:
592 m_console.WriteLine("Unknown terrain command");
593 break;
522 } 594 }
523 } 595 }
524 596