diff options
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneBase.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 79 |
1 files changed, 70 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 712e094..9c6b884 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -149,9 +149,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
149 | #region Update Methods | 149 | #region Update Methods |
150 | 150 | ||
151 | /// <summary> | 151 | /// <summary> |
152 | /// Normally called once every frame/tick to let the world preform anything required (like running the physics simulation) | 152 | /// Called to update the scene loop by a number of frames and until shutdown. |
153 | /// </summary> | 153 | /// </summary> |
154 | public abstract void Update(); | 154 | /// <param name="frames"> |
155 | /// Number of frames to update. Exits on shutdown even if there are frames remaining. | ||
156 | /// If -1 then updates until shutdown. | ||
157 | /// </param> | ||
158 | public abstract void Update(int frames); | ||
155 | 159 | ||
156 | #endregion | 160 | #endregion |
157 | 161 | ||
@@ -472,6 +476,63 @@ namespace OpenSim.Region.Framework.Scenes | |||
472 | /// <summary> | 476 | /// <summary> |
473 | /// Call this from a region module to add a command to the OpenSim console. | 477 | /// Call this from a region module to add a command to the OpenSim console. |
474 | /// </summary> | 478 | /// </summary> |
479 | /// <param name="mod"> | ||
480 | /// The use of IRegionModuleBase is a cheap trick to get a different method signature, | ||
481 | /// though all new modules should be using interfaces descended from IRegionModuleBase anyway. | ||
482 | /// </param> | ||
483 | /// <param name="category"> | ||
484 | /// Category of the command. This is the section under which it will appear when the user asks for help | ||
485 | /// </param> | ||
486 | /// <param name="command"></param> | ||
487 | /// <param name="shorthelp"></param> | ||
488 | /// <param name="longhelp"></param> | ||
489 | /// <param name="callback"></param> | ||
490 | public void AddCommand( | ||
491 | string category, object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) | ||
492 | { | ||
493 | AddCommand(category, mod, command, shorthelp, longhelp, string.Empty, callback); | ||
494 | } | ||
495 | |||
496 | /// <summary> | ||
497 | /// Call this from a region module to add a command to the OpenSim console. | ||
498 | /// </summary> | ||
499 | /// <param name="mod"></param> | ||
500 | /// <param name="command"></param> | ||
501 | /// <param name="shorthelp"></param> | ||
502 | /// <param name="longhelp"></param> | ||
503 | /// <param name="descriptivehelp"></param> | ||
504 | /// <param name="callback"></param> | ||
505 | public void AddCommand(object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) | ||
506 | { | ||
507 | string moduleName = ""; | ||
508 | |||
509 | if (mod != null) | ||
510 | { | ||
511 | if (mod is IRegionModule) | ||
512 | { | ||
513 | IRegionModule module = (IRegionModule)mod; | ||
514 | moduleName = module.Name; | ||
515 | } | ||
516 | else if (mod is IRegionModuleBase) | ||
517 | { | ||
518 | IRegionModuleBase module = (IRegionModuleBase)mod; | ||
519 | moduleName = module.Name; | ||
520 | } | ||
521 | else | ||
522 | { | ||
523 | throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase"); | ||
524 | } | ||
525 | } | ||
526 | |||
527 | AddCommand(moduleName, mod, command, shorthelp, longhelp, descriptivehelp, callback); | ||
528 | } | ||
529 | |||
530 | /// <summary> | ||
531 | /// Call this from a region module to add a command to the OpenSim console. | ||
532 | /// </summary> | ||
533 | /// <param name="category"> | ||
534 | /// Category of the command. This is the section under which it will appear when the user asks for help | ||
535 | /// </param> | ||
475 | /// <param name="mod"></param> | 536 | /// <param name="mod"></param> |
476 | /// <param name="command"></param> | 537 | /// <param name="command"></param> |
477 | /// <param name="shorthelp"></param> | 538 | /// <param name="shorthelp"></param> |
@@ -479,12 +540,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
479 | /// <param name="descriptivehelp"></param> | 540 | /// <param name="descriptivehelp"></param> |
480 | /// <param name="callback"></param> | 541 | /// <param name="callback"></param> |
481 | public void AddCommand( | 542 | public void AddCommand( |
482 | object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) | 543 | string category, object mod, string command, |
544 | string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) | ||
483 | { | 545 | { |
484 | if (MainConsole.Instance == null) | 546 | if (MainConsole.Instance == null) |
485 | return; | 547 | return; |
486 | 548 | ||
487 | string modulename = String.Empty; | ||
488 | bool shared = false; | 549 | bool shared = false; |
489 | 550 | ||
490 | if (mod != null) | 551 | if (mod != null) |
@@ -492,20 +553,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
492 | if (mod is IRegionModule) | 553 | if (mod is IRegionModule) |
493 | { | 554 | { |
494 | IRegionModule module = (IRegionModule)mod; | 555 | IRegionModule module = (IRegionModule)mod; |
495 | modulename = module.Name; | ||
496 | shared = module.IsSharedModule; | 556 | shared = module.IsSharedModule; |
497 | } | 557 | } |
498 | else if (mod is IRegionModuleBase) | 558 | else if (mod is IRegionModuleBase) |
499 | { | 559 | { |
500 | IRegionModuleBase module = (IRegionModuleBase)mod; | ||
501 | modulename = module.Name; | ||
502 | shared = mod is ISharedRegionModule; | 560 | shared = mod is ISharedRegionModule; |
503 | } | 561 | } |
504 | else throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase"); | 562 | else |
563 | { | ||
564 | throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase"); | ||
565 | } | ||
505 | } | 566 | } |
506 | 567 | ||
507 | MainConsole.Instance.Commands.AddCommand( | 568 | MainConsole.Instance.Commands.AddCommand( |
508 | modulename, shared, command, shorthelp, longhelp, descriptivehelp, callback); | 569 | category, shared, command, shorthelp, longhelp, descriptivehelp, callback); |
509 | } | 570 | } |
510 | 571 | ||
511 | public virtual ISceneObject DeserializeObject(string representation) | 572 | public virtual ISceneObject DeserializeObject(string representation) |