本文整理汇总了C#中OpenSim.Region.Framework.Scenes.Scene.RequestModuleInterfaces方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.RequestModuleInterfaces方法的具体用法?C# Scene.RequestModuleInterfaces怎么用?C# Scene.RequestModuleInterfaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.Scene
的用法示例。
在下文中一共展示了Scene.RequestModuleInterfaces方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegionLoaded
public void RegionLoaded(Scene scene)
{
IScriptModule[] scriptModules = scene.RequestModuleInterfaces<IScriptModule>();
foreach (IScriptModule scriptModule in scriptModules)
{
scriptModule.OnScriptRemoved += ScriptRemoved;
scriptModule.OnObjectRemoved += ObjectRemoved;
}
}
示例2: ScenePresence
public ScenePresence(
IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
{
m_scene = world;
AttachmentsSyncLock = new Object();
AllowMovement = true;
IsChildAgent = true;
IsLoggingIn = false;
m_sendCoarseLocationsMethod = SendCoarseLocationsDefault;
Animator = new ScenePresenceAnimator(this);
Overrides = new MovementAnimationOverrides();
PresenceType = type;
DrawDistance = world.DefaultDrawDistance;
RegionHandle = world.RegionInfo.RegionHandle;
ControllingClient = client;
Firstname = ControllingClient.FirstName;
Lastname = ControllingClient.LastName;
m_name = String.Format("{0} {1}", Firstname, Lastname);
m_uuid = client.AgentId;
LocalId = m_scene.AllocateLocalId();
LegacySitOffsets = m_scene.LegacySitOffsets;
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
if (account != null)
m_userFlags = account.UserFlags;
else
m_userFlags = 0;
if (account != null)
UserLevel = account.UserLevel;
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
if (gm != null)
Grouptitle = gm.GetGroupTitle(m_uuid);
m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
AbsolutePosition = posLastSignificantMove = CameraPosition =
m_lastCameraPosition = ControllingClient.StartPos;
m_reprioritization_timer = new Timer(world.ReprioritizationInterval);
m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize);
m_reprioritization_timer.AutoReset = false;
AdjustKnownSeeds();
RegisterToEvents();
SetDirectionVectors();
Appearance = appearance;
m_stateMachine = new ScenePresenceStateMachine(this);
}
示例3: ScenePresence
private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
{
m_regionHandle = reginfo.RegionHandle;
m_controllingClient = client;
Firstname = m_controllingClient.FirstName;
Lastname = m_controllingClient.LastName;
m_name = String.Format("{0} {1}", Firstname, Lastname);
m_scene = world;
m_uuid = client.AgentId;
m_regionInfo = reginfo;
m_localId = m_scene.AllocateLocalId();
m_useFlySlow = m_scene.m_useFlySlow;
m_usePreJump = m_scene.m_usePreJump;
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
if (gm != null)
m_grouptitle = gm.GetGroupTitle(m_uuid);
m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
ISceneViewModule sceneViewModule = m_scene.RequestModuleInterface<ISceneViewModule>();
if (sceneViewModule != null)
m_sceneView = sceneViewModule.CreateSceneView(this);
else
m_log.Warn("[SCENE PRESENCE]: Failed to create a scene view");
SetAgentPositionInfo(null, true, m_controllingClient.StartPos, null, Vector3.Zero, m_velocity);
m_animPersistUntil = 0;
RegisterToEvents();
SetDirectionVectors();
SetDirectionFlags();
m_remotePresences = new AvatarRemotePresences(world, this);
m_connection = world.ConnectionManager.GetConnection(this.UUID);
if (m_connection != null) // can be null for bots which don't have a LLCV
m_connection.ScenePresence = this;
// Prime (cache) the user's group list.
m_scene.UserGroupsGet(this.UUID);
}
示例4: ScenePresence
private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this()
{
m_rootRegionHandle = reginfo.RegionHandle;
m_controllingClient = client;
m_firstname = m_controllingClient.FirstName;
m_lastname = m_controllingClient.LastName;
m_name = String.Format("{0} {1}", m_firstname, m_lastname);
m_scene = world;
m_uuid = client.AgentId;
m_regionInfo = reginfo;
m_localId = m_scene.AllocateLocalId();
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
if (account != null)
m_userLevel = account.UserLevel;
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
if (gm != null)
m_grouptitle = gm.GetGroupTitle(m_uuid);
m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
AbsolutePosition = posLastSignificantMove = m_CameraCenter =
m_lastCameraCenter = m_controllingClient.StartPos;
m_reprioritization_timer = new Timer(world.ReprioritizationInterval);
m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize);
m_reprioritization_timer.AutoReset = false;
AdjustKnownSeeds();
// TODO: I think, this won't send anything, as we are still a child here...
Animator.TrySetMovementAnimation("STAND");
// we created a new ScenePresence (a new child agent) in a fresh region.
// Request info about all the (root) agents in this region
// Note: This won't send data *to* other clients in that region (children don't send)
SendInitialFullUpdateToAllClients();
RegisterToEvents();
SetDirectionVectors();
}
示例5: ScenePresence
private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
{
m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
CreateSceneViewer();
m_regionHandle = reginfo.RegionHandle;
m_controllingClient = client;
m_firstname = m_controllingClient.FirstName;
m_lastname = m_controllingClient.LastName;
m_name = String.Format("{0} {1}", m_firstname, m_lastname);
m_scene = world;
m_uuid = client.AgentId;
m_regionInfo = reginfo;
m_localId = m_scene.AllocateLocalId();
m_useFlySlow = m_scene.m_useFlySlow;
m_usePreJump = m_scene.m_usePreJump;
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
if (gm != null)
m_grouptitle = gm.GetGroupTitle(m_uuid);
m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
AbsolutePosition = m_controllingClient.StartPos;
AdjustKnownSeeds();
TrySetMovementAnimation("STAND"); // TODO: I think, this won't send anything, as we are still a child here...
// we created a new ScenePresence (a new child agent) in a fresh region.
// Request info about all the (root) agents in this region
// Note: This won't send data *to* other clients in that region (children don't send)
SendInitialFullUpdateToAllClients();
RegisterToEvents();
SetDirectionVectors();
}
示例6: ScenePresence
public ScenePresence(
IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
{
m_scene = world;
AttachmentsSyncLock = new Object();
AllowMovement = true;
IsChildAgent = true;
IsLoggingIn = false;
m_sendCoarseLocationsMethod = SendCoarseLocationsDefault;
Animator = new ScenePresenceAnimator(this);
Overrides = new MovementAnimationOverrides();
PresenceType = type;
DrawDistance = world.DefaultDrawDistance;
RegionHandle = world.RegionInfo.RegionHandle;
ControllingClient = client;
Firstname = ControllingClient.FirstName;
Lastname = ControllingClient.LastName;
m_name = String.Format("{0} {1}", Firstname, Lastname);
m_uuid = client.AgentId;
LocalId = m_scene.AllocateLocalId();
LegacySitOffsets = m_scene.LegacySitOffsets;
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
if (account != null)
m_userFlags = account.UserFlags;
else
m_userFlags = 0;
if (account != null)
UserLevel = account.UserLevel;
// IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
// if (gm != null)
// Grouptitle = gm.GetGroupTitle(m_uuid);
m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
AbsolutePosition = posLastMove = posLastSignificantMove = CameraPosition =
m_reprioritizationLastPosition = ControllingClient.StartPos;
m_reprioritizationLastDrawDistance = DrawDistance;
// disable updates workjobs for now
childUpdatesBusy = true;
m_reprioritizationBusy = true;
AdjustKnownSeeds();
RegisterToEvents();
SetDirectionVectors();
Appearance = appearance;
m_stateMachine = new ScenePresenceStateMachine(this);
HealRate = 0.5f;
IConfig sconfig = m_scene.Config.Configs["EntityTransfer"];
if (sconfig != null)
{
string lpb = sconfig.GetString("LandingPointBehavior", "LandingPointBehavior_OS");
if (lpb == "LandingPointBehavior_SL")
m_LandingPointBehavior = LandingPointBehavior.SL;
}
}
示例7: TryGetScriptInstanceRunning
public static bool TryGetScriptInstanceRunning(Scene scene, TaskInventoryItem item, out bool running)
{
running = false;
if (item.InvType != (int)InventoryType.LSL)
return false;
IScriptModule[] engines = scene.RequestModuleInterfaces<IScriptModule>();
if (engines == null) // No engine at all
return false;
foreach (IScriptModule e in engines)
{
if (e.HasScript(item.ItemID, out running))
return true;
}
return false;
}
示例8: HasScriptEngine
private bool HasScriptEngine(Scene scene)
{
IScriptModule[] engines = scene.RequestModuleInterfaces<IScriptModule>();
if (engines.Length == 0)
return false;
if (engines[0] == null) // happens under Phlox if disabled
return false;
return true;
}
示例9: ScenePresence
public ScenePresence(
IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
{
AttachmentsSyncLock = new Object();
m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
Animator = new ScenePresenceAnimator(this);
PresenceType = type;
DrawDistance = world.DefaultDrawDistance;
RegionHandle = world.RegionInfo.RegionHandle;
ControllingClient = client;
Firstname = ControllingClient.FirstName;
Lastname = ControllingClient.LastName;
m_name = String.Format("{0} {1}", Firstname, Lastname);
m_scene = world;
m_uuid = client.AgentId;
LocalId = m_scene.AllocateLocalId();
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
if (account != null)
m_userFlags = account.UserFlags;
else
m_userFlags = 0;
if (account != null)
UserLevel = account.UserLevel;
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
if (gm != null)
Grouptitle = gm.GetGroupTitle(m_uuid);
m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
AbsolutePosition = posLastSignificantMove = CameraPosition =
m_lastCameraPosition = ControllingClient.StartPos;
m_reprioritization_timer = new Timer(world.ReprioritizationInterval);
m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize);
m_reprioritization_timer.AutoReset = false;
AdjustKnownSeeds();
// TODO: I think, this won't send anything, as we are still a child here...
Animator.TrySetMovementAnimation("STAND");
// we created a new ScenePresence (a new child agent) in a fresh region.
// Request info about all the (root) agents in this region
// Note: This won't send data *to* other clients in that region (children don't send)
// MIC: This gets called again in CompleteMovement
// SendInitialFullUpdateToAllClients();
SendOtherAgentsAvatarDataToMe();
SendOtherAgentsAppearanceToMe();
RegisterToEvents();
SetDirectionVectors();
Appearance = appearance;
}