public void Initialize(ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID, ScriptProtectionModule module) { m_ScriptEngine = ScriptEngine; m_host = host; m_localID = localID; m_itemID = itemID; ScriptProtection = module; m_comms = World.RequestModuleInterface<IScriptModuleComms>(); }
public override void RegionLoaded(Scene scene) { base.World = scene; try { IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>(); m_scriptModule.RegisterScriptInvocation(this, "osEasyDialog"); } catch (Exception e) { base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message); } m_dialogModule = base.World.RequestModuleInterface <IDialogModule>(); m_scriptEngine = base.World.RequestModuleInterface <IScriptModule>(); base.World.EventManager.OnChatFromClient += onChat; base.World.EventManager.OnScriptReset += onScriptReset; base.World.EventManager.OnRemoveScript += onScriptRemove; m_timer = new Timer(); m_timer.Interval = 60000; m_timer.AutoReset = true; m_timer.Elapsed += cleanup; m_timer.Start(); }
public void Initialize( IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) { m_ScriptEngine = scriptEngine; m_host = host; m_item = item; m_osslconfig = m_ScriptEngine.ConfigSource.Configs["OSSL"]; if (m_osslconfig == null) { m_osslconfig = m_ScriptEngine.Config; } if (m_osslconfig.GetBoolean("AllowMODFunctions", false)) { m_MODFunctionsEnabled = true; } m_comms = m_ScriptEngine.World.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_MODFunctionsEnabled = false; } }
public override void RegionLoaded(Scene scene) { base.World = scene; base.World.EventManager.OnChatFromClient += onChat; base.World.EventManager.OnChatFromWorld += onChat; base.World.EventManager.OnNewPresence += scriptevent_OnNewPresence; base.World.EventManager.OnRemovePresence += scriptevent_OnRemovePresence; try { IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>(); m_scriptModule.RegisterScriptInvocation(this, "osSendToDiscord"); } catch (Exception e) { base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message); } WebHook webhook = new WebHook(m_discordWebHookURL); webhook.Name = base.World.Name; webhook.Message = "The region started successfully."; webhook.sendAsync(); }
public override void RegionLoaded(Scene scene) { base.World = scene; if (base.World != null) { try { m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>(); m_scriptModule.RegisterScriptInvocation(this, "osGetSearchableObjectList"); m_scriptModule.RegisterScriptInvocation(this, "osGetSearchableObjectPartList"); } catch (Exception e) { base.Logger.WarnFormat("[" + Name + "]: Script method registration failed; {0}", e.Message); } base.World.EventManager.OnSceneObjectLoaded += onSceneObjectLoaded; base.World.EventManager.OnSceneObjectPartCopy += onSceneObjectPartCopy; base.World.EventManager.OnSceneObjectPartUpdated += onSceneObjectPartUpdated; base.World.EventManager.OnIncomingSceneObject += onIncomingSceneObject; } else { base.Logger.Warn("[" + Name + "]: scene == null"); } }
public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_log.WarnFormat("[ModInvoke] ScriptModuleComms interface not defined"); m_enabled = false; return; } m_comms.RegisterScriptInvocation(this, "ModTest0"); m_comms.RegisterScriptInvocation(this, "ModTest1"); m_comms.RegisterScriptInvocation(this, "ModTest2"); m_comms.RegisterScriptInvocation(this, "ModTest3"); m_comms.RegisterScriptInvocation(this, "ModTest4"); m_comms.RegisterScriptInvocation(this, "ModTest5"); m_comms.RegisterScriptInvocation(this, "ModTest6"); m_comms.RegisterScriptInvocation(this, "ModTest7"); m_comms.RegisterScriptInvocation(this, "ModTest8"); // Register some constants as well m_comms.RegisterConstant("ModConstantInt1", 25); m_comms.RegisterConstant("ModConstantFloat1", 25.000f); m_comms.RegisterConstant("ModConstantString1", "abcdefg"); } }
// ----------------------------------------------------------------- /// <summary> /// Called when all modules have been added for a region. This is /// where we hook up events /// </summary> // ----------------------------------------------------------------- public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_log.ErrorFormat("[JsonStoreScripts]: ScriptModuleComms interface not defined"); m_enabled = false; return; } m_store = m_scene.RequestModuleInterface <IJsonStoreModule>(); if (m_store == null) { m_log.ErrorFormat("[JsonStoreScripts]: JsonModule interface not defined"); m_enabled = false; return; } try { m_comms.RegisterScriptInvocations(this); m_comms.RegisterConstants(this); } catch (Exception e) { // See http://opensimulator.org/mantis/view.php?id=5971 for more information m_log.WarnFormat("[JsonStoreScripts]: script method registration failed; {0}", e.Message); m_enabled = false; } } }
public void RegionLoaded(Scene scene) { m_ScriptComms = scene.RequestModuleInterface <IScriptModuleComms>(); if (m_ScriptComms != null) { m_ScriptComms.OnScriptCommand += OnScriptCommand; } }
RayTracer currentModel; //Current ray tracer model public RayTracerRequestHandler(IScriptModuleComms _m_commsMod, Scene _m_scene) { isBusy = false; currentModel = new RayTracer(); m_commsMod = _m_commsMod; m_scene = _m_scene; }//constructure
private void RegisterScriptFunctions() { IScriptModuleComms comms = m_scene.RequestModuleInterface <IScriptModuleComms>(); if (comms != null) { comms.RegisterScriptInvocation(this, "birdsGetStats"); } }
public OpenSimDispatcher(WaterWarsController controller) { m_controller = controller; m_controller.EventManager.OnGameAssetBuildStarted += CreateGameAssetView; // FIXME: If we use this again, we'll need to get one per scene since IScriptModuleComms is not shared m_scriptModuleComms = m_controller.Scenes[0].RequestModuleInterface<IScriptModuleComms>(); // m_scriptModuleComms.OnScriptCommand += ProcessScriptCommand; }
public void Initialize(IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module) { m_ScriptEngine = ScriptEngine; m_host = host; m_localID = localID; m_itemID = itemID; ScriptProtection = module; m_comms = World.RequestModuleInterface <IScriptModuleComms>(); }
public void Initialize (IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module) { m_ScriptEngine = ScriptEngine; m_host = host; m_localID = localID; m_itemID = itemID; ScriptProtection = module; m_comms = World.RequestModuleInterface<IScriptModuleComms>(); }
public OpenSimDispatcher(WaterWarsController controller) { m_controller = controller; m_controller.EventManager.OnGameAssetBuildStarted += CreateGameAssetView; // FIXME: If we use this again, we'll need to get one per scene since IScriptModuleComms is not shared m_scriptModuleComms = m_controller.Scenes[0].RequestModuleInterface <IScriptModuleComms>(); // m_scriptModuleComms.OnScriptCommand += ProcessScriptCommand; }
public void Clear() { m_astRoot.kids = null; m_astRoot.yylx = null; m_astRoot.yyps = null; m_astRoot = null; m_positionMap = null; m_warnings.Clear(); m_comms = null; }
// ----------------------------------------------------------------- /// <summary> /// Called when all modules have been added for a region. This is /// where we hook up events /// </summary> // ----------------------------------------------------------------- public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_log.ErrorFormat("[JsonStoreScripts] ScriptModuleComms interface not defined"); m_enabled = false; return; } m_store = m_scene.RequestModuleInterface <IJsonStoreModule>(); if (m_store == null) { m_log.ErrorFormat("[JsonStoreScripts] JsonModule interface not defined"); m_enabled = false; return; } try { m_comms.RegisterScriptInvocation(this, "JsonCreateStore"); m_comms.RegisterScriptInvocation(this, "JsonDestroyStore"); m_comms.RegisterScriptInvocation(this, "JsonReadNotecard"); m_comms.RegisterScriptInvocation(this, "JsonWriteNotecard"); m_comms.RegisterScriptInvocation(this, "JsonTestPath"); m_comms.RegisterScriptInvocation(this, "JsonTestPathJson"); m_comms.RegisterScriptInvocation(this, "JsonGetValue"); m_comms.RegisterScriptInvocation(this, "JsonGetValueJson"); m_comms.RegisterScriptInvocation(this, "JsonTakeValue"); m_comms.RegisterScriptInvocation(this, "JsonTakeValueJson"); m_comms.RegisterScriptInvocation(this, "JsonReadValue"); m_comms.RegisterScriptInvocation(this, "JsonReadValueJson"); m_comms.RegisterScriptInvocation(this, "JsonSetValue"); m_comms.RegisterScriptInvocation(this, "JsonSetValueJson"); m_comms.RegisterScriptInvocation(this, "JsonRemoveValue"); } catch (Exception e) { // See http://opensimulator.org/mantis/view.php?id=5971 for more information m_log.WarnFormat("[JsonStroreScripts] script method registration failed; {0}", e.Message); m_enabled = false; } } }
public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) { m_ScriptEngine = ScriptEngine; m_host = host; if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) m_LSFunctionsEnabled = true; m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>(); if (m_comms == null) m_LSFunctionsEnabled = false; }
public override void RegionLoaded(Scene scene) { base.Logger.Info("[" + Name + "]: Load region " + scene.Name); base.World = scene; if (m_storageTyp == "REGIONEXTRAS") { m_storage = new RegionExtras(base.World, m_config); } if (m_storageTyp == "FILESYSTEM") { m_storage = new FileSystem(base.World, m_config); } if (m_storageTyp == "MYSQL") { m_storage = new MySQL(base.World, m_config); } if (m_storageTyp == "REDIS") { m_storage = new Redis(base.World, m_config); } if (m_storageTyp == "MEMORY") { m_storage = new Memory(); } if (m_storage == null) { m_storage = new Memory(); } base.Logger.Info("[" + Name + "] Using '" + m_storageTyp + "' as Storage."); m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>(); if (m_scriptModule != null) { m_scriptModule.RegisterScriptInvocation(this, "osGetDataValue"); m_scriptModule.RegisterScriptInvocation(this, "osSetDataValue"); m_scriptModule.RegisterScriptInvocation(this, "osDeleteDataValue"); m_scriptModule.RegisterScriptInvocation(this, "osCheckDataValue"); m_scriptModule.RegisterScriptInvocation(this, "osGetPrivateDataValue"); m_scriptModule.RegisterScriptInvocation(this, "osSetPrivateDataValue"); m_scriptModule.RegisterScriptInvocation(this, "osDeletePrivateDataValue"); m_scriptModule.RegisterScriptInvocation(this, "osCheckPrivateDataValue"); } }
public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) { m_ScriptEngine = ScriptEngine; m_host = host; m_localID = localID; m_itemID = itemID; if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false)) m_MODFunctionsEnabled = true; m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>(); if (m_comms == null) m_MODFunctionsEnabled = false; }
public override void RegionLoaded(Scene scene) { base.World = scene; try { IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>(); m_scriptModule.RegisterScriptInvocation(this, "osRemoteScriptPin"); } catch (Exception e) { base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message); } }
public void Initialize( IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) { m_ScriptEngine = scriptEngine; m_host = host; m_item = item; if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false)) m_MODFunctionsEnabled = true; m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>(); if (m_comms == null) m_MODFunctionsEnabled = false; }
public override void RegionLoaded(Scene scene) { base.World = scene; try { IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>(); m_scriptModule.RegisterScriptInvocation(this, "osStartScriptEvents"); m_scriptModule.RegisterScriptInvocation(this, "osStopScriptEvents"); m_scriptModule.RegisterScriptInvocation(this, "osTriggerCustomEvent"); m_scriptModule.RegisterConstant("EVENT_CUSTOM", 0); m_scriptModule.RegisterConstant("EVENT_NEWPRESENCE", 1); m_scriptModule.RegisterConstant("EVENT_REMOVEPRESENCE", 2); m_scriptModule.RegisterConstant("EVENT_AVATARENTERPARCEL", 3); m_scriptModule.RegisterConstant("EVENT_AVATARTELEPORT", 4); m_scriptModule.RegisterConstant("EVENT_DATASTORAGESET", 1001); m_scriptModule.RegisterConstant("EVENT_DATASTORAGEREMOVE", 1002); m_scriptModule.RegisterConstant("EVENT_EASYDIALOGTIMEOUT", 2001); m_scriptModule.RegisterConstant("EVENT_GENERIC", 42001337); } catch (Exception e) { base.Logger.WarnFormat("[" + Name + "]: Script method registration failed; {0}", e.Message); } ScriptEngine = base.World.RequestModuleInterface <IScriptModule>(); base.World.EventManager.OnScriptReset += onScriptReset; base.World.EventManager.OnRemoveScript += onScriptRemove; //DataStorage Events DataStorageEvents.onDeleteDataValue += scriptevent_onDeleteDataValue; DataStorageEvents.onSetDataValue += scriptevent_onSetDataValue; DataStorageEvents.onRateLimit += scriptevent_onRateLimit; //EasyDialog Events EasyDialogEvents.onDialogTimeout += scriptevent_onDialogTimeout; //Events for Scripts base.World.EventManager.OnNewPresence += scriptevent_OnNewPresence; base.World.EventManager.OnRemovePresence += scriptevent_OnRemovePresence; base.World.EventManager.OnAvatarEnteringNewParcel += scriptevent_OnAvatarEnteringNewParcel; base.World.EventManager.OnTeleportStart += scriptevent_OnTeleportStart; }
//internal IWindLightSettingsModule m_lightShareModule; public void Initialize(IScriptModulePlugin ScriptEngine, SceneObjectPart host, uint localID, UUID itemID, ScriptProtectionModule module) { m_ScriptEngine = ScriptEngine; m_host = host; m_localID = localID; m_itemID = itemID; ScriptProtection = module; if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) m_LSFunctionsEnabled = true; m_comms = World.RequestModuleInterface<IScriptModuleComms>(); if (m_comms == null) m_LSFunctionsEnabled = false; }
public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) { m_ScriptEngine = ScriptEngine; m_host = host; if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) { m_LSFunctionsEnabled = true; } m_comms = m_ScriptEngine.World.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_LSFunctionsEnabled = false; } }
public void PostInitialise() { if (m_enabled) { //Register for modSendCommand events from inworld scripts //If we try to do this as part of Initialise() we get an UnhandledEventException. m_scriptmod = m_scene.RequestModuleInterface <IScriptModuleComms>(); m_scriptmod.OnScriptCommand += new ScriptCommand(OnModSendCommand); //Register for chat commands so we can receive orders to generate new plants m_scene.EventManager.OnChatFromClient += OnChat; m_scene.EventManager.OnChatFromWorld += OnChat; //Register for IDialogModule so we can send notices m_dialogmod = m_scene.RequestModuleInterface <IDialogModule>(); m_log.Info("[vpgManager] Post-initialized... "); } }
// ----------------------------------------------------------------- /// <summary> /// Called when all modules have been added for a region. This is /// where we hook up events /// </summary> // ----------------------------------------------------------------- public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_log.ErrorFormat("[Utility] ScriptModuleComms interface not defined"); m_enabled = false; return; } m_comms.RegisterScriptInvocation(this, "GISConvertFromUTM"); } }
public override void RegionLoaded(Scene scene) { base.World = scene; base.World.Permissions.OnRezObject += onRezObject; base.World.Permissions.OnDeleteObject += onDeleteObject; try { IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>(); m_scriptModule.RegisterScriptInvocation(this, "osSetExtraPermission"); } catch (Exception e) { base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message); } }
public void RegionLoaded(Scene scene) { if (!m_enabled) return; m_scene = scene; m_scriptModuleComms = scene.RequestModuleInterface<IScriptModuleComms>(); if (m_scriptModuleComms == null) { m_log.Error("IScriptModuleComms could not be found, cannot add script functions"); return; } m_scriptModuleComms.RegisterScriptInvocations(this); }
public void Initialize( IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) { m_ScriptEngine = scriptEngine; m_host = host; m_item = item; if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false)) { m_MODFunctionsEnabled = true; } m_comms = m_ScriptEngine.World.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_MODFunctionsEnabled = false; } }
//internal IWindLightSettingsModule m_lightShareModule; public void Initialize(IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module) { m_ScriptEngine = ScriptEngine; m_host = host; m_localID = localID; m_itemID = itemID; ScriptProtection = module; if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) { m_LSFunctionsEnabled = true; } m_comms = World.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_LSFunctionsEnabled = false; } }
public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_log.WarnFormat("[ModInvoke] ScriptModuleComms interface not defined"); m_enabled = false; return; } m_comms.RegisterScriptInvocation(this, "dsMemClear"); m_comms.RegisterScriptInvocation(this, "dsMemCount"); m_comms.RegisterScriptInvocation(this, "dsMemGet"); m_comms.RegisterScriptInvocation(this, "dsMemSet"); } }
public override void RegionLoaded(Scene scene) { base.World = scene; try { IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>(); m_scriptModule.RegisterScriptInvocation(this, "osCreateBitmap"); m_scriptModule.RegisterScriptInvocation(this, "osLoadBitmap"); m_scriptModule.RegisterScriptInvocation(this, "osLoadBitmapFromURL"); m_scriptModule.RegisterScriptInvocation(this, "osUnloadBitmap"); m_scriptModule.RegisterScriptInvocation(this, "osSaveBitmap"); m_scriptModule.RegisterScriptInvocation(this, "osResizeBitmap"); m_scriptModule.RegisterScriptInvocation(this, "osGetBitmapPixel"); m_scriptModule.RegisterScriptInvocation(this, "osSetBitmapPixel"); } catch (Exception e) { base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message); } }
public override void RegionLoaded(Scene scene) { base.World = scene; try { IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>(); m_scriptModule.RegisterScriptInvocation(this, "osTimerStart"); m_scriptModule.RegisterScriptInvocation(this, "osTimerStop"); } catch (Exception e) { base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message); } ScriptEngine = base.World.RequestModuleInterface <IScriptModule>(); base.World.EventManager.OnScriptReset += onScriptReset; base.World.EventManager.OnStopScript += onScriptStop; base.World.EventManager.OnRemoveScript += onScriptRemove; }
public void RegionLoaded(Scene scene) { m_scene = scene; IScriptModuleComms comms = scene.RequestModuleInterface <IScriptModuleComms>(); if (comms != null) { comms.RegisterScriptInvocation(this, "llAttachToAvatarTemp"); m_log.DebugFormat("[TEMP ATTACHS]: Registered script functions"); m_console = scene.RequestModuleInterface <IRegionConsole>(); if (m_console != null) { m_console.AddCommand("TempAttachModule", false, "set auto_grant_attach_perms", "set auto_grant_attach_perms true|false", "Allow objects owned by the region owner or estate managers to obtain attach permissions without asking the user", SetAutoGrantAttachPerms); } } else { m_log.ErrorFormat("[TEMP ATTACHS]: Failed to register script functions"); } }
public override void RegionLoaded(Scene scene) { base.World = scene; base.World.Permissions.OnRezObject += onRezObject; base.World.Permissions.OnDeleteObject += onDeleteObject; base.World.Permissions.OnDuplicateObject += onDuplicateObject; base.World.Permissions.OnEditObject += onEditObject; try { IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>(); m_scriptModule.RegisterScriptInvocation(this, "osGetNodeListToTarget"); m_scriptModule.RegisterScriptInvocation(this, "osGetNodeList"); m_scriptModule.RegisterScriptInvocation(this, "osGetNextNode"); m_scriptModule.RegisterScriptInvocation(this, "osGetNodeConnections"); m_scriptModule.RegisterScriptInvocation(this, "osClearNodeCache"); } catch (Exception e) { base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message); } }
// ----------------------------------------------------------------- /// <summary> /// Called when all modules have been added for a region. This is /// where we hook up events /// </summary> // ----------------------------------------------------------------- public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_log.ErrorFormat("[QuickSort] ScriptModuleComms interface not defined"); m_enabled = false; return; } //m_comms.RegisterScriptInvocation("QuickSortConfig",SI_QuickSortConfig, new Type[] { typeof(string), typeof(string) }, typeof(int)); //m_comms.RegisterScriptInvocation("QuickSortState",SI_QuickSortState, new Type[] { typeof(string) }, typeof(string)); m_comms.RegisterScriptInvocation(this, "QuickSortConfig"); m_comms.RegisterScriptInvocation(this, "QuickSortState"); m_probeTimer.Enabled = false; m_probeTimer.AutoReset = false; m_probeTimer.Interval = 500; // 500 milliseconds wait to start async ops m_probeTimer.Elapsed += new ElapsedEventHandler(UpdateSortObjects); } }
// ----------------------------------------------------------------- /// <summary> /// Called when all modules have been added for a region. This is /// where we hook up events /// </summary> // ----------------------------------------------------------------- public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>(); if (m_comms == null) { m_log.ErrorFormat("[NBody] ScriptModuleComms interface not defined"); m_enabled = false; return; } m_comms.RegisterScriptInvocation(this, "NBCreateDomain"); m_comms.RegisterScriptInvocation(this, "NBDestroyDomain"); m_comms.RegisterScriptInvocation(this, "NBSetTimeScale"); m_comms.RegisterScriptInvocation(this, "NBEnableDomain"); m_comms.RegisterScriptInvocation(this, "NBDisableDomain"); m_comms.RegisterScriptInvocation(this, "NBAddEntity"); m_comms.RegisterScriptInvocation(this, "NBRemoveEntity"); m_comms.RegisterScriptInvocation(this, "NBDump"); } }
public void RegionLoaded(Scene scene) { if (!m_enabled) return; m_scene = scene; m_modComms = scene.RequestModuleInterface<IScriptModuleComms>(); if (m_modComms == null) { m_log.Error( "IScriptModuleComms could not be found, cannot add" + " script functions"); return; } m_modComms.RegisterScriptInvocations(this); m_scene.EventManager.OnRemovePresence += OnRemovePresence; m_scene.EventManager.OnNewPresence += OnNewPresence; m_scene.EventManager.OnObjectBeingRemovedFromScene += OnObjectBeingRemovedFromScene; m_scene.EventManager.OnAttach += OnAttach; }
public CSCodeGenerator(IScriptModuleComms comms) { m_comms = comms; ResetCounters(); }
// ----------------------------------------------------------------- /// <summary> /// Called when all modules have been added for a region. This is /// where we hook up events /// </summary> // ----------------------------------------------------------------- public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>(); if (m_comms == null) { m_log.ErrorFormat("[NBody] ScriptModuleComms interface not defined"); m_enabled = false; return; } m_comms.RegisterScriptInvocation(this,"NBCreateDomain"); m_comms.RegisterScriptInvocation(this,"NBDestroyDomain"); m_comms.RegisterScriptInvocation(this,"NBSetTimeScale"); m_comms.RegisterScriptInvocation(this,"NBEnableDomain"); m_comms.RegisterScriptInvocation(this,"NBDisableDomain"); m_comms.RegisterScriptInvocation(this,"NBAddEntity"); m_comms.RegisterScriptInvocation(this,"NBRemoveEntity"); m_comms.RegisterScriptInvocation(this,"NBDump"); } }
// ----------------------------------------------------------------- /// <summary> /// Called when all modules have been added for a region. This is /// where we hook up events /// </summary> // ----------------------------------------------------------------- public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>(); if (m_comms == null) { m_log.ErrorFormat("[JsonStoreScripts]: ScriptModuleComms interface not defined"); m_enabled = false; return; } m_store = m_scene.RequestModuleInterface<IJsonStoreModule>(); if (m_store == null) { m_log.ErrorFormat("[JsonStoreScripts]: JsonModule interface not defined"); m_enabled = false; return; } try { m_comms.RegisterScriptInvocations(this); m_comms.RegisterConstants(this); } catch (Exception e) { // See http://opensimulator.org/mantis/view.php?id=5971 for more information m_log.WarnFormat("[JsonStoreScripts]: script method registration failed; {0}", e.Message); m_enabled = false; } } }
public void RegionLoaded(Scene scene) { m_scene = scene; m_commsMod = m_scene.RequestModuleInterface<IScriptModuleComms>(); m_commsMod.OnScriptCommand += ProcessScriptCommand; rayTracerRequestHandler = new RayTracerRequestHandler(m_commsMod, m_scene); }
// ----------------------------------------------------------------- /// <summary> /// Called when all modules have been added for a region. This is /// where we hook up events /// </summary> // ----------------------------------------------------------------- public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>(); if (m_comms == null) { m_log.ErrorFormat("[Utility] ScriptModuleComms interface not defined"); m_enabled = false; return; } m_comms.RegisterScriptInvocation(this,"GISConvertFromUTM"); } }
// ----------------------------------------------------------------- /// <summary> /// Called when all modules have been added for a region. This is /// where we hook up events /// </summary> // ----------------------------------------------------------------- public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>(); if (m_comms == null) { m_log.ErrorFormat("[JsonStoreScripts] ScriptModuleComms interface not defined"); m_enabled = false; return; } m_store = m_scene.RequestModuleInterface<IJsonStoreModule>(); if (m_store == null) { m_log.ErrorFormat("[JsonStoreScripts] JsonModule interface not defined"); m_enabled = false; return; } try { m_comms.RegisterScriptInvocation(this,"JsonCreateStore"); m_comms.RegisterScriptInvocation(this,"JsonDestroyStore"); m_comms.RegisterScriptInvocation(this,"JsonReadNotecard"); m_comms.RegisterScriptInvocation(this,"JsonWriteNotecard"); m_comms.RegisterScriptInvocation(this,"JsonTestPath"); m_comms.RegisterScriptInvocation(this,"JsonTestPathJson"); m_comms.RegisterScriptInvocation(this,"JsonGetValue"); m_comms.RegisterScriptInvocation(this,"JsonGetValueJson"); m_comms.RegisterScriptInvocation(this,"JsonTakeValue"); m_comms.RegisterScriptInvocation(this,"JsonTakeValueJson"); m_comms.RegisterScriptInvocation(this,"JsonReadValue"); m_comms.RegisterScriptInvocation(this,"JsonReadValueJson"); m_comms.RegisterScriptInvocation(this,"JsonSetValue"); m_comms.RegisterScriptInvocation(this,"JsonSetValueJson"); m_comms.RegisterScriptInvocation(this,"JsonRemoveValue"); } catch (Exception e) { // See http://opensimulator.org/mantis/view.php?id=5971 for more information m_log.WarnFormat("[JsonStroreScripts] script method registration failed; {0}",e.Message); m_enabled = false; } } }
public CSCodeGenerator(IScriptModuleComms comms) { m_comms = comms; ResetCounters(); }
public void RegionLoaded(Scene scene) { m_ScriptComms = scene.RequestModuleInterface<IScriptModuleComms>(); if (m_ScriptComms != null) { m_ScriptComms.OnScriptCommand += OnScriptCommand; m_ScriptModules.Add(m_ScriptComms); } }
// ----------------------------------------------------------------- /// <summary> /// Called when all modules have been added for a region. This is /// where we hook up events /// </summary> // ----------------------------------------------------------------- public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>(); if (m_comms == null) { m_log.ErrorFormat("[QuickSort] ScriptModuleComms interface not defined"); m_enabled = false; return; } //m_comms.RegisterScriptInvocation("QuickSortConfig",SI_QuickSortConfig, new Type[] { typeof(string), typeof(string) }, typeof(int)); //m_comms.RegisterScriptInvocation("QuickSortState",SI_QuickSortState, new Type[] { typeof(string) }, typeof(string)); m_comms.RegisterScriptInvocation(this,"QuickSortConfig"); m_comms.RegisterScriptInvocation(this,"QuickSortState"); m_probeTimer.Enabled = false; m_probeTimer.AutoReset = false; m_probeTimer.Interval = 500; // 500 milliseconds wait to start async ops m_probeTimer.Elapsed += new ElapsedEventHandler(UpdateSortObjects); } }
/// <summary> /// Initialise all variables needed to be used by this ray tracer model. /// </summary> /// <param name="scene">The scene in the world</param> /// <param name="setOfvariables">Set of variable values from the remote control</param> /// <param name="_scriptID">UUID of the script which called this function</param> public void Initialise(Scene _scene, string _setOfVariables, UUID _scriptID) { m_scene = _scene; m_commsMod = m_scene.RequestModuleInterface<IScriptModuleComms>(); scriptID = _scriptID; setOfVariables = _setOfVariables; //Initialise variables parsed from the remote control. int noOfInitVar = initialiseVariables(setOfVariables); m_log.DebugFormat("[RAY TRACER INITIALISATION]: total number of initialised variables = " + noOfInitVar.ToString()); //Get all the entities in the world try { m_prims = m_scene.GetEntities(); } catch (Exception ex) { } //Initialise transmitter and receiver. if (!findTransmitterAndReceiver()) { m_log.DebugFormat("[Ray Tracer PostInit] Transmitter and/or receiver not Found!"); throw new Exception("Cannot find either Transmitter Tx or Receiver Ry"); } //Initialise worldObjects. WorldObjects contains all the parts of the objects in the world which //the distance from itself to the transmitter is less than the MAX_DISTANCE. This is to reduce the //number of parts that we have to look at, i.e. reduces the computations time to find reflections. worldObjects = new List<SceneObjectPart>(); for (int i = 0; i < m_prims.Length; i++) { if (m_prims[i] is SceneObjectGroup) { SceneObjectGroup sog = (SceneObjectGroup)m_prims[i]; sog.ForEachPart(delegate(SceneObjectPart part) { if (Vector3.Distance(part.AbsolutePosition, transmitter.RootPart.AbsolutePosition) <= MAX_DISTANCE || part.Name.CompareTo("Ry") == 0) { worldObjects.Add(part); } }); } } //Initialise pathList for all reflections from 0 to max reflection pathHits = new Dictionary<string, PathFromTxToRy>[MAX_REFLECTIONS + 1]; for (int i = 0; i < MAX_REFLECTIONS + 1; i++) { pathHits[i] = new Dictionary<string, PathFromTxToRy>(); } m_log.DebugFormat("[RAY TRACER INITIALISATION]: Complete!"); }
public CSCodeGenerator(IScriptModuleComms comms, bool insertCoopTerminationChecks) { m_comms = comms; m_insertCoopTerminationChecks = insertCoopTerminationChecks; ResetCounters(); }
/// <summary> /// Keep a record of the previous node when we do the parsing. /// </summary> /// <remarks> /// We do this here because the parser generated by CSTools does not retain a reference to its parent node. /// The previous node is required so we can correctly insert co-op termination checks when required. /// </remarks> // private SYMBOL m_previousNode; /// <summary> /// Creates an 'empty' CSCodeGenerator instance. /// </summary> public CSCodeGenerator() { m_comms = null; ResetCounters(); }
public void RegionLoaded(Scene scene) { if (m_enabled) { m_scene = scene; m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>(); if (m_comms == null) { m_log.WarnFormat("[ModInvoke] ScriptModuleComms interface not defined"); m_enabled = false; return; } m_comms.RegisterScriptInvocation(this,"ModTest0"); m_comms.RegisterScriptInvocation(this,"ModTest1"); m_comms.RegisterScriptInvocation(this,"ModTest2"); m_comms.RegisterScriptInvocation(this,"ModTest3"); m_comms.RegisterScriptInvocation(this,"ModTest4"); m_comms.RegisterScriptInvocation(this,"ModTest5"); m_comms.RegisterScriptInvocation(this,"ModTest6"); m_comms.RegisterScriptInvocation(this,"ModTest7"); m_comms.RegisterScriptInvocation(this,"ModTest8"); m_comms.RegisterScriptInvocation(this,"ModTestR1"); m_comms.RegisterScriptInvocation(this,"ModTest1p"); m_comms.RegisterScriptInvocation(this,"ModTest2p"); m_comms.RegisterScriptInvocation(this,"ModTest3p"); m_comms.RegisterScriptInvocation(this,"ModTest4p"); m_comms.RegisterScriptInvocation(this,"ModTest5p"); m_comms.RegisterConstant("ModConstantInt1",25); m_comms.RegisterConstant("ModConstantFloat1",25.000f); m_comms.RegisterConstant("ModConstantString1","abcdefg"); } }
public void RegionLoaded(Scene scene) { if (!m_enabled) return; m_scene = scene; m_scriptModuleComms = scene.RequestModuleInterface<IScriptModuleComms>(); if (m_scriptModuleComms == null) { m_log.Error("IScriptModuleComms could not be found, cannot add script functions"); return; } #region Constants m_scriptModuleComms.RegisterConstant("MATH_TWO_PHI", (float)(MATH_PHI * 2.0)); m_scriptModuleComms.RegisterConstant("MATH_PHI_BY_TWO", (float)(MATH_PHI / 2.0)); #endregion m_scriptModuleComms.RegisterScriptInvocations(this); m_scriptModuleComms.RegisterConstants(this); }
public void PostInitialise() { if (m_enabled) { //Register for modSendCommand events from inworld scripts //If we try to do this as part of Initialise() we get an UnhandledEventException. m_scriptmod = m_scene.RequestModuleInterface<IScriptModuleComms>(); m_scriptmod.OnScriptCommand += new ScriptCommand(OnModSendCommand); //Register for chat commands so we can receive orders to generate new plants m_scene.EventManager.OnChatFromClient += OnChat; m_scene.EventManager.OnChatFromWorld += OnChat; //Register for IDialogModule so we can send notices m_dialogmod = m_scene.RequestModuleInterface<IDialogModule>(); m_log.Info("[vpgManager] Post-initialized... "); } }