C# Class OpenSim.Region.OptionalModules.ContentManagement.CMController

The controller in a Model-View-Controller framework. This controller catches actions by the avatars, creates work packets, loops through these work packets in a separate thread, then dictates to the model how the data should change and dictates to the view which data should be displayed. The main mechanism for interaction is through the simchat system.
Mostrar archivo Open project: openmetaversefoundation/fortis-opensim Class Usage Examples

Public Methods

Method Description
CMController ( OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view, Scene scene, int channel ) : System

Initializes a work thread with an initial scene. Additional scenes should be added through the RegisterNewRegion method.

RegisterNewRegion ( Scene scene ) : void

Register a new scene object to keep track of for revisioning. Starts the controller monitoring actions of clients within the given scene.

SimChat ( OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view, OpenSim.Framework.OSChatMessage e, int channel ) : void

Only called by the MainLoop. Takes the message from a user sent to the channel and executes the proper command.

Protected Methods

Method Description
GroupBeingDeleted ( SceneObjectGroup group ) : void
ObjectDuplicated ( uint localID, System.Vector3 offset, uint dupeFlags, UUID AgentID, UUID GroupID ) : void
ObjectDuplicatedOnRay ( uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, UUID RayTargetObj, System.Vector3 RayEnd, System.Vector3 RayStart, bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates ) : void
OnNewClient ( IClientAPI client ) : void
OnUnDid ( IClientAPI remoteClient, UUID primId ) : void
ScenesInOrderOfProximity ( Hashtable sceneList, Scene scene ) : System.Collections.Generic.List

Takes a list of scenes and forms a new orderd list according to the proximity of scenes to the second argument.

SimChatSent ( Object x, OpenSim.Framework.OSChatMessage e ) : void
StartManaging ( IClientAPI client ) : void

Adds extra handlers to a number of events so that the controller can produce work based on the client's actions.

StopManaging ( UUID clientUUID ) : void

UpdateMultiplePosition ( uint localID, System.Vector3 pos, IClientAPI remoteClient ) : void
UpdateMultipleRotation ( uint localID, Quaternion rot, IClientAPI remoteClient ) : void
UpdateMultipleScale ( uint localID, System.Vector3 scale, IClientAPI remoteClient ) : void
UpdateNewParts ( UUID ownerID, UUID groupID, System.Vector3 RayEnd, Quaternion rot, OpenSim.Framework.PrimitiveBaseShape shape, byte bypassRaycast, System.Vector3 RayStart, UUID RayTargetID, byte RayEndIsIntersection ) : void
UpdateSinglePosition ( uint localID, System.Vector3 pos, IClientAPI remoteClient ) : void
UpdateSingleRotation ( uint localID, Quaternion rot, IClientAPI remoteClient ) : void

UpdateSingleScale ( uint localID, System.Vector3 scale, IClientAPI remoteClient ) : void
commit ( string message, Scene scene, OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view ) : void

Only called from within the SimChat method.

diffmode ( Scene scene, OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view ) : void

Only called from within the SimChat method.

rollback ( Scene scene, OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view ) : void

Only called from within the SimChat method. Hides all auras and meta entities, retrieves the current scene object list with the most recent revision retrieved from the model for each scene, then lets the view update the clients of the new objects.

Private Methods

Method Description
GetGroupByPrim ( uint localID ) : SceneObjectGroup

Searches in all scenes for a SceneObjectGroup that contains a part with a specific localID. If found, the object is returned. Else null is returned.

Initialize ( OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view, Scene scene, int channel ) : void
MainLoop ( ) : void

Run in a thread of its own. A endless loop that consumes (or blocks on) and work queue. Thw work queue is filled through client actions.

NewClient ( OpenSim.Region.OptionalModules.ContentManagement.CMView view, IClientAPI client ) : void

Only called by the MainLoop. Updates the view of a new client with metaentities if diff-mode is currently enabled.

ObjectAttributeChanged ( OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view, uint LocalId ) : void

Only called by the MainLoop.

ObjectDuplicated ( OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view, uint localId ) : void

Only called by the MainLoop. Displays new green auras over the newly created part when a part is shift copied.

ObjectKilled ( OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view, SceneObjectGroup group ) : void

Only called by the MainLoop.

PrimitiveAdded ( OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view, Work currentJob ) : void

Only called by the MainLoop.

UndoDid ( OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view, UUID uuid ) : void

Only called by the MainLoop.

Method Details

CMController() public method

Initializes a work thread with an initial scene. Additional scenes should be added through the RegisterNewRegion method.
public CMController ( OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view, Scene scene, int channel ) : System
model OpenSim.Region.OptionalModules.ContentManagement.CMModel /// ///
view OpenSim.Region.OptionalModules.ContentManagement.CMView /// ///
scene OpenSim.Region.Framework.Scenes.Scene /// The first scene to keep track of. ///
channel int /// The simchat channel number to listen to for instructions ///
return System

GroupBeingDeleted() protected method

protected GroupBeingDeleted ( SceneObjectGroup group ) : void
group OpenSim.Region.Framework.Scenes.SceneObjectGroup
return void

ObjectDuplicated() protected method

protected ObjectDuplicated ( uint localID, System.Vector3 offset, uint dupeFlags, UUID AgentID, UUID GroupID ) : void
localID uint
offset System.Vector3
dupeFlags uint
AgentID UUID
GroupID UUID
return void

ObjectDuplicatedOnRay() protected method

