本文整理汇总了C#中IScene类的典型用法代码示例。如果您正苦于以下问题:C# IScene类的具体用法?C# IScene怎么用?C# IScene使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IScene类属于命名空间,在下文中一共展示了IScene类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddRegion
public void AddRegion (IScene scene)
{
if (m_scene == null)
m_scene = scene;
scene.RegisterModuleInterface<IJ2KDecoder>(this);
}
示例2: 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));
}
示例3: AddRegion
public void AddRegion (IScene scene)
{
m_scene = scene;
m_scene.RegisterModuleInterface<IBuySellModule>(this);
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
m_scene.EventManager.OnClosingClient += UnsubscribeFromClientEvents;
}
示例4: 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 ();
}
示例5: AddRegion
public void AddRegion(IScene scene)
{
m_scene = scene;
Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb);
m_graph = Graphics.FromImage(bitmap);
}
示例6: TerrainChannel
public TerrainChannel(IScene scene)
{
m_scene = scene;
m_Width = m_scene.RegionInfo.RegionSizeX;
m_Height = m_scene.RegionInfo.RegionSizeY;
CreateDefaultTerrain(m_scene.RegionInfo.RegionTerrain);
}
示例7: AddRegion
public void AddRegion(IScene scene)
{
scene.EventManager.OnNewClient += EventManager_OnNewClient;
scene.EventManager.OnClosingClient += EventManager_OnClosingClient;
scene.EventManager.OnNewPresence += EventManager_OnNewPresence;
scene.EventManager.OnRemovePresence += EventManager_OnRemovePresence;
}
示例8: Start
public void Start(IScene scene)
{
m_scene = scene;
m_dataStore = m_scene.Simian.GetAppModule<IDataStore>();
if (m_dataStore == null)
{
m_log.Error("LLPrimitiveLoader requires an IDataStore");
return;
}
m_primMesher = m_scene.GetSceneModule<IPrimMesher>();
if (m_primMesher == null)
{
m_log.Error("LLPrimitiveLoader requires an IPrimMesher");
return;
}
m_writeQueue = new ThrottledQueue<UUID, PrimSerialization>(5, 1000 * 30, true, SerializationHandler);
m_writeQueue.Start();
m_scene.OnEntityAddOrUpdate += EntityAddOrUpdateHandler;
m_scene.OnEntityRemove += EntityRemoveHandler;
Deserialize();
}
示例9: RegionLoaded
public void RegionLoaded(IScene scene)
{
if (!m_Enabled)
return;
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnClosingClient -= OnClosingClient;
}
示例10: Start
public void Start(IScene scene)
{
m_scene = scene;
m_assetClient = m_scene.Simian.GetAppModule<IAssetClient>();
if (m_assetClient == null)
{
m_log.Warn("Upload requires an IAssetClient");
return;
}
m_httpServer = m_scene.Simian.GetAppModule<IHttpServer>();
if (m_httpServer == null)
{
m_log.Warn("Upload requires an IHttpServer");
return;
}
m_primMesher = m_scene.GetSceneModule<IPrimMesher>();
m_permissions = m_scene.GetSceneModule<LLPermissions>();
m_scene.Capabilities.AddProtectedResource(m_scene.ID, "UploadBakedTexture", UploadBakedTextureHandler);
m_scene.Capabilities.AddProtectedResource(m_scene.ID, "UploadBakedTextureData", UploadBakedTextureDataHandler);
m_scene.Capabilities.AddProtectedResource(m_scene.ID, "UploadObjectAsset", UploadObjectAssetHandler);
}
示例11: RevertShadeWorld
public void RevertShadeWorld(IScene scene, string[] cmd)
{
ISceneEntity[] entities = scene.Entities.GetEntities();
foreach (ISceneEntity entity in entities)
{
foreach (ISceneChildEntity child in entity.ChildrenEntities())
{
UUID[] textures = GetTextures(child.Shape.Textures);
foreach (UUID t in textures)
{
UUID oldID = t;
AssetBase oldAsset = null;
while (m_revertConverted.ContainsKey(oldID))
{
child.Shape.Textures = SetTexture(child.Shape, m_revertConverted[oldID], oldID);
oldID = m_revertConverted[oldID];
}
UUID newID;
while ((oldAsset = scene.AssetService.Get(oldID.ToString())) != null && UUID.TryParse(oldAsset.Description, out newID))
{
child.Shape.Textures = SetTexture(child.Shape, newID, oldID);
}
}
}
}
m_revertConverted.Clear();
m_previouslyConverted.Clear();
}
示例12: FinishStartup
public void FinishStartup(IScene scene, IConfigSource source, ISimulationBase openSimBase)
{
IEstateConnector EstateConnector = Framework.Utilities.DataManager.RequestPlugin<IEstateConnector>();
if (EstateConnector != null)
{
EstateSettings ES = EstateConnector.GetEstateSettings(scene.RegionInfo.RegionID);
if (ES == null)
{
//It could not find the estate service, wait until it can find it
MainConsole.Instance.Warn(
"We could not find the estate service for this sim. Please make sure that your URLs are correct in grid mode.");
while (true)
{
MainConsole.Instance.Prompt("Press enter to try again.");
if ((ES = EstateConnector.GetEstateSettings(scene.RegionInfo.RegionID)) == null ||
ES.EstateID == 0)
{
ES = CreateEstateInfo(scene);
break;
}
if (ES != null)
break;
}
}
else if (ES.EstateID == 0)
{
//It found the estate service, but found no estates for this region, make a new one
MainConsole.Instance.Warn("[EstateInitializer]: Your region " + scene.RegionInfo.RegionName +
" is not part of an estate.");
ES = CreateEstateInfo(scene);
}
scene.RegionInfo.EstateSettings = ES;
}
}
示例13: HandleAbuseReports
protected void HandleAbuseReports(IScene scene, string [] cmd)
{
int reports;
while (!int.TryParse (MainConsole.Instance.Prompt ("Number of reports to display: ", "7"), out reports))
MainConsole.Instance.Info ("Bad input, must be a number > 0");
string abuseInfo;
abuseInfo = string.Format ("{0, -8}", "Card");
abuseInfo += string.Format ("{0, -30}", "Category");
abuseInfo += string.Format ("{0, -30}", "Summary");
abuseInfo += string.Format ("{0, -20}", "Reporter");
abuseInfo += string.Format ("{0, -20}", "Assigned");
MainConsole.Instance.CleanInfo (abuseInfo);
MainConsole.Instance.CleanInfo (
"----------------------------------------------------------------------------------------------------");
List<AbuseReport> abuseReports = abuseConnector.GetAbuseReports(0, reports, true);
foreach (AbuseReport rpt in abuseReports) {
abuseInfo = string.Format ("{0, -8}", rpt.Number);
abuseInfo += string.Format ("{0, -30}", rpt.Category.ToString().Substring(0,28));
abuseInfo += string.Format ("{0, -30}", rpt.AbuseSummary);
abuseInfo += string.Format ("{0, -20}", rpt.ReporterName);
abuseInfo += string.Format ("{0, -12}", rpt.AssignedTo);
MainConsole.Instance.CleanInfo (abuseInfo);
MainConsole.Instance.CleanInfo ("");
}
}
示例14: PlayScene1
public static void PlayScene1(IScene scene, string fileName, string webaddress, ISceneSerializer sceneSerializer)
{
Console.WriteLine("EndlessDialogs library demonstration");
Console.WriteLine("----------------------------");
Console.WriteLine("Example");
Console.WriteLine("1) Linear conversation");
Console.WriteLine("2) Branched conversation");
Console.WriteLine("3) Save Scene");
Console.WriteLine("4) Load Scene");
int answer = ReadAnswerNumber(1, 4);
if (answer == 1)
ConversationRunner(scene.GetConversations().First());
else if(answer == 2)
ConversationRunner(scene.GetConversations().Skip(1).ToList().First());
else if (answer == 3)
{
sceneSerializer.Serialize(scene, fileName);
Console.WriteLine("Scene saved to file: TestScene.xml");
}
else if (answer == 4)
{
IScene loadedScene = sceneSerializer.Deserialize(fileName);
Console.WriteLine("Scene loaded from file: TestScene.xml");
ConversationRunner(loadedScene.GetConversations().Skip(1).ToList().First());
}
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("----------------------------");
Console.WriteLine("More: \"" + webaddress + "\"");
Console.ReadKey();
}
示例15: FinishedStartup
public void FinishedStartup()
{
if (m_registry == null)
return;
ISceneManager manager = m_registry.RequestModuleInterface<ISceneManager>();
if (manager != null)
{
manager.OnAddedScene += (scene) =>
{
m_scene = scene;
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnClosingClient += OnClosingClient;
scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
scene.EventManager.OnValidateBuyLand += EventManager_OnValidateBuyLand;
scene.RegisterModuleInterface<IMoneyModule>(this);
};
manager.OnCloseScene += (scene) =>
{
m_scene.EventManager.OnNewClient -= OnNewClient;
m_scene.EventManager.OnClosingClient -= OnClosingClient;
m_scene.EventManager.OnMakeRootAgent -= OnMakeRootAgent;
scene.EventManager.OnValidateBuyLand -= EventManager_OnValidateBuyLand;
m_scene.RegisterModuleInterface<IMoneyModule>(this);
m_scene = null;
};
}
if (!m_connector.DoRemoteCalls)
{
if ((m_connector.GetConfig().GiveStipends) && (m_connector.GetConfig().Stipend > 0))
new GiveStipends(m_connector.GetConfig(), m_registry, m_connector);
}
}