本文整理汇总了C#中IScheduler.FireAndForget方法的典型用法代码示例。如果您正苦于以下问题:C# IScheduler.FireAndForget方法的具体用法?C# IScheduler.FireAndForget怎么用?C# IScheduler.FireAndForget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScheduler
的用法示例。
在下文中一共展示了IScheduler.FireAndForget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public bool Start(Simian simian)
{
m_scheduler = simian.GetAppModule<IScheduler>();
if (m_scheduler == null)
{
m_log.Error("LLSceneFactory requires an IScheduler");
return false;
}
m_scenes = new Dictionary<UUID, IScene>();
m_renderer = simian.GetAppModule<ISceneRenderer>();
m_gridClient = simian.GetAppModule<IGridClient>();
string[] sceneFiles = null;
try { sceneFiles = Directory.GetFiles(SOURCE_PATH, "*.ini", SearchOption.AllDirectories); }
catch (DirectoryNotFoundException)
{
m_log.Warn(Path.GetFullPath(SOURCE_PATH) + " not found, cannot load scene definitions");
return false;
}
for (int i = 0; i < sceneFiles.Length; i++)
{
// Create the config source for this region by merging the app config and the region config
IConfigSource configSource = simian.GetConfigCopy();
IniConfigSource regionConfigSource = new IniConfigSource(sceneFiles[i]);
configSource.Merge(regionConfigSource);
IConfig config = configSource.Configs["LindenRegion"];
if (config != null)
{
UUID id;
UUID.TryParse(config.GetString("ID"), out id);
string name = config.GetString("Name");
uint locationX = 0, locationY = 0;
string[] locationParts = config.GetString("Location").Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
if (locationParts.Length != 2 || !UInt32.TryParse(locationParts[0], out locationX) || !UInt32.TryParse(locationParts[1], out locationY))
{
m_log.Warn("Missing or invalid Location for " + name + " region");
}
Vector3d regionPosition = new Vector3d(locationX * (uint)REGION_SIZE, locationY * (uint)REGION_SIZE, 0.0d);
Scene scene = new Scene(id, name, regionPosition, new Vector3d(256.0, 256.0, 4096.0), simian, configSource);
m_log.Info("Starting scene " + scene.Name + " (" + scene.ID + ")");
scene.Start();
m_scenes[scene.ID] = scene;
// Create a map tile for this scene
m_scheduler.FireAndForget(o => CreateMapTile((IScene)o), scene);
}
else
{
m_log.Warn("No [LindenRegion] config section found in " + sceneFiles[i] + ", skipping");
}
}
// Create the array
m_scenesArray = new IScene[m_scenes.Count];
int j = 0;
foreach (IScene scene in m_scenes.Values)
m_scenesArray[j++] = scene;
// Fire the OnSceneStart callback for each scene we started
SceneStartCallback callback = OnSceneStart;
if (callback != null)
{
for (int i = 0; i < m_scenesArray.Length; i++)
{
callback(m_scenesArray[i]);
}
}
return true;
}