protected ObjectDuplicatedOnRay ( uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, UUID RayTargetObj, System.Vector3 RayEnd, System.Vector3 RayStart, bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates ) : void
localID uint
dupeFlags uint
AgentID UUID
GroupID UUID
RayTargetObj UUID
RayEnd System.Vector3
RayStart System.Vector3
BypassRaycast bool
RayEndIsIntersection bool
CopyCenters bool
CopyRotates bool
return void

OnNewClient() protected method

protected OnNewClient ( IClientAPI client ) : void
client IClientAPI
return void

OnUnDid() protected method

protected OnUnDid ( IClientAPI remoteClient, UUID primId ) : void
remoteClient IClientAPI
primId UUID
return void

RegisterNewRegion() public method

Register a new scene object to keep track of for revisioning. Starts the controller monitoring actions of clients within the given scene.
public RegisterNewRegion ( Scene scene ) : void
scene OpenSim.Region.Framework.Scenes.Scene /// A ///
return void

ScenesInOrderOfProximity() protected static method

Takes a list of scenes and forms a new orderd list according to the proximity of scenes to the second argument.
protected static ScenesInOrderOfProximity ( Hashtable sceneList, Scene scene ) : System.Collections.Generic.List
sceneList System.Collections.Hashtable
scene OpenSim.Region.Framework.Scenes.Scene
return System.Collections.Generic.List

SimChat() public method

Only called by the MainLoop. Takes the message from a user sent to the channel and executes the proper command.
public SimChat ( OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view, OpenSim.Framework.OSChatMessage e, int channel ) : void
model OpenSim.Region.OptionalModules.ContentManagement.CMModel
view OpenSim.Region.OptionalModules.ContentManagement.CMView
e OpenSim.Framework.OSChatMessage
channel int
return void

SimChatSent() protected method

protected SimChatSent ( Object x, OpenSim.Framework.OSChatMessage e ) : void
x Object
e OpenSim.Framework.OSChatMessage
return void

StartManaging() protected method

Adds extra handlers to a number of events so that the controller can produce work based on the client's actions.
protected StartManaging ( IClientAPI client ) : void
client IClientAPI
return void

StopManaging() protected method

protected StopManaging ( UUID clientUUID ) : void
clientUUID UUID
return void

UpdateMultiplePosition() protected method

protected UpdateMultiplePosition ( uint localID, System.Vector3 pos, IClientAPI remoteClient ) : void
localID uint
pos System.Vector3
remoteClient IClientAPI
return void

UpdateMultipleRotation() protected method

protected UpdateMultipleRotation ( uint localID, Quaternion rot, IClientAPI remoteClient ) : void
localID uint
rot Quaternion
remoteClient IClientAPI
return void

UpdateMultipleScale() protected method

protected UpdateMultipleScale ( uint localID, System.Vector3 scale, IClientAPI remoteClient ) : void
localID uint
scale System.Vector3
remoteClient IClientAPI
return void

UpdateNewParts() protected method

protected UpdateNewParts ( UUID ownerID, UUID groupID, System.Vector3 RayEnd, Quaternion rot, OpenSim.Framework.PrimitiveBaseShape shape, byte bypassRaycast, System.Vector3 RayStart, UUID RayTargetID, byte RayEndIsIntersection ) : void
ownerID UUID
groupID UUID
RayEnd System.Vector3
rot Quaternion
shape OpenSim.Framework.PrimitiveBaseShape
bypassRaycast byte
RayStart System.Vector3
RayTargetID UUID
RayEndIsIntersection byte
return void

UpdateSinglePosition() protected method

protected UpdateSinglePosition ( uint localID, System.Vector3 pos, IClientAPI remoteClient ) : void
localID uint
pos System.Vector3
remoteClient IClientAPI
return void

UpdateSingleRotation() protected method

protected UpdateSingleRotation ( uint localID, Quaternion rot, IClientAPI remoteClient ) : void
localID uint
rot Quaternion
remoteClient IClientAPI
return void

UpdateSingleScale() protected method

protected UpdateSingleScale ( uint localID, System.Vector3 scale, IClientAPI remoteClient ) : void
localID uint
scale System.Vector3
remoteClient IClientAPI
return void

commit() protected method

Only called from within the SimChat method.
protected commit ( string message, Scene scene, OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view ) : void
message string
scene OpenSim.Region.Framework.Scenes.Scene
model OpenSim.Region.OptionalModules.ContentManagement.CMModel
view OpenSim.Region.OptionalModules.ContentManagement.CMView
return void

diffmode() protected method

Only called from within the SimChat method.
protected diffmode ( Scene scene, OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view ) : void
scene OpenSim.Region.Framework.Scenes.Scene
model OpenSim.Region.OptionalModules.ContentManagement.CMModel
view OpenSim.Region.OptionalModules.ContentManagement.CMView
return void

rollback() protected method

Only called from within the SimChat method. Hides all auras and meta entities, retrieves the current scene object list with the most recent revision retrieved from the model for each scene, then lets the view update the clients of the new objects.
protected rollback ( Scene scene, OpenSim.Region.OptionalModules.ContentManagement.CMModel model, OpenSim.Region.OptionalModules.ContentManagement.CMView view ) : void
scene OpenSim.Region.Framework.Scenes.Scene
model OpenSim.Region.OptionalModules.ContentManagement.CMModel
view OpenSim.Region.OptionalModules.ContentManagement.CMView
return void