本文整理汇总了C#中IScene.RequestModuleInterface方法的典型用法代码示例。如果您正苦于以下问题:C# IScene.RequestModuleInterface方法的具体用法?C# IScene.RequestModuleInterface怎么用?C# IScene.RequestModuleInterface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScene
的用法示例。
在下文中一共展示了IScene.RequestModuleInterface方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LLLoginServiceInConnector
public LLLoginServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
base(config, server, String.Empty)
{
m_log.Debug("[LLLOGIN IN CONNECTOR]: Starting...");
string loginService = ReadLocalServiceFromConfig(config);
ISimulationService simService = scene.RequestModuleInterface<ISimulationService>();
ILibraryService libService = scene.RequestModuleInterface<ILibraryService>();
Object[] args = new Object[] { config, simService, libService };
m_LoginService = ServerUtils.LoadPlugin<ILoginService>(loginService, args);
InitializeHandlers(server);
}
示例2: Initialise
bool m_renderMeshes = true; // true if to render meshes rather than just bounding boxes
#region IMapTileTerrainRenderer Members
public void Initialise (IScene scene, IConfigSource config)
{
m_scene = scene;
m_imgDecoder = m_scene.RequestModuleInterface<IJ2KDecoder> ();
m_config = config;
m_assetCacheDir = m_config.Configs ["AssetCache"].GetString ("CacheDirectory", m_assetCacheDir);
if (m_assetCacheDir == "") {
var defpath = scene.RequestModuleInterface<ISimulationBase> ().DefaultDataPath;
m_assetCacheDir = System.IO.Path.Combine (defpath, Constants.DEFAULT_ASSETCACHE_DIR);
}
List<string> renderers = RenderingLoader.ListRenderers (Util.ExecutingDirectory ());
if (renderers.Count > 0) {
m_primMesher = RenderingLoader.LoadRenderer (renderers [0]);
MainConsole.Instance.Debug ("[WarpTile generator]: Loaded prim mesher " + m_primMesher);
} else {
MainConsole.Instance.Info ("[WarpTile generator]: No prim mesher loaded, prim rendering will be disabled");
}
var mapConfig = m_config.Configs ["MapModule"];
if (mapConfig != null) {
m_texturePrimSize = mapConfig.GetFloat ("TexturePrimSize", m_texturePrimSize);
m_renderMeshes = mapConfig.GetBoolean ("RenderMeshes", m_renderMeshes);
}
ReadCacheMap ();
}
示例3: Initialise
public void Initialise(IScene scene, IConfigSource config)
{
m_scene = scene;
m_imgDecoder = m_scene.RequestModuleInterface<IJ2KDecoder>();
m_config = config;
ReadCacheMap();
}
示例4: SimulationServiceInConnector
public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
base(config, server, String.Empty)
{
//IConfig serverConfig = config.Configs["SimulationService"];
//if (serverConfig == null)
// throw new Exception("No section 'SimulationService' in config file");
//string simService = serverConfig.GetString("LocalServiceModule",
// String.Empty);
//if (simService == String.Empty)
// throw new Exception("No SimulationService in config file");
//Object[] args = new Object[] { config };
m_LocalSimulationService = scene.RequestModuleInterface<ISimulationService>();
m_LocalSimulationService = m_LocalSimulationService.GetInnerService();
//ServerUtils.LoadPlugin<ISimulationService>(simService, args);
//System.Console.WriteLine("XXXXXXXXXXXXXXXXXXX m_AssetSetvice == null? " + ((m_AssetService == null) ? "yes" : "no"));
//server.AddStreamHandler(new AgentGetHandler(m_SimulationService, m_AuthenticationService));
//server.AddStreamHandler(new AgentPostHandler(m_SimulationService, m_AuthenticationService));
//server.AddStreamHandler(new AgentPutHandler(m_SimulationService, m_AuthenticationService));
//server.AddStreamHandler(new AgentDeleteHandler(m_SimulationService, m_AuthenticationService));
server.AddHTTPHandler("/agent/", new AgentHandler(m_LocalSimulationService).Handler);
server.AddHTTPHandler("/object/", new ObjectHandler(m_LocalSimulationService).Handler);
//server.AddStreamHandler(new ObjectPostHandler(m_SimulationService, authentication));
}
示例5: RemoveRegion
public void RemoveRegion(IScene scene)
{
ISyncMessagePosterService syncMessage = scene.RequestModuleInterface<ISyncMessagePosterService>();
if (syncMessage != null)
syncMessage.PostToServer(SyncMessageHelper.LogoutRegionAgents(scene.RegionInfo.RegionHandle));
scene.EventManager.OnNewClient -= OnNewClient;
scene.EventManager.OnClosingClient -= OnClosingClient;
m_scenes.Remove(scene);
}
示例6: AddRegion
public void AddRegion (IScene scene)
{
if (m_storeDirectory == "") {
var simBase = scene.RequestModuleInterface<ISimulationBase> ();
m_storeDirectory = Path.Combine (simBase.DefaultDataPath, "Region");
}
m_scene = scene;
scene.RegisterModuleInterface<IRestartModule> (this);
}
示例7: AddRegion
public void AddRegion(IScene scene)
{
if (m_enabled)
{
scene.EventManager.OnRegisterCaps +=
(agentID, server) => OnRegisterCaps(scene, agentID, server);
}
m_scene = scene;
ISyncMessageRecievedService syncRecievedService =
m_scene.RequestModuleInterface<ISyncMessageRecievedService>();
if (syncRecievedService != null)
syncRecievedService.OnMessageReceived += syncRecievedService_OnMessageReceived;
}
示例8: SimulationServiceInConnector
// private IAuthenticationService m_AuthenticationService;
public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
base(config, server, String.Empty)
{
m_LocalSimulationService = scene.RequestModuleInterface<ISimulationService>();
m_LocalSimulationService = m_LocalSimulationService.GetInnerService();
// This one MUST be a stream handler because compressed fatpacks
// are pure binary and shoehorning that into a string with UTF-8
// encoding breaks it
server.AddStreamHandler(new AgentPostHandler(m_LocalSimulationService));
server.AddStreamHandler(new AgentPutHandler(m_LocalSimulationService));
server.AddHTTPHandler("/agent/", new AgentHandler(m_LocalSimulationService).Handler);
server.AddHTTPHandler("/object/", new ObjectHandler(m_LocalSimulationService).Handler);
}
示例9: AddRegion
public void AddRegion (IScene scene)
{
if (!m_Enabled)
return;
// set the savestate location if not configured
if (m_savestate_oar_directory == "") {
var simBase = scene.RequestModuleInterface<ISimulationBase> ();
m_savestate_oar_directory = Path.Combine (simBase.DefaultDataPath, "Region/SaveStates/");
}
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnClosingClient += OnClosingClient;
}
示例10: SimulationServiceInConnector
public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
base(config, server, String.Empty)
{
IConfig serverConfig = config.Configs["SimulationService"];
if (serverConfig == null)
throw new Exception("No section 'SimulationService' in config file");
bool authentication = serverConfig.GetBoolean("RequireAuthentication", false);
if (authentication)
m_AuthenticationService = scene.RequestModuleInterface<IAuthenticationService>();
bool foreignGuests = serverConfig.GetBoolean("AllowForeignGuests", false);
//string simService = serverConfig.GetString("LocalServiceModule",
// String.Empty);
//if (simService == String.Empty)
// throw new Exception("No SimulationService in config file");
//Object[] args = new Object[] { config };
m_SimulationService = scene.RequestModuleInterface<ISimulationService>();
//ServerUtils.LoadPlugin<ISimulationService>(simService, args);
if (m_SimulationService == null)
throw new Exception("No Local ISimulationService Module");
//System.Console.WriteLine("XXXXXXXXXXXXXXXXXXX m_AssetSetvice == null? " + ((m_AssetService == null) ? "yes" : "no"));
server.AddStreamHandler(new AgentGetHandler(m_SimulationService, m_AuthenticationService));
server.AddStreamHandler(new AgentPostHandler(m_SimulationService, m_AuthenticationService, foreignGuests));
server.AddStreamHandler(new AgentPutHandler(m_SimulationService, m_AuthenticationService));
server.AddStreamHandler(new AgentDeleteHandler(m_SimulationService, m_AuthenticationService));
//server.AddStreamHandler(new ObjectPostHandler(m_SimulationService, authentication));
//server.AddStreamHandler(new NeighborPostHandler(m_SimulationService, authentication));
}
示例11: AddRegion
public void AddRegion(IScene scene)
{
if (!m_Enabled)
return;
m_Scenelist.Add(scene);
scene.RegisterModuleInterface(this);
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnClosingClient += OnClosingClient;
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
moneyService = scene.RequestModuleInterface<IMoneyModule>();
}
示例12: LandObject
public LandObject(UUID owner_id, bool is_group_owned, IScene scene)
{
m_scene = scene;
LandData.Maturity = m_scene.RegionInfo.RegionSettings.Maturity;
LandData.OwnerID = owner_id;
LandData.GroupID = is_group_owned ? owner_id : UUID.Zero;
LandData.IsGroupOwned = is_group_owned;
LandData.RegionID = scene.RegionInfo.RegionID;
LandData.ScopeID = scene.RegionInfo.ScopeID;
LandData.RegionHandle = scene.RegionInfo.RegionHandle;
m_parcelManagementModule = scene.RequestModuleInterface<IParcelManagementModule>();
//We don't set up the InfoID here... it will just be overwriten
}
示例13: RegionLoaded
public void RegionLoaded (IScene scene)
{
if (!m_enabled)
return;
if (m_TransferModule == null) {
m_TransferModule = scene.RequestModuleInterface<IMessageTransferModule> ();
if (m_TransferModule == null) {
MainConsole.Instance.Error ("[Instant message]: No message transfer module, IM will not work!");
scene.EventManager.OnNewClient -= EventManager_OnNewClient;
scene.EventManager.OnClosingClient -= EventManager_OnClosingClient;
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
m_Scene = null;
m_enabled = false;
}
}
}
示例14: Close
public void Close(IScene scene)
{
//Deregister the interface
scene.UnregisterModuleInterface<IGridRegisterModule>(this);
m_scenes.Remove(scene);
MainConsole.Instance.InfoFormat("[RegisterRegionWithGrid]: Deregistering region {0} from the grid...",
scene.RegionInfo.RegionName);
//Deregister from the grid server
IGridService GridService = scene.RequestModuleInterface<IGridService>();
GridRegion r = BuildGridRegion(scene.RegionInfo);
r.IsOnline = false;
string error = "";
if(scene.RegionInfo.HasBeenDeleted)
GridService.DeregisterRegion(r);
else if ((error = GridService.UpdateMap(r)) != "")
MainConsole.Instance.WarnFormat("[RegisterRegionWithGrid]: Deregister from grid failed for region {0}, {1}",
scene.RegionInfo.RegionName, error);
}
示例15: RegionLoaded
public void RegionLoaded (IScene scene)
{
if (!m_enabled)
return;
if (m_TransferModule == null) {
OfflineMessagesConnector = Framework.Utilities.DataManager.RequestPlugin<IOfflineMessagesConnector> ();
m_TransferModule = scene.RequestModuleInterface<IMessageTransferModule> ();
if (m_TransferModule == null || OfflineMessagesConnector == null) {
scene.EventManager.OnNewClient -= OnNewClient;
scene.EventManager.OnClosingClient -= OnClosingClient;
m_enabled = false;
m_Scene = null;
MainConsole.Instance.Error (
"[OFFLINE MESSAGING] No message transfer module or OfflineMessagesConnector is enabled. Disabling offline messages");
return;
}
m_TransferModule.OnUndeliveredMessage += UndeliveredMessage;
}
}