diff options
author | Justin Clarke Casey | 2008-07-12 20:14:17 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-07-12 20:14:17 +0000 |
commit | e30ca523ae0716b9dfa8aef4697de76ab2da66d7 (patch) | |
tree | 0a76902c494a9e0dcc8d2b238b26266e543096b4 /OpenSim/Region/Application | |
parent | * refactor: collapse scene debug settings into same format as packet debug se... (diff) | |
download | opensim-SC_OLD-e30ca523ae0716b9dfa8aef4697de76ab2da66d7.zip opensim-SC_OLD-e30ca523ae0716b9dfa8aef4697de76ab2da66d7.tar.gz opensim-SC_OLD-e30ca523ae0716b9dfa8aef4697de76ab2da66d7.tar.bz2 opensim-SC_OLD-e30ca523ae0716b9dfa8aef4697de76ab2da66d7.tar.xz |
* refactor: Move xml/archive loading and saving code into separate methods ready for future modularization
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 188 |
1 files changed, 109 insertions, 79 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index e5cc795..85a443b 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -280,74 +280,19 @@ namespace OpenSim | |||
280 | break; | 280 | break; |
281 | 281 | ||
282 | case "save-xml": | 282 | case "save-xml": |
283 | m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); | 283 | SaveXml(cmdparams); |
284 | |||
285 | if (cmdparams.Length > 0) | ||
286 | { | ||
287 | m_sceneManager.SaveCurrentSceneToXml(cmdparams[0]); | ||
288 | } | ||
289 | else | ||
290 | { | ||
291 | m_sceneManager.SaveCurrentSceneToXml(DEFAULT_PRIM_BACKUP_FILENAME); | ||
292 | } | ||
293 | break; | 284 | break; |
294 | 285 | ||
295 | case "load-xml": | 286 | case "load-xml": |
296 | m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); | 287 | LoadXml(cmdparams); |
297 | |||
298 | LLVector3 loadOffset = new LLVector3(0, 0, 0); | ||
299 | if (cmdparams.Length > 0) | ||
300 | { | ||
301 | bool generateNewIDS = false; | ||
302 | if (cmdparams.Length > 1) | ||
303 | { | ||
304 | if (cmdparams[1] == "-newUID") | ||
305 | { | ||
306 | generateNewIDS = true; | ||
307 | } | ||
308 | if (cmdparams.Length > 2) | ||
309 | { | ||
310 | loadOffset.X = (float) Convert.ToDecimal(cmdparams[2]); | ||
311 | if (cmdparams.Length > 3) | ||
312 | { | ||
313 | loadOffset.Y = (float) Convert.ToDecimal(cmdparams[3]); | ||
314 | } | ||
315 | if (cmdparams.Length > 4) | ||
316 | { | ||
317 | loadOffset.Z = (float) Convert.ToDecimal(cmdparams[4]); | ||
318 | } | ||
319 | m_console.Error("loadOffsets <X,Y,Z> = <" + loadOffset.X + "," + loadOffset.Y + "," + | ||
320 | loadOffset.Z + ">"); | ||
321 | } | ||
322 | } | ||
323 | m_sceneManager.LoadCurrentSceneFromXml(cmdparams[0], generateNewIDS, loadOffset); | ||
324 | } | ||
325 | else | ||
326 | { | ||
327 | m_sceneManager.LoadCurrentSceneFromXml(DEFAULT_PRIM_BACKUP_FILENAME, false, loadOffset); | ||
328 | } | ||
329 | break; | 288 | break; |
330 | 289 | ||
331 | case "save-xml2": | 290 | case "save-xml2": |
332 | if (cmdparams.Length > 0) | 291 | SaveXml2(cmdparams); |
333 | { | ||
334 | m_sceneManager.SaveCurrentSceneToXml2(cmdparams[0]); | ||
335 | } | ||
336 | else | ||
337 | { | ||
338 | m_sceneManager.SaveCurrentSceneToXml2(DEFAULT_PRIM_BACKUP_FILENAME); | ||
339 | } | ||
340 | break; | 292 | break; |
341 | 293 | ||
342 | case "load-xml2": | 294 | case "load-xml2": |
343 | if (cmdparams.Length > 0) | 295 | LoadXml2(cmdparams); |
344 | { | ||
345 | m_sceneManager.LoadCurrentSceneFromXml2(cmdparams[0]); | ||
346 | } | ||
347 | else | ||
348 | { | ||
349 | m_sceneManager.LoadCurrentSceneFromXml2(DEFAULT_PRIM_BACKUP_FILENAME); | ||
350 | } | ||
351 | break; | 296 | break; |
352 | 297 | ||
353 | case "save-prims-xml2": | 298 | case "save-prims-xml2": |
@@ -362,29 +307,11 @@ namespace OpenSim | |||
362 | break; | 307 | break; |
363 | 308 | ||
364 | case "load-oar": | 309 | case "load-oar": |
365 | m_log.Error("[CONSOLE]: Don't use me - I haven't yet been sufficiently implemented!"); | 310 | LoadOar(cmdparams); |
366 | |||
367 | if (cmdparams.Length > 0) | ||
368 | { | ||
369 | m_sceneManager.LoadArchiveToCurrentScene(cmdparams[0]); | ||
370 | } | ||
371 | else | ||
372 | { | ||
373 | m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME); | ||
374 | } | ||
375 | break; | 311 | break; |
376 | 312 | ||
377 | case "save-oar": | 313 | case "save-oar": |
378 | m_log.Error("[CONSOLE]: Don't use me - I haven't yet been sufficiently implemented!"); | 314 | SaveOar(cmdparams); |
379 | |||
380 | if (cmdparams.Length > 0) | ||
381 | { | ||
382 | m_sceneManager.SaveCurrentSceneToArchive(cmdparams[0]); | ||
383 | } | ||
384 | else | ||
385 | { | ||
386 | m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); | ||
387 | } | ||
388 | break; | 315 | break; |
389 | 316 | ||
390 | case "plugin": | 317 | case "plugin": |
@@ -709,6 +636,109 @@ namespace OpenSim | |||
709 | break; | 636 | break; |
710 | } | 637 | } |
711 | } | 638 | } |
639 | |||
640 | protected void SaveXml(string[] cmdparams) | ||
641 | { | ||
642 | m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); | ||
643 | |||
644 | if (cmdparams.Length > 0) | ||
645 | { | ||
646 | m_sceneManager.SaveCurrentSceneToXml(cmdparams[0]); | ||
647 | } | ||
648 | else | ||
649 | { | ||
650 | m_sceneManager.SaveCurrentSceneToXml(DEFAULT_PRIM_BACKUP_FILENAME); | ||
651 | } | ||
652 | } | ||
653 | |||
654 | protected void LoadXml(string[] cmdparams) | ||
655 | { | ||
656 | m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); | ||
657 | |||
658 | LLVector3 loadOffset = new LLVector3(0, 0, 0); | ||
659 | if (cmdparams.Length > 0) | ||
660 | { | ||
661 | bool generateNewIDS = false; | ||
662 | if (cmdparams.Length > 1) | ||
663 | { | ||
664 | if (cmdparams[1] == "-newUID") | ||
665 | { | ||
666 | generateNewIDS = true; | ||
667 | } | ||
668 | if (cmdparams.Length > 2) | ||
669 | { | ||
670 | loadOffset.X = (float) Convert.ToDecimal(cmdparams[2]); | ||
671 | if (cmdparams.Length > 3) | ||
672 | { | ||
673 | loadOffset.Y = (float) Convert.ToDecimal(cmdparams[3]); | ||
674 | } | ||
675 | if (cmdparams.Length > 4) | ||
676 | { | ||
677 | loadOffset.Z = (float) Convert.ToDecimal(cmdparams[4]); | ||
678 | } | ||
679 | m_console.Error("loadOffsets <X,Y,Z> = <" + loadOffset.X + "," + loadOffset.Y + "," + | ||
680 | loadOffset.Z + ">"); | ||
681 | } | ||
682 | } | ||
683 | m_sceneManager.LoadCurrentSceneFromXml(cmdparams[0], generateNewIDS, loadOffset); | ||
684 | } | ||
685 | else | ||
686 | { | ||
687 | m_sceneManager.LoadCurrentSceneFromXml(DEFAULT_PRIM_BACKUP_FILENAME, false, loadOffset); | ||
688 | } | ||
689 | } | ||
690 | |||
691 | protected void SaveXml2(string[] cmdparams) | ||
692 | { | ||
693 | if (cmdparams.Length > 0) | ||
694 | { | ||
695 | m_sceneManager.SaveCurrentSceneToXml2(cmdparams[0]); | ||
696 | } | ||
697 | else | ||
698 | { | ||
699 | m_sceneManager.SaveCurrentSceneToXml2(DEFAULT_PRIM_BACKUP_FILENAME); | ||
700 | } | ||
701 | } | ||
702 | |||
703 | protected void LoadXml2(string[] cmdparams) | ||
704 | { | ||
705 | if (cmdparams.Length > 0) | ||
706 | { | ||
707 | m_sceneManager.LoadCurrentSceneFromXml2(cmdparams[0]); | ||
708 | } | ||
709 | else | ||
710 | { | ||
711 | m_sceneManager.LoadCurrentSceneFromXml2(DEFAULT_PRIM_BACKUP_FILENAME); | ||
712 | } | ||
713 | } | ||
714 | |||
715 | protected void LoadOar(string[] cmdparams) | ||
716 | { | ||
717 | m_log.Error("[CONSOLE]: Don't use me - I haven't yet been sufficiently implemented!"); | ||
718 | |||
719 | if (cmdparams.Length > 0) | ||
720 | { | ||
721 | m_sceneManager.LoadArchiveToCurrentScene(cmdparams[0]); | ||
722 | } | ||
723 | else | ||
724 | { | ||
725 | m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME); | ||
726 | } | ||
727 | } | ||
728 | |||
729 | protected void SaveOar(string[] cmdparams) | ||
730 | { | ||
731 | m_log.Error("[CONSOLE]: Don't use me - I haven't yet been sufficiently implemented!"); | ||
732 | |||
733 | if (cmdparams.Length > 0) | ||
734 | { | ||
735 | m_sceneManager.SaveCurrentSceneToArchive(cmdparams[0]); | ||
736 | } | ||
737 | else | ||
738 | { | ||
739 | m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); | ||
740 | } | ||
741 | } | ||
712 | 742 | ||
713 | private static string CombineParams(string[] commandParams, int pos) | 743 | private static string CombineParams(string[] commandParams, int pos) |
714 | { | 744 | { |