diff options
author | Jeff Ames | 2008-08-18 00:39:10 +0000 |
---|---|---|
committer | Jeff Ames | 2008-08-18 00:39:10 +0000 |
commit | 6ef9d4da901a346c232458317cca6268da888e2e (patch) | |
tree | dd1d935b10f34f261839da9f9879c02322e8ede7 /OpenSim/Region | |
parent | Update svn properties, minor formatting cleanup. (diff) | |
download | opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.zip opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.gz opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.bz2 opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region')
100 files changed, 1983 insertions, 2028 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 4df6415..59ac161 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -95,7 +95,7 @@ namespace OpenSim | |||
95 | } | 95 | } |
96 | 96 | ||
97 | private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself | 97 | private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself |
98 | 98 | ||
99 | /// <summary> | 99 | /// <summary> |
100 | /// Global exception handler -- all unhandlet exceptions end up here :) | 100 | /// Global exception handler -- all unhandlet exceptions end up here :) |
101 | /// </summary> | 101 | /// </summary> |
diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs index 2e3122f..4fd93e8 100644 --- a/OpenSim/Region/Application/IApplicationPlugin.cs +++ b/OpenSim/Region/Application/IApplicationPlugin.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim | |||
33 | { | 33 | { |
34 | void Initialise(OpenSimBase openSim); | 34 | void Initialise(OpenSimBase openSim); |
35 | } | 35 | } |
36 | 36 | ||
37 | public class ApplicationPluginInitialiser : PluginInitialiserBase | 37 | public class ApplicationPluginInitialiser : PluginInitialiserBase |
38 | { | 38 | { |
39 | private OpenSimBase server; | 39 | private OpenSimBase server; |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 4664b0b..cc2d993 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -90,8 +90,8 @@ namespace OpenSim | |||
90 | m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (m_sandbox ? "sandbox" : "grid")); | 90 | m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (m_sandbox ? "sandbox" : "grid")); |
91 | 91 | ||
92 | m_console = new ConsoleBase("Region", this); | 92 | m_console = new ConsoleBase("Region", this); |
93 | MainConsole.Instance = m_console; | 93 | MainConsole.Instance = m_console; |
94 | 94 | ||
95 | base.Startup(); | 95 | base.Startup(); |
96 | 96 | ||
97 | //Run Startup Commands | 97 | //Run Startup Commands |
@@ -116,9 +116,9 @@ namespace OpenSim | |||
116 | PrintFileToConsole("startuplogo.txt"); | 116 | PrintFileToConsole("startuplogo.txt"); |
117 | RegisterCmd("echoTest", RunEchoTest, "this echos your command args to see how they are parsed"); | 117 | RegisterCmd("echoTest", RunEchoTest, "this echos your command args to see how they are parsed"); |
118 | RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving"); | 118 | RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving"); |
119 | 119 | ||
120 | // For now, start at the 'root' level by default | 120 | // For now, start at the 'root' level by default |
121 | ChangeSelectedRegion(new string[] {"root"}); | 121 | ChangeSelectedRegion(new string[] {"root"}); |
122 | } | 122 | } |
123 | 123 | ||
124 | private void RunAutoTimerScript(object sender, EventArgs e) | 124 | private void RunAutoTimerScript(object sender, EventArgs e) |
@@ -135,7 +135,7 @@ namespace OpenSim | |||
135 | { | 135 | { |
136 | for (int i = 0; i < cmdparams.Length; i++) | 136 | for (int i = 0; i < cmdparams.Length; i++) |
137 | { | 137 | { |
138 | m_log.Info("[EchoTest]: <arg" + i + ">"+cmdparams[i]+"</arg" + i + ">"); | 138 | m_log.Info("[EchoTest]: <arg" + i + ">"+cmdparams[i]+"</arg" + i + ">"); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
@@ -214,7 +214,7 @@ namespace OpenSim | |||
214 | { | 214 | { |
215 | base.RunCmd(command, cmdparams); | 215 | base.RunCmd(command, cmdparams); |
216 | RunPluginCommands(command , cmdparams); | 216 | RunPluginCommands(command , cmdparams); |
217 | 217 | ||
218 | switch (command) | 218 | switch (command) |
219 | { | 219 | { |
220 | case "clear-assets": | 220 | case "clear-assets": |
@@ -255,7 +255,7 @@ namespace OpenSim | |||
255 | m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False"); | 255 | m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False"); |
256 | m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim"); | 256 | m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim"); |
257 | m_console.Notice("export-map [filename] - save image of world map"); | 257 | m_console.Notice("export-map [filename] - save image of world map"); |
258 | m_console.Notice("force-update - force an update of prims in the scene"); | 258 | m_console.Notice("force-update - force an update of prims in the scene"); |
259 | m_console.Notice("restart - disconnects all clients and restarts the sims in the instance."); | 259 | m_console.Notice("restart - disconnects all clients and restarts the sims in the instance."); |
260 | m_console.Notice("remove-region [name] - remove a region"); | 260 | m_console.Notice("remove-region [name] - remove a region"); |
261 | m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)"); | 261 | m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)"); |
@@ -273,14 +273,14 @@ namespace OpenSim | |||
273 | m_console.Notice("config set section field value - set a config value"); | 273 | m_console.Notice("config set section field value - set a config value"); |
274 | m_console.Notice("config get section field - get a config value"); | 274 | m_console.Notice("config get section field - get a config value"); |
275 | m_console.Notice("config save - save OpenSim.ini"); | 275 | m_console.Notice("config save - save OpenSim.ini"); |
276 | m_console.Notice("terrain help - show help for terrain commands."); | 276 | m_console.Notice("terrain help - show help for terrain commands."); |
277 | ShowPluginCommandsHelp(CombineParams(cmdparams, 0), m_console); | 277 | ShowPluginCommandsHelp(CombineParams(cmdparams, 0), m_console); |
278 | 278 | ||
279 | if (m_sandbox) | 279 | if (m_sandbox) |
280 | { | 280 | { |
281 | m_console.Notice(""); | 281 | m_console.Notice(""); |
282 | m_console.Notice("create user - adds a new user."); | 282 | m_console.Notice("create user - adds a new user."); |
283 | } | 283 | } |
284 | 284 | ||
285 | break; | 285 | break; |
286 | 286 | ||
@@ -314,11 +314,11 @@ namespace OpenSim | |||
314 | case "load-oar": | 314 | case "load-oar": |
315 | LoadOar(cmdparams); | 315 | LoadOar(cmdparams); |
316 | break; | 316 | break; |
317 | 317 | ||
318 | case "save-oar": | 318 | case "save-oar": |
319 | SaveOar(cmdparams); | 319 | SaveOar(cmdparams); |
320 | break; | 320 | break; |
321 | 321 | ||
322 | case "save-inv": | 322 | case "save-inv": |
323 | SaveInv(cmdparams); | 323 | SaveInv(cmdparams); |
324 | break; | 324 | break; |
@@ -343,13 +343,13 @@ namespace OpenSim | |||
343 | break; | 343 | break; |
344 | 344 | ||
345 | case "create": | 345 | case "create": |
346 | Create(cmdparams); | 346 | Create(cmdparams); |
347 | break; | 347 | break; |
348 | 348 | ||
349 | case "create-region": | 349 | case "create-region": |
350 | CreateRegion(new RegionInfo(cmdparams[0], "Regions/" + cmdparams[1],false), true); | 350 | CreateRegion(new RegionInfo(cmdparams[0], "Regions/" + cmdparams[1],false), true); |
351 | break; | 351 | break; |
352 | 352 | ||
353 | case "remove-region": | 353 | case "remove-region": |
354 | string regName = CombineParams(cmdparams, 0); | 354 | string regName = CombineParams(cmdparams, 0); |
355 | 355 | ||
@@ -441,7 +441,7 @@ namespace OpenSim | |||
441 | } | 441 | } |
442 | } | 442 | } |
443 | break; | 443 | break; |
444 | 444 | ||
445 | case "modules": | 445 | case "modules": |
446 | if (cmdparams.Length > 0) | 446 | if (cmdparams.Length > 0) |
447 | { | 447 | { |
@@ -488,7 +488,7 @@ namespace OpenSim | |||
488 | m_commsManager.AddInventoryService(cmdparams[0]); | 488 | m_commsManager.AddInventoryService(cmdparams[0]); |
489 | } | 489 | } |
490 | break; | 490 | break; |
491 | 491 | ||
492 | default: | 492 | default: |
493 | string[] tmpPluginArgs = new string[cmdparams.Length + 1]; | 493 | string[] tmpPluginArgs = new string[cmdparams.Length + 1]; |
494 | cmdparams.CopyTo(tmpPluginArgs, 1); | 494 | cmdparams.CopyTo(tmpPluginArgs, 1); |
@@ -498,7 +498,7 @@ namespace OpenSim | |||
498 | break; | 498 | break; |
499 | } | 499 | } |
500 | } | 500 | } |
501 | 501 | ||
502 | /// <summary> | 502 | /// <summary> |
503 | /// Change the currently selected region. The selected region is that operated upon by single region commands. | 503 | /// Change the currently selected region. The selected region is that operated upon by single region commands. |
504 | /// </summary> | 504 | /// </summary> |
@@ -515,13 +515,13 @@ namespace OpenSim | |||
515 | else | 515 | else |
516 | { | 516 | { |
517 | m_console.Error("Usage: change-region <region name>"); | 517 | m_console.Error("Usage: change-region <region name>"); |
518 | } | 518 | } |
519 | 519 | ||
520 | string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); | 520 | string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); |
521 | m_console.Notice(String.Format("Currently selected region is {0}", regionName)); | 521 | m_console.Notice(String.Format("Currently selected region is {0}", regionName)); |
522 | m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); | 522 | m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); |
523 | } | 523 | } |
524 | 524 | ||
525 | /// <summary> | 525 | /// <summary> |
526 | /// Execute switch for some of the create commands | 526 | /// Execute switch for some of the create commands |
527 | /// </summary> | 527 | /// </summary> |
@@ -530,7 +530,7 @@ namespace OpenSim | |||
530 | { | 530 | { |
531 | if (args.Length == 0) | 531 | if (args.Length == 0) |
532 | return; | 532 | return; |
533 | 533 | ||
534 | switch (args[0]) | 534 | switch (args[0]) |
535 | { | 535 | { |
536 | case "user": | 536 | case "user": |
@@ -547,7 +547,7 @@ namespace OpenSim | |||
547 | { | 547 | { |
548 | if (args.Length == 0) | 548 | if (args.Length == 0) |
549 | return; | 549 | return; |
550 | 550 | ||
551 | switch (args[0]) | 551 | switch (args[0]) |
552 | { | 552 | { |
553 | case "packet": | 553 | case "packet": |
@@ -566,7 +566,7 @@ namespace OpenSim | |||
566 | } | 566 | } |
567 | 567 | ||
568 | break; | 568 | break; |
569 | 569 | ||
570 | case "scene": | 570 | case "scene": |
571 | if (args.Length == 4) | 571 | if (args.Length == 4) |
572 | { | 572 | { |
@@ -580,11 +580,11 @@ namespace OpenSim | |||
580 | bool collisionsOn = !Convert.ToBoolean(args[2]); | 580 | bool collisionsOn = !Convert.ToBoolean(args[2]); |
581 | bool physicsOn = !Convert.ToBoolean(args[3]); | 581 | bool physicsOn = !Convert.ToBoolean(args[3]); |
582 | m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); | 582 | m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); |
583 | 583 | ||
584 | m_console.Notice( | 584 | m_console.Notice( |
585 | "CONSOLE", | 585 | "CONSOLE", |
586 | String.Format( | 586 | String.Format( |
587 | "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", | 587 | "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", |
588 | !scriptingOn, !collisionsOn, !physicsOn)); | 588 | !scriptingOn, !collisionsOn, !physicsOn)); |
589 | } | 589 | } |
590 | } | 590 | } |
@@ -592,9 +592,9 @@ namespace OpenSim | |||
592 | { | 592 | { |
593 | m_console.Error("debug scene <scripting> <collisions> <physics> (where inside <> is true/false)"); | 593 | m_console.Error("debug scene <scripting> <collisions> <physics> (where inside <> is true/false)"); |
594 | } | 594 | } |
595 | 595 | ||
596 | break; | 596 | break; |
597 | 597 | ||
598 | default: | 598 | default: |
599 | m_console.Error("Unknown debug"); | 599 | m_console.Error("Unknown debug"); |
600 | break; | 600 | break; |
@@ -666,7 +666,7 @@ namespace OpenSim | |||
666 | break; | 666 | break; |
667 | } | 667 | } |
668 | } | 668 | } |
669 | 669 | ||
670 | /// <summary> | 670 | /// <summary> |
671 | /// Create a new user | 671 | /// Create a new user |
672 | /// </summary> | 672 | /// </summary> |
@@ -697,7 +697,7 @@ namespace OpenSim | |||
697 | 697 | ||
698 | if ( cmdparams.Length < 6 ) | 698 | if ( cmdparams.Length < 6 ) |
699 | regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); | 699 | regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); |
700 | else regY = Convert.ToUInt32(cmdparams[5]); | 700 | else regY = Convert.ToUInt32(cmdparams[5]); |
701 | 701 | ||
702 | if (null == m_commsManager.UserService.GetUserProfile(firstName, lastName)) | 702 | if (null == m_commsManager.UserService.GetUserProfile(firstName, lastName)) |
703 | { | 703 | { |
@@ -706,9 +706,9 @@ namespace OpenSim | |||
706 | else | 706 | else |
707 | { | 707 | { |
708 | m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName); | 708 | m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName); |
709 | } | 709 | } |
710 | } | 710 | } |
711 | 711 | ||
712 | protected void SaveXml(string[] cmdparams) | 712 | protected void SaveXml(string[] cmdparams) |
713 | { | 713 | { |
714 | m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); | 714 | m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); |
@@ -721,8 +721,8 @@ namespace OpenSim | |||
721 | { | 721 | { |
722 | m_sceneManager.SaveCurrentSceneToXml(DEFAULT_PRIM_BACKUP_FILENAME); | 722 | m_sceneManager.SaveCurrentSceneToXml(DEFAULT_PRIM_BACKUP_FILENAME); |
723 | } | 723 | } |
724 | } | 724 | } |
725 | 725 | ||
726 | protected void LoadXml(string[] cmdparams) | 726 | protected void LoadXml(string[] cmdparams) |
727 | { | 727 | { |
728 | m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); | 728 | m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); |
@@ -758,8 +758,8 @@ namespace OpenSim | |||
758 | { | 758 | { |
759 | m_sceneManager.LoadCurrentSceneFromXml(DEFAULT_PRIM_BACKUP_FILENAME, false, loadOffset); | 759 | m_sceneManager.LoadCurrentSceneFromXml(DEFAULT_PRIM_BACKUP_FILENAME, false, loadOffset); |
760 | } | 760 | } |
761 | } | 761 | } |
762 | 762 | ||
763 | protected void SaveXml2(string[] cmdparams) | 763 | protected void SaveXml2(string[] cmdparams) |
764 | { | 764 | { |
765 | if (cmdparams.Length > 0) | 765 | if (cmdparams.Length > 0) |
@@ -771,7 +771,7 @@ namespace OpenSim | |||
771 | m_sceneManager.SaveCurrentSceneToXml2(DEFAULT_PRIM_BACKUP_FILENAME); | 771 | m_sceneManager.SaveCurrentSceneToXml2(DEFAULT_PRIM_BACKUP_FILENAME); |
772 | } | 772 | } |
773 | } | 773 | } |
774 | 774 | ||
775 | protected void LoadXml2(string[] cmdparams) | 775 | protected void LoadXml2(string[] cmdparams) |
776 | { | 776 | { |
777 | if (cmdparams.Length > 0) | 777 | if (cmdparams.Length > 0) |
@@ -782,8 +782,8 @@ namespace OpenSim | |||
782 | { | 782 | { |
783 | m_sceneManager.LoadCurrentSceneFromXml2(DEFAULT_PRIM_BACKUP_FILENAME); | 783 | m_sceneManager.LoadCurrentSceneFromXml2(DEFAULT_PRIM_BACKUP_FILENAME); |
784 | } | 784 | } |
785 | } | 785 | } |
786 | 786 | ||
787 | /// <summary> | 787 | /// <summary> |
788 | /// Load a whole region from an opensim archive. | 788 | /// Load a whole region from an opensim archive. |
789 | /// </summary> | 789 | /// </summary> |
@@ -800,9 +800,9 @@ namespace OpenSim | |||
800 | else | 800 | else |
801 | { | 801 | { |
802 | m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME); | 802 | m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME); |
803 | } | 803 | } |
804 | } | 804 | } |
805 | 805 | ||
806 | /// <summary> | 806 | /// <summary> |
807 | /// Save a region to a file, including all the assets needed to restore it. | 807 | /// Save a region to a file, including all the assets needed to restore it. |
808 | /// </summary> | 808 | /// </summary> |
@@ -819,8 +819,8 @@ namespace OpenSim | |||
819 | else | 819 | else |
820 | { | 820 | { |
821 | m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); | 821 | m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); |
822 | } | 822 | } |
823 | } | 823 | } |
824 | 824 | ||
825 | private static string CombineParams(string[] commandParams, int pos) | 825 | private static string CombineParams(string[] commandParams, int pos) |
826 | { | 826 | { |
@@ -835,7 +835,7 @@ namespace OpenSim | |||
835 | 835 | ||
836 | /// <summary> | 836 | /// <summary> |
837 | /// Runs the best matching plugin command | 837 | /// Runs the best matching plugin command |
838 | /// | 838 | /// |
839 | /// returns true if a match was found, false otherwise. | 839 | /// returns true if a match was found, false otherwise. |
840 | /// </summary> | 840 | /// </summary> |
841 | public bool RunPluginCommands(string cmd, string[] withParams) | 841 | public bool RunPluginCommands(string cmd, string[] withParams) |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0ac8cd7..983773a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim | |||
70 | /// The file used to load and save an opensim archive if no filename has been specified | 70 | /// The file used to load and save an opensim archive if no filename has been specified |
71 | /// </summary> | 71 | /// </summary> |
72 | protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene_oar.tar.gz"; | 72 | protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene_oar.tar.gz"; |
73 | 73 | ||
74 | /// <summary> | 74 | /// <summary> |
75 | /// The file to load and save inventory if no filename has been specified | 75 | /// The file to load and save inventory if no filename has been specified |
76 | /// </summary> | 76 | /// </summary> |
@@ -161,7 +161,7 @@ namespace OpenSim | |||
161 | m_config = new OpenSimConfigSource(); | 161 | m_config = new OpenSimConfigSource(); |
162 | m_config.Source = new IniConfigSource(); | 162 | m_config.Source = new IniConfigSource(); |
163 | // IConfigSource icong; | 163 | // IConfigSource icong; |
164 | 164 | ||
165 | //check for .INI file (either default or name passed in command line) | 165 | //check for .INI file (either default or name passed in command line) |
166 | if (File.Exists(Application.iniFilePath)) | 166 | if (File.Exists(Application.iniFilePath)) |
167 | { | 167 | { |
@@ -338,7 +338,7 @@ namespace OpenSim | |||
338 | 338 | ||
339 | protected void LoadPlugins() | 339 | protected void LoadPlugins() |
340 | { | 340 | { |
341 | PluginLoader<IApplicationPlugin> loader = | 341 | PluginLoader<IApplicationPlugin> loader = |
342 | new PluginLoader<IApplicationPlugin> (new ApplicationPluginInitialiser (this)); | 342 | new PluginLoader<IApplicationPlugin> (new ApplicationPluginInitialiser (this)); |
343 | 343 | ||
344 | loader.Load ("/OpenSim/Startup"); | 344 | loader.Load ("/OpenSim/Startup"); |
@@ -351,7 +351,7 @@ namespace OpenSim | |||
351 | public override void Startup() | 351 | public override void Startup() |
352 | { | 352 | { |
353 | base.Startup(); | 353 | base.Startup(); |
354 | 354 | ||
355 | m_stats = StatsManager.StartCollectingSimExtraStats(); | 355 | m_stats = StatsManager.StartCollectingSimExtraStats(); |
356 | 356 | ||
357 | // StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false) | 357 | // StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false) |
@@ -586,7 +586,7 @@ namespace OpenSim | |||
586 | public void handleRestartRegion(RegionInfo whichRegion) | 586 | public void handleRestartRegion(RegionInfo whichRegion) |
587 | { | 587 | { |
588 | m_log.Error("[OPENSIM MAIN]: Got restart signal from SceneManager"); | 588 | m_log.Error("[OPENSIM MAIN]: Got restart signal from SceneManager"); |
589 | 589 | ||
590 | // Shutting down the client server | 590 | // Shutting down the client server |
591 | bool foundClientServer = false; | 591 | bool foundClientServer = false; |
592 | int clientServerElement = 0; | 592 | int clientServerElement = 0; |
@@ -660,7 +660,7 @@ namespace OpenSim | |||
660 | } | 660 | } |
661 | 661 | ||
662 | #endregion | 662 | #endregion |
663 | 663 | ||
664 | /// <summary> | 664 | /// <summary> |
665 | /// Save inventory to a file. | 665 | /// Save inventory to a file. |
666 | /// </summary> | 666 | /// </summary> |
@@ -668,49 +668,49 @@ namespace OpenSim | |||
668 | protected void SaveInv(string[] cmdparams) | 668 | protected void SaveInv(string[] cmdparams) |
669 | { | 669 | { |
670 | m_log.Error("[CONSOLE]: This command has not yet been implemented!"); | 670 | m_log.Error("[CONSOLE]: This command has not yet been implemented!"); |
671 | 671 | ||
672 | if (cmdparams.Length < 3) | 672 | if (cmdparams.Length < 3) |
673 | { | 673 | { |
674 | m_log.Error("[CONSOLE]: usage is save-inv <first name> <last name> <inventory path> [<save file path>]"); | 674 | m_log.Error("[CONSOLE]: usage is save-inv <first name> <last name> <inventory path> [<save file path>]"); |
675 | return; | 675 | return; |
676 | } | 676 | } |
677 | 677 | ||
678 | string firstName = cmdparams[0]; | 678 | string firstName = cmdparams[0]; |
679 | string lastName = cmdparams[1]; | 679 | string lastName = cmdparams[1]; |
680 | string invPath = cmdparams[2]; | 680 | string invPath = cmdparams[2]; |
681 | //string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME); | 681 | //string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME); |
682 | 682 | ||
683 | UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(firstName, lastName); | 683 | UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(firstName, lastName); |
684 | if (null == userProfile) | 684 | if (null == userProfile) |
685 | { | 685 | { |
686 | m_log.ErrorFormat("[CONSOLE]: Failed to find user {0} {1}", firstName, lastName); | 686 | m_log.ErrorFormat("[CONSOLE]: Failed to find user {0} {1}", firstName, lastName); |
687 | return; | 687 | return; |
688 | } | 688 | } |
689 | 689 | ||
690 | CachedUserInfo userInfo = m_commsManager.UserProfileCacheService.GetUserDetails(userProfile.ID); | 690 | CachedUserInfo userInfo = m_commsManager.UserProfileCacheService.GetUserDetails(userProfile.ID); |
691 | if (null == userInfo) | 691 | if (null == userInfo) |
692 | { | 692 | { |
693 | m_log.ErrorFormat("[CONSOLE]: Failed to find user info for {0} {1} {2}", firstName, lastName, userProfile.ID); | 693 | m_log.ErrorFormat("[CONSOLE]: Failed to find user info for {0} {1} {2}", firstName, lastName, userProfile.ID); |
694 | return; | 694 | return; |
695 | } | 695 | } |
696 | 696 | ||
697 | InventoryFolderImpl inventoryFolder = null; | 697 | InventoryFolderImpl inventoryFolder = null; |
698 | InventoryItemBase inventoryItem = null; | 698 | InventoryItemBase inventoryItem = null; |
699 | 699 | ||
700 | if (userInfo.HasReceivedInventory) | 700 | if (userInfo.HasReceivedInventory) |
701 | { | 701 | { |
702 | // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl | 702 | // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl |
703 | // itself (possibly at a small loss in efficiency). | 703 | // itself (possibly at a small loss in efficiency). |
704 | string[] components | 704 | string[] components |
705 | = invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); | 705 | = invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); |
706 | invPath = String.Empty; | 706 | invPath = String.Empty; |
707 | foreach (string c in components) | 707 | foreach (string c in components) |
708 | { | 708 | { |
709 | invPath += c + InventoryFolderImpl.PATH_DELIMITER; | 709 | invPath += c + InventoryFolderImpl.PATH_DELIMITER; |
710 | } | 710 | } |
711 | 711 | ||
712 | invPath = invPath.Remove(invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER)); | 712 | invPath = invPath.Remove(invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER)); |
713 | 713 | ||
714 | // Annoyingly Split actually returns the original string if the input string consists only of delimiters | 714 | // Annoyingly Split actually returns the original string if the input string consists only of delimiters |
715 | // Therefore if we still start with a / after the split, then we need the root folder | 715 | // Therefore if we still start with a / after the split, then we need the root folder |
716 | if (invPath.StartsWith(InventoryFolderImpl.PATH_DELIMITER)) | 716 | if (invPath.StartsWith(InventoryFolderImpl.PATH_DELIMITER)) |
@@ -718,10 +718,10 @@ namespace OpenSim | |||
718 | inventoryFolder = userInfo.RootFolder; | 718 | inventoryFolder = userInfo.RootFolder; |
719 | } | 719 | } |
720 | else | 720 | else |
721 | { | 721 | { |
722 | inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); | 722 | inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); |
723 | } | 723 | } |
724 | 724 | ||
725 | // The path may point to an item instead | 725 | // The path may point to an item instead |
726 | if (inventoryFolder == null) | 726 | if (inventoryFolder == null) |
727 | { | 727 | { |
@@ -733,7 +733,7 @@ namespace OpenSim | |||
733 | m_log.ErrorFormat("[CONSOLE]: Have not yet received inventory info for user {0} {1} {2}", firstName, lastName, userProfile.ID); | 733 | m_log.ErrorFormat("[CONSOLE]: Have not yet received inventory info for user {0} {1} {2}", firstName, lastName, userProfile.ID); |
734 | return; | 734 | return; |
735 | } | 735 | } |
736 | 736 | ||
737 | if (null != inventoryFolder) | 737 | if (null != inventoryFolder) |
738 | { | 738 | { |
739 | m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, invPath); | 739 | m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, invPath); |
@@ -746,8 +746,8 @@ namespace OpenSim | |||
746 | { | 746 | { |
747 | m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); | 747 | m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); |
748 | return; | 748 | return; |
749 | } | 749 | } |
750 | } | 750 | } |
751 | 751 | ||
752 | /// <summary> | 752 | /// <summary> |
753 | /// Performs any last-minute sanity checking and shuts down the region server | 753 | /// Performs any last-minute sanity checking and shuts down the region server |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index b14b3db..3c24fb6 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -230,7 +230,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
230 | 230 | ||
231 | private RegionHandleRequest handlerRegionHandleRequest = null; // OnRegionHandleRequest | 231 | private RegionHandleRequest handlerRegionHandleRequest = null; // OnRegionHandleRequest |
232 | private ParcelInfoRequest handlerParcelInfoRequest = null; // OnParcelInfoRequest | 232 | private ParcelInfoRequest handlerParcelInfoRequest = null; // OnParcelInfoRequest |
233 | 233 | ||
234 | private ScriptAnswer handlerScriptAnswer = null; | 234 | private ScriptAnswer handlerScriptAnswer = null; |
235 | private RequestPayPrice handlerRequestPayPrice = null; | 235 | private RequestPayPrice handlerRequestPayPrice = null; |
236 | private ObjectDeselect handlerObjectDetach = null; | 236 | private ObjectDeselect handlerObjectDetach = null; |
@@ -366,7 +366,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
366 | 366 | ||
367 | public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, | 367 | public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, |
368 | AgentCircuitManager authenSessions, LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP) | 368 | AgentCircuitManager authenSessions, LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP) |
369 | { | 369 | { |
370 | m_moneyBalance = 1000; | 370 | m_moneyBalance = 1000; |
371 | 371 | ||
372 | m_channelVersion = Helpers.StringToField(scene.GetSimulatorVersion()); | 372 | m_channelVersion = Helpers.StringToField(scene.GetSimulatorVersion()); |
@@ -378,7 +378,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
378 | 378 | ||
379 | m_networkServer = packServer; | 379 | m_networkServer = packServer; |
380 | // m_inventoryCache = inventoryCache; | 380 | // m_inventoryCache = inventoryCache; |
381 | m_authenticateSessionsHandler = authenSessions; | 381 | m_authenticateSessionsHandler = authenSessions; |
382 | 382 | ||
383 | m_agentId = agentId; | 383 | m_agentId = agentId; |
384 | m_sessionId = sessionId; | 384 | m_sessionId = sessionId; |
@@ -404,8 +404,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
404 | m_clientThread.IsBackground = true; | 404 | m_clientThread.IsBackground = true; |
405 | m_clientThread.Start(); | 405 | m_clientThread.Start(); |
406 | ThreadTracker.Add(m_clientThread); | 406 | ThreadTracker.Add(m_clientThread); |
407 | 407 | ||
408 | m_log.Info("[CLIENT]: Started up new thread to handle client UDP session"); | 408 | m_log.Info("[CLIENT]: Started up new thread to handle client UDP session"); |
409 | } | 409 | } |
410 | 410 | ||
411 | public void SetDebug(int newDebug) | 411 | public void SetDebug(int newDebug) |
@@ -457,9 +457,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
457 | public void Close(bool shutdownCircuit) | 457 | public void Close(bool shutdownCircuit) |
458 | { | 458 | { |
459 | m_log.DebugFormat( | 459 | m_log.DebugFormat( |
460 | "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}", | 460 | "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}", |
461 | shutdownCircuit, m_scene.RegionInfo.RegionName); | 461 | shutdownCircuit, m_scene.RegionInfo.RegionName); |
462 | 462 | ||
463 | m_PacketHandler.Flush(); | 463 | m_PacketHandler.Flush(); |
464 | 464 | ||
465 | // raise an event on the packet server to Shutdown the circuit | 465 | // raise an event on the packet server to Shutdown the circuit |
@@ -639,7 +639,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
639 | # endregion | 639 | # endregion |
640 | 640 | ||
641 | protected int m_terrainCheckerCount = 0; | 641 | protected int m_terrainCheckerCount = 0; |
642 | 642 | ||
643 | /// <summary> | 643 | /// <summary> |
644 | /// Event handler for check client timer | 644 | /// Event handler for check client timer |
645 | /// Checks to ensure that the client is still connected. If the client has failed to respond to many pings | 645 | /// Checks to ensure that the client is still connected. If the client has failed to respond to many pings |
@@ -652,15 +652,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
652 | if (m_PacketHandler.PacketsReceived == m_PacketHandler.PacketsReceivedReported) | 652 | if (m_PacketHandler.PacketsReceived == m_PacketHandler.PacketsReceivedReported) |
653 | { | 653 | { |
654 | m_probesWithNoIngressPackets++; | 654 | m_probesWithNoIngressPackets++; |
655 | if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) | 655 | if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) |
656 | || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) | 656 | || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) |
657 | { | 657 | { |
658 | if (OnConnectionClosed != null) | 658 | if (OnConnectionClosed != null) |
659 | { | 659 | { |
660 | m_log.WarnFormat( | 660 | m_log.WarnFormat( |
661 | "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection", | 661 | "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection", |
662 | Name, AgentId); | 662 | Name, AgentId); |
663 | 663 | ||
664 | OnConnectionClosed(this); | 664 | OnConnectionClosed(this); |
665 | } | 665 | } |
666 | } | 666 | } |
@@ -694,7 +694,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
694 | m_clientPingTimer = new Timer(5000); | 694 | m_clientPingTimer = new Timer(5000); |
695 | m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); | 695 | m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); |
696 | m_clientPingTimer.Enabled = true; | 696 | m_clientPingTimer.Enabled = true; |
697 | 697 | ||
698 | m_scene.AddNewClient(this, true); | 698 | m_scene.AddNewClient(this, true); |
699 | } | 699 | } |
700 | 700 | ||
@@ -764,7 +764,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
764 | 764 | ||
765 | LLQueItem item = new LLQueItem(); | 765 | LLQueItem item = new LLQueItem(); |
766 | item.Packet = packet; | 766 | item.Packet = packet; |
767 | 767 | ||
768 | m_PacketHandler.ProcessOutPacket(item); | 768 | m_PacketHandler.ProcessOutPacket(item); |
769 | 769 | ||
770 | // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to | 770 | // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to |
@@ -1091,7 +1091,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1091 | for (int y = 0; y < 16; y++) | 1091 | for (int y = 0; y < 16; y++) |
1092 | { | 1092 | { |
1093 | // For some terrains, sending more than one terrain patch at once results in a libsecondlife exception | 1093 | // For some terrains, sending more than one terrain patch at once results in a libsecondlife exception |
1094 | // see http://opensimulator.org/mantis/view.php?id=1662 | 1094 | // see http://opensimulator.org/mantis/view.php?id=1662 |
1095 | //for (int x = 0; x < 16; x += 4) | 1095 | //for (int x = 0; x < 16; x += 4) |
1096 | //{ | 1096 | //{ |
1097 | // SendLayerPacket(map, y, x); | 1097 | // SendLayerPacket(map, y, x); |
@@ -1113,7 +1113,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1113 | /// <summary> | 1113 | /// <summary> |
1114 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client | 1114 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client |
1115 | /// </summary> | 1115 | /// </summary> |
1116 | /// <param name="map">heightmap</param> | 1116 | /// <param name="map">heightmap</param> |
1117 | /// <param name="px">X coordinate for patches 0..12</param> | 1117 | /// <param name="px">X coordinate for patches 0..12</param> |
1118 | /// <param name="py">Y coordinate for patches 0..15</param> | 1118 | /// <param name="py">Y coordinate for patches 0..15</param> |
1119 | // private void SendLayerPacket(float[] map, int y, int x) | 1119 | // private void SendLayerPacket(float[] map, int y, int x) |
@@ -1147,7 +1147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1147 | 1147 | ||
1148 | LayerDataPacket layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); | 1148 | LayerDataPacket layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); |
1149 | layerpack.Header.Zerocoded = true; | 1149 | layerpack.Header.Zerocoded = true; |
1150 | 1150 | ||
1151 | OutPacket(layerpack, ThrottleOutPacketType.Land); | 1151 | OutPacket(layerpack, ThrottleOutPacketType.Land); |
1152 | } | 1152 | } |
1153 | catch (Exception e) | 1153 | catch (Exception e) |
@@ -1157,7 +1157,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | /// <summary> | 1159 | /// <summary> |
1160 | /// Tell the client that the given neighbour region is ready to receive a child agent. | 1160 | /// Tell the client that the given neighbour region is ready to receive a child agent. |
1161 | /// </summary> | 1161 | /// </summary> |
1162 | /// <param name="neighbourHandle"></param> | 1162 | /// <param name="neighbourHandle"></param> |
1163 | /// <param name="neighbourIP"></param> | 1163 | /// <param name="neighbourIP"></param> |
@@ -3405,7 +3405,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3405 | } | 3405 | } |
3406 | 3406 | ||
3407 | /// <summary> | 3407 | /// <summary> |
3408 | /// | 3408 | /// |
3409 | /// </summary> | 3409 | /// </summary> |
3410 | /// <param name="client"></param> | 3410 | /// <param name="client"></param> |
3411 | /// <returns></returns> | 3411 | /// <returns></returns> |
@@ -3682,7 +3682,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3682 | 3682 | ||
3683 | /// <summary> | 3683 | /// <summary> |
3684 | /// returns a byte array of the client set throttles Gets multiplied by the multiplier | 3684 | /// returns a byte array of the client set throttles Gets multiplied by the multiplier |
3685 | /// | 3685 | /// |
3686 | /// </summary> | 3686 | /// </summary> |
3687 | /// <param name="multiplier">non 1 multiplier for subdividing the throttles between individual regions</param> | 3687 | /// <param name="multiplier">non 1 multiplier for subdividing the throttles between individual regions</param> |
3688 | /// <returns></returns> | 3688 | /// <returns></returns> |
@@ -3691,7 +3691,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3691 | return m_PacketHandler.PacketQueue.GetThrottlesPacked(multiplier); | 3691 | return m_PacketHandler.PacketQueue.GetThrottlesPacked(multiplier); |
3692 | } | 3692 | } |
3693 | /// <summary> | 3693 | /// <summary> |
3694 | /// sets the throttles from values supplied by the client | 3694 | /// sets the throttles from values supplied by the client |
3695 | /// </summary> | 3695 | /// </summary> |
3696 | /// <param name="throttles"></param> | 3696 | /// <param name="throttles"></param> |
3697 | public void SetChildAgentThrottle(byte[] throttles) | 3697 | public void SetChildAgentThrottle(byte[] throttles) |
@@ -5291,24 +5291,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5291 | 5291 | ||
5292 | case PacketType.RegionHandleRequest: | 5292 | case PacketType.RegionHandleRequest: |
5293 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; | 5293 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; |
5294 | 5294 | ||
5295 | handlerRegionHandleRequest = OnRegionHandleRequest; | 5295 | handlerRegionHandleRequest = OnRegionHandleRequest; |
5296 | if (handlerRegionHandleRequest != null) | 5296 | if (handlerRegionHandleRequest != null) |
5297 | { | 5297 | { |
5298 | handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); | 5298 | handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); |
5299 | } | 5299 | } |
5300 | break; | 5300 | break; |
5301 | 5301 | ||
5302 | case PacketType.ParcelInfoRequest: | 5302 | case PacketType.ParcelInfoRequest: |
5303 | ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack; | 5303 | ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack; |
5304 | 5304 | ||
5305 | handlerParcelInfoRequest = OnParcelInfoRequest; | 5305 | handlerParcelInfoRequest = OnParcelInfoRequest; |
5306 | if (handlerParcelInfoRequest != null) | 5306 | if (handlerParcelInfoRequest != null) |
5307 | { | 5307 | { |
5308 | handlerParcelInfoRequest(this, pirPack.Data.ParcelID); | 5308 | handlerParcelInfoRequest(this, pirPack.Data.ParcelID); |
5309 | } | 5309 | } |
5310 | break; | 5310 | break; |
5311 | 5311 | ||
5312 | case PacketType.ParcelAccessListRequest: | 5312 | case PacketType.ParcelAccessListRequest: |
5313 | ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; | 5313 | ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; |
5314 | 5314 | ||
@@ -6277,10 +6277,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6277 | } | 6277 | } |
6278 | 6278 | ||
6279 | #endregion | 6279 | #endregion |
6280 | 6280 | ||
6281 | 6281 | ||
6282 | #region Camera | 6282 | #region Camera |
6283 | 6283 | ||
6284 | public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) | 6284 | public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) |
6285 | { | 6285 | { |
6286 | SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties); | 6286 | SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties); |
@@ -6292,7 +6292,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6292 | SetFollowCamPropertiesPacket.CameraPropertyBlock block = new SetFollowCamPropertiesPacket.CameraPropertyBlock(); | 6292 | SetFollowCamPropertiesPacket.CameraPropertyBlock block = new SetFollowCamPropertiesPacket.CameraPropertyBlock(); |
6293 | block.Type = pair.Key; | 6293 | block.Type = pair.Key; |
6294 | block.Value = pair.Value; | 6294 | block.Value = pair.Value; |
6295 | 6295 | ||
6296 | camPropBlock[idx++] = block; | 6296 | camPropBlock[idx++] = block; |
6297 | } | 6297 | } |
6298 | packet.CameraProperty = camPropBlock; | 6298 | packet.CameraProperty = camPropBlock; |
@@ -6314,7 +6314,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6314 | reply.ReplyBlock.RegionHandle = handle; | 6314 | reply.ReplyBlock.RegionHandle = handle; |
6315 | OutPacket(reply, ThrottleOutPacketType.Land); | 6315 | OutPacket(reply, ThrottleOutPacketType.Land); |
6316 | } | 6316 | } |
6317 | 6317 | ||
6318 | public void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y) | 6318 | public void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y) |
6319 | { | 6319 | { |
6320 | ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); | 6320 | ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); |
@@ -6325,16 +6325,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6325 | reply.Data.Desc = Helpers.StringToField(land.Description); | 6325 | reply.Data.Desc = Helpers.StringToField(land.Description); |
6326 | reply.Data.ActualArea = land.Area; | 6326 | reply.Data.ActualArea = land.Area; |
6327 | reply.Data.BillableArea = land.Area; // TODO: what is this? | 6327 | reply.Data.BillableArea = land.Area; // TODO: what is this? |
6328 | 6328 | ||
6329 | // Bit 0: Mature, bit 7: on sale, other bits: no idea | 6329 | // Bit 0: Mature, bit 7: on sale, other bits: no idea |
6330 | reply.Data.Flags = (byte)( | 6330 | reply.Data.Flags = (byte)( |
6331 | ((land.Flags & (uint)Parcel.ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) + | 6331 | ((land.Flags & (uint)Parcel.ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) + |
6332 | ((land.Flags & (uint)Parcel.ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); | 6332 | ((land.Flags & (uint)Parcel.ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); |
6333 | 6333 | ||
6334 | LLVector3 pos = land.UserLocation; | 6334 | LLVector3 pos = land.UserLocation; |
6335 | if (pos.Equals(LLVector3.Zero)) | 6335 | if (pos.Equals(LLVector3.Zero)) |
6336 | { | 6336 | { |
6337 | pos = (land.AABBMax + land.AABBMin) * 0.5f; | 6337 | pos = (land.AABBMax + land.AABBMin) * 0.5f; |
6338 | } | 6338 | } |
6339 | reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x; | 6339 | reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x; |
6340 | reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y; | 6340 | reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y; |
@@ -6344,7 +6344,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6344 | reply.Data.Dwell = 0; // TODO: not implemented yet | 6344 | reply.Data.Dwell = 0; // TODO: not implemented yet |
6345 | reply.Data.SalePrice = land.SalePrice; | 6345 | reply.Data.SalePrice = land.SalePrice; |
6346 | reply.Data.AuctionID = (int)land.AuctionID; | 6346 | reply.Data.AuctionID = (int)land.AuctionID; |
6347 | 6347 | ||
6348 | OutPacket(reply, ThrottleOutPacketType.Land); | 6348 | OutPacket(reply, ThrottleOutPacketType.Land); |
6349 | } | 6349 | } |
6350 | } | 6350 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 8fe9a7b..8023f58 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | |||
@@ -230,7 +230,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
230 | { | 230 | { |
231 | // Call the load balancer's hook. If this is not active here | 231 | // Call the load balancer's hook. If this is not active here |
232 | // we defer to the sim server this client is actually connected | 232 | // we defer to the sim server this client is actually connected |
233 | // to. Packet drop notifies will not be triggered in this | 233 | // to. Packet drop notifies will not be triggered in this |
234 | // configuration! | 234 | // configuration! |
235 | // | 235 | // |
236 | if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) | 236 | if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) |
@@ -282,7 +282,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
282 | } | 282 | } |
283 | } | 283 | } |
284 | } | 284 | } |
285 | 285 | ||
286 | private void QueuePacket( | 286 | private void QueuePacket( |
287 | Packet packet, ThrottleOutPacketType throttlePacketType, | 287 | Packet packet, ThrottleOutPacketType throttlePacketType, |
288 | Object id) | 288 | Object id) |
@@ -303,7 +303,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
303 | { | 303 | { |
304 | int now = System.Environment.TickCount; | 304 | int now = System.Environment.TickCount; |
305 | int lastAck = m_LastAck; | 305 | int lastAck = m_LastAck; |
306 | 306 | ||
307 | // Unless we have received at least one ack, don't bother resending | 307 | // Unless we have received at least one ack, don't bother resending |
308 | // anything. There may not be a client there, don't clog up the | 308 | // anything. There may not be a client there, don't clog up the |
309 | // pipes. | 309 | // pipes. |
@@ -558,7 +558,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
558 | 558 | ||
559 | PruneDupeTracker(); | 559 | PruneDupeTracker(); |
560 | 560 | ||
561 | // Check for duplicate packets.. packets that the client is | 561 | // Check for duplicate packets.. packets that the client is |
562 | // resending because it didn't receive our ack | 562 | // resending because it didn't receive our ack |
563 | // | 563 | // |
564 | lock (m_DupeTracker) | 564 | lock (m_DupeTracker) |
@@ -677,7 +677,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
677 | 677 | ||
678 | m_Sequence = info.sequence; | 678 | m_Sequence = info.sequence; |
679 | } | 679 | } |
680 | 680 | ||
681 | public void AddImportantPacket(PacketType type) | 681 | public void AddImportantPacket(PacketType type) |
682 | { | 682 | { |
683 | if (m_ImportantPackets.Contains(type)) | 683 | if (m_ImportantPackets.Contains(type)) |
@@ -693,7 +693,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
693 | 693 | ||
694 | m_ImportantPackets.Remove(type); | 694 | m_ImportantPackets.Remove(type); |
695 | } | 695 | } |
696 | 696 | ||
697 | private void DropResend(Object id) | 697 | private void DropResend(Object id) |
698 | { | 698 | { |
699 | foreach (AckData data in new List<AckData>(m_NeedAck.Values)) | 699 | foreach (AckData data in new List<AckData>(m_NeedAck.Values)) |
@@ -736,7 +736,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
736 | if (packet.Header.Reliable) | 736 | if (packet.Header.Reliable) |
737 | { | 737 | { |
738 | m_UnackedBytes += packet.ToBytes().Length; | 738 | m_UnackedBytes += packet.ToBytes().Length; |
739 | m_NeedAck[packet.Header.Sequence] = new AckData(packet, | 739 | m_NeedAck[packet.Header.Sequence] = new AckData(packet, |
740 | item.Identifier); | 740 | item.Identifier); |
741 | } | 741 | } |
742 | } | 742 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 5903661..7c21df2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -213,7 +213,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
213 | } | 213 | } |
214 | 214 | ||
215 | BeginReceive(); | 215 | BeginReceive(); |
216 | 216 | ||
217 | if (packet != null) | 217 | if (packet != null) |
218 | { | 218 | { |
219 | try | 219 | try |
@@ -297,11 +297,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
297 | m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, | 297 | m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, |
298 | ReceivedData, null); | 298 | ReceivedData, null); |
299 | 299 | ||
300 | // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. | 300 | // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. |
301 | // so therefore.. we've got to tell the server to BeginReceiveFrom again. | 301 | // so therefore.. we've got to tell the server to BeginReceiveFrom again. |
302 | // This will happen over and over until we've gone through all packets | 302 | // This will happen over and over until we've gone through all packets |
303 | // sent to and from this particular user. | 303 | // sent to and from this particular user. |
304 | // Stupid I know.. | 304 | // Stupid I know.. |
305 | // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. | 305 | // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. |
306 | } | 306 | } |
307 | catch (SocketException e) | 307 | catch (SocketException e) |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
329 | { | 329 | { |
330 | if (!(packet is UseCircuitCodePacket)) | 330 | if (!(packet is UseCircuitCodePacket)) |
331 | return; | 331 | return; |
332 | 332 | ||
333 | UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; | 333 | UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; |
334 | lock (clientCircuits) | 334 | lock (clientCircuits) |
335 | { | 335 | { |
@@ -424,13 +424,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
424 | public virtual void RemoveClientCircuit(uint circuitcode) | 424 | public virtual void RemoveClientCircuit(uint circuitcode) |
425 | { | 425 | { |
426 | EndPoint sendto = null; | 426 | EndPoint sendto = null; |
427 | if (clientCircuits_reverse.Contains(circuitcode)) | 427 | if (clientCircuits_reverse.Contains(circuitcode)) |
428 | { | 428 | { |
429 | sendto = (EndPoint)clientCircuits_reverse[circuitcode]; | 429 | sendto = (EndPoint)clientCircuits_reverse[circuitcode]; |
430 | 430 | ||
431 | clientCircuits_reverse.Remove(circuitcode); | 431 | clientCircuits_reverse.Remove(circuitcode); |
432 | 432 | ||
433 | lock (clientCircuits) | 433 | lock (clientCircuits) |
434 | { | 434 | { |
435 | if (sendto != null) | 435 | if (sendto != null) |
436 | { | 436 | { |
@@ -442,7 +442,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
442 | "[UDPSERVER]: endpoint for circuit code {0} in RemoveClientCircuit() was unexpectedly null!", circuitcode); | 442 | "[UDPSERVER]: endpoint for circuit code {0} in RemoveClientCircuit() was unexpectedly null!", circuitcode); |
443 | } | 443 | } |
444 | } | 444 | } |
445 | lock (proxyCircuits) | 445 | lock (proxyCircuits) |
446 | { | 446 | { |
447 | proxyCircuits.Remove(circuitcode); | 447 | proxyCircuits.Remove(circuitcode); |
448 | } | 448 | } |
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 7a552a6..91f7472 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.ClientStack | |||
74 | public override void Startup() | 74 | public override void Startup() |
75 | { | 75 | { |
76 | base.Startup(); | 76 | base.Startup(); |
77 | 77 | ||
78 | m_storageManager = CreateStorageManager(m_storageConnectionString, m_estateConnectionString); | 78 | m_storageManager = CreateStorageManager(m_storageConnectionString, m_estateConnectionString); |
79 | 79 | ||
80 | m_clientStackManager = CreateClientStackManager(); | 80 | m_clientStackManager = CreateClientStackManager(); |
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 8149bcc..7501967 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs | |||
@@ -496,13 +496,13 @@ namespace OpenSim.Region.Communications.Local | |||
496 | { | 496 | { |
497 | m_log.DebugFormat("[INTERREGION STANDALONE] requests land data in {0}, at {1}, {2}", | 497 | m_log.DebugFormat("[INTERREGION STANDALONE] requests land data in {0}, at {1}, {2}", |
498 | regionHandle, x, y); | 498 | regionHandle, x, y); |
499 | 499 | ||
500 | if (m_regionListeners.ContainsKey(regionHandle)) | 500 | if (m_regionListeners.ContainsKey(regionHandle)) |
501 | { | 501 | { |
502 | LandData land = m_regionListeners[regionHandle].TriggerGetLandData(x, y); | 502 | LandData land = m_regionListeners[regionHandle].TriggerGetLandData(x, y); |
503 | return land; | 503 | return land; |
504 | } | 504 | } |
505 | 505 | ||
506 | m_log.Debug("[INTERREGION STANDALONE] didn't find land data locally."); | 506 | m_log.Debug("[INTERREGION STANDALONE] didn't find land data locally."); |
507 | return null; | 507 | return null; |
508 | } | 508 | } |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 9a4c166..7baaa16 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
139 | try | 139 | try |
140 | { | 140 | { |
141 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); | 141 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); |
142 | 142 | ||
143 | // The timeout should always be significantly larger than the timeout for the grid server to request | 143 | // The timeout should always be significantly larger than the timeout for the grid server to request |
144 | // the initial status of the region before confirming registration. | 144 | // the initial status of the region before confirming registration. |
145 | GridResp = GridReq.Send(serversInfo.GridURL, 90000); | 145 | GridResp = GridReq.Send(serversInfo.GridURL, 90000); |
@@ -630,7 +630,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
630 | } | 630 | } |
631 | 631 | ||
632 | XmlRpcResponse resp = new XmlRpcResponse(); | 632 | XmlRpcResponse resp = new XmlRpcResponse(); |
633 | 633 | ||
634 | if (banned) | 634 | if (banned) |
635 | { | 635 | { |
636 | m_log.InfoFormat("[OGS1 GRID SERVICES]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname); | 636 | m_log.InfoFormat("[OGS1 GRID SERVICES]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname); |
@@ -645,7 +645,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
645 | m_log.Debug("[CONNECTION DEBUGGING]: Triggering welcome for " + agentData.AgentID.ToString() + " into " + regionHandle.ToString()); | 645 | m_log.Debug("[CONNECTION DEBUGGING]: Triggering welcome for " + agentData.AgentID.ToString() + " into " + regionHandle.ToString()); |
646 | m_localBackend.TriggerExpectUser(regionHandle, agentData); | 646 | m_localBackend.TriggerExpectUser(regionHandle, agentData); |
647 | m_log.Info("[OGS1 GRID SERVICES]: Welcoming new user..."); | 647 | m_log.Info("[OGS1 GRID SERVICES]: Welcoming new user..."); |
648 | Hashtable respdata = new Hashtable(); | 648 | Hashtable respdata = new Hashtable(); |
649 | respdata["success"] = "TRUE"; | 649 | respdata["success"] = "TRUE"; |
650 | resp.Value = respdata; | 650 | resp.Value = respdata; |
651 | 651 | ||
@@ -1638,10 +1638,10 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1638 | hash["region_handle"] = regionHandle.ToString(); | 1638 | hash["region_handle"] = regionHandle.ToString(); |
1639 | hash["x"] = x.ToString(); | 1639 | hash["x"] = x.ToString(); |
1640 | hash["y"] = y.ToString(); | 1640 | hash["y"] = y.ToString(); |
1641 | 1641 | ||
1642 | IList paramList = new ArrayList(); | 1642 | IList paramList = new ArrayList(); |
1643 | paramList.Add(hash); | 1643 | paramList.Add(hash); |
1644 | 1644 | ||
1645 | // this might be cached, as we probably requested it just a moment ago... | 1645 | // this might be cached, as we probably requested it just a moment ago... |
1646 | RegionInfo info = RequestNeighbourInfo(regionHandle); | 1646 | RegionInfo info = RequestNeighbourInfo(regionHandle); |
1647 | 1647 | ||
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 06a28d0..1d86646 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | |||
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
252 | IList parameters = new ArrayList(); | 252 | IList parameters = new ArrayList(); |
253 | parameters.Add(param); | 253 | parameters.Add(param); |
254 | XmlRpcRequest req = new XmlRpcRequest("logout_of_simulator", parameters); | 254 | XmlRpcRequest req = new XmlRpcRequest("logout_of_simulator", parameters); |
255 | 255 | ||
256 | try | 256 | try |
257 | { | 257 | { |
258 | req.Send(m_parent.NetworkServersInfo.UserURL, 3000); | 258 | req.Send(m_parent.NetworkServersInfo.UserURL, 3000); |
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
262 | m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff"); | 262 | m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff"); |
263 | } | 263 | } |
264 | } | 264 | } |
265 | 265 | ||
266 | public UserProfileData GetUserProfile(string firstName, string lastName) | 266 | public UserProfileData GetUserProfile(string firstName, string lastName) |
267 | { | 267 | { |
268 | return GetUserProfile(firstName + " " + lastName); | 268 | return GetUserProfile(firstName + " " + lastName); |
@@ -711,7 +711,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
711 | public AvatarAppearance GetUserAppearance(LLUUID user) | 711 | public AvatarAppearance GetUserAppearance(LLUUID user) |
712 | { | 712 | { |
713 | AvatarAppearance appearance = null; | 713 | AvatarAppearance appearance = null; |
714 | 714 | ||
715 | try | 715 | try |
716 | { | 716 | { |
717 | Hashtable param = new Hashtable(); | 717 | Hashtable param = new Hashtable(); |
@@ -722,14 +722,14 @@ namespace OpenSim.Region.Communications.OGS1 | |||
722 | XmlRpcRequest req = new XmlRpcRequest("get_avatar_appearance", parameters); | 722 | XmlRpcRequest req = new XmlRpcRequest("get_avatar_appearance", parameters); |
723 | XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 8000); | 723 | XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 8000); |
724 | Hashtable respData = (Hashtable) resp.Value; | 724 | Hashtable respData = (Hashtable) resp.Value; |
725 | 725 | ||
726 | return ConvertXMLRPCDataToAvatarAppearance(respData); | 726 | return ConvertXMLRPCDataToAvatarAppearance(respData); |
727 | } | 727 | } |
728 | catch (WebException e) | 728 | catch (WebException e) |
729 | { | 729 | { |
730 | m_log.ErrorFormat("[OGS1 USER SERVICES]: Network problems when trying to fetch appearance for avatar {0}, {1}", user, e.Message); | 730 | m_log.ErrorFormat("[OGS1 USER SERVICES]: Network problems when trying to fetch appearance for avatar {0}, {1}", user, e.Message); |
731 | } | 731 | } |
732 | 732 | ||
733 | return appearance; | 733 | return appearance; |
734 | } | 734 | } |
735 | 735 | ||
diff --git a/OpenSim/Region/Environment/Interfaces/ICommander.cs b/OpenSim/Region/Environment/Interfaces/ICommander.cs index f2260c3..c4102af 100644 --- a/OpenSim/Region/Environment/Interfaces/ICommander.cs +++ b/OpenSim/Region/Environment/Interfaces/ICommander.cs | |||
@@ -27,8 +27,6 @@ | |||
27 | 27 | ||
28 | namespace OpenSim.Region.Environment.Interfaces | 28 | namespace OpenSim.Region.Environment.Interfaces |
29 | { | 29 | { |
30 | |||
31 | |||
32 | public interface ICommander | 30 | public interface ICommander |
33 | { | 31 | { |
34 | void ProcessConsoleCommand(string function, string[] args); | 32 | void ProcessConsoleCommand(string function, string[] args); |
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs index ad5983c..4e716a2 100644 --- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
47 | /// <param name="obj"></param> | 47 | /// <param name="obj"></param> |
48 | /// <param name="regionUUID"></param> | 48 | /// <param name="regionUUID"></param> |
49 | void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); | 49 | void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Entirely removes the object, including inventory | 52 | /// Entirely removes the object, including inventory |
53 | /// </summary> | 53 | /// </summary> |
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
55 | /// <param name="regionUUID"></param> | 55 | /// <param name="regionUUID"></param> |
56 | /// <returns></returns> | 56 | /// <returns></returns> |
57 | void RemoveObject(LLUUID uuid, LLUUID regionUUID); | 57 | void RemoveObject(LLUUID uuid, LLUUID regionUUID); |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Store a prim's inventory | 60 | /// Store a prim's inventory |
61 | /// </summary> | 61 | /// </summary> |
diff --git a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs index aa34c45..4bcb14b 100644 --- a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
38 | /// </summary> | 38 | /// </summary> |
39 | /// <returns></returns> | 39 | /// <returns></returns> |
40 | float[] GetFloatsSerialised(); | 40 | float[] GetFloatsSerialised(); |
41 | 41 | ||
42 | double[,] GetDoubles(); | 42 | double[,] GetDoubles(); |
43 | bool Tainted(int x, int y); | 43 | bool Tainted(int x, int y); |
44 | ITerrainChannel MakeCopy(); | 44 | ITerrainChannel MakeCopy(); |
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index 3f8b9ff..09f2dda 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs | |||
@@ -320,7 +320,7 @@ namespace OpenSim.Region.Environment | |||
320 | public void UnloadModule(IRegionModule rm) | 320 | public void UnloadModule(IRegionModule rm) |
321 | { | 321 | { |
322 | rm.Close(); | 322 | rm.Close(); |
323 | 323 | ||
324 | m_loadedModules.Remove(rm); | 324 | m_loadedModules.Remove(rm); |
325 | } | 325 | } |
326 | } | 326 | } |
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index 10ef766..e6ee75f 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
46 | { | 46 | { |
47 | private static readonly ILog m_log | 47 | private static readonly ILog m_log |
48 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// True if the service has been closed, probably because a user with texture requests still queued | 51 | /// True if the service has been closed, probably because a user with texture requests still queued |
52 | /// logged out. | 52 | /// logged out. |
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
175 | public void TextureCallback(LLUUID textureID, AssetBase texture) | 175 | public void TextureCallback(LLUUID textureID, AssetBase texture) |
176 | { | 176 | { |
177 | //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); | 177 | //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); |
178 | 178 | ||
179 | // There may still be texture requests pending for a logged out client | 179 | // There may still be texture requests pending for a logged out client |
180 | if (closed) | 180 | if (closed) |
181 | return; | 181 | return; |
@@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
247 | internal void Close() | 247 | internal void Close() |
248 | { | 248 | { |
249 | closed = true; | 249 | closed = true; |
250 | 250 | ||
251 | lock (m_textureSenders) | 251 | lock (m_textureSenders) |
252 | { | 252 | { |
253 | foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) | 253 | foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) |
@@ -257,7 +257,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
257 | 257 | ||
258 | m_textureSenders.Clear(); | 258 | m_textureSenders.Clear(); |
259 | } | 259 | } |
260 | 260 | ||
261 | // XXX: It might be possible to also remove pending texture requests from the asset cache queues, | 261 | // XXX: It might be possible to also remove pending texture requests from the asset cache queues, |
262 | // though this might also be more trouble than it's worth. | 262 | // though this might also be more trouble than it's worth. |
263 | } | 263 | } |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index c5a4a96..4a98622 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs | |||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
186 | client.OnTerminateFriendship += OnTerminateFriendship; | 186 | client.OnTerminateFriendship += OnTerminateFriendship; |
187 | 187 | ||
188 | doFriendListUpdateOnline(client.AgentId); | 188 | doFriendListUpdateOnline(client.AgentId); |
189 | 189 | ||
190 | } | 190 | } |
191 | 191 | ||
192 | private void doFriendListUpdateOnline(LLUUID AgentId) | 192 | private void doFriendListUpdateOnline(LLUUID AgentId) |
@@ -386,7 +386,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
386 | { | 386 | { |
387 | m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); | 387 | m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); |
388 | m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); | 388 | m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); |
389 | 389 | ||
390 | List<StoredFriendListUpdate> updateme = new List<StoredFriendListUpdate>(); | 390 | List<StoredFriendListUpdate> updateme = new List<StoredFriendListUpdate>(); |
391 | lock (StoredFriendListUpdates) | 391 | lock (StoredFriendListUpdates) |
392 | { | 392 | { |
@@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
546 | 546 | ||
547 | SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); | 547 | SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); |
548 | SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); | 548 | SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); |
549 | 549 | ||
550 | 550 | ||
551 | //LLUUID[] Agents = new LLUUID[1]; | 551 | //LLUUID[] Agents = new LLUUID[1]; |
552 | //Agents[0] = msg.toAgentID; | 552 | //Agents[0] = msg.toAgentID; |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs index a83730e..eaa5013 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
62 | scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; | 62 | scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; |
63 | lock (m_groupUUIDGroup) | 63 | lock (m_groupUUIDGroup) |
64 | { | 64 | { |
65 | 65 | ||
66 | GroupData OpenSimulatorGroup = new GroupData(); | 66 | GroupData OpenSimulatorGroup = new GroupData(); |
67 | OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; | 67 | OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; |
68 | OpenSimulatorGroup.GroupID = opensimulatorGroupID; | 68 | OpenSimulatorGroup.GroupID = opensimulatorGroupID; |
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
136 | } | 136 | } |
137 | 137 | ||
138 | } | 138 | } |
139 | 139 | ||
140 | lock (m_groupmap) | 140 | lock (m_groupmap) |
141 | { | 141 | { |
142 | if (!m_groupmap.ContainsKey(client.AgentId)) | 142 | if (!m_groupmap.ContainsKey(client.AgentId)) |
@@ -159,8 +159,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
159 | updateGroups[0] = OpenSimulatorGroup; | 159 | updateGroups[0] = OpenSimulatorGroup; |
160 | 160 | ||
161 | client.SendGroupMembership(updateGroups); | 161 | client.SendGroupMembership(updateGroups); |
162 | |||
163 | |||
164 | } | 162 | } |
165 | 163 | ||
166 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) | 164 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) |
@@ -275,6 +273,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups | |||
275 | GC.Collect(); | 273 | GC.Collect(); |
276 | } | 274 | } |
277 | } | 275 | } |
278 | 276 | } | |
279 | |||
280 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs index a3452ab..15ce584 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
208 | SceneObjectPart part = scene.GetSceneObjectPart(PrimID); | 208 | SceneObjectPart part = scene.GetSceneObjectPart(PrimID); |
209 | byte[] assetData; | 209 | byte[] assetData; |
210 | AssetBase oldAsset = null; | 210 | AssetBase oldAsset = null; |
211 | 211 | ||
212 | if (BlendWithOldTexture) | 212 | if (BlendWithOldTexture) |
213 | { | 213 | { |
214 | LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; | 214 | LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; |
@@ -228,7 +228,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
228 | assetData = new byte[data.Length]; | 228 | assetData = new byte[data.Length]; |
229 | Array.Copy(data, assetData, data.Length); | 229 | Array.Copy(data, assetData, data.Length); |
230 | } | 230 | } |
231 | 231 | ||
232 | // Create a new asset for user | 232 | // Create a new asset for user |
233 | AssetBase asset = new AssetBase(); | 233 | AssetBase asset = new AssetBase(); |
234 | asset.FullID = LLUUID.Random(); | 234 | asset.FullID = LLUUID.Random(); |
@@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
244 | 244 | ||
245 | // mostly keep the values from before | 245 | // mostly keep the values from before |
246 | LLObject.TextureEntry tmptex = part.Shape.Textures; | 246 | LLObject.TextureEntry tmptex = part.Shape.Textures; |
247 | 247 | ||
248 | // remove the old asset from the cache | 248 | // remove the old asset from the cache |
249 | LLUUID oldID = tmptex.DefaultTexture.TextureID; | 249 | LLUUID oldID = tmptex.DefaultTexture.TextureID; |
250 | scene.AssetCache.ExpireAsset(oldID); | 250 | scene.AssetCache.ExpireAsset(oldID); |
@@ -298,4 +298,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture | |||
298 | 298 | ||
299 | #endregion | 299 | #endregion |
300 | } | 300 | } |
301 | } \ No newline at end of file | 301 | } |
diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index 1162c25..bcf3e76 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs | |||
@@ -68,14 +68,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
68 | { | 68 | { |
69 | m_Config = config; | 69 | m_Config = config; |
70 | IConfig SMTPConfig; | 70 | IConfig SMTPConfig; |
71 | 71 | ||
72 | //FIXME: RegionName is correct?? | 72 | //FIXME: RegionName is correct?? |
73 | //m_RegionName = scene.RegionInfo.RegionName; | 73 | //m_RegionName = scene.RegionInfo.RegionName; |
74 | 74 | ||
75 | IConfig startupConfig = m_Config.Configs["Startup"]; | 75 | IConfig startupConfig = m_Config.Configs["Startup"]; |
76 | 76 | ||
77 | m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); | 77 | m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); |
78 | 78 | ||
79 | //Load SMTP SERVER config | 79 | //Load SMTP SERVER config |
80 | try | 80 | try |
81 | { | 81 | { |
@@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
85 | m_Enabled = false; | 85 | m_Enabled = false; |
86 | return; | 86 | return; |
87 | } | 87 | } |
88 | 88 | ||
89 | if (!SMTPConfig.GetBoolean("enabled", false)) | 89 | if (!SMTPConfig.GetBoolean("enabled", false)) |
90 | { | 90 | { |
91 | m_log.InfoFormat("[SMTP] module disabled in configuration"); | 91 | m_log.InfoFormat("[SMTP] module disabled in configuration"); |
92 | m_Enabled = false; | 92 | m_Enabled = false; |
93 | return; | 93 | return; |
94 | } | 94 | } |
95 | 95 | ||
96 | m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); | 96 | m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); |
97 | SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); | 97 | SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); |
98 | SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); | 98 | SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); |
99 | SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); | 99 | SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); |
100 | SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); | 100 | SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); |
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
124 | m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); | 124 | m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | m_log.Info("[EMAIL] Activated DefaultEmailModule"); | 128 | m_log.Info("[EMAIL] Activated DefaultEmailModule"); |
129 | } | 129 | } |
130 | } | 130 | } |
@@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
146 | { | 146 | { |
147 | get { return true; } | 147 | get { return true; } |
148 | } | 148 | } |
149 | 149 | ||
150 | /// <summary> | 150 | /// <summary> |
151 | /// | 151 | /// |
152 | /// </summary> | 152 | /// </summary> |
153 | /// <param name="seconds"></param> | 153 | /// <param name="seconds"></param> |
154 | private void DelayInSeconds(int seconds) | 154 | private void DelayInSeconds(int seconds) |
@@ -156,11 +156,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
156 | TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); | 156 | TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); |
157 | DateTime EndDelay = DateTime.Now.Add(DiffDelay); | 157 | DateTime EndDelay = DateTime.Now.Add(DiffDelay); |
158 | while (DateTime.Now < EndDelay) | 158 | while (DateTime.Now < EndDelay) |
159 | { | 159 | { |
160 | ;//Do nothing!! | 160 | ;//Do nothing!! |
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) | 164 | private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) |
165 | { | 165 | { |
166 | lock (m_Scenes) | 166 | lock (m_Scenes) |
@@ -187,7 +187,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
187 | { | 187 | { |
188 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); | 188 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); |
189 | ObjectName = part.Name; | 189 | ObjectName = part.Name; |
190 | ObjectRegionName = m_ObjectRegionName; | 190 | ObjectRegionName = m_ObjectRegionName; |
191 | return; | 191 | return; |
192 | } | 192 | } |
193 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); | 193 | ObjectAbsolutePosition = part.AbsolutePosition.ToString(); |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
195 | ObjectRegionName = m_ObjectRegionName; | 195 | ObjectRegionName = m_ObjectRegionName; |
196 | return; | 196 | return; |
197 | } | 197 | } |
198 | 198 | ||
199 | /// <summary> | 199 | /// <summary> |
200 | /// SendMail function utilized by llEMail | 200 | /// SendMail function utilized by llEMail |
201 | /// </summary> | 201 | /// </summary> |
@@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
206 | public void SendEmail(LLUUID objectID, string address, string subject, string body) | 206 | public void SendEmail(LLUUID objectID, string address, string subject, string body) |
207 | { | 207 | { |
208 | //Check if address is empty | 208 | //Check if address is empty |
209 | if (address == string.Empty) | 209 | if (address == string.Empty) |
210 | return; | 210 | return; |
211 | 211 | ||
212 | //FIXED:Check the email is correct form in REGEX | 212 | //FIXED:Check the email is correct form in REGEX |
213 | string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" | 213 | string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" |
214 | + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" | 214 | + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" |
215 | + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | 215 | + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" |
216 | + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" | 216 | + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" |
217 | + @"[a-zA-Z]{2,}))$"; | 217 | + @"[a-zA-Z]{2,}))$"; |
218 | Regex EMailreStrict = new Regex(EMailpatternStrict); | 218 | Regex EMailreStrict = new Regex(EMailpatternStrict); |
219 | bool isEMailStrictMatch = EMailreStrict.IsMatch(address); | 219 | bool isEMailStrictMatch = EMailreStrict.IsMatch(address); |
@@ -226,9 +226,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
226 | if ((subject.Length + body.Length) > 1024) | 226 | if ((subject.Length + body.Length) > 1024) |
227 | { | 227 | { |
228 | m_log.Error("[EMAIL] subject + body > 1024 Byte"); | 228 | m_log.Error("[EMAIL] subject + body > 1024 Byte"); |
229 | return; | 229 | return; |
230 | } | 230 | } |
231 | 231 | ||
232 | try | 232 | try |
233 | { | 233 | { |
234 | string LastObjectName = string.Empty; | 234 | string LastObjectName = string.Empty; |
@@ -242,21 +242,21 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
242 | //From | 242 | //From |
243 | emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); | 243 | emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); |
244 | //To - Only One | 244 | //To - Only One |
245 | emailMessage.AddToAddress(new EmailAddress(address)); | 245 | emailMessage.AddToAddress(new EmailAddress(address)); |
246 | //Subject | 246 | //Subject |
247 | emailMessage.Subject = subject; | 247 | emailMessage.Subject = subject; |
248 | //TEXT Body | 248 | //TEXT Body |
249 | resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); | 249 | resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); |
250 | emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + | 250 | emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + |
251 | "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + | 251 | "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + |
252 | LastObjectPosition+"\r\n\r\n\r\n" + body); | 252 | LastObjectPosition+"\r\n\r\n\r\n" + body); |
253 | //HTML Body | 253 | //HTML Body |
254 | emailMessage.HtmlPart = new HtmlAttachment("<html><body><p>" + | 254 | emailMessage.HtmlPart = new HtmlAttachment("<html><body><p>" + |
255 | "<BR>Object-Name: " + LastObjectName + | 255 | "<BR>Object-Name: " + LastObjectName + |
256 | "<BR>Region: " + LastObjectRegionName + | 256 | "<BR>Region: " + LastObjectRegionName + |
257 | "<BR>Local-Position: " + LastObjectPosition + "<BR><BR><BR>" | 257 | "<BR>Local-Position: " + LastObjectPosition + "<BR><BR><BR>" |
258 | +body+"\r\n</p></body><html>"); | 258 | +body+"\r\n</p></body><html>"); |
259 | 259 | ||
260 | //Set SMTP SERVER config | 260 | //Set SMTP SERVER config |
261 | SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); | 261 | SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); |
262 | //Authentication | 262 | //Authentication |
@@ -272,9 +272,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules | |||
272 | return; | 272 | return; |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | /// <summary> | 276 | /// <summary> |
277 | /// | 277 | /// |
278 | /// </summary> | 278 | /// </summary> |
279 | /// <param name="objectID"></param> | 279 | /// <param name="objectID"></param> |
280 | /// <param name="sender"></param> | 280 | /// <param name="sender"></param> |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index a5688ef..a76ff0d 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs | |||
@@ -39,33 +39,33 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
39 | /// The location of the archive control file | 39 | /// The location of the archive control file |
40 | /// </summary> | 40 | /// </summary> |
41 | public static readonly string CONTROL_FILE_PATH = "archive.xml"; | 41 | public static readonly string CONTROL_FILE_PATH = "archive.xml"; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Path for the assets held in an archive | 44 | /// Path for the assets held in an archive |
45 | /// </summary> | 45 | /// </summary> |
46 | public static readonly string ASSETS_PATH = "assets/"; | 46 | public static readonly string ASSETS_PATH = "assets/"; |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Path for the assets metadata file | 49 | /// Path for the assets metadata file |
50 | /// </summary> | 50 | /// </summary> |
51 | //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; | 51 | //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Path for the prims file | 54 | /// Path for the prims file |
55 | /// </summary> | 55 | /// </summary> |
56 | public static readonly string OBJECTS_PATH = "objects/"; | 56 | public static readonly string OBJECTS_PATH = "objects/"; |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. | 59 | /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. |
60 | /// </summary> | 60 | /// </summary> |
61 | public static readonly string TERRAINS_PATH = "terrains/"; | 61 | public static readonly string TERRAINS_PATH = "terrains/"; |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Extensions used for asset types in the archive | 64 | /// Extensions used for asset types in the archive |
65 | /// </summary> | 65 | /// </summary> |
66 | public static readonly IDictionary<sbyte, string> ASSET_TYPE_TO_EXTENSION = new Dictionary<sbyte, string>(); | 66 | public static readonly IDictionary<sbyte, string> ASSET_TYPE_TO_EXTENSION = new Dictionary<sbyte, string>(); |
67 | public static readonly IDictionary<string, sbyte> EXTENSION_TO_ASSET_TYPE = new Dictionary<string, sbyte>(); | 67 | public static readonly IDictionary<string, sbyte> EXTENSION_TO_ASSET_TYPE = new Dictionary<string, sbyte>(); |
68 | 68 | ||
69 | static ArchiveConstants() | 69 | static ArchiveConstants() |
70 | { | 70 | { |
71 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh"; | 71 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh"; |
@@ -79,11 +79,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
79 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this | 79 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this |
80 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso"; | 80 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso"; |
81 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl"; | 81 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl"; |
82 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; | 82 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; |
83 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml"; | 83 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml"; |
84 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this | 84 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this |
85 | // disable warning: we know Script is obsolete, but need to support it | 85 | // disable warning: we know Script is obsolete, but need to support it |
86 | // anyhow | 86 | // anyhow |
87 | #pragma warning disable 0612 | 87 | #pragma warning disable 0612 |
88 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this | 88 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this |
89 | #pragma warning restore 0612 | 89 | #pragma warning restore 0612 |
@@ -93,8 +93,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
93 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav"; | 93 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav"; |
94 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2"; | 94 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2"; |
95 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga"; | 95 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga"; |
96 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this | 96 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this |
97 | 97 | ||
98 | EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation; | 98 | EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation; |
99 | EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart; | 99 | EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart; |
100 | EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard; | 100 | EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard; |
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
110 | EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object; | 110 | EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object; |
111 | EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder; | 111 | EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder; |
112 | // disable warning: we know Script is obsolete, but need to support it | 112 | // disable warning: we know Script is obsolete, but need to support it |
113 | // anyhow | 113 | // anyhow |
114 | #pragma warning disable 0612 | 114 | #pragma warning disable 0612 |
115 | EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script; | 115 | EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script; |
116 | #pragma warning restore 0612 | 116 | #pragma warning restore 0612 |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 1340f8b..87106fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
53 | 53 | ||
54 | private Scene m_scene; | 54 | private Scene m_scene; |
55 | private string m_loadPath; | 55 | private string m_loadPath; |
56 | 56 | ||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Used to cache lookups for valid uuids. | 58 | /// Used to cache lookups for valid uuids. |
59 | /// </summary> | 59 | /// </summary> |
@@ -68,15 +68,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
68 | } | 68 | } |
69 | 69 | ||
70 | private void DearchiveRegion() | 70 | private void DearchiveRegion() |
71 | { | 71 | { |
72 | TarArchiveReader archive | 72 | TarArchiveReader archive |
73 | = new TarArchiveReader( | 73 | = new TarArchiveReader( |
74 | new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); | 74 | new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); |
75 | //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); | 75 | //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); |
76 | 76 | ||
77 | List<string> serialisedSceneObjects = new List<string>(); | 77 | List<string> serialisedSceneObjects = new List<string>(); |
78 | string filePath = "ERROR"; | 78 | string filePath = "ERROR"; |
79 | 79 | ||
80 | int successfulAssetRestores = 0; | 80 | int successfulAssetRestores = 0; |
81 | int failedAssetRestores = 0; | 81 | int failedAssetRestores = 0; |
82 | 82 | ||
@@ -111,30 +111,30 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
111 | //m_log.Debug("[ARCHIVER]: Reached end of archive"); | 111 | //m_log.Debug("[ARCHIVER]: Reached end of archive"); |
112 | 112 | ||
113 | archive.Close(); | 113 | archive.Close(); |
114 | 114 | ||
115 | m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores); | 115 | m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores); |
116 | 116 | ||
117 | if (failedAssetRestores > 0) | 117 | if (failedAssetRestores > 0) |
118 | m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); | 118 | m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); |
119 | 119 | ||
120 | m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); | 120 | m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); |
121 | m_scene.DeleteAllSceneObjects(); | 121 | m_scene.DeleteAllSceneObjects(); |
122 | 122 | ||
123 | // Reload serialized prims | 123 | // Reload serialized prims |
124 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); | 124 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); |
125 | 125 | ||
126 | IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); | 126 | IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); |
127 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 127 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
128 | 128 | ||
129 | foreach (string serialisedSceneObject in serialisedSceneObjects) | 129 | foreach (string serialisedSceneObject in serialisedSceneObjects) |
130 | { | 130 | { |
131 | SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); | 131 | SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); |
132 | 132 | ||
133 | // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned | 133 | // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned |
134 | // on the same region server and multiple examples a single object archive to be imported | 134 | // on the same region server and multiple examples a single object archive to be imported |
135 | // to the same scene (when this is possible). | 135 | // to the same scene (when this is possible). |
136 | sceneObject.ResetIDs(); | 136 | sceneObject.ResetIDs(); |
137 | 137 | ||
138 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | 138 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid |
139 | // otherwise, use the master avatar uuid instead | 139 | // otherwise, use the master avatar uuid instead |
140 | LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 140 | LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
@@ -144,41 +144,41 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
144 | { | 144 | { |
145 | if (!resolveUserUuid(part.CreatorID)) | 145 | if (!resolveUserUuid(part.CreatorID)) |
146 | part.CreatorID = masterAvatarId; | 146 | part.CreatorID = masterAvatarId; |
147 | 147 | ||
148 | if (!resolveUserUuid(part.OwnerID)) | 148 | if (!resolveUserUuid(part.OwnerID)) |
149 | part.OwnerID = masterAvatarId; | 149 | part.OwnerID = masterAvatarId; |
150 | 150 | ||
151 | if (!resolveUserUuid(part.LastOwnerID)) | 151 | if (!resolveUserUuid(part.LastOwnerID)) |
152 | part.LastOwnerID = masterAvatarId; | 152 | part.LastOwnerID = masterAvatarId; |
153 | 153 | ||
154 | // And zap any troublesome sit target information | 154 | // And zap any troublesome sit target information |
155 | part.SitTargetOrientation = new Quaternion(0,0,0,1); | 155 | part.SitTargetOrientation = new Quaternion(0,0,0,1); |
156 | part.SitTargetPosition = new Vector3(0,0,0); | 156 | part.SitTargetPosition = new Vector3(0,0,0); |
157 | } | 157 | } |
158 | 158 | ||
159 | if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) | 159 | if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) |
160 | { | 160 | { |
161 | sceneObjects.Add(sceneObject); | 161 | sceneObjects.Add(sceneObject); |
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); | 165 | m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); |
166 | 166 | ||
167 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; | 167 | int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; |
168 | 168 | ||
169 | if (ignoredObjects > 0) | 169 | if (ignoredObjects > 0) |
170 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); | 170 | m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); |
171 | 171 | ||
172 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); | 172 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); |
173 | 173 | ||
174 | m_log.Debug("[ARCHIVER]: Starting scripts"); | 174 | m_log.Debug("[ARCHIVER]: Starting scripts"); |
175 | 175 | ||
176 | foreach (SceneObjectGroup sceneObject in sceneObjects) | 176 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
177 | { | 177 | { |
178 | sceneObject.CreateScriptInstances(0, true); | 178 | sceneObject.CreateScriptInstances(0, true); |
179 | } | 179 | } |
180 | } | 180 | } |
181 | 181 | ||
182 | /// <summary> | 182 | /// <summary> |
183 | /// Look up the given user id to check whether it's one that is valid for this grid. | 183 | /// Look up the given user id to check whether it's one that is valid for this grid. |
184 | /// </summary> | 184 | /// </summary> |
@@ -194,13 +194,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
194 | else | 194 | else |
195 | m_validUserUuids.Add(uuid, false); | 195 | m_validUserUuids.Add(uuid, false); |
196 | } | 196 | } |
197 | 197 | ||
198 | if (m_validUserUuids[uuid]) | 198 | if (m_validUserUuids[uuid]) |
199 | return true; | 199 | return true; |
200 | else | 200 | else |
201 | return false; | 201 | return false; |
202 | } | 202 | } |
203 | 203 | ||
204 | /// <summary> | 204 | /// <summary> |
205 | /// Load an asset | 205 | /// Load an asset |
206 | /// </summary> | 206 | /// </summary> |
@@ -212,20 +212,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
212 | // Right now we're nastily obtaining the lluuid from the filename | 212 | // Right now we're nastily obtaining the lluuid from the filename |
213 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); | 213 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); |
214 | string extension = filename.Substring(filename.LastIndexOf("_")); | 214 | string extension = filename.Substring(filename.LastIndexOf("_")); |
215 | string uuid = filename.Remove(filename.Length - extension.Length); | 215 | string uuid = filename.Remove(filename.Length - extension.Length); |
216 | 216 | ||
217 | if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) | 217 | if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) |
218 | { | 218 | { |
219 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | 219 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; |
220 | 220 | ||
221 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 221 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
222 | 222 | ||
223 | AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); | 223 | AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); |
224 | asset.Type = assetType; | 224 | asset.Type = assetType; |
225 | asset.Data = data; | 225 | asset.Data = data; |
226 | 226 | ||
227 | m_scene.AssetCache.AddAsset(asset); | 227 | m_scene.AssetCache.AddAsset(asset); |
228 | 228 | ||
229 | return true; | 229 | return true; |
230 | } | 230 | } |
231 | else | 231 | else |
@@ -233,11 +233,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
233 | m_log.ErrorFormat( | 233 | m_log.ErrorFormat( |
234 | "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}", | 234 | "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}", |
235 | assetPath, extension); | 235 | assetPath, extension); |
236 | 236 | ||
237 | return false; | 237 | return false; |
238 | } | 238 | } |
239 | } | 239 | } |
240 | 240 | ||
241 | /// <summary> | 241 | /// <summary> |
242 | /// Load terrain data | 242 | /// Load terrain data |
243 | /// </summary> | 243 | /// </summary> |
@@ -249,13 +249,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
249 | private bool LoadTerrain(string terrainPath, byte[] data) | 249 | private bool LoadTerrain(string terrainPath, byte[] data) |
250 | { | 250 | { |
251 | ITerrainModule terrainModule = m_scene.RequestModuleInterface<ITerrainModule>(); | 251 | ITerrainModule terrainModule = m_scene.RequestModuleInterface<ITerrainModule>(); |
252 | 252 | ||
253 | MemoryStream ms = new MemoryStream(data); | 253 | MemoryStream ms = new MemoryStream(data); |
254 | terrainModule.LoadFromStream(terrainPath, ms); | 254 | terrainModule.LoadFromStream(terrainPath, ms); |
255 | ms.Close(); | 255 | ms.Close(); |
256 | 256 | ||
257 | m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); | 257 | m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); |
258 | 258 | ||
259 | return true; | 259 | return true; |
260 | } | 260 | } |
261 | } | 261 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index 0341a70..26d4797 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -61,8 +61,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
61 | 61 | ||
62 | public ArchiveWriteRequestExecution( | 62 | public ArchiveWriteRequestExecution( |
63 | List<SceneObjectGroup> sceneObjects, | 63 | List<SceneObjectGroup> sceneObjects, |
64 | ITerrainModule terrainModule, | 64 | ITerrainModule terrainModule, |
65 | IRegionSerialiser serialiser, | 65 | IRegionSerialiser serialiser, |
66 | string sceneName, | 66 | string sceneName, |
67 | string savePath) | 67 | string savePath) |
68 | { | 68 | { |
@@ -79,37 +79,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
79 | { | 79 | { |
80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); | 80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); |
81 | } | 81 | } |
82 | 82 | ||
83 | m_log.InfoFormat( | 83 | m_log.InfoFormat( |
84 | "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); | 84 | "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); |
85 | 85 | ||
86 | TarArchiveWriter archive = new TarArchiveWriter(); | 86 | TarArchiveWriter archive = new TarArchiveWriter(); |
87 | 87 | ||
88 | // Write out control file | 88 | // Write out control file |
89 | archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); | 89 | archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); |
90 | 90 | ||
91 | // Write out terrain | 91 | // Write out terrain |
92 | string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); | 92 | string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); |
93 | MemoryStream ms = new MemoryStream(); | 93 | MemoryStream ms = new MemoryStream(); |
94 | m_terrainModule.SaveToStream(terrainPath, ms); | 94 | m_terrainModule.SaveToStream(terrainPath, ms); |
95 | archive.AddFile(terrainPath, ms.ToArray()); | 95 | archive.AddFile(terrainPath, ms.ToArray()); |
96 | ms.Close(); | 96 | ms.Close(); |
97 | 97 | ||
98 | // Write out scene object metadata | 98 | // Write out scene object metadata |
99 | foreach (SceneObjectGroup sceneObject in m_sceneObjects) | 99 | foreach (SceneObjectGroup sceneObject in m_sceneObjects) |
100 | { | 100 | { |
101 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); | 101 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); |
102 | 102 | ||
103 | LLVector3 position = sceneObject.AbsolutePosition; | 103 | LLVector3 position = sceneObject.AbsolutePosition; |
104 | 104 | ||
105 | string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); | 105 | string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); |
106 | string filename | 106 | string filename |
107 | = string.Format( | 107 | = string.Format( |
108 | "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", | 108 | "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", |
109 | ArchiveConstants.OBJECTS_PATH, sceneObject.Name, | 109 | ArchiveConstants.OBJECTS_PATH, sceneObject.Name, |
110 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), | 110 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), |
111 | sceneObject.UUID); | 111 | sceneObject.UUID); |
112 | 112 | ||
113 | archive.AddFile(filename, serializedObject); | 113 | archive.AddFile(filename, serializedObject); |
114 | } | 114 | } |
115 | 115 | ||
@@ -120,8 +120,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
120 | archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); | 120 | archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); |
121 | 121 | ||
122 | m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); | 122 | m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); |
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// Create the control file for this archive | 126 | /// Create the control file for this archive |
127 | /// </summary> | 127 | /// </summary> |
@@ -136,13 +136,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
136 | xtw.WriteAttributeString("major_version", "0"); | 136 | xtw.WriteAttributeString("major_version", "0"); |
137 | xtw.WriteAttributeString("minor_version", "1"); | 137 | xtw.WriteAttributeString("minor_version", "1"); |
138 | xtw.WriteEndElement(); | 138 | xtw.WriteEndElement(); |
139 | 139 | ||
140 | xtw.Flush(); | 140 | xtw.Flush(); |
141 | xtw.Close(); | 141 | xtw.Close(); |
142 | 142 | ||
143 | String s = sw.ToString(); | 143 | String s = sw.ToString(); |
144 | sw.Close(); | 144 | sw.Close(); |
145 | 145 | ||
146 | return s; | 146 | return s; |
147 | } | 147 | } |
148 | } | 148 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index 327808a..20e15ab 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -52,14 +52,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
52 | 52 | ||
53 | protected Scene m_scene; | 53 | protected Scene m_scene; |
54 | protected string m_savePath; | 54 | protected string m_savePath; |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// Used for identifying uuids embedded in scripts | 57 | /// Used for identifying uuids embedded in scripts |
58 | /// </summary> | 58 | /// </summary> |
59 | protected static readonly Regex m_uuidRegex | 59 | protected static readonly Regex m_uuidRegex |
60 | = new Regex( | 60 | = new Regex( |
61 | "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", | 61 | "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", |
62 | RegexOptions.Compiled); | 62 | RegexOptions.Compiled); |
63 | 63 | ||
64 | /// <summary> | 64 | /// <summary> |
65 | /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate | 65 | /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate |
@@ -93,9 +93,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
93 | Monitor.Pulse(this); | 93 | Monitor.Pulse(this); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | /// <summary> | 97 | /// <summary> |
98 | /// Get an asset synchronously, potentially using an asynchronous callback. If the | 98 | /// Get an asset synchronously, potentially using an asynchronous callback. If the |
99 | /// asynchronous callback is used, we will wait for it to complete. | 99 | /// asynchronous callback is used, we will wait for it to complete. |
100 | /// </summary> | 100 | /// </summary> |
101 | /// <param name="uuid"></param> | 101 | /// <param name="uuid"></param> |
@@ -118,11 +118,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
118 | Monitor.Wait(this); | 118 | Monitor.Wait(this); |
119 | m_waitingForObjectAsset = false; | 119 | m_waitingForObjectAsset = false; |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | return m_requestedObjectAsset; | 123 | return m_requestedObjectAsset; |
124 | } | 124 | } |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Record the asset uuids embedded within the given script. | 127 | /// Record the asset uuids embedded within the given script. |
128 | /// </summary> | 128 | /// </summary> |
@@ -138,16 +138,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
138 | //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); | 138 | //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); |
139 | MatchCollection uuidMatches = m_uuidRegex.Matches(script); | 139 | MatchCollection uuidMatches = m_uuidRegex.Matches(script); |
140 | //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); | 140 | //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); |
141 | 141 | ||
142 | foreach (Match uuidMatch in uuidMatches) | 142 | foreach (Match uuidMatch in uuidMatches) |
143 | { | 143 | { |
144 | LLUUID uuid = new LLUUID(uuidMatch.Value); | 144 | LLUUID uuid = new LLUUID(uuidMatch.Value); |
145 | //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); | 145 | //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); |
146 | assetUuids[uuid] = 1; | 146 | assetUuids[uuid] = 1; |
147 | } | 147 | } |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | /// <summary> | 151 | /// <summary> |
152 | /// Record the uuids referenced by the given wearable asset | 152 | /// Record the uuids referenced by the given wearable asset |
153 | /// </summary> | 153 | /// </summary> |
@@ -159,25 +159,25 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
159 | //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); | 159 | //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); |
160 | AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); | 160 | AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); |
161 | wearableAsset.Decode(); | 161 | wearableAsset.Decode(); |
162 | 162 | ||
163 | //m_log.DebugFormat( | 163 | //m_log.DebugFormat( |
164 | // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); | 164 | // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); |
165 | 165 | ||
166 | foreach (LLUUID uuid in wearableAsset.Textures.Values) | 166 | foreach (LLUUID uuid in wearableAsset.Textures.Values) |
167 | { | 167 | { |
168 | //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); | 168 | //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); |
169 | assetUuids[uuid] = 1; | 169 | assetUuids[uuid] = 1; |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
173 | /// <summary> | 173 | /// <summary> |
174 | /// Get all the asset uuids associated with a given object. This includes both those directly associated with | 174 | /// Get all the asset uuids associated with a given object. This includes both those directly associated with |
175 | /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained | 175 | /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained |
176 | /// within this object). | 176 | /// within this object). |
177 | /// </summary> | 177 | /// </summary> |
178 | /// <param name="sceneObject"></param> | 178 | /// <param name="sceneObject"></param> |
179 | /// <param name="assetUuids"></param> | 179 | /// <param name="assetUuids"></param> |
180 | protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids) | 180 | protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids) |
181 | { | 181 | { |
182 | AssetBase objectAsset = GetAsset(sceneObjectUuid); | 182 | AssetBase objectAsset = GetAsset(sceneObjectUuid); |
183 | 183 | ||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
186 | string xml = Helpers.FieldToUTF8String(objectAsset.Data); | 186 | string xml = Helpers.FieldToUTF8String(objectAsset.Data); |
187 | SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); | 187 | SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); |
188 | GetSceneObjectAssetUuids(sog, assetUuids); | 188 | GetSceneObjectAssetUuids(sog, assetUuids); |
189 | } | 189 | } |
190 | } | 190 | } |
191 | 191 | ||
192 | /// <summary> | 192 | /// <summary> |
@@ -209,10 +209,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
209 | try | 209 | try |
210 | { | 210 | { |
211 | LLObject.TextureEntry textureEntry = part.Shape.Textures; | 211 | LLObject.TextureEntry textureEntry = part.Shape.Textures; |
212 | 212 | ||
213 | // Get the prim's default texture. This will be used for faces which don't have their own texture | 213 | // Get the prim's default texture. This will be used for faces which don't have their own texture |
214 | assetUuids[textureEntry.DefaultTexture.TextureID] = 1; | 214 | assetUuids[textureEntry.DefaultTexture.TextureID] = 1; |
215 | 215 | ||
216 | // XXX: Not a great way to iterate through face textures, but there's no | 216 | // XXX: Not a great way to iterate through face textures, but there's no |
217 | // other method available to tell how many faces there actually are | 217 | // other method available to tell how many faces there actually are |
218 | //int i = 0; | 218 | //int i = 0; |
@@ -224,15 +224,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
224 | assetUuids[texture.TextureID] = 1; | 224 | assetUuids[texture.TextureID] = 1; |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | foreach (TaskInventoryItem tii in part.TaskInventory.Values) | 228 | foreach (TaskInventoryItem tii in part.TaskInventory.Values) |
229 | { | 229 | { |
230 | //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); | 230 | //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); |
231 | 231 | ||
232 | if (!assetUuids.ContainsKey(tii.AssetID)) | 232 | if (!assetUuids.ContainsKey(tii.AssetID)) |
233 | { | 233 | { |
234 | assetUuids[tii.AssetID] = 1; | 234 | assetUuids[tii.AssetID] = 1; |
235 | 235 | ||
236 | if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) | 236 | if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) |
237 | { | 237 | { |
238 | GetWearableAssetUuids(tii.AssetID, assetUuids); | 238 | GetWearableAssetUuids(tii.AssetID, assetUuids); |
@@ -275,20 +275,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
275 | if (entity is SceneObjectGroup) | 275 | if (entity is SceneObjectGroup) |
276 | sceneObjects.Add((SceneObjectGroup)entity); | 276 | sceneObjects.Add((SceneObjectGroup)entity); |
277 | } | 277 | } |
278 | 278 | ||
279 | foreach (SceneObjectGroup sceneObject in sceneObjects) | 279 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
280 | { | 280 | { |
281 | GetSceneObjectAssetUuids(sceneObject, assetUuids); | 281 | GetSceneObjectAssetUuids(sceneObject, assetUuids); |
282 | } | 282 | } |
283 | 283 | ||
284 | m_log.DebugFormat( | 284 | m_log.DebugFormat( |
285 | "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", | 285 | "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", |
286 | sceneObjects.Count, assetUuids.Count); | 286 | sceneObjects.Count, assetUuids.Count); |
287 | 287 | ||
288 | // Asynchronously request all the assets required to perform this archive operation | 288 | // Asynchronously request all the assets required to perform this archive operation |
289 | ArchiveWriteRequestExecution awre | 289 | ArchiveWriteRequestExecution awre |
290 | = new ArchiveWriteRequestExecution( | 290 | = new ArchiveWriteRequestExecution( |
291 | sceneObjects, | 291 | sceneObjects, |
292 | m_scene.RequestModuleInterface<ITerrainModule>(), | 292 | m_scene.RequestModuleInterface<ITerrainModule>(), |
293 | m_scene.RequestModuleInterface<IRegionSerialiser>(), | 293 | m_scene.RequestModuleInterface<IRegionSerialiser>(), |
294 | m_scene.RegionInfo.RegionName, | 294 | m_scene.RegionInfo.RegionName, |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 2704224..708bed3 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs | |||
@@ -41,17 +41,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
41 | public class AssetsArchiver | 41 | public class AssetsArchiver |
42 | { | 42 | { |
43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Archive assets | 46 | /// Archive assets |
47 | /// </summary> | 47 | /// </summary> |
48 | protected IDictionary<LLUUID, AssetBase> m_assets; | 48 | protected IDictionary<LLUUID, AssetBase> m_assets; |
49 | 49 | ||
50 | public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets) | 50 | public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets) |
51 | { | 51 | { |
52 | m_assets = assets; | 52 | m_assets = assets; |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Archive the assets given to this archiver to the given archive. | 56 | /// Archive the assets given to this archiver to the given archive. |
57 | /// </summary> | 57 | /// </summary> |
@@ -70,44 +70,44 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
70 | { | 70 | { |
71 | StringWriter sw = new StringWriter(); | 71 | StringWriter sw = new StringWriter(); |
72 | XmlTextWriter xtw = new XmlTextWriter(sw); | 72 | XmlTextWriter xtw = new XmlTextWriter(sw); |
73 | 73 | ||
74 | xtw.Formatting = Formatting.Indented; | 74 | xtw.Formatting = Formatting.Indented; |
75 | xtw.WriteStartDocument(); | 75 | xtw.WriteStartDocument(); |
76 | 76 | ||
77 | xtw.WriteStartElement("assets"); | 77 | xtw.WriteStartElement("assets"); |
78 | 78 | ||
79 | foreach (LLUUID uuid in m_assets.Keys) | 79 | foreach (LLUUID uuid in m_assets.Keys) |
80 | { | 80 | { |
81 | AssetBase asset = m_assets[uuid]; | 81 | AssetBase asset = m_assets[uuid]; |
82 | 82 | ||
83 | if (asset != null) | 83 | if (asset != null) |
84 | { | 84 | { |
85 | xtw.WriteStartElement("asset"); | 85 | xtw.WriteStartElement("asset"); |
86 | 86 | ||
87 | string extension = string.Empty; | 87 | string extension = string.Empty; |
88 | 88 | ||
89 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) | 89 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
90 | { | 90 | { |
91 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; | 91 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
92 | } | 92 | } |
93 | 93 | ||
94 | xtw.WriteElementString("filename", uuid.ToString() + extension); | 94 | xtw.WriteElementString("filename", uuid.ToString() + extension); |
95 | 95 | ||
96 | xtw.WriteElementString("name", asset.Name); | 96 | xtw.WriteElementString("name", asset.Name); |
97 | xtw.WriteElementString("description", asset.Description); | 97 | xtw.WriteElementString("description", asset.Description); |
98 | xtw.WriteElementString("asset-type", asset.Type.ToString()); | 98 | xtw.WriteElementString("asset-type", asset.Type.ToString()); |
99 | 99 | ||
100 | xtw.WriteEndElement(); | 100 | xtw.WriteEndElement(); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | xtw.WriteEndElement(); | 104 | xtw.WriteEndElement(); |
105 | 105 | ||
106 | xtw.WriteEndDocument(); | 106 | xtw.WriteEndDocument(); |
107 | 107 | ||
108 | archive.AddFile("assets.xml", sw.ToString()); | 108 | archive.AddFile("assets.xml", sw.ToString()); |
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// Write asset data files to the given archive | 112 | /// Write asset data files to the given archive |
113 | /// </summary> | 113 | /// </summary> |
@@ -116,18 +116,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
116 | { | 116 | { |
117 | // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar | 117 | // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar |
118 | //archive.AddDir("assets"); | 118 | //archive.AddDir("assets"); |
119 | 119 | ||
120 | foreach (LLUUID uuid in m_assets.Keys) | 120 | foreach (LLUUID uuid in m_assets.Keys) |
121 | { | 121 | { |
122 | AssetBase asset = m_assets[uuid]; | 122 | AssetBase asset = m_assets[uuid]; |
123 | 123 | ||
124 | string extension = string.Empty; | 124 | string extension = string.Empty; |
125 | 125 | ||
126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) | 126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
127 | { | 127 | { |
128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; | 128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
129 | } | 129 | } |
130 | 130 | ||
131 | archive.AddFile( | 131 | archive.AddFile( |
132 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, | 132 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, |
133 | asset.Data); | 133 | asset.Data); |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs index 284a39e..17abb24 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs | |||
@@ -43,9 +43,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
43 | public class AssetsDearchiver | 43 | public class AssetsDearchiver |
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); | 47 | protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Store for asset data we received before we get the metadata | 50 | /// Store for asset data we received before we get the metadata |
51 | /// </summary> | 51 | /// </summary> |
@@ -55,17 +55,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
55 | /// Asset metadata. Is null if asset metadata isn't yet available. | 55 | /// Asset metadata. Is null if asset metadata isn't yet available. |
56 | /// </summary> | 56 | /// </summary> |
57 | protected Dictionary<string, AssetMetadata> m_metadata; | 57 | protected Dictionary<string, AssetMetadata> m_metadata; |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Cache to which dearchived assets will be added | 60 | /// Cache to which dearchived assets will be added |
61 | /// </summary> | 61 | /// </summary> |
62 | protected AssetCache m_cache; | 62 | protected AssetCache m_cache; |
63 | 63 | ||
64 | public AssetsDearchiver(AssetCache cache) | 64 | public AssetsDearchiver(AssetCache cache) |
65 | { | 65 | { |
66 | m_cache = cache; | 66 | m_cache = cache; |
67 | } | 67 | } |
68 | 68 | ||
69 | /// <summary> | 69 | /// <summary> |
70 | /// Add asset data to the dearchiver | 70 | /// Add asset data to the dearchiver |
71 | /// </summary> | 71 | /// </summary> |
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
82 | ResolveAssetData(assetFilename, data); | 82 | ResolveAssetData(assetFilename, data); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// Add asset metadata xml | 87 | /// Add asset metadata xml |
88 | /// </summary> | 88 | /// </summary> |
@@ -90,39 +90,39 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
90 | public void AddAssetMetadata(string xml) | 90 | public void AddAssetMetadata(string xml) |
91 | { | 91 | { |
92 | m_metadata = new Dictionary<string, AssetMetadata>(); | 92 | m_metadata = new Dictionary<string, AssetMetadata>(); |
93 | 93 | ||
94 | StringReader sr = new StringReader(xml); | 94 | StringReader sr = new StringReader(xml); |
95 | XmlTextReader reader = new XmlTextReader(sr); | 95 | XmlTextReader reader = new XmlTextReader(sr); |
96 | 96 | ||
97 | reader.ReadStartElement("assets"); | 97 | reader.ReadStartElement("assets"); |
98 | reader.Read(); | 98 | reader.Read(); |
99 | 99 | ||
100 | while (reader.Name.Equals("asset")) | 100 | while (reader.Name.Equals("asset")) |
101 | { | 101 | { |
102 | reader.Read(); | 102 | reader.Read(); |
103 | 103 | ||
104 | AssetMetadata metadata = new AssetMetadata(); | 104 | AssetMetadata metadata = new AssetMetadata(); |
105 | 105 | ||
106 | string filename = reader.ReadElementString("filename"); | 106 | string filename = reader.ReadElementString("filename"); |
107 | m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename); | 107 | m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename); |
108 | 108 | ||
109 | metadata.Name = reader.ReadElementString("name"); | 109 | metadata.Name = reader.ReadElementString("name"); |
110 | metadata.Description = reader.ReadElementString("description"); | 110 | metadata.Description = reader.ReadElementString("description"); |
111 | metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type")); | 111 | metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type")); |
112 | 112 | ||
113 | m_metadata[filename] = metadata; | 113 | m_metadata[filename] = metadata; |
114 | 114 | ||
115 | // Read asset end tag | 115 | // Read asset end tag |
116 | reader.ReadEndElement(); | 116 | reader.ReadEndElement(); |
117 | 117 | ||
118 | reader.Read(); | 118 | reader.Read(); |
119 | } | 119 | } |
120 | 120 | ||
121 | m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count); | 121 | m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count); |
122 | 122 | ||
123 | ResolvePendingAssetData(); | 123 | ResolvePendingAssetData(); |
124 | } | 124 | } |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Resolve asset data that we collected before receiving the metadata | 127 | /// Resolve asset data that we collected before receiving the metadata |
128 | /// </summary> | 128 | /// </summary> |
@@ -133,7 +133,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
133 | ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]); | 133 | ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]); |
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | /// <summary> | 137 | /// <summary> |
138 | /// Resolve a new piece of asset data against stored metadata | 138 | /// Resolve a new piece of asset data against stored metadata |
139 | /// </summary> | 139 | /// </summary> |
@@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
143 | { | 143 | { |
144 | // Right now we're nastily obtaining the lluuid from the filename | 144 | // Right now we're nastily obtaining the lluuid from the filename |
145 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); | 145 | string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); |
146 | 146 | ||
147 | if (m_metadata.ContainsKey(filename)) | 147 | if (m_metadata.ContainsKey(filename)) |
148 | { | 148 | { |
149 | AssetMetadata metadata = m_metadata[filename]; | 149 | AssetMetadata metadata = m_metadata[filename]; |
150 | 150 | ||
151 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType)) | 151 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType)) |
152 | { | 152 | { |
153 | string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType]; | 153 | string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType]; |
@@ -166,11 +166,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
166 | else | 166 | else |
167 | { | 167 | { |
168 | m_log.ErrorFormat( | 168 | m_log.ErrorFormat( |
169 | "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", | 169 | "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", |
170 | assetPath); | 170 | assetPath); |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | /// <summary> | 174 | /// <summary> |
175 | /// Metadata for an asset | 175 | /// Metadata for an asset |
176 | /// </summary> | 176 | /// </summary> |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs index 6ffbcbb..2164f7e 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs | |||
@@ -43,12 +43,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
43 | class AssetsRequest | 43 | class AssetsRequest |
44 | { | 44 | { |
45 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// uuids to request | 48 | /// uuids to request |
49 | /// </summary> | 49 | /// </summary> |
50 | protected ICollection<LLUUID> m_uuids; | 50 | protected ICollection<LLUUID> m_uuids; |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Callback used when all the assets requested have been received. | 53 | /// Callback used when all the assets requested have been received. |
54 | /// </summary> | 54 | /// </summary> |
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
58 | /// Assets retrieved in this request | 58 | /// Assets retrieved in this request |
59 | /// </summary> | 59 | /// </summary> |
60 | protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); | 60 | protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. | 63 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. |
64 | /// </summary> | 64 | /// </summary> |
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
81 | m_assetCache = assetCache; | 81 | m_assetCache = assetCache; |
82 | m_repliesRequired = uuids.Count; | 82 | m_repliesRequired = uuids.Count; |
83 | } | 83 | } |
84 | 84 | ||
85 | protected internal void Execute() | 85 | protected internal void Execute() |
86 | { | 86 | { |
87 | // We can stop here if there are no assets to fetch | 87 | // We can stop here if there are no assets to fetch |
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
105 | m_assets[assetID] = asset; | 105 | m_assets[assetID] = asset; |
106 | else | 106 | else |
107 | m_notFoundAssetUuids.Add(assetID); | 107 | m_notFoundAssetUuids.Add(assetID); |
108 | 108 | ||
109 | //m_log.DebugFormat( | 109 | //m_log.DebugFormat( |
110 | // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); | 110 | // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); |
111 | 111 | ||
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs index 585d1d4..4e000cc 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs | |||
@@ -69,9 +69,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
69 | public byte[] ReadEntry(out string filePath) | 69 | public byte[] ReadEntry(out string filePath) |
70 | { | 70 | { |
71 | filePath = String.Empty; | 71 | filePath = String.Empty; |
72 | 72 | ||
73 | TarHeader header = ReadHeader(); | 73 | TarHeader header = ReadHeader(); |
74 | 74 | ||
75 | if (null == header) | 75 | if (null == header) |
76 | return null; | 76 | return null; |
77 | 77 | ||
@@ -98,14 +98,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
98 | /// </summary> | 98 | /// </summary> |
99 | /// <returns>A tar header struct. null if we have reached the end of the archive.</returns> | 99 | /// <returns>A tar header struct. null if we have reached the end of the archive.</returns> |
100 | protected TarHeader ReadHeader() | 100 | protected TarHeader ReadHeader() |
101 | { | 101 | { |
102 | byte[] header = m_br.ReadBytes(512); | 102 | byte[] header = m_br.ReadBytes(512); |
103 | 103 | ||
104 | // If we've reached the end of the archive we'll be in null block territory, which means | 104 | // If we've reached the end of the archive we'll be in null block territory, which means |
105 | // the next byte will be 0 | 105 | // the next byte will be 0 |
106 | if (header[0] == 0) | 106 | if (header[0] == 0) |
107 | return null; | 107 | return null; |
108 | 108 | ||
109 | TarHeader tarHeader = new TarHeader(); | 109 | TarHeader tarHeader = new TarHeader(); |
110 | 110 | ||
111 | tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); | 111 | tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs index f70a93d..83b9250 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs | |||
@@ -54,10 +54,10 @@ namespace OpenSim.Region.Environment | |||
54 | // Directories are signalled by a final / | 54 | // Directories are signalled by a final / |
55 | if (!dirName.EndsWith("/")) | 55 | if (!dirName.EndsWith("/")) |
56 | dirName += "/"; | 56 | dirName += "/"; |
57 | 57 | ||
58 | AddFile(dirName, new byte[0]); | 58 | AddFile(dirName, new byte[0]); |
59 | } | 59 | } |
60 | 60 | ||
61 | /// <summary> | 61 | /// <summary> |
62 | /// Add a file to the tar archive | 62 | /// Add a file to the tar archive |
63 | /// </summary> | 63 | /// </summary> |
@@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment | |||
161 | if (data.Length % 512 != 0) | 161 | if (data.Length % 512 != 0) |
162 | { | 162 | { |
163 | int paddingRequired = 512 - (data.Length % 512); | 163 | int paddingRequired = 512 - (data.Length % 512); |
164 | 164 | ||
165 | //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); | 165 | //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); |
166 | 166 | ||
167 | byte[] padding = new byte[paddingRequired]; | 167 | byte[] padding = new byte[paddingRequired]; |
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 1e622be..28347d0 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs | |||
@@ -223,7 +223,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
223 | if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) | 223 | if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) |
224 | { | 224 | { |
225 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | 225 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; |
226 | 226 | ||
227 | bool alreadyInList = false; | 227 | bool alreadyInList = false; |
228 | 228 | ||
229 | for (int i = 0; i < banlistcheck.Length; i++) | 229 | for (int i = 0; i < banlistcheck.Length; i++) |
@@ -407,8 +407,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
407 | args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; | 407 | args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; |
408 | args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; | 408 | args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; |
409 | args.simName = m_scene.RegionInfo.RegionName; | 409 | args.simName = m_scene.RegionInfo.RegionName; |
410 | 410 | ||
411 | |||
412 | remote_client.SendRegionInfoToEstateMenu(args); | 411 | remote_client.SendRegionInfoToEstateMenu(args); |
413 | } | 412 | } |
414 | 413 | ||
@@ -416,6 +415,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
416 | { | 415 | { |
417 | remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); | 416 | remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); |
418 | } | 417 | } |
418 | |||
419 | private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) | 419 | private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) |
420 | { | 420 | { |
421 | Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); | 421 | Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); |
@@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
472 | continue; | 472 | continue; |
473 | } | 473 | } |
474 | } | 474 | } |
475 | 475 | ||
476 | SceneReport.Add(lsri); | 476 | SceneReport.Add(lsri); |
477 | } | 477 | } |
478 | } | 478 | } |
@@ -481,7 +481,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
481 | } | 481 | } |
482 | } | 482 | } |
483 | remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); | 483 | remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); |
484 | 484 | ||
485 | if (uuidNameLookupList.Count > 0) | 485 | if (uuidNameLookupList.Count > 0) |
486 | LookupUUID(uuidNameLookupList); | 486 | LookupUUID(uuidNameLookupList); |
487 | } | 487 | } |
@@ -502,7 +502,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
502 | private void LookupUUIDsAsync(List<LLUUID> uuidLst) | 502 | private void LookupUUIDsAsync(List<LLUUID> uuidLst) |
503 | { | 503 | { |
504 | LLUUID[] uuidarr = new LLUUID[0]; | 504 | LLUUID[] uuidarr = new LLUUID[0]; |
505 | 505 | ||
506 | lock (uuidLst) | 506 | lock (uuidLst) |
507 | { | 507 | { |
508 | uuidarr = uuidLst.ToArray(); | 508 | uuidarr = uuidLst.ToArray(); |
@@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
539 | if (EstateManagers[i] == remoteClient.AgentId) | 539 | if (EstateManagers[i] == remoteClient.AgentId) |
540 | estatemanager = true; | 540 | estatemanager = true; |
541 | } | 541 | } |
542 | 542 | ||
543 | args.isEstateManager = estatemanager; | 543 | args.isEstateManager = estatemanager; |
544 | 544 | ||
545 | args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; | 545 | args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; |
@@ -729,11 +729,11 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
729 | client.OnLandStatRequest += HandleLandStatRequest; | 729 | client.OnLandStatRequest += HandleLandStatRequest; |
730 | sendRegionHandshake(client); | 730 | sendRegionHandshake(client); |
731 | } | 731 | } |
732 | 732 | ||
733 | public uint GetRegionFlags() | 733 | public uint GetRegionFlags() |
734 | { | 734 | { |
735 | Simulator.RegionFlags flags = Simulator.RegionFlags.None; | 735 | Simulator.RegionFlags flags = Simulator.RegionFlags.None; |
736 | 736 | ||
737 | // Fully implemented | 737 | // Fully implemented |
738 | // | 738 | // |
739 | if (m_scene.RegionInfo.RegionSettings.AllowDamage) | 739 | if (m_scene.RegionInfo.RegionSettings.AllowDamage) |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 9b1b9b5..00994fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | |||
@@ -47,14 +47,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
47 | { | 47 | { |
48 | private static readonly ILog m_log = | 48 | private static readonly ILog m_log = |
49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | private static readonly string remoteParcelRequestPath = "0009/"; | 51 | private static readonly string remoteParcelRequestPath = "0009/"; |
52 | 52 | ||
53 | private LandChannel landChannel; | 53 | private LandChannel landChannel; |
54 | private Scene m_scene; | 54 | private Scene m_scene; |
55 | 55 | ||
56 | |||
57 | |||
58 | private readonly int[,] landIDList = new int[64, 64]; | 56 | private readonly int[,] landIDList = new int[64, 64]; |
59 | private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); | 57 | private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); |
60 | 58 | ||
@@ -115,8 +113,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
115 | } | 113 | } |
116 | } | 114 | } |
117 | 115 | ||
118 | |||
119 | |||
120 | public void PostInitialise() | 116 | public void PostInitialise() |
121 | { | 117 | { |
122 | } | 118 | } |
@@ -153,8 +149,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
153 | } | 149 | } |
154 | } | 150 | } |
155 | 151 | ||
156 | |||
157 | |||
158 | public bool AllowedForcefulBans | 152 | public bool AllowedForcefulBans |
159 | { | 153 | { |
160 | get { return m_allowedForcefulBans; } | 154 | get { return m_allowedForcefulBans; } |
@@ -185,11 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
185 | public List<ILandObject> ParcelsNearPoint(LLVector3 position) | 179 | public List<ILandObject> ParcelsNearPoint(LLVector3 position) |
186 | { | 180 | { |
187 | List<ILandObject> parcelsNear = new List<ILandObject>(); | 181 | List<ILandObject> parcelsNear = new List<ILandObject>(); |
188 | int x; | 182 | for (int x = -4; x <= 4; x += 4) |
189 | for (x = -4; x <= 4; x += 4) | ||
190 | { | 183 | { |
191 | int y; | 184 | for (int y = -4; y <= 4; y += 4) |
192 | for (y = -4; y <= 4; y += 4) | ||
193 | { | 185 | { |
194 | ILandObject check = GetLandObject(position.X + x, position.Y + y); | 186 | ILandObject check = GetLandObject(position.X + x, position.Y + y); |
195 | if (check != null) | 187 | if (check != null) |
@@ -286,7 +278,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
286 | ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), | 278 | ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), |
287 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); | 279 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); |
288 | 280 | ||
289 | |||
290 | if (over != null) | 281 | if (over != null) |
291 | { | 282 | { |
292 | if (force) | 283 | if (force) |
@@ -387,6 +378,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
387 | Console.WriteLine("INVALID LOCAL LAND ID"); | 378 | Console.WriteLine("INVALID LOCAL LAND ID"); |
388 | } | 379 | } |
389 | } | 380 | } |
381 | |||
390 | /// <summary> | 382 | /// <summary> |
391 | /// Creates a basic Parcel object without an owner (a zeroed key) | 383 | /// Creates a basic Parcel object without an owner (a zeroed key) |
392 | /// </summary> | 384 | /// </summary> |
@@ -406,13 +398,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
406 | new_land.landData.LocalID = lastLandLocalID; | 398 | new_land.landData.LocalID = lastLandLocalID; |
407 | landList.Add(lastLandLocalID, new_land.Copy()); | 399 | landList.Add(lastLandLocalID, new_land.Copy()); |
408 | 400 | ||
409 | |||
410 | bool[,] landBitmap = new_land.getLandBitmap(); | 401 | bool[,] landBitmap = new_land.getLandBitmap(); |
411 | int x; | 402 | for (int x = 0; x < 64; x++) |
412 | for (x = 0; x < 64; x++) | ||
413 | { | 403 | { |
414 | int y; | 404 | for (int y = 0; y < 64; y++) |
415 | for (y = 0; y < 64; y++) | ||
416 | { | 405 | { |
417 | if (landBitmap[x, y]) | 406 | if (landBitmap[x, y]) |
418 | { | 407 | { |
@@ -431,11 +420,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
431 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> | 420 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> |
432 | public void removeLandObject(int local_id) | 421 | public void removeLandObject(int local_id) |
433 | { | 422 | { |
434 | int x; | 423 | for (int x = 0; x < 64; x++) |
435 | for (x = 0; x < 64; x++) | ||
436 | { | 424 | { |
437 | int y; | 425 | for (int y = 0; y < 64; y++) |
438 | for (y = 0; y < 64; y++) | ||
439 | { | 426 | { |
440 | if (landIDList[x, y] == local_id) | 427 | if (landIDList[x, y] == local_id) |
441 | { | 428 | { |
@@ -451,12 +438,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
451 | 438 | ||
452 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 439 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
453 | { | 440 | { |
454 | int x; | ||
455 | bool[,] landBitmapSlave = slave.getLandBitmap(); | 441 | bool[,] landBitmapSlave = slave.getLandBitmap(); |
456 | for (x = 0; x < 64; x++) | 442 | for (int x = 0; x < 64; x++) |
457 | { | 443 | { |
458 | int y; | 444 | for (int y = 0; y < 64; y++) |
459 | for (y = 0; y < 64; y++) | ||
460 | { | 445 | { |
461 | if (landBitmapSlave[x, y]) | 446 | if (landBitmapSlave[x, y]) |
462 | { | 447 | { |
@@ -519,6 +504,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
519 | } | 504 | } |
520 | return landList[landIDList[x / 4, y / 4]]; | 505 | return landList[landIDList[x / 4, y / 4]]; |
521 | } | 506 | } |
507 | |||
522 | #endregion | 508 | #endregion |
523 | 509 | ||
524 | #region Parcel Modification | 510 | #region Parcel Modification |
@@ -601,7 +587,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
601 | ResetAllLandPrimCounts(); | 587 | ResetAllLandPrimCounts(); |
602 | lock (m_scene.Entities) | 588 | lock (m_scene.Entities) |
603 | { | 589 | { |
604 | foreach (EntityBase obj in m_scene.Entities.Values) | 590 | foreach (EntityBase obj in m_scene.Entities.Values) |
605 | { | 591 | { |
606 | if (obj != null) | 592 | if (obj != null) |
607 | { | 593 | { |
@@ -647,11 +633,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
647 | { | 633 | { |
648 | int totalX = end_x - start_x; | 634 | int totalX = end_x - start_x; |
649 | int totalY = end_y - start_y; | 635 | int totalY = end_y - start_y; |
650 | int y; | 636 | for (int y = 0; y < totalY; y++) |
651 | for (y = 0; y < totalY; y++) | ||
652 | { | 637 | { |
653 | int x; | 638 | for (int x = 0; x < totalX; x++) |
654 | for (x = 0; x < totalX; x++) | ||
655 | { | 639 | { |
656 | ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); | 640 | ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); |
657 | if (tempLandObject == null) return; | 641 | if (tempLandObject == null) return; |
@@ -690,9 +674,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
690 | ILandObject result = AddLandObject(newLand); | 674 | ILandObject result = AddLandObject(newLand); |
691 | UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); | 675 | UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); |
692 | result.sendLandUpdateToAvatarsOverMe(); | 676 | result.sendLandUpdateToAvatarsOverMe(); |
693 | |||
694 | |||
695 | return; | ||
696 | } | 677 | } |
697 | 678 | ||
698 | /// <summary> | 679 | /// <summary> |
@@ -730,7 +711,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
730 | ILandObject masterLandObject = selectedLandObjects[0]; | 711 | ILandObject masterLandObject = selectedLandObjects[0]; |
731 | selectedLandObjects.RemoveAt(0); | 712 | selectedLandObjects.RemoveAt(0); |
732 | 713 | ||
733 | |||
734 | if (selectedLandObjects.Count < 1) | 714 | if (selectedLandObjects.Count < 1) |
735 | { | 715 | { |
736 | return; | 716 | return; |
@@ -753,12 +733,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
753 | performFinalLandJoin(masterLandObject, slaveLandObject); | 733 | performFinalLandJoin(masterLandObject, slaveLandObject); |
754 | } | 734 | } |
755 | 735 | ||
756 | |||
757 | SetPrimsTainted(); | 736 | SetPrimsTainted(); |
758 | 737 | ||
759 | masterLandObject.sendLandUpdateToAvatarsOverMe(); | 738 | masterLandObject.sendLandUpdateToAvatarsOverMe(); |
760 | |||
761 | return; | ||
762 | } | 739 | } |
763 | 740 | ||
764 | #endregion | 741 | #endregion |
@@ -777,17 +754,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
777 | int byteArrayCount = 0; | 754 | int byteArrayCount = 0; |
778 | int sequenceID = 0; | 755 | int sequenceID = 0; |
779 | 756 | ||
780 | int y; | 757 | for (int y = 0; y < 64; y++) |
781 | for (y = 0; y < 64; y++) | ||
782 | { | 758 | { |
783 | int x; | 759 | for (int x = 0; x < 64; x++) |
784 | for (x = 0; x < 64; x++) | ||
785 | { | 760 | { |
786 | byte tempByte = 0; //This represents the byte for the current 4x4 | 761 | byte tempByte = 0; //This represents the byte for the current 4x4 |
787 | 762 | ||
788 | ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); | 763 | ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); |
789 | 764 | ||
790 | |||
791 | if (currentParcelBlock != null) | 765 | if (currentParcelBlock != null) |
792 | { | 766 | { |
793 | if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) | 767 | if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) |
@@ -813,7 +787,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
813 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); | 787 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); |
814 | } | 788 | } |
815 | 789 | ||
816 | |||
817 | //Now for border control | 790 | //Now for border control |
818 | 791 | ||
819 | ILandObject westParcel = null; | 792 | ILandObject westParcel = null; |
@@ -864,14 +837,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
864 | { | 837 | { |
865 | //Get the land objects within the bounds | 838 | //Get the land objects within the bounds |
866 | List<ILandObject> temp = new List<ILandObject>(); | 839 | List<ILandObject> temp = new List<ILandObject>(); |
867 | int x; | ||
868 | int i; | ||
869 | int inc_x = end_x - start_x; | 840 | int inc_x = end_x - start_x; |
870 | int inc_y = end_y - start_y; | 841 | int inc_y = end_y - start_y; |
871 | for (x = 0; x < inc_x; x++) | 842 | for (int x = 0; x < inc_x; x++) |
872 | { | 843 | { |
873 | int y; | 844 | for (int y = 0; y < inc_y; y++) |
874 | for (y = 0; y < inc_y; y++) | ||
875 | { | 845 | { |
876 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); | 846 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); |
877 | 847 | ||
@@ -892,12 +862,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
892 | requestResult = LandChannel.LAND_RESULT_MULTIPLE; | 862 | requestResult = LandChannel.LAND_RESULT_MULTIPLE; |
893 | } | 863 | } |
894 | 864 | ||
895 | for (i = 0; i < temp.Count; i++) | 865 | for (int i = 0; i < temp.Count; i++) |
896 | { | 866 | { |
897 | temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); | 867 | temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); |
898 | } | 868 | } |
899 | 869 | ||
900 | |||
901 | SendParcelOverlay(remote_client); | 870 | SendParcelOverlay(remote_client); |
902 | } | 871 | } |
903 | 872 | ||
@@ -921,7 +890,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
921 | 890 | ||
922 | public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) | 891 | public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) |
923 | { | 892 | { |
924 | |||
925 | landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); | 893 | landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); |
926 | } | 894 | } |
927 | 895 | ||
@@ -954,7 +922,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
954 | landList[local_id].sendLandUpdateToClient(remote_client); | 922 | landList[local_id].sendLandUpdateToClient(remote_client); |
955 | } | 923 | } |
956 | } | 924 | } |
957 | |||
958 | } | 925 | } |
959 | 926 | ||
960 | public void handleParcelReclaim(int local_id, IClientAPI remote_client) | 927 | public void handleParcelReclaim(int local_id, IClientAPI remote_client) |
@@ -972,7 +939,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
972 | landList[local_id].sendLandUpdateToClient(remote_client); | 939 | landList[local_id].sendLandUpdateToClient(remote_client); |
973 | } | 940 | } |
974 | } | 941 | } |
975 | |||
976 | } | 942 | } |
977 | #endregion | 943 | #endregion |
978 | 944 | ||
@@ -1076,7 +1042,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1076 | { | 1042 | { |
1077 | selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); | 1043 | selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); |
1078 | } | 1044 | } |
1079 | |||
1080 | } | 1045 | } |
1081 | 1046 | ||
1082 | public void NoLandDataFromStorage() | 1047 | public void NoLandDataFromStorage() |
@@ -1093,11 +1058,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1093 | obj.setParcelObjectMaxOverride(overrideDel); | 1058 | obj.setParcelObjectMaxOverride(overrideDel); |
1094 | } | 1059 | } |
1095 | } | 1060 | } |
1061 | |||
1096 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) | 1062 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) |
1097 | { | 1063 | { |
1098 | } | 1064 | } |
1099 | 1065 | ||
1100 | #region CAPS handler | 1066 | #region CAPS handler |
1067 | |||
1101 | private void OnRegisterCaps(LLUUID agentID, Caps caps) | 1068 | private void OnRegisterCaps(LLUUID agentID, Caps caps) |
1102 | { | 1069 | { |
1103 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 1070 | string capsBase = "/CAPS/" + caps.CapsObjectPath; |
@@ -1109,7 +1076,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1109 | return RemoteParcelRequest(request, path, param, agentID, caps); | 1076 | return RemoteParcelRequest(request, path, param, agentID, caps); |
1110 | })); | 1077 | })); |
1111 | } | 1078 | } |
1112 | 1079 | ||
1113 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the | 1080 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the |
1114 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. | 1081 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. |
1115 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x | 1082 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x |
@@ -1171,11 +1138,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1171 | { | 1138 | { |
1172 | m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); | 1139 | m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); |
1173 | } | 1140 | } |
1174 | 1141 | ||
1175 | LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); | 1142 | LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); |
1176 | response.parcel_id = parcelID; | 1143 | response.parcel_id = parcelID; |
1177 | m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); | 1144 | m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); |
1178 | 1145 | ||
1179 | return LLSDHelpers.SerialiseLLSDReply(response); | 1146 | return LLSDHelpers.SerialiseLLSDReply(response); |
1180 | } | 1147 | } |
1181 | 1148 | ||
@@ -1191,7 +1158,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1191 | uint x, y; | 1158 | uint x, y; |
1192 | Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); | 1159 | Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); |
1193 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); | 1160 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); |
1194 | 1161 | ||
1195 | LandData landData; | 1162 | LandData landData; |
1196 | if (regionHandle == m_scene.RegionInfo.RegionHandle) | 1163 | if (regionHandle == m_scene.RegionInfo.RegionHandle) |
1197 | landData = this.GetLandObject(x, y).landData; | 1164 | landData = this.GetLandObject(x, y).landData; |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 305e236..6388a1c 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs | |||
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
116 | return newLand; | 116 | return newLand; |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; | 120 | static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; |
121 | static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; | 121 | static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; |
122 | 122 | ||
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | #endregion | 158 | #endregion |
159 | 159 | ||
160 | #region Packet Request Handling | 160 | #region Packet Request Handling |
161 | 161 | ||
162 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) | 162 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) |
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 7b05027..09f12b2 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | |||
@@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
305 | 305 | ||
306 | public event RegionHandleRequest OnRegionHandleRequest; | 306 | public event RegionHandleRequest OnRegionHandleRequest; |
307 | public event ParcelInfoRequest OnParcelInfoRequest; | 307 | public event ParcelInfoRequest OnParcelInfoRequest; |
308 | 308 | ||
309 | #pragma warning restore 67 | 309 | #pragma warning restore 67 |
310 | 310 | ||
311 | #endregion | 311 | #endregion |
@@ -368,7 +368,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
368 | { | 368 | { |
369 | get { return 0; } | 369 | get { return 0; } |
370 | } | 370 | } |
371 | 371 | ||
372 | public ulong GetGroupPowers(LLUUID groupID) | 372 | public ulong GetGroupPowers(LLUUID groupID) |
373 | { | 373 | { |
374 | return 0; | 374 | return 0; |
@@ -820,13 +820,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
820 | 820 | ||
821 | 821 | ||
822 | public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) | 822 | public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) |
823 | { | 823 | { |
824 | } | 824 | } |
825 | 825 | ||
826 | public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, | 826 | public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, |
827 | byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, | 827 | byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, |
828 | byte mediaLoop) | 828 | byte mediaLoop) |
829 | { | 829 | { |
830 | } | 830 | } |
831 | 831 | ||
832 | public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) | 832 | public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) |
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 6107f48..071e3af 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs | |||
@@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
146 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); | 146 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); |
147 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); | 147 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); |
148 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); | 148 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); |
149 | 149 | ||
150 | if (m_bypassPermissions) | 150 | if (m_bypassPermissions) |
151 | m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); | 151 | m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); |
152 | else | 152 | else |
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs index 0df19d9..22c9b29 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
44 | public class SceneXmlLoader | 44 | public class SceneXmlLoader |
45 | { | 45 | { |
46 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) | 48 | public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) |
49 | { | 49 | { |
50 | XmlDocument doc = new XmlDocument(); | 50 | XmlDocument doc = new XmlDocument(); |
@@ -114,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
114 | doc.Load(reader); | 114 | doc.Load(reader); |
115 | reader.Close(); | 115 | reader.Close(); |
116 | rootNode = doc.FirstChild; | 116 | rootNode = doc.FirstChild; |
117 | 117 | ||
118 | // This is to deal with neighbouring regions that are still surrounding the group xml with the <scene> | 118 | // This is to deal with neighbouring regions that are still surrounding the group xml with the <scene> |
119 | // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or | 119 | // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or |
120 | // when some other changes forces all regions to upgrade). | 120 | // when some other changes forces all regions to upgrade). |
@@ -127,13 +127,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
127 | // There is only ever one prim. This oddity should be removeable post 0.5.9 | 127 | // There is only ever one prim. This oddity should be removeable post 0.5.9 |
128 | return new SceneObjectGroup(aPrimNode.OuterXml); | 128 | return new SceneObjectGroup(aPrimNode.OuterXml); |
129 | } | 129 | } |
130 | 130 | ||
131 | return null; | 131 | return null; |
132 | } | 132 | } |
133 | else | 133 | else |
134 | { | 134 | { |
135 | return new SceneObjectGroup(rootNode.OuterXml); | 135 | return new SceneObjectGroup(rootNode.OuterXml); |
136 | } | 136 | } |
137 | } | 137 | } |
138 | 138 | ||
139 | /// <summary> | 139 | /// <summary> |
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
171 | reader.Close(); | 171 | reader.Close(); |
172 | XmlNode rootNode = doc.FirstChild; | 172 | XmlNode rootNode = doc.FirstChild; |
173 | 173 | ||
174 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 174 | ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
175 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) | 175 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) |
176 | { | 176 | { |
177 | SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml); | 177 | SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml); |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
195 | { | 195 | { |
196 | SceneObjectGroup obj = new SceneObjectGroup(xmlData); | 196 | SceneObjectGroup obj = new SceneObjectGroup(xmlData); |
197 | 197 | ||
198 | if (scene.AddRestoredSceneObject(obj, true, false)) | 198 | if (scene.AddRestoredSceneObject(obj, true, false)) |
199 | return obj; | 199 | return obj; |
200 | else | 200 | else |
201 | return null; | 201 | return null; |
@@ -254,7 +254,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
254 | if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) | 254 | if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) |
255 | continue; | 255 | continue; |
256 | } | 256 | } |
257 | 257 | ||
258 | stream.WriteLine(g.ToXmlString2()); | 258 | stream.WriteLine(g.ToXmlString2()); |
259 | primCount++; | 259 | primCount++; |
260 | } | 260 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 5682de3..9690433 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules | |||
94 | private LLVector3 Position = new LLVector3(0,0,0); | 94 | private LLVector3 Position = new LLVector3(0,0,0); |
95 | private LLVector3 Velocity = new LLVector3(0,0,0); | 95 | private LLVector3 Velocity = new LLVector3(0,0,0); |
96 | private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); | 96 | private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); |
97 | 97 | ||
98 | private long LindenHourOffset = 0; | 98 | private long LindenHourOffset = 0; |
99 | private bool sunFixed = false; | 99 | private bool sunFixed = false; |
100 | 100 | ||
@@ -111,7 +111,7 @@ namespace OpenSim.Region.Environment.Modules | |||
111 | private float GetLindenEstateHourFromCurrentTime() | 111 | private float GetLindenEstateHourFromCurrentTime() |
112 | { | 112 | { |
113 | float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle); | 113 | float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle); |
114 | 114 | ||
115 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6; | 115 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6; |
116 | 116 | ||
117 | return hour; | 117 | return hour; |
@@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules | |||
132 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)); | 132 | float hour = (24 * (ticksleftover / SecondsPerSunCycle)); |
133 | 133 | ||
134 | float offsethours = 0; | 134 | float offsethours = 0; |
135 | 135 | ||
136 | if (LindenHour - 6 > hour) | 136 | if (LindenHour - 6 > hour) |
137 | { | 137 | { |
138 | offsethours = hour + ((LindenHour-6) - hour); | 138 | offsethours = hour + ((LindenHour-6) - hour); |
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Environment.Modules | |||
142 | offsethours = hour - (hour - (LindenHour - 6)); | 142 | offsethours = hour - (hour - (LindenHour - 6)); |
143 | } | 143 | } |
144 | //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString()); | 144 | //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString()); |
145 | 145 | ||
146 | LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); | 146 | LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); |
147 | m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); | 147 | m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); |
148 | 148 | ||
@@ -422,7 +422,7 @@ namespace OpenSim.Region.Environment.Modules | |||
422 | } | 422 | } |
423 | } | 423 | } |
424 | } | 424 | } |
425 | 425 | ||
426 | public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) | 426 | public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) |
427 | { | 427 | { |
428 | if (m_scene.RegionInfo.RegionHandle == regionHandle) | 428 | if (m_scene.RegionInfo.RegionHandle == regionHandle) |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs index 34bbf78..48da96d 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | 51 | ||
52 | colours.Save(filename, ImageFormat.Bmp); | 52 | colours.Save(filename, ImageFormat.Bmp); |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Exports a stream using a System.Drawing exporter. | 56 | /// Exports a stream using a System.Drawing exporter. |
57 | /// </summary> | 57 | /// </summary> |
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
62 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 62 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
63 | 63 | ||
64 | colours.Save(stream, ImageFormat.Png); | 64 | colours.Save(stream, ImageFormat.Png); |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// The human readable version of the file format(s) this loader handles | 68 | /// The human readable version of the file format(s) this loader handles |
@@ -73,4 +73,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
73 | return "BMP"; | 73 | return "BMP"; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | } \ No newline at end of file | 76 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs index 0cd9000..accffd2 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
40 | 40 | ||
41 | colours.Save(filename, ImageFormat.Gif); | 41 | colours.Save(filename, ImageFormat.Gif); |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Exports a stream using a System.Drawing exporter. | 45 | /// Exports a stream using a System.Drawing exporter. |
46 | /// </summary> | 46 | /// </summary> |
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
52 | 52 | ||
53 | colours.Save(stream, ImageFormat.Gif); | 53 | colours.Save(stream, ImageFormat.Gif); |
54 | } | 54 | } |
55 | 55 | ||
56 | public override string ToString() | 56 | public override string ToString() |
57 | { | 57 | { |
58 | return "GIF"; | 58 | return "GIF"; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } \ No newline at end of file | 61 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index 4d213e0..983ad29 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs | |||
@@ -58,19 +58,19 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
58 | /// <returns>A terrain channel generated from the image.</returns> | 58 | /// <returns>A terrain channel generated from the image.</returns> |
59 | public virtual ITerrainChannel LoadFile(string filename) | 59 | public virtual ITerrainChannel LoadFile(string filename) |
60 | { | 60 | { |
61 | return LoadBitmap(new Bitmap(filename)); | 61 | return LoadBitmap(new Bitmap(filename)); |
62 | } | 62 | } |
63 | 63 | ||
64 | public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) | 64 | public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) |
65 | { | 65 | { |
66 | throw new NotImplementedException(); | 66 | throw new NotImplementedException(); |
67 | } | 67 | } |
68 | 68 | ||
69 | public virtual ITerrainChannel LoadStream(Stream stream) | 69 | public virtual ITerrainChannel LoadStream(Stream stream) |
70 | { | 70 | { |
71 | return LoadBitmap(new Bitmap(stream)); | 71 | return LoadBitmap(new Bitmap(stream)); |
72 | } | 72 | } |
73 | 73 | ||
74 | protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap) | 74 | protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap) |
75 | { | 75 | { |
76 | ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height); | 76 | ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height); |
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
88 | return retval; | 88 | return retval; |
89 | } | 89 | } |
90 | 90 | ||
91 | /// <summary> | 91 | /// <summary> |
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
99 | 99 | ||
100 | colours.Save(filename, ImageFormat.Png); | 100 | colours.Save(filename, ImageFormat.Png); |
101 | } | 101 | } |
102 | 102 | ||
103 | /// <summary> | 103 | /// <summary> |
104 | /// Exports a stream using a System.Drawing exporter. | 104 | /// Exports a stream using a System.Drawing exporter. |
105 | /// </summary> | 105 | /// </summary> |
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
110 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 110 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
111 | 111 | ||
112 | colours.Save(stream, ImageFormat.Png); | 112 | colours.Save(stream, ImageFormat.Png); |
113 | } | 113 | } |
114 | 114 | ||
115 | #endregion | 115 | #endregion |
116 | 116 | ||
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs index 9886b81..35576c7 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs | |||
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | { | 51 | { |
52 | throw new NotImplementedException(); | 52 | throw new NotImplementedException(); |
53 | } | 53 | } |
54 | 54 | ||
55 | public ITerrainChannel LoadStream(Stream stream) | 55 | public ITerrainChannel LoadStream(Stream stream) |
56 | { | 56 | { |
57 | throw new NotImplementedException(); | 57 | throw new NotImplementedException(); |
58 | } | 58 | } |
59 | 59 | ||
60 | public void SaveFile(string filename, ITerrainChannel map) | 60 | public void SaveFile(string filename, ITerrainChannel map) |
61 | { | 61 | { |
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
63 | 63 | ||
64 | colours.Save(filename, ImageFormat.Jpeg); | 64 | colours.Save(filename, ImageFormat.Jpeg); |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// Exports a stream using a System.Drawing exporter. | 68 | /// Exports a stream using a System.Drawing exporter. |
69 | /// </summary> | 69 | /// </summary> |
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
74 | Bitmap colours = CreateBitmapFromMap(map); | 74 | Bitmap colours = CreateBitmapFromMap(map); |
75 | 75 | ||
76 | colours.Save(stream, ImageFormat.Jpeg); | 76 | colours.Save(stream, ImageFormat.Jpeg); |
77 | } | 77 | } |
78 | 78 | ||
79 | #endregion | 79 | #endregion |
80 | 80 | ||
@@ -109,4 +109,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
109 | return bmp; | 109 | return bmp; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | } \ No newline at end of file | 112 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs index 21fba2b..5f13d01 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
74 | FileInfo file = new FileInfo(filename); | 74 | FileInfo file = new FileInfo(filename); |
75 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); | 75 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); |
76 | ITerrainChannel retval = LoadStream(s); | 76 | ITerrainChannel retval = LoadStream(s); |
77 | 77 | ||
78 | s.Close(); | 78 | s.Close(); |
79 | 79 | ||
80 | return retval; | 80 | return retval; |
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
113 | // i.e. eat X upto where we start | 113 | // i.e. eat X upto where we start |
114 | while (currFileXOffset < offsetX) | 114 | while (currFileXOffset < offsetX) |
115 | { | 115 | { |
116 | bs.ReadBytes(sectionWidth * 13); | 116 | bs.ReadBytes(sectionWidth * 13); |
117 | currFileXOffset++; | 117 | currFileXOffset++; |
118 | } | 118 | } |
119 | 119 | ||
@@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
143 | 143 | ||
144 | return retval; | 144 | return retval; |
145 | } | 145 | } |
146 | 146 | ||
147 | public ITerrainChannel LoadStream(Stream s) | 147 | public ITerrainChannel LoadStream(Stream s) |
148 | { | 148 | { |
149 | TerrainChannel retval = new TerrainChannel(); | 149 | TerrainChannel retval = new TerrainChannel(); |
150 | 150 | ||
151 | BinaryReader bs = new BinaryReader(s); | 151 | BinaryReader bs = new BinaryReader(s); |
152 | int y; | 152 | int y; |
153 | for (y = 0; y < retval.Height; y++) | 153 | for (y = 0; y < retval.Height; y++) |
@@ -160,8 +160,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | bs.Close(); | 163 | bs.Close(); |
164 | 164 | ||
165 | return retval; | 165 | return retval; |
166 | } | 166 | } |
167 | 167 | ||
@@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
173 | 173 | ||
174 | s.Close(); | 174 | s.Close(); |
175 | } | 175 | } |
176 | 176 | ||
177 | public void SaveStream(Stream s, ITerrainChannel map) | 177 | public void SaveStream(Stream s, ITerrainChannel map) |
178 | { | 178 | { |
179 | BinaryWriter binStream = new BinaryWriter(s); | 179 | BinaryWriter binStream = new BinaryWriter(s); |
@@ -224,9 +224,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | binStream.Close(); | 227 | binStream.Close(); |
228 | } | 228 | } |
229 | 229 | ||
230 | public string FileExtension | 230 | public string FileExtension |
231 | { | 231 | { |
232 | get { return ".raw"; } | 232 | get { return ".raw"; } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs index cf95486..19e181e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
40 | 40 | ||
41 | colours.Save(filename, ImageFormat.Png); | 41 | colours.Save(filename, ImageFormat.Png); |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Exports a stream using a System.Drawing exporter. | 45 | /// Exports a stream using a System.Drawing exporter. |
46 | /// </summary> | 46 | /// </summary> |
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
52 | 52 | ||
53 | colours.Save(stream, ImageFormat.Png); | 53 | colours.Save(stream, ImageFormat.Png); |
54 | } | 54 | } |
55 | 55 | ||
56 | public override string ToString() | 56 | public override string ToString() |
57 | { | 57 | { |
58 | return "PNG"; | 58 | return "PNG"; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } \ No newline at end of file | 61 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs index bb8b0f7..758821a 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs | |||
@@ -112,11 +112,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
112 | 112 | ||
113 | return retval; | 113 | return retval; |
114 | } | 114 | } |
115 | 115 | ||
116 | public ITerrainChannel LoadStream(Stream s) | 116 | public ITerrainChannel LoadStream(Stream s) |
117 | { | 117 | { |
118 | TerrainChannel retval = new TerrainChannel(); | 118 | TerrainChannel retval = new TerrainChannel(); |
119 | 119 | ||
120 | BinaryReader bs = new BinaryReader(s); | 120 | BinaryReader bs = new BinaryReader(s); |
121 | int y; | 121 | int y; |
122 | for (y = 0; y < retval.Height; y++) | 122 | for (y = 0; y < retval.Height; y++) |
@@ -129,10 +129,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
129 | } | 129 | } |
130 | 130 | ||
131 | bs.Close(); | 131 | bs.Close(); |
132 | 132 | ||
133 | return retval; | 133 | return retval; |
134 | } | 134 | } |
135 | 135 | ||
136 | public void SaveFile(string filename, ITerrainChannel map) | 136 | public void SaveFile(string filename, ITerrainChannel map) |
137 | { | 137 | { |
138 | FileInfo file = new FileInfo(filename); | 138 | FileInfo file = new FileInfo(filename); |
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
141 | 141 | ||
142 | s.Close(); | 142 | s.Close(); |
143 | } | 143 | } |
144 | 144 | ||
145 | public void SaveStream(Stream s, ITerrainChannel map) | 145 | public void SaveStream(Stream s, ITerrainChannel map) |
146 | { | 146 | { |
147 | BinaryWriter bs = new BinaryWriter(s); | 147 | BinaryWriter bs = new BinaryWriter(s); |
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | bs.Close(); | 159 | bs.Close(); |
160 | } | 160 | } |
161 | 161 | ||
162 | #endregion | 162 | #endregion |
@@ -166,4 +166,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
166 | return "RAW32"; | 166 | return "RAW32"; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | } \ No newline at end of file | 169 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs index 3f98f40..95b43b0 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
40 | 40 | ||
41 | colours.Save(filename, ImageFormat.Tiff); | 41 | colours.Save(filename, ImageFormat.Tiff); |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Exports a stream using a System.Drawing exporter. | 45 | /// Exports a stream using a System.Drawing exporter. |
46 | /// </summary> | 46 | /// </summary> |
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | 51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); |
52 | 52 | ||
53 | colours.Save(stream, ImageFormat.Tiff); | 53 | colours.Save(stream, ImageFormat.Tiff); |
54 | } | 54 | } |
55 | 55 | ||
56 | public override string ToString() | 56 | public override string ToString() |
57 | { | 57 | { |
58 | return "TIFF"; | 58 | return "TIFF"; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } \ No newline at end of file | 61 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs index 5dc2aa5..2bf029e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs | |||
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
51 | 51 | ||
52 | return retval; | 52 | return retval; |
53 | } | 53 | } |
54 | 54 | ||
55 | public ITerrainChannel LoadStream(Stream s) | 55 | public ITerrainChannel LoadStream(Stream s) |
56 | { | 56 | { |
57 | TerrainChannel retval = new TerrainChannel(); | 57 | TerrainChannel retval = new TerrainChannel(); |
58 | 58 | ||
59 | BinaryReader bs = new BinaryReader(s); | 59 | BinaryReader bs = new BinaryReader(s); |
60 | 60 | ||
61 | bool eof = false; | 61 | bool eof = false; |
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
107 | } | 107 | } |
108 | 108 | ||
109 | bs.Close(); | 109 | bs.Close(); |
110 | 110 | ||
111 | return retval; | 111 | return retval; |
112 | } | 112 | } |
113 | 113 | ||
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
115 | { | 115 | { |
116 | throw new NotImplementedException(); | 116 | throw new NotImplementedException(); |
117 | } | 117 | } |
118 | 118 | ||
119 | public void SaveStream(Stream stream, ITerrainChannel map) | 119 | public void SaveStream(Stream stream, ITerrainChannel map) |
120 | { | 120 | { |
121 | throw new NotImplementedException(); | 121 | throw new NotImplementedException(); |
@@ -138,4 +138,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
138 | return "Terragen"; | 138 | return "Terragen"; |
139 | } | 139 | } |
140 | } | 140 | } |
141 | } \ No newline at end of file | 141 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs index e255515..beeff03 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
33 | { | 33 | { |
34 | void LoadFromFile(string filename); | 34 | void LoadFromFile(string filename); |
35 | void SaveToFile(string filename); | 35 | void SaveToFile(string filename); |
36 | 36 | ||
37 | /// <summary> | 37 | /// <summary> |
38 | /// Load a terrain from a stream. | 38 | /// Load a terrain from a stream. |
39 | /// </summary> | 39 | /// </summary> |
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
42 | /// </param> | 42 | /// </param> |
43 | /// <param name="stream"></param> | 43 | /// <param name="stream"></param> |
44 | void LoadFromStream(string filename, Stream stream); | 44 | void LoadFromStream(string filename, Stream stream); |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// Save a terrain to a stream. | 47 | /// Save a terrain to a stream. |
48 | /// </summary> | 48 | /// </summary> |
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
51 | /// </param> | 51 | /// </param> |
52 | /// <param name="stream"></param> | 52 | /// <param name="stream"></param> |
53 | void SaveToStream(string filename, Stream stream); | 53 | void SaveToStream(string filename, Stream stream); |
54 | 54 | ||
55 | void InstallPlugin(string name, ITerrainEffect plug); | 55 | void InstallPlugin(string name, ITerrainEffect plug); |
56 | } | 56 | } |
57 | } | 57 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index 8fbc62e..4a62446 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs | |||
@@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
221 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); | 221 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | /// <summary> | 225 | /// <summary> |
226 | /// Loads a terrain file from a stream and installs it in the scene. | 226 | /// Loads a terrain file from a stream and installs it in the scene. |
227 | /// </summary> | 227 | /// </summary> |
@@ -281,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
281 | m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); | 281 | m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); |
282 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); | 282 | throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); |
283 | } | 283 | } |
284 | } | 284 | } |
285 | 285 | ||
286 | #region Plugin Loading Methods | 286 | #region Plugin Loading Methods |
287 | 287 | ||
@@ -450,7 +450,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
450 | m_tainted = false; | 450 | m_tainted = false; |
451 | m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); | 451 | m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); |
452 | m_scene.SaveTerrain(); | 452 | m_scene.SaveTerrain(); |
453 | 453 | ||
454 | // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. | 454 | // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. |
455 | //m_scene.CreateTerrainTexture(true); | 455 | //m_scene.CreateTerrainTexture(true); |
456 | } | 456 | } |
@@ -517,11 +517,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
517 | // fixup and height deltas that don't respect them | 517 | // fixup and height deltas that don't respect them |
518 | if (respectEstateSettings && LimitChannelChanges(x, y)) | 518 | if (respectEstateSettings && LimitChannelChanges(x, y)) |
519 | { | 519 | { |
520 | // this has been vetoed, so update | 520 | // this has been vetoed, so update |
521 | // what we are going to send to the client | 521 | // what we are going to send to the client |
522 | serialised = m_channel.GetFloatsSerialised(); | 522 | serialised = m_channel.GetFloatsSerialised(); |
523 | } | 523 | } |
524 | 524 | ||
525 | SendToClients(serialised, x, y); | 525 | SendToClients(serialised, x, y); |
526 | shouldTaint = true; | 526 | shouldTaint = true; |
527 | } | 527 | } |
@@ -580,9 +580,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
580 | private void SendToClients(float[] serialised, int x, int y) | 580 | private void SendToClients(float[] serialised, int x, int y) |
581 | { | 581 | { |
582 | m_scene.ForEachClient( | 582 | m_scene.ForEachClient( |
583 | delegate(IClientAPI controller) | 583 | delegate(IClientAPI controller) |
584 | { controller.SendLayerData( | 584 | { controller.SendLayerData( |
585 | x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); | 585 | x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); |
586 | } | 586 | } |
587 | ); | 587 | ); |
588 | } | 588 | } |
@@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
647 | { | 647 | { |
648 | // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. | 648 | // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. |
649 | // for now check a point in the centre of the region | 649 | // for now check a point in the centre of the region |
650 | 650 | ||
651 | if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) | 651 | if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) |
652 | { | 652 | { |
653 | InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter | 653 | InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter |
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs index a331d37..9b8dc75 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs | |||
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
162 | { | 162 | { |
163 | int tc = System.Environment.TickCount; | 163 | int tc = System.Environment.TickCount; |
164 | m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain"); | 164 | m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain"); |
165 | 165 | ||
166 | double[,] hm = whichScene.Heightmap.GetDoubles(); | 166 | double[,] hm = whichScene.Heightmap.GetDoubles(); |
167 | bool ShadowDebugContinue = true; | 167 | bool ShadowDebugContinue = true; |
168 | //Color prim = Color.FromArgb(120, 120, 120); | 168 | //Color prim = Color.FromArgb(120, 120, 120); |
@@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
247 | //X | 247 | //X |
248 | // . | 248 | // . |
249 | // | 249 | // |
250 | // Shade the terrain for shadows | 250 | // Shade the terrain for shadows |
251 | if ((x - 1 > 0) && (y - 1 > 0)) | 251 | if ((x - 1 > 0) && (y - 1 > 0)) |
252 | { | 252 | { |
253 | hfvalue = (float)hm[x, y]; | 253 | hfvalue = (float)hm[x, y]; |
@@ -268,7 +268,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
268 | else if (hfdiff < -0.3f) | 268 | else if (hfdiff < -0.3f) |
269 | { | 269 | { |
270 | // We have to desaturate and blacken the land at the same time | 270 | // We have to desaturate and blacken the land at the same time |
271 | // we use floats, colors use bytes, so shrink are space down to | 271 | // we use floats, colors use bytes, so shrink are space down to |
272 | // 0-255 | 272 | // 0-255 |
273 | 273 | ||
274 | 274 | ||
@@ -368,8 +368,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
368 | 368 | ||
369 | return mapbmp; | 369 | return mapbmp; |
370 | } | 370 | } |
371 | 371 | ||
372 | 372 | ||
373 | private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) | 373 | private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) |
374 | { | 374 | { |
375 | int tc = 0; | 375 | int tc = 0; |
@@ -570,4 +570,4 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
570 | } | 570 | } |
571 | #endregion | 571 | #endregion |
572 | } | 572 | } |
573 | } \ No newline at end of file | 573 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 2a7af87..2430822 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | |||
@@ -54,13 +54,13 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
54 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | 55 | ||
56 | private static readonly string m_mapLayerPath = "0001/"; | 56 | private static readonly string m_mapLayerPath = "0001/"; |
57 | 57 | ||
58 | //private IConfig m_config; | 58 | //private IConfig m_config; |
59 | private Scene m_scene; | 59 | private Scene m_scene; |
60 | private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); | 60 | private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); |
61 | private int cachedTime = 0; | 61 | private int cachedTime = 0; |
62 | private byte[] myMapImageJPEG; | 62 | private byte[] myMapImageJPEG; |
63 | 63 | ||
64 | //private int CacheRegionsDistance = 256; | 64 | //private int CacheRegionsDistance = 256; |
65 | 65 | ||
66 | #region IRegionModule Members | 66 | #region IRegionModule Members |
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
85 | } | 85 | } |
86 | public void PostInitialise() | 86 | public void PostInitialise() |
87 | { | 87 | { |
88 | 88 | ||
89 | } | 89 | } |
90 | 90 | ||
91 | public void Close() | 91 | public void Close() |
@@ -102,10 +102,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
102 | } | 102 | } |
103 | 103 | ||
104 | #endregion | 104 | #endregion |
105 | |||
106 | |||
107 | |||
108 | |||
109 | 105 | ||
110 | public void OnRegisterCaps(LLUUID agentID, Caps caps) | 106 | public void OnRegisterCaps(LLUUID agentID, Caps caps) |
111 | { | 107 | { |
@@ -117,9 +113,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
117 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 113 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
118 | { | 114 | { |
119 | return MapLayerRequest(request, path, param, | 115 | return MapLayerRequest(request, path, param, |
120 | agentID, caps); | 116 | agentID, caps); |
121 | })); | 117 | })); |
122 | |||
123 | } | 118 | } |
124 | 119 | ||
125 | /// <summary> | 120 | /// <summary> |
@@ -138,12 +133,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
138 | //{ | 133 | //{ |
139 | //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", | 134 | //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", |
140 | //request, path, param,agentID.ToString()); | 135 | //request, path, param,agentID.ToString()); |
141 | 136 | ||
142 | // this is here because CAPS map requests work even beyond the 10,000 limit. | 137 | // this is here because CAPS map requests work even beyond the 10,000 limit. |
143 | ScenePresence avatarPresence = null; | 138 | ScenePresence avatarPresence = null; |
144 | 139 | ||
145 | m_scene.TryGetAvatar(agentID, out avatarPresence); | 140 | m_scene.TryGetAvatar(agentID, out avatarPresence); |
146 | 141 | ||
147 | if (avatarPresence != null) | 142 | if (avatarPresence != null) |
148 | { | 143 | { |
149 | bool lookup = false; | 144 | bool lookup = false; |
@@ -168,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
168 | 163 | ||
169 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); | 164 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); |
170 | avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); | 165 | avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); |
171 | 166 | ||
172 | lock (cachedMapBlocks) | 167 | lock (cachedMapBlocks) |
173 | cachedMapBlocks = mapBlocks; | 168 | cachedMapBlocks = mapBlocks; |
174 | 169 | ||
@@ -262,18 +257,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
262 | MemoryStream imgstream = new MemoryStream(); | 257 | MemoryStream imgstream = new MemoryStream(); |
263 | Bitmap mapTexture = new Bitmap(1,1); | 258 | Bitmap mapTexture = new Bitmap(1,1); |
264 | System.Drawing.Image image = (System.Drawing.Image)mapTexture; | 259 | System.Drawing.Image image = (System.Drawing.Image)mapTexture; |
265 | 260 | ||
266 | |||
267 | try | 261 | try |
268 | { | 262 | { |
269 | // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data | 263 | // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data |
270 | 264 | ||
271 | |||
272 | imgstream = new MemoryStream(); | 265 | imgstream = new MemoryStream(); |
273 | 266 | ||
274 | // non-async because we know we have the asset immediately. | 267 | // non-async because we know we have the asset immediately. |
275 | AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); | 268 | AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); |
276 | 269 | ||
277 | // Decode image to System.Drawing.Image | 270 | // Decode image to System.Drawing.Image |
278 | image = OpenJPEG.DecodeToImage(mapasset.Data); | 271 | image = OpenJPEG.DecodeToImage(mapasset.Data); |
279 | 272 | ||
@@ -293,7 +286,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
293 | 286 | ||
294 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); | 287 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); |
295 | myEncoderParameters.Param[0] = myEncoderParameter; | 288 | myEncoderParameters.Param[0] = myEncoderParameter; |
296 | 289 | ||
297 | // Save bitmap to stream | 290 | // Save bitmap to stream |
298 | mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); | 291 | mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); |
299 | 292 | ||
@@ -332,16 +325,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
332 | // From msdn | 325 | // From msdn |
333 | private static ImageCodecInfo GetEncoderInfo(String mimeType) | 326 | private static ImageCodecInfo GetEncoderInfo(String mimeType) |
334 | { | 327 | { |
335 | int j; | ||
336 | ImageCodecInfo[] encoders; | 328 | ImageCodecInfo[] encoders; |
337 | encoders = ImageCodecInfo.GetImageEncoders(); | 329 | encoders = ImageCodecInfo.GetImageEncoders(); |
338 | for (j = 0; j < encoders.Length; ++j) | 330 | for (int j = 0; j < encoders.Length; ++j) |
339 | { | 331 | { |
340 | if (encoders[j].MimeType == mimeType) | 332 | if (encoders[j].MimeType == mimeType) |
341 | return encoders[j]; | 333 | return encoders[j]; |
342 | } | 334 | } |
343 | return null; | 335 | return null; |
344 | } | 336 | } |
345 | |||
346 | } | 337 | } |
347 | } | 338 | } |
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index bc3e06c..40caabc 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
63 | get { return m_name; } | 63 | get { return m_name; } |
64 | set { m_name = value; } | 64 | set { m_name = value; } |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// Signals whether this group was in a scene but has since been deleted from it. | 68 | /// Signals whether this group was in a scene but has since been deleted from it. |
69 | /// </summary> | 69 | /// </summary> |
@@ -71,7 +71,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
71 | { | 71 | { |
72 | get { return m_isDeleted; } | 72 | get { return m_isDeleted; } |
73 | } | 73 | } |
74 | protected bool m_isDeleted; | 74 | protected bool m_isDeleted; |
75 | 75 | ||
76 | protected LLVector3 m_pos; | 76 | protected LLVector3 m_pos; |
77 | 77 | ||
diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index 2b1adee..1dd2273 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs | |||
@@ -131,13 +131,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
131 | 131 | ||
132 | public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; | 132 | public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; |
133 | 133 | ||
134 | |||
135 | public delegate void SignificantClientMovement(IClientAPI remote_client); | 134 | public delegate void SignificantClientMovement(IClientAPI remote_client); |
136 | 135 | ||
137 | public event SignificantClientMovement OnSignificantClientMovement; | 136 | public event SignificantClientMovement OnSignificantClientMovement; |
138 | 137 | ||
139 | |||
140 | |||
141 | public delegate void NewGridInstantMessage(GridInstantMessage message); | 138 | public delegate void NewGridInstantMessage(GridInstantMessage message); |
142 | 139 | ||
143 | public event NewGridInstantMessage OnGridInstantMessageToIMModule; | 140 | public event NewGridInstantMessage OnGridInstantMessageToIMModule; |
@@ -163,7 +160,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
163 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; | 160 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; |
164 | 161 | ||
165 | public delegate void ScriptNotAtTargetEvent(uint localID); | 162 | public delegate void ScriptNotAtTargetEvent(uint localID); |
166 | 163 | ||
167 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; | 164 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; |
168 | 165 | ||
169 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); | 166 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); |
@@ -172,8 +169,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
172 | public event ScriptColliding OnScriptColliding; | 169 | public event ScriptColliding OnScriptColliding; |
173 | public event ScriptColliding OnScriptCollidingEnd; | 170 | public event ScriptColliding OnScriptCollidingEnd; |
174 | 171 | ||
175 | |||
176 | |||
177 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); | 172 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); |
178 | public event OnMakeChildAgentDelegate OnMakeChildAgent; | 173 | public event OnMakeChildAgentDelegate OnMakeChildAgent; |
179 | 174 | ||
@@ -289,7 +284,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
289 | public int transactionID = 0; | 284 | public int transactionID = 0; |
290 | public int amountDebited = 0; | 285 | public int amountDebited = 0; |
291 | 286 | ||
292 | |||
293 | public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, | 287 | public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, |
294 | bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, | 288 | bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, |
295 | bool pauthenticated) | 289 | bool pauthenticated) |
@@ -306,8 +300,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
306 | } | 300 | } |
307 | } | 301 | } |
308 | 302 | ||
309 | |||
310 | |||
311 | public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); | 303 | public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); |
312 | 304 | ||
313 | public delegate void LandBuy(Object sender, LandBuyArgs e); | 305 | public delegate void LandBuy(Object sender, LandBuyArgs e); |
@@ -377,7 +369,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
377 | private ScriptColliding handlerColliding = null; | 369 | private ScriptColliding handlerColliding = null; |
378 | private ScriptColliding handlerCollidingEnd = null; | 370 | private ScriptColliding handlerCollidingEnd = null; |
379 | 371 | ||
380 | |||
381 | private SunLindenHour handlerSunGetLindenHour = null; | 372 | private SunLindenHour handlerSunGetLindenHour = null; |
382 | 373 | ||
383 | public void TriggerOnScriptChangedEvent(uint localID, uint change) | 374 | public void TriggerOnScriptChangedEvent(uint localID, uint change) |
@@ -491,7 +482,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
491 | if (handlerObjectBeingRemovedFromScene != null) | 482 | if (handlerObjectBeingRemovedFromScene != null) |
492 | { | 483 | { |
493 | handlerObjectBeingRemovedFromScene(obj); | 484 | handlerObjectBeingRemovedFromScene(obj); |
494 | |||
495 | } | 485 | } |
496 | } | 486 | } |
497 | 487 | ||
@@ -641,7 +631,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
641 | { | 631 | { |
642 | handlerGridInstantMessageToFriends(message); | 632 | handlerGridInstantMessageToFriends(message); |
643 | } | 633 | } |
644 | |||
645 | } | 634 | } |
646 | } | 635 | } |
647 | 636 | ||
@@ -698,7 +687,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
698 | handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); | 687 | handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); |
699 | } | 688 | } |
700 | } | 689 | } |
701 | public void TriggerLandBuy (Object sender, LandBuyArgs e) | 690 | |
691 | public void TriggerLandBuy(Object sender, LandBuyArgs e) | ||
702 | { | 692 | { |
703 | handlerLandBuy = OnLandBuy; | 693 | handlerLandBuy = OnLandBuy; |
704 | if (handlerLandBuy != null) | 694 | if (handlerLandBuy != null) |
@@ -706,6 +696,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
706 | handlerLandBuy(sender, e); | 696 | handlerLandBuy(sender, e); |
707 | } | 697 | } |
708 | } | 698 | } |
699 | |||
709 | public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) | 700 | public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) |
710 | { | 701 | { |
711 | handlerValidateLandBuy = OnValidateLandBuy; | 702 | handlerValidateLandBuy = OnValidateLandBuy; |
@@ -741,6 +732,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
741 | handlerRequestChangeWaterHeight(height); | 732 | handlerRequestChangeWaterHeight(height); |
742 | } | 733 | } |
743 | } | 734 | } |
735 | |||
744 | public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) | 736 | public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) |
745 | { | 737 | { |
746 | handlerAvatarKill = OnAvatarKilled; | 738 | handlerAvatarKill = OnAvatarKilled; |
@@ -756,7 +748,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
756 | if (handlerSignificantClientMovement != null) | 748 | if (handlerSignificantClientMovement != null) |
757 | { | 749 | { |
758 | handlerSignificantClientMovement(client); | 750 | handlerSignificantClientMovement(client); |
759 | |||
760 | } | 751 | } |
761 | } | 752 | } |
762 | 753 | ||
@@ -787,7 +778,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
787 | } | 778 | } |
788 | } | 779 | } |
789 | 780 | ||
790 | |||
791 | public void TriggerNoticeNoLandDataFromStorage() | 781 | public void TriggerNoticeNoLandDataFromStorage() |
792 | { | 782 | { |
793 | handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; | 783 | handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; |
@@ -818,26 +808,24 @@ namespace OpenSim.Region.Environment.Scenes | |||
818 | } | 808 | } |
819 | } | 809 | } |
820 | 810 | ||
821 | |||
822 | |||
823 | public void TriggerRequestParcelPrimCountUpdate() | 811 | public void TriggerRequestParcelPrimCountUpdate() |
824 | { | 812 | { |
825 | handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; | 813 | handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; |
826 | if (handlerRequestParcelPrimCountUpdate != null) | 814 | if (handlerRequestParcelPrimCountUpdate != null) |
827 | { | 815 | { |
828 | handlerRequestParcelPrimCountUpdate(); | 816 | handlerRequestParcelPrimCountUpdate(); |
829 | |||
830 | } | 817 | } |
831 | } | 818 | } |
819 | |||
832 | public void TriggerParcelPrimCountTainted() | 820 | public void TriggerParcelPrimCountTainted() |
833 | { | 821 | { |
834 | handlerParcelPrimCountTainted = OnParcelPrimCountTainted; | 822 | handlerParcelPrimCountTainted = OnParcelPrimCountTainted; |
835 | if (handlerParcelPrimCountTainted != null) | 823 | if (handlerParcelPrimCountTainted != null) |
836 | { | 824 | { |
837 | handlerParcelPrimCountTainted(); | 825 | handlerParcelPrimCountTainted(); |
838 | |||
839 | } | 826 | } |
840 | } | 827 | } |
828 | |||
841 | // this lets us keep track of nasty script events like timer, etc. | 829 | // this lets us keep track of nasty script events like timer, etc. |
842 | public void TriggerTimerEvent(uint objLocalID, double Interval) | 830 | public void TriggerTimerEvent(uint objLocalID, double Interval) |
843 | { | 831 | { |
@@ -845,9 +833,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
845 | if (handlerScriptTimerEvent != null) | 833 | if (handlerScriptTimerEvent != null) |
846 | { | 834 | { |
847 | handlerScriptTimerEvent(objLocalID, Interval); | 835 | handlerScriptTimerEvent(objLocalID, Interval); |
848 | |||
849 | } | 836 | } |
850 | |||
851 | } | 837 | } |
852 | 838 | ||
853 | public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) | 839 | public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) |
@@ -875,19 +861,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
875 | if (handlerCollidingStart != null) | 861 | if (handlerCollidingStart != null) |
876 | handlerCollidingStart(localId, colliders); | 862 | handlerCollidingStart(localId, colliders); |
877 | } | 863 | } |
864 | |||
878 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) | 865 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) |
879 | { | 866 | { |
880 | |||
881 | handlerColliding = OnScriptColliding; | 867 | handlerColliding = OnScriptColliding; |
882 | if (handlerColliding != null) | 868 | if (handlerColliding != null) |
883 | handlerColliding(localId, colliders); | 869 | handlerColliding(localId, colliders); |
884 | } | 870 | } |
871 | |||
885 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) | 872 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) |
886 | { | 873 | { |
887 | handlerCollidingEnd = OnScriptCollidingEnd; | 874 | handlerCollidingEnd = OnScriptCollidingEnd; |
888 | if (handlerCollidingEnd != null) | 875 | if (handlerCollidingEnd != null) |
889 | handlerCollidingEnd(localId, colliders); | 876 | handlerCollidingEnd(localId, colliders); |
890 | } | 877 | } |
891 | |||
892 | } | 878 | } |
893 | } | 879 | } |
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 3021891..6695dbf 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -96,7 +96,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
96 | // Then we've got to remove the previous | 96 | // Then we've got to remove the previous |
97 | // event handler | 97 | // event handler |
98 | 98 | ||
99 | if (_PhyScene != null) | 99 | if (_PhyScene != null) |
100 | _PhyScene.OnPhysicsCrash -= physicsBasedCrash; | 100 | _PhyScene.OnPhysicsCrash -= physicsBasedCrash; |
101 | 101 | ||
102 | _PhyScene = value; | 102 | _PhyScene = value; |
@@ -194,7 +194,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
194 | /// </param> | 194 | /// </param> |
195 | /// <returns> | 195 | /// <returns> |
196 | /// true if the object was added, false if an object with the same uuid was already in the scene | 196 | /// true if the object was added, false if an object with the same uuid was already in the scene |
197 | /// </returns> | 197 | /// </returns> |
198 | protected internal bool AddRestoredSceneObject( | 198 | protected internal bool AddRestoredSceneObject( |
199 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 199 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
200 | { | 200 | { |
@@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
205 | { | 205 | { |
206 | part.LocalId = m_parentScene.PrimIDAllocate(); | 206 | part.LocalId = m_parentScene.PrimIDAllocate(); |
207 | } | 207 | } |
208 | 208 | ||
209 | sceneObject.UpdateParentIDs(); | 209 | sceneObject.UpdateParentIDs(); |
210 | 210 | ||
211 | if (!alreadyPersisted) | 211 | if (!alreadyPersisted) |
@@ -213,10 +213,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
213 | sceneObject.ForceInventoryPersistence(); | 213 | sceneObject.ForceInventoryPersistence(); |
214 | sceneObject.HasGroupChanged = true; | 214 | sceneObject.HasGroupChanged = true; |
215 | } | 215 | } |
216 | 216 | ||
217 | return AddSceneObject(sceneObject, attachToBackup); | 217 | return AddSceneObject(sceneObject, attachToBackup); |
218 | } | 218 | } |
219 | 219 | ||
220 | /// <summary> | 220 | /// <summary> |
221 | /// Add a newly created object to the scene. This will both update the scene, and send information about the | 221 | /// Add a newly created object to the scene. This will both update the scene, and send information about the |
222 | /// new object to all clients interested in the scene. | 222 | /// new object to all clients interested in the scene. |
@@ -228,12 +228,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
228 | /// </param> | 228 | /// </param> |
229 | /// <returns> | 229 | /// <returns> |
230 | /// true if the object was added, false if an object with the same uuid was already in the scene | 230 | /// true if the object was added, false if an object with the same uuid was already in the scene |
231 | /// </returns> | 231 | /// </returns> |
232 | protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) | 232 | protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) |
233 | { | 233 | { |
234 | // Ensure that we persist this new scene object | 234 | // Ensure that we persist this new scene object |
235 | sceneObject.HasGroupChanged = true; | 235 | sceneObject.HasGroupChanged = true; |
236 | 236 | ||
237 | return AddSceneObject(sceneObject, attachToBackup); | 237 | return AddSceneObject(sceneObject, attachToBackup); |
238 | } | 238 | } |
239 | 239 | ||
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
252 | { | 252 | { |
253 | sceneObject.ApplyPhysics(m_parentScene.m_physicalPrim); | 253 | sceneObject.ApplyPhysics(m_parentScene.m_physicalPrim); |
254 | sceneObject.ScheduleGroupForFullUpdate(); | 254 | sceneObject.ScheduleGroupForFullUpdate(); |
255 | 255 | ||
256 | lock (Entities) | 256 | lock (Entities) |
257 | { | 257 | { |
258 | if (!Entities.ContainsKey(sceneObject.UUID)) | 258 | if (!Entities.ContainsKey(sceneObject.UUID)) |
@@ -261,8 +261,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
261 | Entities.Add(sceneObject.UUID, sceneObject); | 261 | Entities.Add(sceneObject.UUID, sceneObject); |
262 | m_numPrim += sceneObject.Children.Count; | 262 | m_numPrim += sceneObject.Children.Count; |
263 | 263 | ||
264 | if (attachToBackup) | 264 | if (attachToBackup) |
265 | sceneObject.AttachToBackup(); | 265 | sceneObject.AttachToBackup(); |
266 | 266 | ||
267 | return true; | 267 | return true; |
268 | } | 268 | } |
@@ -342,7 +342,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
342 | "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e); | 342 | "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e); |
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
346 | m_updateList.Clear(); | 346 | m_updateList.Clear(); |
347 | } | 347 | } |
348 | } | 348 | } |
@@ -555,7 +555,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
555 | protected internal void AddScenePresence(ScenePresence presence) | 555 | protected internal void AddScenePresence(ScenePresence presence) |
556 | { | 556 | { |
557 | bool child = presence.IsChildAgent; | 557 | bool child = presence.IsChildAgent; |
558 | 558 | ||
559 | if (child) | 559 | if (child) |
560 | { | 560 | { |
561 | m_numChildAgents++; | 561 | m_numChildAgents++; |
@@ -598,7 +598,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
598 | { | 598 | { |
599 | if (!ScenePresences.Remove(agentID)) | 599 | if (!ScenePresences.Remove(agentID)) |
600 | { | 600 | { |
601 | m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); | 601 | m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); |
602 | } | 602 | } |
603 | // else | 603 | // else |
604 | // { | 604 | // { |
@@ -774,7 +774,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
774 | /// Get a scene object group that contains the prim with the given uuid | 774 | /// Get a scene object group that contains the prim with the given uuid |
775 | /// </summary> | 775 | /// </summary> |
776 | /// <param name="fullID"></param> | 776 | /// <param name="fullID"></param> |
777 | /// <returns>null if no scene object group containing that prim is found</returns> | 777 | /// <returns>null if no scene object group containing that prim is found</returns> |
778 | private SceneObjectGroup GetGroupByPrim(LLUUID fullID) | 778 | private SceneObjectGroup GetGroupByPrim(LLUUID fullID) |
779 | { | 779 | { |
780 | List<EntityBase> EntityList = GetEntities(); | 780 | List<EntityBase> EntityList = GetEntities(); |
@@ -823,7 +823,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
823 | protected internal SceneObjectPart GetSceneObjectPart(uint localID) | 823 | protected internal SceneObjectPart GetSceneObjectPart(uint localID) |
824 | { | 824 | { |
825 | SceneObjectGroup group = GetGroupByPrim(localID); | 825 | SceneObjectGroup group = GetGroupByPrim(localID); |
826 | 826 | ||
827 | if (group != null) | 827 | if (group != null) |
828 | return group.GetChildPart(localID); | 828 | return group.GetChildPart(localID); |
829 | else | 829 | else |
@@ -834,7 +834,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
834 | /// Get a part contained in this scene. | 834 | /// Get a part contained in this scene. |
835 | /// </summary> | 835 | /// </summary> |
836 | /// <param name="fullID"></param> | 836 | /// <param name="fullID"></param> |
837 | /// <returns>null if the part was not found</returns> | 837 | /// <returns>null if the part was not found</returns> |
838 | protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) | 838 | protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) |
839 | { | 839 | { |
840 | SceneObjectGroup group = GetGroupByPrim(fullID); | 840 | SceneObjectGroup group = GetGroupByPrim(fullID); |
@@ -1089,7 +1089,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1089 | group.SendGroupTerseUpdate(); | 1089 | group.SendGroupTerseUpdate(); |
1090 | return; | 1090 | return; |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) | 1093 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) |
1094 | { | 1094 | { |
1095 | group.UpdateSinglePosition(pos, localID); | 1095 | group.UpdateSinglePosition(pos, localID); |
@@ -1119,7 +1119,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1119 | if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) | 1119 | if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) |
1120 | { | 1120 | { |
1121 | group.SendGroupTerseUpdate(); | 1121 | group.SendGroupTerseUpdate(); |
1122 | 1122 | ||
1123 | return; | 1123 | return; |
1124 | } | 1124 | } |
1125 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) | 1125 | if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) |
@@ -1397,14 +1397,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1397 | if (sendEvents) | 1397 | if (sendEvents) |
1398 | parenPrim.TriggerScriptChangedEvent(Changed.LINK); | 1398 | parenPrim.TriggerScriptChangedEvent(Changed.LINK); |
1399 | } | 1399 | } |
1400 | else | 1400 | else |
1401 | { | 1401 | { |
1402 | // The link set has prims remaining. This path is taken | 1402 | // The link set has prims remaining. This path is taken |
1403 | // when a subset of a link set's prims are selected | 1403 | // when a subset of a link set's prims are selected |
1404 | // and the root prim is part of that selection | 1404 | // and the root prim is part of that selection |
1405 | // | 1405 | // |
1406 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parenPrim.Children.Values); | 1406 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parenPrim.Children.Values); |
1407 | 1407 | ||
1408 | List<uint> unlink_ids = new List<uint>(); | 1408 | List<uint> unlink_ids = new List<uint>(); |
1409 | foreach (SceneObjectPart unlink_part in parts) | 1409 | foreach (SceneObjectPart unlink_part in parts) |
1410 | unlink_ids.Add(unlink_part.LocalId); | 1410 | unlink_ids.Add(unlink_part.LocalId); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index fe66dd5..0148d76 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -242,9 +242,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
242 | 242 | ||
243 | // Retrieve item | 243 | // Retrieve item |
244 | TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); | 244 | TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); |
245 | 245 | ||
246 | if (null == item) | 246 | if (null == item) |
247 | { | 247 | { |
248 | m_log.ErrorFormat( | 248 | m_log.ErrorFormat( |
249 | "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " | 249 | "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " |
250 | + " but the item does not exist in this inventory", | 250 | + " but the item does not exist in this inventory", |
@@ -338,7 +338,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
338 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 338 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
339 | else | 339 | else |
340 | item.CreationDate = itemUpd.CreationDate; | 340 | item.CreationDate = itemUpd.CreationDate; |
341 | |||
342 | 341 | ||
343 | // TODO: Check if folder changed and move item | 342 | // TODO: Check if folder changed and move item |
344 | //item.NextPermissions = itemUpd.Folder; | 343 | //item.NextPermissions = itemUpd.Folder; |
@@ -577,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
577 | asset.Type = assetType; | 576 | asset.Type = assetType; |
578 | asset.FullID = LLUUID.Random(); | 577 | asset.FullID = LLUUID.Random(); |
579 | asset.Data = (data == null) ? new byte[1] : data; | 578 | asset.Data = (data == null) ? new byte[1] : data; |
580 | 579 | ||
581 | return asset; | 580 | return asset; |
582 | } | 581 | } |
583 | 582 | ||
@@ -958,7 +957,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
958 | agentItem.Folder = folderId; | 957 | agentItem.Folder = folderId; |
959 | AddInventoryItem(remoteClient, agentItem); | 958 | AddInventoryItem(remoteClient, agentItem); |
960 | } | 959 | } |
961 | 960 | ||
962 | /// <summary> | 961 | /// <summary> |
963 | /// <see>ClientMoveTaskInventoryItem</see> | 962 | /// <see>ClientMoveTaskInventoryItem</see> |
964 | /// </summary> | 963 | /// </summary> |
@@ -981,13 +980,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
981 | } | 980 | } |
982 | 981 | ||
983 | TaskInventoryItem taskItem = part.GetInventoryItem(itemId); | 982 | TaskInventoryItem taskItem = part.GetInventoryItem(itemId); |
984 | 983 | ||
985 | if (null == taskItem) | 984 | if (null == taskItem) |
986 | { | 985 | { |
987 | m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" | 986 | m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" |
988 | + " because the inventory item could not be found", | 987 | + " because the inventory item could not be found", |
989 | itemId, primLocalId); | 988 | itemId, primLocalId); |
990 | 989 | ||
991 | return; | 990 | return; |
992 | } | 991 | } |
993 | 992 | ||
@@ -997,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
997 | 996 | ||
998 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | 997 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); |
999 | } | 998 | } |
1000 | 999 | ||
1001 | /// <summary> | 1000 | /// <summary> |
1002 | /// <see>MoveTaskInventoryItem</see> | 1001 | /// <see>MoveTaskInventoryItem</see> |
1003 | /// </summary> | 1002 | /// </summary> |
@@ -1029,7 +1028,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1029 | AddInventoryItem(avatarId, agentItem); | 1028 | AddInventoryItem(avatarId, agentItem); |
1030 | } | 1029 | } |
1031 | } | 1030 | } |
1032 | 1031 | ||
1033 | /// <summary> | 1032 | /// <summary> |
1034 | /// Copy a task (prim) inventory item to another task (prim) | 1033 | /// Copy a task (prim) inventory item to another task (prim) |
1035 | /// </summary> | 1034 | /// </summary> |
@@ -1049,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1049 | 1048 | ||
1050 | return; | 1049 | return; |
1051 | } | 1050 | } |
1052 | 1051 | ||
1053 | SceneObjectPart destPart = GetSceneObjectPart(destId); | 1052 | SceneObjectPart destPart = GetSceneObjectPart(destId); |
1054 | 1053 | ||
1055 | if (destPart == null) | 1054 | if (destPart == null) |
@@ -1060,7 +1059,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1060 | destId); | 1059 | destId); |
1061 | return; | 1060 | return; |
1062 | } | 1061 | } |
1063 | 1062 | ||
1064 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) | 1063 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) |
1065 | { | 1064 | { |
1066 | // object cannot copy items to an object owned by a different owner | 1065 | // object cannot copy items to an object owned by a different owner |
@@ -1076,7 +1075,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1076 | } | 1075 | } |
1077 | 1076 | ||
1078 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); | 1077 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); |
1079 | 1078 | ||
1080 | destTaskItem.ItemID = LLUUID.Random(); | 1079 | destTaskItem.ItemID = LLUUID.Random(); |
1081 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | 1080 | destTaskItem.CreatorID = srcTaskItem.CreatorID; |
1082 | destTaskItem.AssetID = srcTaskItem.AssetID; | 1081 | destTaskItem.AssetID = srcTaskItem.AssetID; |
@@ -1091,7 +1090,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1091 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; | 1090 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; |
1092 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; | 1091 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; |
1093 | destTaskItem.Flags = srcTaskItem.Flags; | 1092 | destTaskItem.Flags = srcTaskItem.Flags; |
1094 | 1093 | ||
1095 | if (destPart.OwnerID != part.OwnerID) | 1094 | if (destPart.OwnerID != part.OwnerID) |
1096 | { | 1095 | { |
1097 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 1096 | if (ExternalChecks.ExternalChecksPropagatePermissions()) |
@@ -1112,20 +1111,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
1112 | destTaskItem.Name = srcTaskItem.Name; | 1111 | destTaskItem.Name = srcTaskItem.Name; |
1113 | destTaskItem.InvType = srcTaskItem.InvType; | 1112 | destTaskItem.InvType = srcTaskItem.InvType; |
1114 | destTaskItem.Type = srcTaskItem.Type; | 1113 | destTaskItem.Type = srcTaskItem.Type; |
1115 | 1114 | ||
1116 | destPart.AddInventoryItem(destTaskItem); | 1115 | destPart.AddInventoryItem(destTaskItem); |
1117 | 1116 | ||
1118 | if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1117 | if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1119 | part.RemoveInventoryItem(itemId); | 1118 | part.RemoveInventoryItem(itemId); |
1120 | 1119 | ||
1121 | ScenePresence avatar; | 1120 | ScenePresence avatar; |
1122 | 1121 | ||
1123 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) | 1122 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) |
1124 | { | 1123 | { |
1125 | destPart.GetProperties(avatar.ControllingClient); | 1124 | destPart.GetProperties(avatar.ControllingClient); |
1126 | } | 1125 | } |
1127 | } | 1126 | } |
1128 | 1127 | ||
1129 | public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List<LLUUID> items) | 1128 | public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List<LLUUID> items) |
1130 | { | 1129 | { |
1131 | CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); | 1130 | CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); |
@@ -1139,7 +1138,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1139 | } | 1138 | } |
1140 | 1139 | ||
1141 | LLUUID newFolderID = LLUUID.Random(); | 1140 | LLUUID newFolderID = LLUUID.Random(); |
1142 | 1141 | ||
1143 | profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); | 1142 | profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); |
1144 | 1143 | ||
1145 | foreach (LLUUID itemID in items) | 1144 | foreach (LLUUID itemID in items) |
@@ -1346,7 +1345,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1346 | 1345 | ||
1347 | part.AddInventoryItem(taskItem); | 1346 | part.AddInventoryItem(taskItem); |
1348 | part.GetProperties(remoteClient); | 1347 | part.GetProperties(remoteClient); |
1349 | 1348 | ||
1350 | part.CreateScriptInstance(taskItem, 0, false); | 1349 | part.CreateScriptInstance(taskItem, 0, false); |
1351 | } | 1350 | } |
1352 | } | 1351 | } |
@@ -1370,7 +1369,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1370 | 1369 | ||
1371 | return; | 1370 | return; |
1372 | } | 1371 | } |
1373 | 1372 | ||
1374 | SceneObjectPart destPart = GetSceneObjectPart(destId); | 1373 | SceneObjectPart destPart = GetSceneObjectPart(destId); |
1375 | 1374 | ||
1376 | if (destPart == null) | 1375 | if (destPart == null) |
@@ -1381,7 +1380,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1381 | destId); | 1380 | destId); |
1382 | return; | 1381 | return; |
1383 | } | 1382 | } |
1384 | 1383 | ||
1385 | // Must own the object, and have modify rights | 1384 | // Must own the object, and have modify rights |
1386 | if (srcPart.OwnerID != destPart.OwnerID) | 1385 | if (srcPart.OwnerID != destPart.OwnerID) |
1387 | return; | 1386 | return; |
@@ -1395,14 +1394,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1395 | "[PRIM INVENTORY]: " + | 1394 | "[PRIM INVENTORY]: " + |
1396 | "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", | 1395 | "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", |
1397 | srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); | 1396 | srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); |
1398 | // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - | 1397 | // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - |
1399 | // "Object: Task Object trying to illegally load script onto task Other_Object!" | 1398 | // "Object: Task Object trying to illegally load script onto task Other_Object!" |
1400 | // How do we shout from in here? | 1399 | // How do we shout from in here? |
1401 | return; | 1400 | return; |
1402 | } | 1401 | } |
1403 | 1402 | ||
1404 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); | 1403 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); |
1405 | 1404 | ||
1406 | destTaskItem.ItemID = LLUUID.Random(); | 1405 | destTaskItem.ItemID = LLUUID.Random(); |
1407 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | 1406 | destTaskItem.CreatorID = srcTaskItem.CreatorID; |
1408 | destTaskItem.AssetID = srcTaskItem.AssetID; | 1407 | destTaskItem.AssetID = srcTaskItem.AssetID; |
@@ -1417,7 +1416,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1417 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; | 1416 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; |
1418 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; | 1417 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; |
1419 | destTaskItem.Flags = srcTaskItem.Flags; | 1418 | destTaskItem.Flags = srcTaskItem.Flags; |
1420 | 1419 | ||
1421 | if (destPart.OwnerID != srcPart.OwnerID) | 1420 | if (destPart.OwnerID != srcPart.OwnerID) |
1422 | { | 1421 | { |
1423 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 1422 | if (ExternalChecks.ExternalChecksPropagatePermissions()) |
@@ -1438,22 +1437,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
1438 | destTaskItem.Name = srcTaskItem.Name; | 1437 | destTaskItem.Name = srcTaskItem.Name; |
1439 | destTaskItem.InvType = srcTaskItem.InvType; | 1438 | destTaskItem.InvType = srcTaskItem.InvType; |
1440 | destTaskItem.Type = srcTaskItem.Type; | 1439 | destTaskItem.Type = srcTaskItem.Type; |
1441 | 1440 | ||
1442 | destPart.AddInventoryItemExclusive(destTaskItem); | 1441 | destPart.AddInventoryItemExclusive(destTaskItem); |
1443 | 1442 | ||
1444 | if (running > 0) | 1443 | if (running > 0) |
1445 | { | 1444 | { |
1446 | destPart.CreateScriptInstance(destTaskItem, 0, false); | 1445 | destPart.CreateScriptInstance(destTaskItem, 0, false); |
1447 | } | 1446 | } |
1448 | 1447 | ||
1449 | ScenePresence avatar; | 1448 | ScenePresence avatar; |
1450 | 1449 | ||
1451 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) | 1450 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) |
1452 | { | 1451 | { |
1453 | destPart.GetProperties(avatar.ControllingClient); | 1452 | destPart.GetProperties(avatar.ControllingClient); |
1454 | } | 1453 | } |
1455 | } | 1454 | } |
1456 | 1455 | ||
1457 | /// <summary> | 1456 | /// <summary> |
1458 | /// Called when an object is removed from the environment into inventory. | 1457 | /// Called when an object is removed from the environment into inventory. |
1459 | /// </summary> | 1458 | /// </summary> |
@@ -1566,7 +1565,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1566 | private bool InventoryDeQueueAndDelete() | 1565 | private bool InventoryDeQueueAndDelete() |
1567 | { | 1566 | { |
1568 | DeleteToInventoryHolder x = null; | 1567 | DeleteToInventoryHolder x = null; |
1569 | 1568 | ||
1570 | try | 1569 | try |
1571 | { | 1570 | { |
1572 | lock (m_inventoryDeletes) | 1571 | lock (m_inventoryDeletes) |
@@ -1580,13 +1579,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1580 | return true; | 1579 | return true; |
1581 | } | 1580 | } |
1582 | } | 1581 | } |
1583 | } | 1582 | } |
1584 | catch(Exception e) | 1583 | catch(Exception e) |
1585 | { | 1584 | { |
1586 | // We can't put the object group details in here since the root part may have disappeared (which is where these sit). | 1585 | // We can't put the object group details in here since the root part may have disappeared (which is where these sit). |
1587 | // FIXME: This needs to be fixed. | 1586 | // FIXME: This needs to be fixed. |
1588 | m_log.ErrorFormat( | 1587 | m_log.ErrorFormat( |
1589 | "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", | 1588 | "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", |
1590 | (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); | 1589 | (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); |
1591 | } | 1590 | } |
1592 | 1591 | ||
@@ -1745,7 +1744,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1745 | } | 1744 | } |
1746 | } | 1745 | } |
1747 | } | 1746 | } |
1748 | 1747 | ||
1749 | AssetBase asset = CreateAsset( | 1748 | AssetBase asset = CreateAsset( |
1750 | objectGroup.GetPartName(objectGroup.LocalId), | 1749 | objectGroup.GetPartName(objectGroup.LocalId), |
1751 | objectGroup.GetPartDescription(objectGroup.LocalId), | 1750 | objectGroup.GetPartDescription(objectGroup.LocalId), |
@@ -1792,7 +1791,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1792 | } | 1791 | } |
1793 | } | 1792 | } |
1794 | } | 1793 | } |
1795 | 1794 | ||
1796 | public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) | 1795 | public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) |
1797 | { | 1796 | { |
1798 | SceneObjectGroup objectGroup = grp; | 1797 | SceneObjectGroup objectGroup = grp; |
@@ -2057,7 +2056,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2057 | /// <param name="param"></param> | 2056 | /// <param name="param"></param> |
2058 | /// <returns></returns> | 2057 | /// <returns></returns> |
2059 | public virtual SceneObjectGroup RezObject( | 2058 | public virtual SceneObjectGroup RezObject( |
2060 | SceneObjectPart sourcePart, TaskInventoryItem item, | 2059 | SceneObjectPart sourcePart, TaskInventoryItem item, |
2061 | LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) | 2060 | LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) |
2062 | { | 2061 | { |
2063 | // Rez object | 2062 | // Rez object |
@@ -2142,10 +2141,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2142 | return rootPart.ParentGroup; | 2141 | return rootPart.ParentGroup; |
2143 | } | 2142 | } |
2144 | } | 2143 | } |
2145 | 2144 | ||
2146 | return null; | 2145 | return null; |
2147 | } | 2146 | } |
2148 | 2147 | ||
2149 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) | 2148 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) |
2150 | { | 2149 | { |
2151 | string message = ""; | 2150 | string message = ""; |
@@ -2218,7 +2217,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2218 | item.AssetType = asset.Type; | 2217 | item.AssetType = asset.Type; |
2219 | item.InvType = (int)InventoryType.Object; | 2218 | item.InvType = (int)InventoryType.Object; |
2220 | item.Folder = folderID; | 2219 | item.Folder = folderID; |
2221 | 2220 | ||
2222 | if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) | 2221 | if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) |
2223 | { | 2222 | { |
2224 | uint perms = returnobjects[i].GetEffectivePermissions(); | 2223 | uint perms = returnobjects[i].GetEffectivePermissions(); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e8a8a78..474f062 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -74,11 +74,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
74 | public InnerScene m_innerScene; | 74 | public InnerScene m_innerScene; |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
77 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is | 77 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is |
78 | /// dispenced. | 78 | /// dispenced. |
79 | /// </summary> | 79 | /// </summary> |
80 | private uint m_lastAllocatedLocalId = 720000; | 80 | private uint m_lastAllocatedLocalId = 720000; |
81 | 81 | ||
82 | private readonly Mutex _primAllocateMutex = new Mutex(false); | 82 | private readonly Mutex _primAllocateMutex = new Mutex(false); |
83 | 83 | ||
84 | private int m_timePhase = 24; | 84 | private int m_timePhase = 24; |
@@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
607 | public override void Close() | 607 | public override void Close() |
608 | { | 608 | { |
609 | m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); | 609 | m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); |
610 | 610 | ||
611 | // Kick all ROOT agents with the message, 'The simulator is going down' | 611 | // Kick all ROOT agents with the message, 'The simulator is going down' |
612 | ForEachScenePresence(delegate(ScenePresence avatar) | 612 | ForEachScenePresence(delegate(ScenePresence avatar) |
613 | { | 613 | { |
@@ -765,7 +765,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
765 | if (m_frame % m_update_backup == 0) | 765 | if (m_frame % m_update_backup == 0) |
766 | { | 766 | { |
767 | UpdateStorageBackup(); | 767 | UpdateStorageBackup(); |
768 | 768 | ||
769 | } | 769 | } |
770 | 770 | ||
771 | if (m_frame % m_update_terrain == 0) | 771 | if (m_frame % m_update_terrain == 0) |
@@ -1112,7 +1112,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1112 | //X | 1112 | //X |
1113 | // . | 1113 | // . |
1114 | // | 1114 | // |
1115 | // Shade the terrain for shadows | 1115 | // Shade the terrain for shadows |
1116 | if ((x - 1 > 0) && (y - 1 > 0)) | 1116 | if ((x - 1 > 0) && (y - 1 > 0)) |
1117 | { | 1117 | { |
1118 | hfvalue = (float)hm[x, y]; | 1118 | hfvalue = (float)hm[x, y]; |
@@ -1133,7 +1133,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1133 | else if (hfdiff < -0.3f) | 1133 | else if (hfdiff < -0.3f) |
1134 | { | 1134 | { |
1135 | // We have to desaturate and blacken the land at the same time | 1135 | // We have to desaturate and blacken the land at the same time |
1136 | // we use floats, colors use bytes, so shrink are space down to | 1136 | // we use floats, colors use bytes, so shrink are space down to |
1137 | // 0-255 | 1137 | // 0-255 |
1138 | 1138 | ||
1139 | 1139 | ||
@@ -1429,13 +1429,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1429 | public void LazySaveGeneratedMaptile(byte[] data, bool temporary) | 1429 | public void LazySaveGeneratedMaptile(byte[] data, bool temporary) |
1430 | { | 1430 | { |
1431 | // Overwrites the local Asset cache with new maptile data | 1431 | // Overwrites the local Asset cache with new maptile data |
1432 | // Assets are single write, this causes the asset server to ignore this update, | 1432 | // Assets are single write, this causes the asset server to ignore this update, |
1433 | // but the local asset cache does not | 1433 | // but the local asset cache does not |
1434 | 1434 | ||
1435 | // this is on purpose! The net result of this is the region always has the most up to date | 1435 | // this is on purpose! The net result of this is the region always has the most up to date |
1436 | // map tile while protecting the (grid) asset database from bloat caused by a new asset each | 1436 | // map tile while protecting the (grid) asset database from bloat caused by a new asset each |
1437 | // time a mapimage is generated! | 1437 | // time a mapimage is generated! |
1438 | 1438 | ||
1439 | LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; | 1439 | LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; |
1440 | 1440 | ||
1441 | int lastMapRefresh = 0; | 1441 | int lastMapRefresh = 0; |
@@ -1711,7 +1711,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1711 | /// </param> | 1711 | /// </param> |
1712 | /// <returns> | 1712 | /// <returns> |
1713 | /// true if the object was added, false if an object with the same uuid was already in the scene | 1713 | /// true if the object was added, false if an object with the same uuid was already in the scene |
1714 | /// </returns> | 1714 | /// </returns> |
1715 | public bool AddRestoredSceneObject( | 1715 | public bool AddRestoredSceneObject( |
1716 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 1716 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
1717 | { | 1717 | { |
@@ -1739,15 +1739,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1739 | lock (Entities) | 1739 | lock (Entities) |
1740 | { | 1740 | { |
1741 | ICollection<EntityBase> entities = new List<EntityBase>(Entities.Values); | 1741 | ICollection<EntityBase> entities = new List<EntityBase>(Entities.Values); |
1742 | 1742 | ||
1743 | foreach (EntityBase e in entities) | 1743 | foreach (EntityBase e in entities) |
1744 | { | 1744 | { |
1745 | if (e is SceneObjectGroup) | 1745 | if (e is SceneObjectGroup) |
1746 | DeleteSceneObject((SceneObjectGroup)e); | 1746 | DeleteSceneObject((SceneObjectGroup)e); |
1747 | } | 1747 | } |
1748 | } | 1748 | } |
1749 | } | 1749 | } |
1750 | 1750 | ||
1751 | /// <summary> | 1751 | /// <summary> |
1752 | /// Delete the given object from the scene. | 1752 | /// Delete the given object from the scene. |
1753 | /// </summary> | 1753 | /// </summary> |
@@ -1791,8 +1791,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1791 | 1791 | ||
1792 | public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) | 1792 | public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) |
1793 | { | 1793 | { |
1794 | m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); | 1794 | m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); |
1795 | 1795 | ||
1796 | m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); | 1796 | m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); |
1797 | } | 1797 | } |
1798 | 1798 | ||
@@ -1805,29 +1805,29 @@ namespace OpenSim.Region.Environment.Scenes | |||
1805 | 1805 | ||
1806 | public void LoadPrimsFromXml2(string fileName) | 1806 | public void LoadPrimsFromXml2(string fileName) |
1807 | { | 1807 | { |
1808 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); | 1808 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); |
1809 | 1809 | ||
1810 | m_serialiser.LoadPrimsFromXml2(this, fileName); | 1810 | m_serialiser.LoadPrimsFromXml2(this, fileName); |
1811 | } | 1811 | } |
1812 | 1812 | ||
1813 | public void LoadPrimsFromXml2(TextReader reader, bool startScripts) | 1813 | public void LoadPrimsFromXml2(TextReader reader, bool startScripts) |
1814 | { | 1814 | { |
1815 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); | 1815 | m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); |
1816 | 1816 | ||
1817 | m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); | 1817 | m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); |
1818 | } | 1818 | } |
1819 | 1819 | ||
1820 | public void SavePrimsToXml2(string fileName) | 1820 | public void SavePrimsToXml2(string fileName) |
1821 | { | 1821 | { |
1822 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); | 1822 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); |
1823 | 1823 | ||
1824 | m_serialiser.SavePrimsToXml2(this, fileName); | 1824 | m_serialiser.SavePrimsToXml2(this, fileName); |
1825 | } | 1825 | } |
1826 | 1826 | ||
1827 | public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) | 1827 | public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) |
1828 | { | 1828 | { |
1829 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); | 1829 | m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); |
1830 | 1830 | ||
1831 | m_serialiser.SavePrimsToXml2(this, stream, min, max); | 1831 | m_serialiser.SavePrimsToXml2(this, stream, min, max); |
1832 | } | 1832 | } |
1833 | 1833 | ||
@@ -1835,7 +1835,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1835 | { | 1835 | { |
1836 | m_log.InfoFormat( | 1836 | m_log.InfoFormat( |
1837 | "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName); | 1837 | "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName); |
1838 | 1838 | ||
1839 | List<EntityBase> entityList = GetEntities(); | 1839 | List<EntityBase> entityList = GetEntities(); |
1840 | List<EntityBase> primList = new List<EntityBase>(); | 1840 | List<EntityBase> primList = new List<EntityBase>(); |
1841 | 1841 | ||
@@ -1860,7 +1860,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1860 | public void LoadPrimsFromArchive(string filePath) | 1860 | public void LoadPrimsFromArchive(string filePath) |
1861 | { | 1861 | { |
1862 | m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath); | 1862 | m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath); |
1863 | 1863 | ||
1864 | m_archiver.DearchiveRegion(filePath); | 1864 | m_archiver.DearchiveRegion(filePath); |
1865 | } | 1865 | } |
1866 | 1866 | ||
@@ -1871,7 +1871,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1871 | public void SavePrimsToArchive(string filePath) | 1871 | public void SavePrimsToArchive(string filePath) |
1872 | { | 1872 | { |
1873 | m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath); | 1873 | m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath); |
1874 | 1874 | ||
1875 | m_archiver.ArchiveRegion(filePath); | 1875 | m_archiver.ArchiveRegion(filePath); |
1876 | } | 1876 | } |
1877 | 1877 | ||
@@ -1986,7 +1986,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1986 | m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); | 1986 | m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); |
1987 | if (XMLMethod == 0) | 1987 | if (XMLMethod == 0) |
1988 | { | 1988 | { |
1989 | SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); | 1989 | SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); |
1990 | AddRestoredSceneObject(sceneObject, true, false); | 1990 | AddRestoredSceneObject(sceneObject, true, false); |
1991 | 1991 | ||
1992 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); | 1992 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); |
@@ -1999,7 +1999,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1999 | { | 1999 | { |
2000 | DeleteSceneObject(grp); | 2000 | DeleteSceneObject(grp); |
2001 | } | 2001 | } |
2002 | 2002 | ||
2003 | m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); | 2003 | m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); |
2004 | 2004 | ||
2005 | return false; | 2005 | return false; |
@@ -2075,7 +2075,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2075 | else | 2075 | else |
2076 | { | 2076 | { |
2077 | m_log.DebugFormat( | 2077 | m_log.DebugFormat( |
2078 | "[SCENE]: Adding new {0} agent {1} {2} in {3}", | 2078 | "[SCENE]: Adding new {0} agent {1} {2} in {3}", |
2079 | (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); | 2079 | (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); |
2080 | 2080 | ||
2081 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | 2081 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); |
@@ -2156,7 +2156,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2156 | client.OnScriptReset += ProcessScriptReset; | 2156 | client.OnScriptReset += ProcessScriptReset; |
2157 | client.OnGetScriptRunning += GetScriptRunning; | 2157 | client.OnGetScriptRunning += GetScriptRunning; |
2158 | client.OnSetScriptRunning += SetScriptRunning; | 2158 | client.OnSetScriptRunning += SetScriptRunning; |
2159 | 2159 | ||
2160 | client.OnRegionHandleRequest += RegionHandleRequest; | 2160 | client.OnRegionHandleRequest += RegionHandleRequest; |
2161 | 2161 | ||
2162 | client.OnUnackedTerrain += TerrainUnAcked; | 2162 | client.OnUnackedTerrain += TerrainUnAcked; |
@@ -2310,7 +2310,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2310 | public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) | 2310 | public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) |
2311 | { | 2311 | { |
2312 | appearance = null; // VS needs this line, mono doesn't | 2312 | appearance = null; // VS needs this line, mono doesn't |
2313 | 2313 | ||
2314 | try | 2314 | try |
2315 | { | 2315 | { |
2316 | if (m_AvatarFactory == null || | 2316 | if (m_AvatarFactory == null || |
@@ -2323,10 +2323,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2323 | catch (Exception e) | 2323 | catch (Exception e) |
2324 | { | 2324 | { |
2325 | m_log.ErrorFormat( | 2325 | m_log.ErrorFormat( |
2326 | "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", | 2326 | "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", |
2327 | client.Name, client.AgentId, e); | 2327 | client.Name, client.AgentId, e); |
2328 | appearance = new AvatarAppearance(); | 2328 | appearance = new AvatarAppearance(); |
2329 | } | 2329 | } |
2330 | } | 2330 | } |
2331 | 2331 | ||
2332 | /// <summary> | 2332 | /// <summary> |
@@ -2341,13 +2341,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
2341 | { | 2341 | { |
2342 | childagentYN = avatar.IsChildAgent; | 2342 | childagentYN = avatar.IsChildAgent; |
2343 | } | 2343 | } |
2344 | 2344 | ||
2345 | try | 2345 | try |
2346 | { | 2346 | { |
2347 | m_log.DebugFormat( | 2347 | m_log.DebugFormat( |
2348 | "[SCENE]: Removing {0} agent {1} from region {2}", | 2348 | "[SCENE]: Removing {0} agent {1} from region {2}", |
2349 | (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); | 2349 | (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); |
2350 | 2350 | ||
2351 | if (avatar.IsChildAgent) | 2351 | if (avatar.IsChildAgent) |
2352 | { | 2352 | { |
2353 | m_innerScene.removeUserCount(false); | 2353 | m_innerScene.removeUserCount(false); |
@@ -2378,7 +2378,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2378 | // We don't know which count to remove it from | 2378 | // We don't know which count to remove it from |
2379 | // Avatar is already disposed :/ | 2379 | // Avatar is already disposed :/ |
2380 | } | 2380 | } |
2381 | 2381 | ||
2382 | m_eventManager.TriggerOnRemovePresence(agentID); | 2382 | m_eventManager.TriggerOnRemovePresence(agentID); |
2383 | Broadcast(delegate(IClientAPI client) | 2383 | Broadcast(delegate(IClientAPI client) |
2384 | { | 2384 | { |
@@ -2717,7 +2717,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2717 | { | 2717 | { |
2718 | m_innerScene.removeUserCount(true); | 2718 | m_innerScene.removeUserCount(true); |
2719 | } | 2719 | } |
2720 | 2720 | ||
2721 | // Tell a single agent to disconnect from the region. | 2721 | // Tell a single agent to disconnect from the region. |
2722 | presence.ControllingClient.SendShutdownConnectionNotice(); | 2722 | presence.ControllingClient.SendShutdownConnectionNotice(); |
2723 | 2723 | ||
@@ -3827,9 +3827,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
3827 | { | 3827 | { |
3828 | //should be doing this by parcel, but as its only for testing | 3828 | //should be doing this by parcel, but as its only for testing |
3829 | // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4 | 3829 | // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4 |
3830 | // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist | 3830 | // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist |
3831 | // in the context of `<>c__CompilerGenerated17' | 3831 | // in the context of `<>c__CompilerGenerated17' |
3832 | // MW said it was okay to comment the body of this method out for now since the code is experimental | 3832 | // MW said it was okay to comment the body of this method out for now since the code is experimental |
3833 | // and will be replaced anyway | 3833 | // and will be replaced anyway |
3834 | // ForEachClient(delegate(IClientAPI client) | 3834 | // ForEachClient(delegate(IClientAPI client) |
3835 | // { | 3835 | // { |
@@ -3840,7 +3840,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
3840 | // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); | 3840 | // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); |
3841 | // }); | 3841 | // }); |
3842 | } | 3842 | } |
3843 | 3843 | ||
3844 | public void RegionHandleRequest(IClientAPI client, LLUUID regionID) | 3844 | public void RegionHandleRequest(IClientAPI client, LLUUID regionID) |
3845 | { | 3845 | { |
3846 | RegionInfo info; | 3846 | RegionInfo info; |
@@ -3860,4 +3860,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
3860 | client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); | 3860 | client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); |
3861 | } | 3861 | } |
3862 | } | 3862 | } |
3863 | } | 3863 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 35a7434..adad7d3 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
60 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; | 60 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; |
61 | public event LogOffUser OnLogOffUser; | 61 | public event LogOffUser OnLogOffUser; |
62 | public event GetLandData OnGetLandData; | 62 | public event GetLandData OnGetLandData; |
63 | 63 | ||
64 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; | 64 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; |
65 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; | 65 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; |
66 | private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; | 66 | private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; |
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
70 | private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; | 70 | private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; |
71 | private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; | 71 | private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; |
72 | private LogOffUser handlerLogOffUser = null; | 72 | private LogOffUser handlerLogOffUser = null; |
73 | private GetLandData handlerGetLandData = null; // OnGetLandData | 73 | private GetLandData handlerGetLandData = null; // OnGetLandData |
74 | 74 | ||
75 | public KillObjectDelegate KillObject; | 75 | public KillObjectDelegate KillObject; |
76 | public string _debugRegionName = String.Empty; | 76 | public string _debugRegionName = String.Empty; |
@@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
240 | } | 240 | } |
241 | return null; | 241 | return null; |
242 | } | 242 | } |
243 | 243 | ||
244 | #endregion | 244 | #endregion |
245 | 245 | ||
246 | #region Inform Client of Neighbours | 246 | #region Inform Client of Neighbours |
@@ -582,7 +582,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
582 | LLVector3 lookAt, uint flags) | 582 | LLVector3 lookAt, uint flags) |
583 | { | 583 | { |
584 | bool destRegionUp = false; | 584 | bool destRegionUp = false; |
585 | 585 | ||
586 | if (regionHandle == m_regionInfo.RegionHandle) | 586 | if (regionHandle == m_regionInfo.RegionHandle) |
587 | { | 587 | { |
588 | // Teleport within the same region | 588 | // Teleport within the same region |
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index 0b2cc9e..a0e0a37 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -45,534 +45,553 @@ namespace OpenSim.Region.Environment.Scenes | |||
45 | 45 | ||
46 | #region Object Permission Checks | 46 | #region Object Permission Checks |
47 | 47 | ||
48 | public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); | 48 | public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); |
49 | private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>(); | 49 | private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>(); |
50 | 50 | ||
51 | public void addGenerateClientFlags(GenerateClientFlags delegateFunc) | 51 | public void addGenerateClientFlags(GenerateClientFlags delegateFunc) |
52 | { | 52 | { |
53 | if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) | 53 | if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) |
54 | GenerateClientFlagsCheckFunctions.Add(delegateFunc); | 54 | GenerateClientFlagsCheckFunctions.Add(delegateFunc); |
55 | } | 55 | } |
56 | public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) | ||
57 | { | ||
58 | if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) | ||
59 | GenerateClientFlagsCheckFunctions.Remove(delegateFunc); | ||
60 | } | ||
61 | 56 | ||
62 | public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) | 57 | public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) |
63 | { | 58 | { |
64 | SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); | 59 | if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) |
65 | 60 | GenerateClientFlagsCheckFunctions.Remove(delegateFunc); | |
66 | if (part == null) | 61 | } |
67 | return 0; | ||
68 | |||
69 | uint perms=part.GetEffectiveObjectFlags() | | ||
70 | (uint)LLObject.ObjectFlags.ObjectModify | | ||
71 | (uint)LLObject.ObjectFlags.ObjectCopy | | ||
72 | (uint)LLObject.ObjectFlags.ObjectMove | | ||
73 | (uint)LLObject.ObjectFlags.ObjectTransfer | | ||
74 | (uint)LLObject.ObjectFlags.ObjectYouOwner | | ||
75 | (uint)LLObject.ObjectFlags.ObjectAnyOwner | | ||
76 | (uint)LLObject.ObjectFlags.ObjectOwnerModify | | ||
77 | (uint)LLObject.ObjectFlags.ObjectYouOfficer; | ||
78 | |||
79 | foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) | ||
80 | { | ||
81 | perms &= check(userID, objectID); | ||
82 | } | ||
83 | return perms; | ||
84 | } | ||
85 | 62 | ||
86 | public delegate void SetBypassPermissions(bool value); | 63 | public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) |
87 | private List<SetBypassPermissions> SetBypassPermissionsCheckFunctions = new List<SetBypassPermissions>(); | 64 | { |
65 | SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); | ||
88 | 66 | ||
89 | public void addSetBypassPermissions(SetBypassPermissions delegateFunc) | 67 | if (part == null) |
90 | { | 68 | return 0; |
91 | if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
92 | SetBypassPermissionsCheckFunctions.Add(delegateFunc); | ||
93 | } | ||
94 | public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) | ||
95 | { | ||
96 | if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
97 | SetBypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
98 | } | ||
99 | 69 | ||
100 | public void ExternalChecksSetBypassPermissions(bool value) | 70 | uint perms=part.GetEffectiveObjectFlags() | |
71 | (uint)LLObject.ObjectFlags.ObjectModify | | ||
72 | (uint)LLObject.ObjectFlags.ObjectCopy | | ||
73 | (uint)LLObject.ObjectFlags.ObjectMove | | ||
74 | (uint)LLObject.ObjectFlags.ObjectTransfer | | ||
75 | (uint)LLObject.ObjectFlags.ObjectYouOwner | | ||
76 | (uint)LLObject.ObjectFlags.ObjectAnyOwner | | ||
77 | (uint)LLObject.ObjectFlags.ObjectOwnerModify | | ||
78 | (uint)LLObject.ObjectFlags.ObjectYouOfficer; | ||
79 | |||
80 | foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) | ||
101 | { | 81 | { |
102 | foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) | 82 | perms &= check(userID, objectID); |
103 | { | ||
104 | check(value); | ||
105 | } | ||
106 | } | 83 | } |
84 | return perms; | ||
85 | } | ||
107 | 86 | ||
108 | public delegate bool BypassPermissions(); | 87 | public delegate void SetBypassPermissions(bool value); |
109 | private List<BypassPermissions> BypassPermissionsCheckFunctions = new List<BypassPermissions>(); | 88 | private List<SetBypassPermissions> SetBypassPermissionsCheckFunctions = new List<SetBypassPermissions>(); |
110 | 89 | ||
111 | public void addBypassPermissions(BypassPermissions delegateFunc) | 90 | public void addSetBypassPermissions(SetBypassPermissions delegateFunc) |
112 | { | 91 | { |
113 | if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) | 92 | if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) |
114 | BypassPermissionsCheckFunctions.Add(delegateFunc); | 93 | SetBypassPermissionsCheckFunctions.Add(delegateFunc); |
115 | } | 94 | } |
116 | public void removeBypassPermissions(BypassPermissions delegateFunc) | 95 | |
96 | public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) | ||
97 | { | ||
98 | if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
99 | SetBypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
100 | } | ||
101 | |||
102 | public void ExternalChecksSetBypassPermissions(bool value) | ||
103 | { | ||
104 | foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) | ||
117 | { | 105 | { |
118 | if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) | 106 | check(value); |
119 | BypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
120 | } | 107 | } |
108 | } | ||
121 | 109 | ||
122 | public bool ExternalChecksBypassPermissions() | 110 | public delegate bool BypassPermissions(); |
111 | private List<BypassPermissions> BypassPermissionsCheckFunctions = new List<BypassPermissions>(); | ||
112 | |||
113 | public void addBypassPermissions(BypassPermissions delegateFunc) | ||
114 | { | ||
115 | if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
116 | BypassPermissionsCheckFunctions.Add(delegateFunc); | ||
117 | } | ||
118 | |||
119 | public void removeBypassPermissions(BypassPermissions delegateFunc) | ||
120 | { | ||
121 | if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) | ||
122 | BypassPermissionsCheckFunctions.Remove(delegateFunc); | ||
123 | } | ||
124 | |||
125 | public bool ExternalChecksBypassPermissions() | ||
126 | { | ||
127 | foreach (BypassPermissions check in BypassPermissionsCheckFunctions) | ||
123 | { | 128 | { |
124 | foreach (BypassPermissions check in BypassPermissionsCheckFunctions) | 129 | if (check() == false) |
125 | { | 130 | { |
126 | if (check() == false) | 131 | return false; |
127 | { | ||
128 | return false; | ||
129 | } | ||
130 | } | 132 | } |
131 | return true; | ||
132 | } | 133 | } |
134 | return true; | ||
135 | } | ||
133 | 136 | ||
134 | public delegate bool PropagatePermissions(); | 137 | public delegate bool PropagatePermissions(); |
135 | private List<PropagatePermissions> PropagatePermissionsCheckFunctions = new List<PropagatePermissions>(); | 138 | private List<PropagatePermissions> PropagatePermissionsCheckFunctions = new List<PropagatePermissions>(); |
136 | 139 | ||
137 | public void addPropagatePermissions(PropagatePermissions delegateFunc) | 140 | public void addPropagatePermissions(PropagatePermissions delegateFunc) |
138 | { | 141 | { |
139 | if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | 142 | if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) |
140 | PropagatePermissionsCheckFunctions.Add(delegateFunc); | 143 | PropagatePermissionsCheckFunctions.Add(delegateFunc); |
141 | } | 144 | } |
142 | public void removePropagatePermissions(PropagatePermissions delegateFunc) | ||
143 | { | ||
144 | if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | ||
145 | PropagatePermissionsCheckFunctions.Remove(delegateFunc); | ||
146 | } | ||
147 | 145 | ||
148 | public bool ExternalChecksPropagatePermissions() | 146 | public void removePropagatePermissions(PropagatePermissions delegateFunc) |
147 | { | ||
148 | if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | ||
149 | PropagatePermissionsCheckFunctions.Remove(delegateFunc); | ||
150 | } | ||
151 | |||
152 | public bool ExternalChecksPropagatePermissions() | ||
153 | { | ||
154 | foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) | ||
149 | { | 155 | { |
150 | foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) | 156 | if (check() == false) |
151 | { | 157 | { |
152 | if (check() == false) | 158 | return false; |
153 | { | ||
154 | return false; | ||
155 | } | ||
156 | } | 159 | } |
157 | return true; | ||
158 | } | 160 | } |
161 | return true; | ||
162 | } | ||
159 | 163 | ||
160 | #region REZ OBJECT | 164 | #region REZ OBJECT |
161 | public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); | 165 | public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); |
162 | private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); | 166 | private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); |
163 | 167 | ||
164 | public void addCheckRezObject(CanRezObject delegateFunc) | 168 | public void addCheckRezObject(CanRezObject delegateFunc) |
165 | { | 169 | { |
166 | if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) | 170 | if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) |
167 | CanRezObjectCheckFunctions.Add(delegateFunc); | 171 | CanRezObjectCheckFunctions.Add(delegateFunc); |
168 | } | 172 | } |
169 | public void removeCheckRezObject(CanRezObject delegateFunc) | ||
170 | { | ||
171 | if (CanRezObjectCheckFunctions.Contains(delegateFunc)) | ||
172 | CanRezObjectCheckFunctions.Remove(delegateFunc); | ||
173 | } | ||
174 | 173 | ||
175 | public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) | 174 | public void removeCheckRezObject(CanRezObject delegateFunc) |
175 | { | ||
176 | if (CanRezObjectCheckFunctions.Contains(delegateFunc)) | ||
177 | CanRezObjectCheckFunctions.Remove(delegateFunc); | ||
178 | } | ||
179 | |||
180 | public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) | ||
181 | { | ||
182 | foreach (CanRezObject check in CanRezObjectCheckFunctions) | ||
176 | { | 183 | { |
177 | foreach (CanRezObject check in CanRezObjectCheckFunctions) | 184 | if (check(objectCount, owner,objectPosition, m_scene) == false) |
178 | { | 185 | { |
179 | if (check(objectCount, owner,objectPosition, m_scene) == false) | 186 | return false; |
180 | { | ||
181 | return false; | ||
182 | } | ||
183 | } | 187 | } |
184 | return true; | ||
185 | } | 188 | } |
189 | return true; | ||
190 | } | ||
186 | 191 | ||
187 | #endregion | 192 | #endregion |
188 | 193 | ||
189 | #region DELETE OBJECT | 194 | #region DELETE OBJECT |
190 | public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); | 195 | public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); |
191 | private List<CanDeleteObject> CanDeleteObjectCheckFunctions = new List<CanDeleteObject>(); | 196 | private List<CanDeleteObject> CanDeleteObjectCheckFunctions = new List<CanDeleteObject>(); |
192 | 197 | ||
193 | public void addCheckDeleteObject(CanDeleteObject delegateFunc) | 198 | public void addCheckDeleteObject(CanDeleteObject delegateFunc) |
194 | { | 199 | { |
195 | if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) | 200 | if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) |
196 | CanDeleteObjectCheckFunctions.Add(delegateFunc); | 201 | CanDeleteObjectCheckFunctions.Add(delegateFunc); |
197 | } | 202 | } |
198 | public void removeCheckDeleteObject(CanDeleteObject delegateFunc) | ||
199 | { | ||
200 | if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) | ||
201 | CanDeleteObjectCheckFunctions.Remove(delegateFunc); | ||
202 | } | ||
203 | 203 | ||
204 | public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) | 204 | public void removeCheckDeleteObject(CanDeleteObject delegateFunc) |
205 | { | ||
206 | if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) | ||
207 | CanDeleteObjectCheckFunctions.Remove(delegateFunc); | ||
208 | } | ||
209 | |||
210 | public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) | ||
211 | { | ||
212 | foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) | ||
205 | { | 213 | { |
206 | foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) | 214 | if (check(objectID,deleter,m_scene) == false) |
207 | { | 215 | { |
208 | if (check(objectID,deleter,m_scene) == false) | 216 | return false; |
209 | { | ||
210 | return false; | ||
211 | } | ||
212 | } | 217 | } |
213 | return true; | ||
214 | } | 218 | } |
219 | return true; | ||
220 | } | ||
215 | 221 | ||
216 | #endregion | 222 | #endregion |
217 | 223 | ||
218 | #region TAKE OBJECT | 224 | #region TAKE OBJECT |
219 | public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); | 225 | public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); |
220 | private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>(); | 226 | private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>(); |
221 | 227 | ||
222 | public void addCheckTakeObject(CanTakeObject delegateFunc) | 228 | public void addCheckTakeObject(CanTakeObject delegateFunc) |
223 | { | 229 | { |
224 | if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) | 230 | if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) |
225 | CanTakeObjectCheckFunctions.Add(delegateFunc); | 231 | CanTakeObjectCheckFunctions.Add(delegateFunc); |
226 | } | 232 | } |
227 | public void removeCheckTakeObject(CanTakeObject delegateFunc) | ||
228 | { | ||
229 | if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) | ||
230 | CanTakeObjectCheckFunctions.Remove(delegateFunc); | ||
231 | } | ||
232 | 233 | ||
233 | public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) | 234 | public void removeCheckTakeObject(CanTakeObject delegateFunc) |
235 | { | ||
236 | if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) | ||
237 | CanTakeObjectCheckFunctions.Remove(delegateFunc); | ||
238 | } | ||
239 | |||
240 | public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) | ||
241 | { | ||
242 | foreach (CanTakeObject check in CanTakeObjectCheckFunctions) | ||
234 | { | 243 | { |
235 | foreach (CanTakeObject check in CanTakeObjectCheckFunctions) | 244 | if (check(objectID, AvatarTakingUUID, m_scene) == false) |
236 | { | 245 | { |
237 | if (check(objectID, AvatarTakingUUID, m_scene) == false) | 246 | return false; |
238 | { | ||
239 | return false; | ||
240 | } | ||
241 | } | 247 | } |
242 | return true; | ||
243 | } | 248 | } |
249 | return true; | ||
250 | } | ||
244 | 251 | ||
245 | #endregion | 252 | #endregion |
246 | 253 | ||
247 | #region TAKE COPY OBJECT | 254 | #region TAKE COPY OBJECT |
248 | public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); | 255 | public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); |
249 | private List<CanTakeCopyObject> CanTakeCopyObjectCheckFunctions = new List<CanTakeCopyObject>(); | 256 | private List<CanTakeCopyObject> CanTakeCopyObjectCheckFunctions = new List<CanTakeCopyObject>(); |
250 | 257 | ||
251 | public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) | 258 | public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) |
252 | { | 259 | { |
253 | if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) | 260 | if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) |
254 | CanTakeCopyObjectCheckFunctions.Add(delegateFunc); | 261 | CanTakeCopyObjectCheckFunctions.Add(delegateFunc); |
255 | } | 262 | } |
256 | public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) | ||
257 | { | ||
258 | if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) | ||
259 | CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); | ||
260 | } | ||
261 | 263 | ||
262 | public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) | 264 | public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) |
265 | { | ||
266 | if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) | ||
267 | CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); | ||
268 | } | ||
269 | |||
270 | public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) | ||
271 | { | ||
272 | foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) | ||
263 | { | 273 | { |
264 | foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) | 274 | if (check(objectID,userID,m_scene) == false) |
265 | { | 275 | { |
266 | if (check(objectID,userID,m_scene) == false) | 276 | return false; |
267 | { | ||
268 | return false; | ||
269 | } | ||
270 | } | 277 | } |
271 | return true; | ||
272 | } | 278 | } |
279 | return true; | ||
280 | } | ||
273 | 281 | ||
274 | #endregion | 282 | #endregion |
275 | 283 | ||
276 | #region DUPLICATE OBJECT | 284 | #region DUPLICATE OBJECT |
277 | public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); | 285 | public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); |
278 | private List<CanDuplicateObject> CanDuplicateObjectCheckFunctions = new List<CanDuplicateObject>(); | 286 | private List<CanDuplicateObject> CanDuplicateObjectCheckFunctions = new List<CanDuplicateObject>(); |
279 | 287 | ||
280 | public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) | 288 | public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) |
281 | { | 289 | { |
282 | if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) | 290 | if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) |
283 | CanDuplicateObjectCheckFunctions.Add(delegateFunc); | 291 | CanDuplicateObjectCheckFunctions.Add(delegateFunc); |
284 | } | 292 | } |
285 | public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) | ||
286 | { | ||
287 | if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) | ||
288 | CanDuplicateObjectCheckFunctions.Remove(delegateFunc); | ||
289 | } | ||
290 | 293 | ||
291 | public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) | 294 | public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) |
295 | { | ||
296 | if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) | ||
297 | CanDuplicateObjectCheckFunctions.Remove(delegateFunc); | ||
298 | } | ||
299 | |||
300 | public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) | ||
301 | { | ||
302 | foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) | ||
292 | { | 303 | { |
293 | foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) | 304 | if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) |
294 | { | 305 | { |
295 | if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) | 306 | return false; |
296 | { | ||
297 | return false; | ||
298 | } | ||
299 | } | 307 | } |
300 | return true; | ||
301 | } | 308 | } |
309 | return true; | ||
310 | } | ||
302 | 311 | ||
303 | #endregion | 312 | #endregion |
304 | 313 | ||
305 | #region EDIT OBJECT | 314 | #region EDIT OBJECT |
306 | public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); | 315 | public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); |
307 | private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>(); | 316 | private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>(); |
308 | 317 | ||
309 | public void addCheckEditObject(CanEditObject delegateFunc) | 318 | public void addCheckEditObject(CanEditObject delegateFunc) |
310 | { | 319 | { |
311 | if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) | 320 | if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) |
312 | CanEditObjectCheckFunctions.Add(delegateFunc); | 321 | CanEditObjectCheckFunctions.Add(delegateFunc); |
313 | } | 322 | } |
314 | public void removeCheckEditObject(CanEditObject delegateFunc) | ||
315 | { | ||
316 | if (CanEditObjectCheckFunctions.Contains(delegateFunc)) | ||
317 | CanEditObjectCheckFunctions.Remove(delegateFunc); | ||
318 | } | ||
319 | 323 | ||
320 | public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) | 324 | public void removeCheckEditObject(CanEditObject delegateFunc) |
325 | { | ||
326 | if (CanEditObjectCheckFunctions.Contains(delegateFunc)) | ||
327 | CanEditObjectCheckFunctions.Remove(delegateFunc); | ||
328 | } | ||
329 | |||
330 | public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) | ||
331 | { | ||
332 | foreach (CanEditObject check in CanEditObjectCheckFunctions) | ||
321 | { | 333 | { |
322 | foreach (CanEditObject check in CanEditObjectCheckFunctions) | 334 | if (check(objectID, editorID, m_scene) == false) |
323 | { | 335 | { |
324 | if (check(objectID, editorID, m_scene) == false) | 336 | return false; |
325 | { | ||
326 | return false; | ||
327 | } | ||
328 | } | 337 | } |
329 | return true; | ||
330 | } | 338 | } |
339 | return true; | ||
340 | } | ||
331 | 341 | ||
332 | #endregion | 342 | #endregion |
333 | 343 | ||
334 | #region MOVE OBJECT | 344 | #region MOVE OBJECT |
335 | public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); | 345 | public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); |
336 | private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>(); | 346 | private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>(); |
337 | 347 | ||
338 | public void addCheckMoveObject(CanMoveObject delegateFunc) | 348 | public void addCheckMoveObject(CanMoveObject delegateFunc) |
339 | { | 349 | { |
340 | if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) | 350 | if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) |
341 | CanMoveObjectCheckFunctions.Add(delegateFunc); | 351 | CanMoveObjectCheckFunctions.Add(delegateFunc); |
342 | } | 352 | } |
343 | public void removeCheckMoveObject(CanMoveObject delegateFunc) | ||
344 | { | ||
345 | if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) | ||
346 | CanMoveObjectCheckFunctions.Remove(delegateFunc); | ||
347 | } | ||
348 | 353 | ||
349 | public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) | 354 | public void removeCheckMoveObject(CanMoveObject delegateFunc) |
355 | { | ||
356 | if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) | ||
357 | CanMoveObjectCheckFunctions.Remove(delegateFunc); | ||
358 | } | ||
359 | |||
360 | public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) | ||
361 | { | ||
362 | foreach (CanMoveObject check in CanMoveObjectCheckFunctions) | ||
350 | { | 363 | { |
351 | foreach (CanMoveObject check in CanMoveObjectCheckFunctions) | 364 | if (check(objectID,moverID,m_scene) == false) |
352 | { | 365 | { |
353 | if (check(objectID,moverID,m_scene) == false) | 366 | return false; |
354 | { | ||
355 | return false; | ||
356 | } | ||
357 | } | 367 | } |
358 | return true; | ||
359 | } | 368 | } |
369 | return true; | ||
370 | } | ||
360 | 371 | ||
361 | #endregion | 372 | #endregion |
362 | 373 | ||
363 | #region OBJECT ENTRY | 374 | #region OBJECT ENTRY |
364 | public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); | 375 | public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); |
365 | private List<CanObjectEntry> CanObjectEntryCheckFunctions = new List<CanObjectEntry>(); | 376 | private List<CanObjectEntry> CanObjectEntryCheckFunctions = new List<CanObjectEntry>(); |
366 | 377 | ||
367 | public void addCheckObjectEntry(CanObjectEntry delegateFunc) | 378 | public void addCheckObjectEntry(CanObjectEntry delegateFunc) |
368 | { | 379 | { |
369 | if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) | 380 | if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) |
370 | CanObjectEntryCheckFunctions.Add(delegateFunc); | 381 | CanObjectEntryCheckFunctions.Add(delegateFunc); |
371 | } | 382 | } |
372 | public void removeCheckObjectEntry(CanObjectEntry delegateFunc) | ||
373 | { | ||
374 | if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) | ||
375 | CanObjectEntryCheckFunctions.Remove(delegateFunc); | ||
376 | } | ||
377 | 383 | ||
378 | public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) | 384 | public void removeCheckObjectEntry(CanObjectEntry delegateFunc) |
385 | { | ||
386 | if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) | ||
387 | CanObjectEntryCheckFunctions.Remove(delegateFunc); | ||
388 | } | ||
389 | |||
390 | public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) | ||
391 | { | ||
392 | foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) | ||
379 | { | 393 | { |
380 | foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) | 394 | if (check(objectID, newPoint, m_scene) == false) |
381 | { | 395 | { |
382 | if (check(objectID, newPoint, m_scene) == false) | 396 | return false; |
383 | { | ||
384 | return false; | ||
385 | } | ||
386 | } | 397 | } |
387 | return true; | ||
388 | } | 398 | } |
399 | return true; | ||
400 | } | ||
389 | 401 | ||
390 | #endregion | 402 | #endregion |
391 | 403 | ||
392 | #region RETURN OBJECT | 404 | #region RETURN OBJECT |
393 | public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); | 405 | public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); |
394 | private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>(); | 406 | private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>(); |
395 | 407 | ||
396 | public void addCheckReturnObject(CanReturnObject delegateFunc) | 408 | public void addCheckReturnObject(CanReturnObject delegateFunc) |
397 | { | 409 | { |
398 | if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) | 410 | if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) |
399 | CanReturnObjectCheckFunctions.Add(delegateFunc); | 411 | CanReturnObjectCheckFunctions.Add(delegateFunc); |
400 | } | 412 | } |
401 | public void removeCheckReturnObject(CanReturnObject delegateFunc) | ||
402 | { | ||
403 | if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) | ||
404 | CanReturnObjectCheckFunctions.Remove(delegateFunc); | ||
405 | } | ||
406 | 413 | ||
407 | public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) | 414 | public void removeCheckReturnObject(CanReturnObject delegateFunc) |
415 | { | ||
416 | if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) | ||
417 | CanReturnObjectCheckFunctions.Remove(delegateFunc); | ||
418 | } | ||
419 | |||
420 | public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) | ||
421 | { | ||
422 | foreach (CanReturnObject check in CanReturnObjectCheckFunctions) | ||
408 | { | 423 | { |
409 | foreach (CanReturnObject check in CanReturnObjectCheckFunctions) | 424 | if (check(objectID,returnerID,m_scene) == false) |
410 | { | 425 | { |
411 | if (check(objectID,returnerID,m_scene) == false) | 426 | return false; |
412 | { | ||
413 | return false; | ||
414 | } | ||
415 | } | 427 | } |
416 | return true; | ||
417 | } | 428 | } |
429 | return true; | ||
430 | } | ||
418 | 431 | ||
419 | #endregion | 432 | #endregion |
420 | 433 | ||
421 | #region INSTANT MESSAGE | 434 | #region INSTANT MESSAGE |
422 | public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); | 435 | public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); |
423 | private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>(); | 436 | private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>(); |
424 | 437 | ||
425 | public void addCheckInstantMessage(CanInstantMessage delegateFunc) | 438 | public void addCheckInstantMessage(CanInstantMessage delegateFunc) |
426 | { | 439 | { |
427 | if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) | 440 | if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) |
428 | CanInstantMessageCheckFunctions.Add(delegateFunc); | 441 | CanInstantMessageCheckFunctions.Add(delegateFunc); |
429 | } | 442 | } |
430 | public void removeCheckInstantMessage(CanInstantMessage delegateFunc) | 443 | |
431 | { | 444 | public void removeCheckInstantMessage(CanInstantMessage delegateFunc) |
432 | if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) | 445 | { |
433 | CanInstantMessageCheckFunctions.Remove(delegateFunc); | 446 | if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) |
434 | } | 447 | CanInstantMessageCheckFunctions.Remove(delegateFunc); |
448 | } | ||
435 | 449 | ||
436 | public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) | 450 | public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) |
451 | { | ||
452 | foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) | ||
437 | { | 453 | { |
438 | foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) | 454 | if (check(user, target, m_scene) == false) |
439 | { | 455 | { |
440 | if (check(user, target, m_scene) == false) | 456 | return false; |
441 | { | ||
442 | return false; | ||
443 | } | ||
444 | } | 457 | } |
445 | return true; | ||
446 | } | 458 | } |
459 | return true; | ||
460 | } | ||
447 | 461 | ||
448 | #endregion | 462 | #endregion |
449 | 463 | ||
450 | #region INVENTORY TRANSFER | 464 | #region INVENTORY TRANSFER |
451 | public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); | 465 | public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); |
452 | private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>(); | 466 | private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>(); |
453 | 467 | ||
454 | public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) | 468 | public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) |
455 | { | 469 | { |
456 | if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) | 470 | if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) |
457 | CanInventoryTransferCheckFunctions.Add(delegateFunc); | 471 | CanInventoryTransferCheckFunctions.Add(delegateFunc); |
458 | } | 472 | } |
459 | public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) | 473 | |
474 | public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) | ||
460 | { | 475 | { |
461 | if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) | 476 | if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) |
462 | CanInventoryTransferCheckFunctions.Remove(delegateFunc); | 477 | CanInventoryTransferCheckFunctions.Remove(delegateFunc); |
463 | } | 478 | } |
464 | 479 | ||
465 | public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) | 480 | public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) |
481 | { | ||
482 | foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) | ||
466 | { | 483 | { |
467 | foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) | 484 | if (check(user, target, m_scene) == false) |
468 | { | 485 | { |
469 | if (check(user, target, m_scene) == false) | 486 | return false; |
470 | { | ||
471 | return false; | ||
472 | } | ||
473 | } | 487 | } |
474 | return true; | ||
475 | } | 488 | } |
489 | return true; | ||
490 | } | ||
476 | 491 | ||
477 | #endregion | 492 | #endregion |
478 | 493 | ||
479 | #region VIEW SCRIPT | 494 | #region VIEW SCRIPT |
480 | public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 495 | public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); |
481 | private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>(); | 496 | private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>(); |
482 | 497 | ||
483 | public void addCheckViewScript(CanViewScript delegateFunc) | 498 | public void addCheckViewScript(CanViewScript delegateFunc) |
484 | { | 499 | { |
485 | if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) | 500 | if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) |
486 | CanViewScriptCheckFunctions.Add(delegateFunc); | 501 | CanViewScriptCheckFunctions.Add(delegateFunc); |
487 | } | 502 | } |
488 | public void removeCheckViewScript(CanViewScript delegateFunc) | ||
489 | { | ||
490 | if (CanViewScriptCheckFunctions.Contains(delegateFunc)) | ||
491 | CanViewScriptCheckFunctions.Remove(delegateFunc); | ||
492 | } | ||
493 | 503 | ||
494 | public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) | 504 | public void removeCheckViewScript(CanViewScript delegateFunc) |
505 | { | ||
506 | if (CanViewScriptCheckFunctions.Contains(delegateFunc)) | ||
507 | CanViewScriptCheckFunctions.Remove(delegateFunc); | ||
508 | } | ||
509 | |||
510 | public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) | ||
511 | { | ||
512 | foreach (CanViewScript check in CanViewScriptCheckFunctions) | ||
495 | { | 513 | { |
496 | foreach (CanViewScript check in CanViewScriptCheckFunctions) | 514 | if (check(script, objectID, user, m_scene) == false) |
497 | { | 515 | { |
498 | if (check(script, objectID, user, m_scene) == false) | 516 | return false; |
499 | { | ||
500 | return false; | ||
501 | } | ||
502 | } | 517 | } |
503 | return true; | ||
504 | } | 518 | } |
519 | return true; | ||
520 | } | ||
505 | 521 | ||
506 | public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 522 | public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); |
507 | private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>(); | 523 | private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>(); |
508 | 524 | ||
509 | public void addCheckViewNotecard(CanViewNotecard delegateFunc) | 525 | public void addCheckViewNotecard(CanViewNotecard delegateFunc) |
510 | { | 526 | { |
511 | if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) | 527 | if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) |
512 | CanViewNotecardCheckFunctions.Add(delegateFunc); | 528 | CanViewNotecardCheckFunctions.Add(delegateFunc); |
513 | } | 529 | } |
514 | public void removeCheckViewNotecard(CanViewNotecard delegateFunc) | 530 | |
515 | { | 531 | public void removeCheckViewNotecard(CanViewNotecard delegateFunc) |
516 | if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) | 532 | { |
517 | CanViewNotecardCheckFunctions.Remove(delegateFunc); | 533 | if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) |
518 | } | 534 | CanViewNotecardCheckFunctions.Remove(delegateFunc); |
535 | } | ||
519 | 536 | ||
520 | public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) | 537 | public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) |
538 | { | ||
539 | foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) | ||
521 | { | 540 | { |
522 | foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) | 541 | if (check(script, objectID, user, m_scene) == false) |
523 | { | 542 | { |
524 | if (check(script, objectID, user, m_scene) == false) | 543 | return false; |
525 | { | ||
526 | return false; | ||
527 | } | ||
528 | } | 544 | } |
529 | return true; | ||
530 | } | 545 | } |
546 | return true; | ||
547 | } | ||
548 | |||
549 | #endregion | ||
531 | 550 | ||
532 | #endregion | 551 | #region EDIT SCRIPT |
552 | public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | ||
553 | private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>(); | ||
533 | 554 | ||
534 | #region EDIT SCRIPT | 555 | public void addCheckEditScript(CanEditScript delegateFunc) |
535 | public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 556 | { |
536 | private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>(); | 557 | if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) |
558 | CanEditScriptCheckFunctions.Add(delegateFunc); | ||
559 | } | ||
537 | 560 | ||
538 | public void addCheckEditScript(CanEditScript delegateFunc) | 561 | public void removeCheckEditScript(CanEditScript delegateFunc) |
539 | { | 562 | { |
540 | if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) | 563 | if (CanEditScriptCheckFunctions.Contains(delegateFunc)) |
541 | CanEditScriptCheckFunctions.Add(delegateFunc); | 564 | CanEditScriptCheckFunctions.Remove(delegateFunc); |
542 | } | 565 | } |
543 | public void removeCheckEditScript(CanEditScript delegateFunc) | ||
544 | { | ||
545 | if (CanEditScriptCheckFunctions.Contains(delegateFunc)) | ||
546 | CanEditScriptCheckFunctions.Remove(delegateFunc); | ||
547 | } | ||
548 | 566 | ||
549 | public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) | 567 | public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) |
568 | { | ||
569 | foreach (CanEditScript check in CanEditScriptCheckFunctions) | ||
550 | { | 570 | { |
551 | foreach (CanEditScript check in CanEditScriptCheckFunctions) | 571 | if (check(script, objectID, user, m_scene) == false) |
552 | { | 572 | { |
553 | if (check(script, objectID, user, m_scene) == false) | 573 | return false; |
554 | { | ||
555 | return false; | ||
556 | } | ||
557 | } | 574 | } |
558 | return true; | ||
559 | } | 575 | } |
576 | return true; | ||
577 | } | ||
560 | 578 | ||
561 | public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); | 579 | public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); |
562 | private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>(); | 580 | private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>(); |
563 | 581 | ||
564 | public void addCheckEditNotecard(CanEditNotecard delegateFunc) | 582 | public void addCheckEditNotecard(CanEditNotecard delegateFunc) |
565 | { | 583 | { |
566 | if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) | 584 | if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) |
567 | CanEditNotecardCheckFunctions.Add(delegateFunc); | 585 | CanEditNotecardCheckFunctions.Add(delegateFunc); |
568 | } | 586 | } |
569 | public void removeCheckEditNotecard(CanEditNotecard delegateFunc) | ||
570 | { | ||
571 | if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) | ||
572 | CanEditNotecardCheckFunctions.Remove(delegateFunc); | ||
573 | } | ||
574 | 587 | ||
575 | public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) | 588 | public void removeCheckEditNotecard(CanEditNotecard delegateFunc) |
589 | { | ||
590 | if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) | ||
591 | CanEditNotecardCheckFunctions.Remove(delegateFunc); | ||
592 | } | ||
593 | |||
594 | public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) | ||
576 | { | 595 | { |
577 | foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) | 596 | foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) |
578 | { | 597 | { |
@@ -584,388 +603,402 @@ namespace OpenSim.Region.Environment.Scenes | |||
584 | return true; | 603 | return true; |
585 | } | 604 | } |
586 | 605 | ||
587 | #endregion | 606 | #endregion |
588 | 607 | ||
589 | #region RUN SCRIPT (When Script Placed in Object) | 608 | #region RUN SCRIPT (When Script Placed in Object) |
590 | public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); | 609 | public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); |
591 | private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>(); | 610 | private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>(); |
592 | 611 | ||
593 | public void addCheckRunScript(CanRunScript delegateFunc) | 612 | public void addCheckRunScript(CanRunScript delegateFunc) |
594 | { | 613 | { |
595 | if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) | 614 | if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) |
596 | CanRunScriptCheckFunctions.Add(delegateFunc); | 615 | CanRunScriptCheckFunctions.Add(delegateFunc); |
597 | } | 616 | } |
598 | public void removeCheckRunScript(CanRunScript delegateFunc) | ||
599 | { | ||
600 | if (CanRunScriptCheckFunctions.Contains(delegateFunc)) | ||
601 | CanRunScriptCheckFunctions.Remove(delegateFunc); | ||
602 | } | ||
603 | 617 | ||
604 | public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) | 618 | public void removeCheckRunScript(CanRunScript delegateFunc) |
619 | { | ||
620 | if (CanRunScriptCheckFunctions.Contains(delegateFunc)) | ||
621 | CanRunScriptCheckFunctions.Remove(delegateFunc); | ||
622 | } | ||
623 | |||
624 | public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) | ||
625 | { | ||
626 | foreach (CanRunScript check in CanRunScriptCheckFunctions) | ||
605 | { | 627 | { |
606 | foreach (CanRunScript check in CanRunScriptCheckFunctions) | 628 | if (check(script, objectID, user, m_scene) == false) |
607 | { | 629 | { |
608 | if (check(script, objectID, user, m_scene) == false) | 630 | return false; |
609 | { | ||
610 | return false; | ||
611 | } | ||
612 | } | 631 | } |
613 | return true; | ||
614 | } | 632 | } |
633 | return true; | ||
634 | } | ||
615 | 635 | ||
616 | #endregion | 636 | #endregion |
617 | 637 | ||
618 | #region START SCRIPT (When Script run box is Checked after placed in object) | 638 | #region START SCRIPT (When Script run box is Checked after placed in object) |
619 | public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); | 639 | public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); |
620 | private List<CanStartScript> CanStartScriptCheckFunctions = new List<CanStartScript>(); | 640 | private List<CanStartScript> CanStartScriptCheckFunctions = new List<CanStartScript>(); |
621 | 641 | ||
622 | public void addCheckStartScript(CanStartScript delegateFunc) | 642 | public void addCheckStartScript(CanStartScript delegateFunc) |
623 | { | 643 | { |
624 | if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) | 644 | if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) |
625 | CanStartScriptCheckFunctions.Add(delegateFunc); | 645 | CanStartScriptCheckFunctions.Add(delegateFunc); |
626 | } | 646 | } |
627 | public void removeCheckStartScript(CanStartScript delegateFunc) | ||
628 | { | ||
629 | if (CanStartScriptCheckFunctions.Contains(delegateFunc)) | ||
630 | CanStartScriptCheckFunctions.Remove(delegateFunc); | ||
631 | } | ||
632 | 647 | ||
633 | public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) | 648 | public void removeCheckStartScript(CanStartScript delegateFunc) |
649 | { | ||
650 | if (CanStartScriptCheckFunctions.Contains(delegateFunc)) | ||
651 | CanStartScriptCheckFunctions.Remove(delegateFunc); | ||
652 | } | ||
653 | |||
654 | public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) | ||
655 | { | ||
656 | foreach (CanStartScript check in CanStartScriptCheckFunctions) | ||
634 | { | 657 | { |
635 | foreach (CanStartScript check in CanStartScriptCheckFunctions) | 658 | if (check(script, user, m_scene) == false) |
636 | { | 659 | { |
637 | if (check(script, user, m_scene) == false) | 660 | return false; |
638 | { | ||
639 | return false; | ||
640 | } | ||
641 | } | 661 | } |
642 | return true; | ||
643 | } | 662 | } |
663 | return true; | ||
664 | } | ||
644 | 665 | ||
645 | #endregion | 666 | #endregion |
646 | 667 | ||
647 | #region STOP SCRIPT (When Script run box is unchecked after placed in object) | 668 | #region STOP SCRIPT (When Script run box is unchecked after placed in object) |
648 | public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); | 669 | public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); |
649 | private List<CanStopScript> CanStopScriptCheckFunctions = new List<CanStopScript>(); | 670 | private List<CanStopScript> CanStopScriptCheckFunctions = new List<CanStopScript>(); |
650 | 671 | ||
651 | public void addCheckStopScript(CanStopScript delegateFunc) | 672 | public void addCheckStopScript(CanStopScript delegateFunc) |
652 | { | 673 | { |
653 | if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) | 674 | if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) |
654 | CanStopScriptCheckFunctions.Add(delegateFunc); | 675 | CanStopScriptCheckFunctions.Add(delegateFunc); |
655 | } | 676 | } |
656 | public void removeCheckStopScript(CanStopScript delegateFunc) | ||
657 | { | ||
658 | if (CanStopScriptCheckFunctions.Contains(delegateFunc)) | ||
659 | CanStopScriptCheckFunctions.Remove(delegateFunc); | ||
660 | } | ||
661 | 677 | ||
662 | public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) | 678 | public void removeCheckStopScript(CanStopScript delegateFunc) |
679 | { | ||
680 | if (CanStopScriptCheckFunctions.Contains(delegateFunc)) | ||
681 | CanStopScriptCheckFunctions.Remove(delegateFunc); | ||
682 | } | ||
683 | |||
684 | public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) | ||
685 | { | ||
686 | foreach (CanStopScript check in CanStopScriptCheckFunctions) | ||
663 | { | 687 | { |
664 | foreach (CanStopScript check in CanStopScriptCheckFunctions) | 688 | if (check(script, user, m_scene) == false) |
665 | { | 689 | { |
666 | if (check(script, user, m_scene) == false) | 690 | return false; |
667 | { | ||
668 | return false; | ||
669 | } | ||
670 | } | 691 | } |
671 | return true; | ||
672 | } | 692 | } |
693 | return true; | ||
694 | } | ||
673 | 695 | ||
674 | #endregion | 696 | #endregion |
675 | 697 | ||
676 | #region RESET SCRIPT | 698 | #region RESET SCRIPT |
677 | public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); | 699 | public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); |
678 | private List<CanResetScript> CanResetScriptCheckFunctions = new List<CanResetScript>(); | 700 | private List<CanResetScript> CanResetScriptCheckFunctions = new List<CanResetScript>(); |
679 | 701 | ||
680 | public void addCheckResetScript(CanResetScript delegateFunc) | 702 | public void addCheckResetScript(CanResetScript delegateFunc) |
681 | { | 703 | { |
682 | if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) | 704 | if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) |
683 | CanResetScriptCheckFunctions.Add(delegateFunc); | 705 | CanResetScriptCheckFunctions.Add(delegateFunc); |
684 | } | 706 | } |
685 | public void removeCheckResetScript(CanResetScript delegateFunc) | 707 | |
686 | { | 708 | public void removeCheckResetScript(CanResetScript delegateFunc) |
687 | if (CanResetScriptCheckFunctions.Contains(delegateFunc)) | 709 | { |
688 | CanResetScriptCheckFunctions.Remove(delegateFunc); | 710 | if (CanResetScriptCheckFunctions.Contains(delegateFunc)) |
689 | } | 711 | CanResetScriptCheckFunctions.Remove(delegateFunc); |
712 | } | ||
690 | 713 | ||
691 | public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) | 714 | public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) |
715 | { | ||
716 | foreach (CanResetScript check in CanResetScriptCheckFunctions) | ||
692 | { | 717 | { |
693 | foreach (CanResetScript check in CanResetScriptCheckFunctions) | 718 | if (check(script, user, m_scene) == false) |
694 | { | 719 | { |
695 | if (check(script, user, m_scene) == false) | 720 | return false; |
696 | { | ||
697 | return false; | ||
698 | } | ||
699 | } | 721 | } |
700 | return true; | ||
701 | } | 722 | } |
723 | return true; | ||
724 | } | ||
702 | 725 | ||
703 | #endregion | 726 | #endregion |
704 | 727 | ||
705 | #region TERRAFORM LAND | 728 | #region TERRAFORM LAND |
706 | public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); | 729 | public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); |
707 | private List<CanTerraformLand> CanTerraformLandCheckFunctions = new List<CanTerraformLand>(); | 730 | private List<CanTerraformLand> CanTerraformLandCheckFunctions = new List<CanTerraformLand>(); |
708 | 731 | ||
709 | public void addCheckTerraformLand(CanTerraformLand delegateFunc) | 732 | public void addCheckTerraformLand(CanTerraformLand delegateFunc) |
710 | { | 733 | { |
711 | if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) | 734 | if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) |
712 | CanTerraformLandCheckFunctions.Add(delegateFunc); | 735 | CanTerraformLandCheckFunctions.Add(delegateFunc); |
713 | } | 736 | } |
714 | public void removeCheckTerraformLand(CanTerraformLand delegateFunc) | ||
715 | { | ||
716 | if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) | ||
717 | CanTerraformLandCheckFunctions.Remove(delegateFunc); | ||
718 | } | ||
719 | 737 | ||
720 | public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) | 738 | public void removeCheckTerraformLand(CanTerraformLand delegateFunc) |
739 | { | ||
740 | if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) | ||
741 | CanTerraformLandCheckFunctions.Remove(delegateFunc); | ||
742 | } | ||
743 | |||
744 | public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) | ||
745 | { | ||
746 | foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) | ||
721 | { | 747 | { |
722 | foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) | 748 | if (check(user, pos, m_scene) == false) |
723 | { | 749 | { |
724 | if (check(user, pos, m_scene) == false) | 750 | return false; |
725 | { | ||
726 | return false; | ||
727 | } | ||
728 | } | 751 | } |
729 | return true; | ||
730 | } | 752 | } |
753 | return true; | ||
754 | } | ||
731 | 755 | ||
732 | #endregion | 756 | #endregion |
733 | 757 | ||
734 | #region RUN CONSOLE COMMAND | 758 | #region RUN CONSOLE COMMAND |
735 | public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); | 759 | public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); |
736 | private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>(); | 760 | private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>(); |
737 | 761 | ||
738 | public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) | 762 | public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) |
739 | { | 763 | { |
740 | if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) | 764 | if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) |
741 | CanRunConsoleCommandCheckFunctions.Add(delegateFunc); | 765 | CanRunConsoleCommandCheckFunctions.Add(delegateFunc); |
742 | } | 766 | } |
743 | public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) | ||
744 | { | ||
745 | if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) | ||
746 | CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); | ||
747 | } | ||
748 | 767 | ||
749 | public bool ExternalChecksCanRunConsoleCommand(LLUUID user) | 768 | public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) |
769 | { | ||
770 | if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) | ||
771 | CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); | ||
772 | } | ||
773 | |||
774 | public bool ExternalChecksCanRunConsoleCommand(LLUUID user) | ||
775 | { | ||
776 | foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) | ||
750 | { | 777 | { |
751 | foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) | 778 | if (check(user, m_scene) == false) |
752 | { | 779 | { |
753 | if (check(user, m_scene) == false) | 780 | return false; |
754 | { | ||
755 | return false; | ||
756 | } | ||
757 | } | 781 | } |
758 | return true; | ||
759 | } | 782 | } |
783 | return true; | ||
784 | } | ||
760 | 785 | ||
761 | #endregion | 786 | #endregion |
762 | 787 | ||
763 | #region CAN ISSUE ESTATE COMMAND | 788 | #region CAN ISSUE ESTATE COMMAND |
764 | public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); | 789 | public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); |
765 | private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>(); | 790 | private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>(); |
766 | 791 | ||
767 | public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) | 792 | public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) |
768 | { | 793 | { |
769 | if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) | 794 | if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) |
770 | CanIssueEstateCommandCheckFunctions.Add(delegateFunc); | 795 | CanIssueEstateCommandCheckFunctions.Add(delegateFunc); |
771 | } | 796 | } |
772 | public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) | ||
773 | { | ||
774 | if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) | ||
775 | CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); | ||
776 | } | ||
777 | 797 | ||
778 | public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) | 798 | public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) |
799 | { | ||
800 | if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) | ||
801 | CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); | ||
802 | } | ||
803 | |||
804 | public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) | ||
805 | { | ||
806 | foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) | ||
779 | { | 807 | { |
780 | foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) | 808 | if (check(user, m_scene, ownerCommand) == false) |
781 | { | 809 | { |
782 | if (check(user, m_scene, ownerCommand) == false) | 810 | return false; |
783 | { | ||
784 | return false; | ||
785 | } | ||
786 | } | 811 | } |
787 | return true; | ||
788 | } | 812 | } |
789 | #endregion | 813 | return true; |
814 | } | ||
815 | #endregion | ||
790 | 816 | ||
791 | #region CAN BE GODLIKE | 817 | #region CAN BE GODLIKE |
792 | public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); | 818 | public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); |
793 | private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>(); | 819 | private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>(); |
794 | 820 | ||
795 | public void addCheckBeGodLike(CanBeGodLike delegateFunc) | 821 | public void addCheckBeGodLike(CanBeGodLike delegateFunc) |
796 | { | 822 | { |
797 | if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) | 823 | if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) |
798 | CanBeGodLikeCheckFunctions.Add(delegateFunc); | 824 | CanBeGodLikeCheckFunctions.Add(delegateFunc); |
799 | } | 825 | } |
800 | public void removeCheckBeGodLike(CanBeGodLike delegateFunc) | 826 | |
801 | { | 827 | public void removeCheckBeGodLike(CanBeGodLike delegateFunc) |
802 | if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) | 828 | { |
803 | CanBeGodLikeCheckFunctions.Remove(delegateFunc); | 829 | if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) |
804 | } | 830 | CanBeGodLikeCheckFunctions.Remove(delegateFunc); |
831 | } | ||
805 | 832 | ||
806 | public bool ExternalChecksCanBeGodLike(LLUUID user) | 833 | public bool ExternalChecksCanBeGodLike(LLUUID user) |
834 | { | ||
835 | foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) | ||
807 | { | 836 | { |
808 | foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) | 837 | if (check(user, m_scene) == false) |
809 | { | 838 | { |
810 | if (check(user, m_scene) == false) | 839 | return false; |
811 | { | ||
812 | return false; | ||
813 | } | ||
814 | } | 840 | } |
815 | return true; | ||
816 | } | 841 | } |
817 | #endregion | 842 | return true; |
843 | } | ||
844 | #endregion | ||
818 | 845 | ||
819 | #region EDIT PARCEL | 846 | #region EDIT PARCEL |
820 | public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); | 847 | public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); |
821 | private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>(); | 848 | private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>(); |
822 | 849 | ||
823 | public void addCheckEditParcel(CanEditParcel delegateFunc) | 850 | public void addCheckEditParcel(CanEditParcel delegateFunc) |
824 | { | 851 | { |
825 | if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) | 852 | if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) |
826 | CanEditParcelCheckFunctions.Add(delegateFunc); | 853 | CanEditParcelCheckFunctions.Add(delegateFunc); |
827 | } | 854 | } |
828 | public void removeCheckEditParcel(CanEditParcel delegateFunc) | 855 | |
829 | { | 856 | public void removeCheckEditParcel(CanEditParcel delegateFunc) |
830 | if (CanEditParcelCheckFunctions.Contains(delegateFunc)) | 857 | { |
831 | CanEditParcelCheckFunctions.Remove(delegateFunc); | 858 | if (CanEditParcelCheckFunctions.Contains(delegateFunc)) |
832 | } | 859 | CanEditParcelCheckFunctions.Remove(delegateFunc); |
860 | } | ||
833 | 861 | ||
834 | public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) | 862 | public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) |
863 | { | ||
864 | foreach (CanEditParcel check in CanEditParcelCheckFunctions) | ||
835 | { | 865 | { |
836 | foreach (CanEditParcel check in CanEditParcelCheckFunctions) | 866 | if (check(user, parcel, m_scene) == false) |
837 | { | 867 | { |
838 | if (check(user, parcel, m_scene) == false) | 868 | return false; |
839 | { | ||
840 | return false; | ||
841 | } | ||
842 | } | 869 | } |
843 | return true; | ||
844 | } | 870 | } |
845 | #endregion | 871 | return true; |
872 | } | ||
873 | #endregion | ||
846 | 874 | ||
847 | #region SELL PARCEL | 875 | #region SELL PARCEL |
848 | public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); | 876 | public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); |
849 | private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>(); | 877 | private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>(); |
850 | 878 | ||
851 | public void addCheckSellParcel(CanSellParcel delegateFunc) | 879 | public void addCheckSellParcel(CanSellParcel delegateFunc) |
852 | { | 880 | { |
853 | if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) | 881 | if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) |
854 | CanSellParcelCheckFunctions.Add(delegateFunc); | 882 | CanSellParcelCheckFunctions.Add(delegateFunc); |
855 | } | 883 | } |
856 | public void removeCheckSellParcel(CanSellParcel delegateFunc) | 884 | |
857 | { | 885 | public void removeCheckSellParcel(CanSellParcel delegateFunc) |
858 | if (CanSellParcelCheckFunctions.Contains(delegateFunc)) | 886 | { |
859 | CanSellParcelCheckFunctions.Remove(delegateFunc); | 887 | if (CanSellParcelCheckFunctions.Contains(delegateFunc)) |
860 | } | 888 | CanSellParcelCheckFunctions.Remove(delegateFunc); |
889 | } | ||
861 | 890 | ||
862 | public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) | 891 | public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) |
892 | { | ||
893 | foreach (CanSellParcel check in CanSellParcelCheckFunctions) | ||
863 | { | 894 | { |
864 | foreach (CanSellParcel check in CanSellParcelCheckFunctions) | 895 | if (check(user, parcel, m_scene) == false) |
865 | { | 896 | { |
866 | if (check(user, parcel, m_scene) == false) | 897 | return false; |
867 | { | ||
868 | return false; | ||
869 | } | ||
870 | } | 898 | } |
871 | return true; | ||
872 | } | 899 | } |
873 | #endregion | 900 | return true; |
901 | } | ||
902 | #endregion | ||
874 | 903 | ||
875 | #region ABANDON PARCEL | 904 | #region ABANDON PARCEL |
876 | public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); | 905 | public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); |
877 | private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>(); | 906 | private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>(); |
878 | 907 | ||
879 | public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) | 908 | public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) |
880 | { | 909 | { |
881 | if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) | 910 | if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) |
882 | CanAbandonParcelCheckFunctions.Add(delegateFunc); | 911 | CanAbandonParcelCheckFunctions.Add(delegateFunc); |
883 | } | 912 | } |
884 | public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) | ||
885 | { | ||
886 | if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) | ||
887 | CanAbandonParcelCheckFunctions.Remove(delegateFunc); | ||
888 | } | ||
889 | 913 | ||
890 | public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) | 914 | public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) |
915 | { | ||
916 | if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) | ||
917 | CanAbandonParcelCheckFunctions.Remove(delegateFunc); | ||
918 | } | ||
919 | |||
920 | public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) | ||
921 | { | ||
922 | foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) | ||
891 | { | 923 | { |
892 | foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) | 924 | if (check(user, parcel, m_scene) == false) |
893 | { | 925 | { |
894 | if (check(user, parcel, m_scene) == false) | 926 | return false; |
895 | { | ||
896 | return false; | ||
897 | } | ||
898 | } | 927 | } |
899 | return true; | ||
900 | } | 928 | } |
901 | #endregion | 929 | return true; |
930 | } | ||
931 | #endregion | ||
902 | 932 | ||
903 | public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); | 933 | public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); |
904 | private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>(); | 934 | private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>(); |
905 | 935 | ||
906 | public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) | 936 | public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) |
907 | { | 937 | { |
908 | if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) | 938 | if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) |
909 | CanReclaimParcelCheckFunctions.Add(delegateFunc); | 939 | CanReclaimParcelCheckFunctions.Add(delegateFunc); |
910 | } | 940 | } |
911 | public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) | ||
912 | { | ||
913 | if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) | ||
914 | CanReclaimParcelCheckFunctions.Remove(delegateFunc); | ||
915 | } | ||
916 | 941 | ||
917 | public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) | 942 | public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) |
943 | { | ||
944 | if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) | ||
945 | CanReclaimParcelCheckFunctions.Remove(delegateFunc); | ||
946 | } | ||
947 | |||
948 | public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) | ||
949 | { | ||
950 | foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) | ||
918 | { | 951 | { |
919 | foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) | 952 | if (check(user, parcel, m_scene) == false) |
920 | { | 953 | { |
921 | if (check(user, parcel, m_scene) == false) | 954 | return false; |
922 | { | ||
923 | return false; | ||
924 | } | ||
925 | } | 955 | } |
926 | return true; | ||
927 | } | 956 | } |
928 | public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); | 957 | return true; |
929 | private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>(); | 958 | } |
959 | public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); | ||
960 | private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>(); | ||
930 | 961 | ||
931 | public void addCheckCanBuyLand(CanBuyLand delegateFunc) | 962 | public void addCheckCanBuyLand(CanBuyLand delegateFunc) |
932 | { | 963 | { |
933 | if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) | 964 | if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) |
934 | CanBuyLandCheckFunctions.Add(delegateFunc); | 965 | CanBuyLandCheckFunctions.Add(delegateFunc); |
935 | } | 966 | } |
936 | public void removeCheckCanBuyLand(CanBuyLand delegateFunc) | ||
937 | { | ||
938 | if (CanBuyLandCheckFunctions.Contains(delegateFunc)) | ||
939 | CanBuyLandCheckFunctions.Remove(delegateFunc); | ||
940 | } | ||
941 | 967 | ||
942 | public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) | 968 | public void removeCheckCanBuyLand(CanBuyLand delegateFunc) |
969 | { | ||
970 | if (CanBuyLandCheckFunctions.Contains(delegateFunc)) | ||
971 | CanBuyLandCheckFunctions.Remove(delegateFunc); | ||
972 | } | ||
973 | |||
974 | public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) | ||
975 | { | ||
976 | foreach (CanBuyLand check in CanBuyLandCheckFunctions) | ||
943 | { | 977 | { |
944 | foreach (CanBuyLand check in CanBuyLandCheckFunctions) | 978 | if (check(user, parcel, m_scene) == false) |
945 | { | 979 | { |
946 | if (check(user, parcel, m_scene) == false) | 980 | return false; |
947 | { | ||
948 | return false; | ||
949 | } | ||
950 | } | 981 | } |
951 | return true; | ||
952 | } | 982 | } |
983 | return true; | ||
984 | } | ||
953 | 985 | ||
954 | public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); | 986 | public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); |
955 | private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>(); | 987 | private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>(); |
956 | 988 | ||
957 | public void addCheckCanLinkObject(CanLinkObject delegateFunc) | 989 | public void addCheckCanLinkObject(CanLinkObject delegateFunc) |
958 | { | 990 | { |
959 | if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) | 991 | if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) |
960 | CanLinkObjectCheckFunctions.Add(delegateFunc); | 992 | CanLinkObjectCheckFunctions.Add(delegateFunc); |
961 | } | 993 | } |
962 | public void removeCheckCanLinkObject(CanLinkObject delegateFunc) | 994 | |
963 | { | 995 | public void removeCheckCanLinkObject(CanLinkObject delegateFunc) |
964 | if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) | 996 | { |
965 | CanLinkObjectCheckFunctions.Remove(delegateFunc); | 997 | if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) |
966 | } | 998 | CanLinkObjectCheckFunctions.Remove(delegateFunc); |
999 | } | ||
967 | 1000 | ||
968 | public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) | 1001 | public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) |
969 | { | 1002 | { |
970 | foreach (CanLinkObject check in CanLinkObjectCheckFunctions) | 1003 | foreach (CanLinkObject check in CanLinkObjectCheckFunctions) |
971 | { | 1004 | { |
@@ -977,137 +1010,141 @@ namespace OpenSim.Region.Environment.Scenes | |||
977 | return true; | 1010 | return true; |
978 | } | 1011 | } |
979 | 1012 | ||
980 | public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); | 1013 | public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); |
981 | private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>(); | 1014 | private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>(); |
982 | 1015 | ||
983 | public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) | 1016 | public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) |
984 | { | 1017 | { |
985 | if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) | 1018 | if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) |
986 | CanDelinkObjectCheckFunctions.Add(delegateFunc); | 1019 | CanDelinkObjectCheckFunctions.Add(delegateFunc); |
987 | } | 1020 | } |
988 | public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) | 1021 | |
989 | { | 1022 | public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) |
990 | if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) | 1023 | { |
991 | CanDelinkObjectCheckFunctions.Remove(delegateFunc); | 1024 | if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) |
992 | } | 1025 | CanDelinkObjectCheckFunctions.Remove(delegateFunc); |
1026 | } | ||
993 | 1027 | ||
994 | public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) | 1028 | public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) |
1029 | { | ||
1030 | foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) | ||
995 | { | 1031 | { |
996 | foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) | 1032 | if (check(user, objectID) == false) |
997 | { | 1033 | { |
998 | if (check(user, objectID) == false) | 1034 | return false; |
999 | { | ||
1000 | return false; | ||
1001 | } | ||
1002 | } | 1035 | } |
1003 | return true; | ||
1004 | } | 1036 | } |
1037 | return true; | ||
1038 | } | ||
1005 | 1039 | ||
1006 | #endregion | 1040 | #endregion |
1007 | 1041 | ||
1008 | public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); | 1042 | public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); |
1009 | private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>(); | 1043 | private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>(); |
1010 | 1044 | ||
1011 | public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) | 1045 | public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) |
1012 | { | 1046 | { |
1013 | if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) | 1047 | if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) |
1014 | CanCreateInventoryCheckFunctions.Add(delegateFunc); | 1048 | CanCreateInventoryCheckFunctions.Add(delegateFunc); |
1015 | } | 1049 | } |
1016 | public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) | ||
1017 | { | ||
1018 | if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) | ||
1019 | CanCreateInventoryCheckFunctions.Remove(delegateFunc); | ||
1020 | } | ||
1021 | 1050 | ||
1022 | public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) | 1051 | public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) |
1052 | { | ||
1053 | if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) | ||
1054 | CanCreateInventoryCheckFunctions.Remove(delegateFunc); | ||
1055 | } | ||
1056 | |||
1057 | public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) | ||
1058 | { | ||
1059 | foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) | ||
1023 | { | 1060 | { |
1024 | foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) | 1061 | if (check(invType, objectID, userID) == false) |
1025 | { | 1062 | { |
1026 | if (check(invType, objectID, userID) == false) | 1063 | return false; |
1027 | { | ||
1028 | return false; | ||
1029 | } | ||
1030 | } | 1064 | } |
1031 | return true; | ||
1032 | } | 1065 | } |
1066 | return true; | ||
1067 | } | ||
1033 | 1068 | ||
1034 | public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); | 1069 | public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); |
1035 | private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>(); | 1070 | private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>(); |
1036 | 1071 | ||
1037 | public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) | 1072 | public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) |
1038 | { | 1073 | { |
1039 | if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) | 1074 | if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) |
1040 | CanCopyInventoryCheckFunctions.Add(delegateFunc); | 1075 | CanCopyInventoryCheckFunctions.Add(delegateFunc); |
1041 | } | 1076 | } |
1042 | public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) | 1077 | |
1043 | { | 1078 | public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) |
1044 | if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) | 1079 | { |
1045 | CanCopyInventoryCheckFunctions.Remove(delegateFunc); | 1080 | if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) |
1046 | } | 1081 | CanCopyInventoryCheckFunctions.Remove(delegateFunc); |
1082 | } | ||
1047 | 1083 | ||
1048 | public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | 1084 | public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) |
1085 | { | ||
1086 | foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) | ||
1049 | { | 1087 | { |
1050 | foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) | 1088 | if (check(itemID, objectID, userID) == false) |
1051 | { | 1089 | { |
1052 | if (check(itemID, objectID, userID) == false) | 1090 | return false; |
1053 | { | ||
1054 | return false; | ||
1055 | } | ||
1056 | } | 1091 | } |
1057 | return true; | ||
1058 | } | 1092 | } |
1093 | return true; | ||
1094 | } | ||
1059 | 1095 | ||
1060 | public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); | 1096 | public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); |
1061 | private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>(); | 1097 | private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>(); |
1062 | 1098 | ||
1063 | public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) | 1099 | public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) |
1064 | { | 1100 | { |
1065 | if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) | 1101 | if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) |
1066 | CanDeleteInventoryCheckFunctions.Add(delegateFunc); | 1102 | CanDeleteInventoryCheckFunctions.Add(delegateFunc); |
1067 | } | 1103 | } |
1068 | public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) | ||
1069 | { | ||
1070 | if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) | ||
1071 | CanDeleteInventoryCheckFunctions.Remove(delegateFunc); | ||
1072 | } | ||
1073 | 1104 | ||
1074 | public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | 1105 | public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) |
1106 | { | ||
1107 | if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) | ||
1108 | CanDeleteInventoryCheckFunctions.Remove(delegateFunc); | ||
1109 | } | ||
1110 | |||
1111 | public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | ||
1112 | { | ||
1113 | foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) | ||
1075 | { | 1114 | { |
1076 | foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) | 1115 | if (check(itemID, objectID, userID) == false) |
1077 | { | 1116 | { |
1078 | if (check(itemID, objectID, userID) == false) | 1117 | return false; |
1079 | { | ||
1080 | return false; | ||
1081 | } | ||
1082 | } | 1118 | } |
1083 | return true; | ||
1084 | } | 1119 | } |
1120 | return true; | ||
1121 | } | ||
1085 | 1122 | ||
1086 | public delegate bool CanTeleport(LLUUID userID); | 1123 | public delegate bool CanTeleport(LLUUID userID); |
1087 | private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>(); | 1124 | private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>(); |
1088 | 1125 | ||
1089 | public void addCheckCanTeleport(CanTeleport delegateFunc) | 1126 | public void addCheckCanTeleport(CanTeleport delegateFunc) |
1090 | { | 1127 | { |
1091 | if (!CanTeleportCheckFunctions.Contains(delegateFunc)) | 1128 | if (!CanTeleportCheckFunctions.Contains(delegateFunc)) |
1092 | CanTeleportCheckFunctions.Add(delegateFunc); | 1129 | CanTeleportCheckFunctions.Add(delegateFunc); |
1093 | } | 1130 | } |
1094 | public void removeCheckCanTeleport(CanTeleport delegateFunc) | ||
1095 | { | ||
1096 | if (CanTeleportCheckFunctions.Contains(delegateFunc)) | ||
1097 | CanTeleportCheckFunctions.Remove(delegateFunc); | ||
1098 | } | ||
1099 | 1131 | ||
1100 | public bool ExternalChecksCanTeleport(LLUUID userID) | 1132 | public void removeCheckCanTeleport(CanTeleport delegateFunc) |
1133 | { | ||
1134 | if (CanTeleportCheckFunctions.Contains(delegateFunc)) | ||
1135 | CanTeleportCheckFunctions.Remove(delegateFunc); | ||
1136 | } | ||
1137 | |||
1138 | public bool ExternalChecksCanTeleport(LLUUID userID) | ||
1139 | { | ||
1140 | foreach (CanTeleport check in CanTeleportCheckFunctions) | ||
1101 | { | 1141 | { |
1102 | foreach (CanTeleport check in CanTeleportCheckFunctions) | 1142 | if (check(userID) == false) |
1103 | { | 1143 | { |
1104 | if (check(userID) == false) | 1144 | return false; |
1105 | { | ||
1106 | return false; | ||
1107 | } | ||
1108 | } | 1145 | } |
1109 | return true; | ||
1110 | } | 1146 | } |
1147 | return true; | ||
1148 | } | ||
1111 | } | 1149 | } |
1112 | } | 1150 | } |
1113 | |||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index cc4891f..032d673 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
41 | /// <summary> | 41 | /// <summary> |
42 | /// Force all task inventories of prims in the scene object to persist | 42 | /// Force all task inventories of prims in the scene object to persist |
43 | /// </summary> | 43 | /// </summary> |
44 | public void ForceInventoryPersistence() | 44 | public void ForceInventoryPersistence() |
45 | { | 45 | { |
@@ -49,9 +49,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
49 | { | 49 | { |
50 | part.ForceInventoryPersistence(); | 50 | part.ForceInventoryPersistence(); |
51 | } | 51 | } |
52 | } | 52 | } |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Start the scripts contained in all the prims in this group. | 56 | /// Start the scripts contained in all the prims in this group. |
57 | /// </summary> | 57 | /// </summary> |
@@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
161 | // taskItem.SalePrice = item.SalePrice; | 161 | // taskItem.SalePrice = item.SalePrice; |
162 | // taskItem.SaleType = item.SaleType; | 162 | // taskItem.SaleType = item.SaleType; |
163 | taskItem.CreationDate = (uint)item.CreationDate; | 163 | taskItem.CreationDate = (uint)item.CreationDate; |
164 | 164 | ||
165 | part.AddInventoryItem(taskItem); | 165 | part.AddInventoryItem(taskItem); |
166 | 166 | ||
167 | return true; | 167 | return true; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2a1b8c5..9c3d6a7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
94 | /// since the group's last persistent backup | 94 | /// since the group's last persistent backup |
95 | /// </summary> | 95 | /// </summary> |
96 | public bool HasGroupChanged = false; | 96 | public bool HasGroupChanged = false; |
97 | 97 | ||
98 | public float scriptScore = 0f; | 98 | public float scriptScore = 0f; |
99 | 99 | ||
100 | private LLVector3 lastPhysGroupPos; | 100 | private LLVector3 lastPhysGroupPos; |
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
115 | private bool m_scriptListens_notAtTarget = false; | 115 | private bool m_scriptListens_notAtTarget = false; |
116 | 116 | ||
117 | #region Properties | 117 | #region Properties |
118 | 118 | ||
119 | /// <summary> | 119 | /// <summary> |
120 | /// The name of an object grouping is always the same as its root part | 120 | /// The name of an object grouping is always the same as its root part |
121 | /// </summary> | 121 | /// </summary> |
@@ -123,7 +123,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
123 | { | 123 | { |
124 | get { return RootPart.Name; } | 124 | get { return RootPart.Name; } |
125 | set { RootPart.Name = value; } | 125 | set { RootPart.Name = value; } |
126 | } | 126 | } |
127 | 127 | ||
128 | /// <summary> | 128 | /// <summary> |
129 | /// Added because the Parcel code seems to use it | 129 | /// Added because the Parcel code seems to use it |
@@ -445,13 +445,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
445 | } | 445 | } |
446 | more = !reader.EOF; | 446 | more = !reader.EOF; |
447 | } | 447 | } |
448 | 448 | ||
449 | reader.Close(); | 449 | reader.Close(); |
450 | sr.Close(); | 450 | sr.Close(); |
451 | 451 | ||
452 | UpdateParentIDs(); | 452 | UpdateParentIDs(); |
453 | } | 453 | } |
454 | 454 | ||
455 | /// <summary> | 455 | /// <summary> |
456 | /// | 456 | /// |
457 | /// </summary> | 457 | /// </summary> |
@@ -468,14 +468,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
468 | newPart.LinkNum = 0; | 468 | newPart.LinkNum = 0; |
469 | m_parts.Add(newPart.UUID, newPart); | 469 | m_parts.Add(newPart.UUID, newPart); |
470 | SetPartAsRoot(newPart); | 470 | SetPartAsRoot(newPart); |
471 | 471 | ||
472 | // one of these is a proxy. | 472 | // one of these is a proxy. |
473 | if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) | 473 | if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) |
474 | AttachToBackup(); | 474 | AttachToBackup(); |
475 | 475 | ||
476 | //ApplyPhysics(scene.m_physicalPrim); | 476 | //ApplyPhysics(scene.m_physicalPrim); |
477 | } | 477 | } |
478 | 478 | ||
479 | /// <summary> | 479 | /// <summary> |
480 | /// | 480 | /// |
481 | /// </summary> | 481 | /// </summary> |
@@ -754,7 +754,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
754 | m_rootPart.ScheduleFullUpdate(); | 754 | m_rootPart.ScheduleFullUpdate(); |
755 | m_rootPart.ClearUndoState(); | 755 | m_rootPart.ClearUndoState(); |
756 | } | 756 | } |
757 | 757 | ||
758 | public void DetachToInventoryPrep() | 758 | public void DetachToInventoryPrep() |
759 | { | 759 | { |
760 | ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); | 760 | ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); |
@@ -873,11 +873,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
873 | return m_scene.MaxUndoCount; | 873 | return m_scene.MaxUndoCount; |
874 | return 5; | 874 | return 5; |
875 | } | 875 | } |
876 | 876 | ||
877 | // justincc: I don't believe this hack is needed any longer, especially since the physics | 877 | // justincc: I don't believe this hack is needed any longer, especially since the physics |
878 | // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false | 878 | // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false |
879 | // this method was preventing proper reload of scene objects. | 879 | // this method was preventing proper reload of scene objects. |
880 | // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects | 880 | // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects |
881 | // at region startup | 881 | // at region startup |
882 | public void ResetChildPrimPhysicsPositions() | 882 | public void ResetChildPrimPhysicsPositions() |
883 | { | 883 | { |
@@ -926,20 +926,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
926 | /// </summary> | 926 | /// </summary> |
927 | public void DeleteGroup() | 927 | public void DeleteGroup() |
928 | { | 928 | { |
929 | // We need to keep track of this state in case this group is still queued for backup. | 929 | // We need to keep track of this state in case this group is still queued for backup. |
930 | // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race | 930 | // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race |
931 | // conditions where a user deletes an entity while it is being stored. Really, the update | 931 | // conditions where a user deletes an entity while it is being stored. Really, the update |
932 | // code needs a redesign. | 932 | // code needs a redesign. |
933 | m_isDeleted = true; | 933 | m_isDeleted = true; |
934 | 934 | ||
935 | DetachFromBackup(this); | 935 | DetachFromBackup(this); |
936 | 936 | ||
937 | lock (m_parts) | 937 | lock (m_parts) |
938 | { | 938 | { |
939 | foreach (SceneObjectPart part in m_parts.Values) | 939 | foreach (SceneObjectPart part in m_parts.Values) |
940 | { | 940 | { |
941 | part.RemoveScriptInstances(); | 941 | part.RemoveScriptInstances(); |
942 | 942 | ||
943 | List<ScenePresence> avatars = Scene.GetScenePresences(); | 943 | List<ScenePresence> avatars = Scene.GetScenePresences(); |
944 | for (int i = 0; i < avatars.Count; i++) | 944 | for (int i = 0; i < avatars.Count; i++) |
945 | { | 945 | { |
@@ -951,12 +951,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
951 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | 951 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); |
952 | } | 952 | } |
953 | } | 953 | } |
954 | 954 | ||
955 | m_rootPart = null; | 955 | m_rootPart = null; |
956 | m_parts.Clear(); | 956 | m_parts.Clear(); |
957 | } | 957 | } |
958 | } | 958 | } |
959 | 959 | ||
960 | public void FakeDeleteGroup() | 960 | public void FakeDeleteGroup() |
961 | { | 961 | { |
962 | foreach (SceneObjectPart part in m_parts.Values) | 962 | foreach (SceneObjectPart part in m_parts.Values) |
@@ -1034,7 +1034,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1034 | lock (m_targets) | 1034 | lock (m_targets) |
1035 | m_targets.Clear(); | 1035 | m_targets.Clear(); |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | ScheduleGroupForFullUpdate(); | 1038 | ScheduleGroupForFullUpdate(); |
1039 | } | 1039 | } |
1040 | 1040 | ||
@@ -1067,7 +1067,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1067 | { | 1067 | { |
1068 | part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); | 1068 | part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | // Hack to get the physics scene geometries in the right spot | 1071 | // Hack to get the physics scene geometries in the right spot |
1072 | ResetChildPrimPhysicsPositions(); | 1072 | ResetChildPrimPhysicsPositions(); |
1073 | } | 1073 | } |
@@ -1102,14 +1102,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1102 | /// </summary> | 1102 | /// </summary> |
1103 | /// <param name="datastore"></param> | 1103 | /// <param name="datastore"></param> |
1104 | public void ProcessBackup(IRegionDataStore datastore) | 1104 | public void ProcessBackup(IRegionDataStore datastore) |
1105 | { | 1105 | { |
1106 | if (HasGroupChanged) | 1106 | if (HasGroupChanged) |
1107 | { | 1107 | { |
1108 | // don't backup while it's selected or you're asking for changes mid stream. | 1108 | // don't backup while it's selected or you're asking for changes mid stream. |
1109 | if ((!IsSelected) && (RootPart != null)) | 1109 | if ((!IsSelected) && (RootPart != null)) |
1110 | { | 1110 | { |
1111 | m_log.InfoFormat( | 1111 | m_log.InfoFormat( |
1112 | "[SCENE]: Storing object {0}, {1} in {2}", | 1112 | "[SCENE]: Storing object {0}, {1} in {2}", |
1113 | Name, UUID, m_scene.RegionInfo.RegionName); | 1113 | Name, UUID, m_scene.RegionInfo.RegionName); |
1114 | 1114 | ||
1115 | SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); | 1115 | SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); |
@@ -1236,7 +1236,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1236 | 1236 | ||
1237 | dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); | 1237 | dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); |
1238 | } | 1238 | } |
1239 | 1239 | ||
1240 | // Now we've made a copy that replaces this one, we need to | 1240 | // Now we've made a copy that replaces this one, we need to |
1241 | // switch the owner to the person who did the copying | 1241 | // switch the owner to the person who did the copying |
1242 | // Second Life copies an object and duplicates the first one in it's place | 1242 | // Second Life copies an object and duplicates the first one in it's place |
@@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1267 | dupe.UpdateParentIDs(); | 1267 | dupe.UpdateParentIDs(); |
1268 | dupe.HasGroupChanged = true; | 1268 | dupe.HasGroupChanged = true; |
1269 | dupe.AttachToBackup(); | 1269 | dupe.AttachToBackup(); |
1270 | 1270 | ||
1271 | ScheduleGroupForFullUpdate(); | 1271 | ScheduleGroupForFullUpdate(); |
1272 | } | 1272 | } |
1273 | 1273 | ||
@@ -1673,7 +1673,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1673 | { | 1673 | { |
1674 | return true; | 1674 | return true; |
1675 | } | 1675 | } |
1676 | 1676 | ||
1677 | return false; | 1677 | return false; |
1678 | } | 1678 | } |
1679 | 1679 | ||
@@ -1695,7 +1695,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1695 | } | 1695 | } |
1696 | } | 1696 | } |
1697 | } | 1697 | } |
1698 | 1698 | ||
1699 | return false; | 1699 | return false; |
1700 | } | 1700 | } |
1701 | 1701 | ||
@@ -2042,7 +2042,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2042 | public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) | 2042 | public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) |
2043 | { | 2043 | { |
2044 | SceneObjectPart selectionPart = GetChildPart(localID); | 2044 | SceneObjectPart selectionPart = GetChildPart(localID); |
2045 | 2045 | ||
2046 | if (selectionPart != null) | 2046 | if (selectionPart != null) |
2047 | { | 2047 | { |
2048 | lock (m_parts) | 2048 | lock (m_parts) |
@@ -2164,7 +2164,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2164 | m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); | 2164 | m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); |
2165 | } | 2165 | } |
2166 | //if (part.UUID != m_rootPart.UUID) | 2166 | //if (part.UUID != m_rootPart.UUID) |
2167 | 2167 | ||
2168 | HasGroupChanged = true; | 2168 | HasGroupChanged = true; |
2169 | ScheduleGroupForFullUpdate(); | 2169 | ScheduleGroupForFullUpdate(); |
2170 | 2170 | ||
@@ -2332,10 +2332,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2332 | } | 2332 | } |
2333 | 2333 | ||
2334 | AbsolutePosition = pos; | 2334 | AbsolutePosition = pos; |
2335 | 2335 | ||
2336 | HasGroupChanged = true; | 2336 | HasGroupChanged = true; |
2337 | } | 2337 | } |
2338 | 2338 | ||
2339 | //we need to do a terse update even if the move wasn't allowed | 2339 | //we need to do a terse update even if the move wasn't allowed |
2340 | // so that the position is reset in the client (the object snaps back) | 2340 | // so that the position is reset in the client (the object snaps back) |
2341 | ScheduleGroupForTerseUpdate(); | 2341 | ScheduleGroupForTerseUpdate(); |
@@ -2349,7 +2349,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2349 | public void UpdateSinglePosition(LLVector3 pos, uint localID) | 2349 | public void UpdateSinglePosition(LLVector3 pos, uint localID) |
2350 | { | 2350 | { |
2351 | SceneObjectPart part = GetChildPart(localID); | 2351 | SceneObjectPart part = GetChildPart(localID); |
2352 | 2352 | ||
2353 | if (part != null) | 2353 | if (part != null) |
2354 | { | 2354 | { |
2355 | if (part.UUID == m_rootPart.UUID) | 2355 | if (part.UUID == m_rootPart.UUID) |
@@ -2360,7 +2360,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2360 | { | 2360 | { |
2361 | part.UpdateOffSet(pos); | 2361 | part.UpdateOffSet(pos); |
2362 | } | 2362 | } |
2363 | 2363 | ||
2364 | HasGroupChanged = true; | 2364 | HasGroupChanged = true; |
2365 | } | 2365 | } |
2366 | } | 2366 | } |
@@ -2398,7 +2398,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2398 | } | 2398 | } |
2399 | 2399 | ||
2400 | AbsolutePosition = newPos; | 2400 | AbsolutePosition = newPos; |
2401 | 2401 | ||
2402 | HasGroupChanged = true; | 2402 | HasGroupChanged = true; |
2403 | ScheduleGroupForTerseUpdate(); | 2403 | ScheduleGroupForTerseUpdate(); |
2404 | } | 2404 | } |
@@ -2426,7 +2426,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2426 | m_rootPart.RotationOffset.Z); | 2426 | m_rootPart.RotationOffset.Z); |
2427 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 2427 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); |
2428 | } | 2428 | } |
2429 | 2429 | ||
2430 | HasGroupChanged = true; | 2430 | HasGroupChanged = true; |
2431 | ScheduleGroupForTerseUpdate(); | 2431 | ScheduleGroupForTerseUpdate(); |
2432 | } | 2432 | } |
@@ -2447,7 +2447,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2447 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 2447 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); |
2448 | } | 2448 | } |
2449 | AbsolutePosition = pos; | 2449 | AbsolutePosition = pos; |
2450 | 2450 | ||
2451 | HasGroupChanged = true; | 2451 | HasGroupChanged = true; |
2452 | ScheduleGroupForTerseUpdate(); | 2452 | ScheduleGroupForTerseUpdate(); |
2453 | } | 2453 | } |
@@ -2684,7 +2684,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2684 | } | 2684 | } |
2685 | } | 2685 | } |
2686 | } | 2686 | } |
2687 | 2687 | ||
2688 | /// <summary> | 2688 | /// <summary> |
2689 | /// Set the user group to which this scene object belongs. | 2689 | /// Set the user group to which this scene object belongs. |
2690 | /// </summary> | 2690 | /// </summary> |
@@ -2698,10 +2698,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2698 | { | 2698 | { |
2699 | part.SetGroup(GroupID, client); | 2699 | part.SetGroup(GroupID, client); |
2700 | } | 2700 | } |
2701 | 2701 | ||
2702 | HasGroupChanged = true; | 2702 | HasGroupChanged = true; |
2703 | } | 2703 | } |
2704 | 2704 | ||
2705 | ScheduleGroupForFullUpdate(); | 2705 | ScheduleGroupForFullUpdate(); |
2706 | } | 2706 | } |
2707 | 2707 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 480c030..0ac20e2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
43 | 43 | ||
44 | private string m_inventoryFileName = String.Empty; | 44 | private string m_inventoryFileName = String.Empty; |
45 | private int m_inventoryFileNameSerial = 0; | 45 | private int m_inventoryFileNameSerial = 0; |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Serial count for inventory file , used to tell if inventory has changed | 48 | /// Serial count for inventory file , used to tell if inventory has changed |
49 | /// no need for this to be part of Database backup | 49 | /// no need for this to be part of Database backup |
@@ -53,13 +53,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Holds in memory prim inventory | 54 | /// Holds in memory prim inventory |
55 | /// </summary> | 55 | /// </summary> |
56 | protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); | 56 | protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Tracks whether inventory has changed since the last persistent backup | 59 | /// Tracks whether inventory has changed since the last persistent backup |
60 | /// </summary> | 60 | /// </summary> |
61 | protected bool HasInventoryChanged; | 61 | protected bool HasInventoryChanged; |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Force the task inventory of this prim to persist at the next update sweep | 64 | /// Force the task inventory of this prim to persist at the next update sweep |
65 | /// </summary> | 65 | /// </summary> |
@@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
308 | { | 308 | { |
309 | if (i.InvType == (int)InventoryType.LSL) | 309 | if (i.InvType == (int)InventoryType.LSL) |
310 | RemoveScriptInstance(i.ItemID); | 310 | RemoveScriptInstance(i.ItemID); |
311 | 311 | ||
312 | RemoveInventoryItem(i.ItemID); | 312 | RemoveInventoryItem(i.ItemID); |
313 | break; | 313 | break; |
314 | } | 314 | } |
@@ -316,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
316 | 316 | ||
317 | AddInventoryItem(item.Name, item); | 317 | AddInventoryItem(item.Name, item); |
318 | } | 318 | } |
319 | 319 | ||
320 | /// <summary> | 320 | /// <summary> |
321 | /// Add an item to this prim's inventory. | 321 | /// Add an item to this prim's inventory. |
322 | /// </summary> | 322 | /// </summary> |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
329 | { | 329 | { |
330 | item.ParentID = UUID; | 330 | item.ParentID = UUID; |
331 | item.ParentPartID = UUID; | 331 | item.ParentPartID = UUID; |
332 | 332 | ||
333 | lock (m_taskInventory) | 333 | lock (m_taskInventory) |
334 | { | 334 | { |
335 | m_taskInventory.Add(item.ItemID, item); | 335 | m_taskInventory.Add(item.ItemID, item); |
@@ -339,7 +339,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
339 | m_inventorySerial++; | 339 | m_inventorySerial++; |
340 | //m_inventorySerial += 2; | 340 | //m_inventorySerial += 2; |
341 | HasInventoryChanged = true; | 341 | HasInventoryChanged = true; |
342 | ParentGroup.HasGroupChanged = true; | 342 | ParentGroup.HasGroupChanged = true; |
343 | } | 343 | } |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
@@ -369,10 +369,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
369 | /// <param name="itemID"></param> | 369 | /// <param name="itemID"></param> |
370 | /// <returns>null if the item does not exist</returns> | 370 | /// <returns>null if the item does not exist</returns> |
371 | public TaskInventoryItem GetInventoryItem(LLUUID itemId) | 371 | public TaskInventoryItem GetInventoryItem(LLUUID itemId) |
372 | { | 372 | { |
373 | TaskInventoryItem item; | 373 | TaskInventoryItem item; |
374 | m_taskInventory.TryGetValue(itemId, out item); | 374 | m_taskInventory.TryGetValue(itemId, out item); |
375 | 375 | ||
376 | return item; | 376 | return item; |
377 | } | 377 | } |
378 | 378 | ||
@@ -450,12 +450,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
450 | } | 450 | } |
451 | 451 | ||
452 | } | 452 | } |
453 | 453 | ||
454 | if (scriptcount <= 0) | 454 | if (scriptcount <= 0) |
455 | { | 455 | { |
456 | RemFlag(LLObject.ObjectFlags.Scripted); | 456 | RemFlag(LLObject.ObjectFlags.Scripted); |
457 | } | 457 | } |
458 | 458 | ||
459 | ScheduleFullUpdate(); | 459 | ScheduleFullUpdate(); |
460 | 460 | ||
461 | return type; | 461 | return type; |
@@ -603,7 +603,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
603 | public void ProcessInventoryBackup(IRegionDataStore datastore) | 603 | public void ProcessInventoryBackup(IRegionDataStore datastore) |
604 | { | 604 | { |
605 | if (HasInventoryChanged) | 605 | if (HasInventoryChanged) |
606 | { | 606 | { |
607 | lock (TaskInventory) | 607 | lock (TaskInventory) |
608 | { | 608 | { |
609 | datastore.StorePrimInventory(UUID, TaskInventory.Values); | 609 | datastore.StorePrimInventory(UUID, TaskInventory.Values); |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 1432912..517114f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
141 | public uint AttachmentPoint = (byte)0; | 141 | public uint AttachmentPoint = (byte)0; |
142 | [XmlIgnore] | 142 | [XmlIgnore] |
143 | public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); | 143 | public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); |
144 | 144 | ||
145 | [XmlIgnore] | 145 | [XmlIgnore] |
146 | public bool Undoing = false; | 146 | public bool Undoing = false; |
147 | 147 | ||
@@ -196,11 +196,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
196 | protected LLVector3 m_velocity; | 196 | protected LLVector3 m_velocity; |
197 | 197 | ||
198 | // TODO: Those have to be changed into persistent properties at some later point, | 198 | // TODO: Those have to be changed into persistent properties at some later point, |
199 | // or sit-camera on vehicles will break on sim-crossing. | 199 | // or sit-camera on vehicles will break on sim-crossing. |
200 | private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); | 200 | private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); |
201 | private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); | 201 | private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); |
202 | private bool m_forceMouselook = false; | 202 | private bool m_forceMouselook = false; |
203 | 203 | ||
204 | #endregion Fields | 204 | #endregion Fields |
205 | 205 | ||
206 | #region Constructors | 206 | #region Constructors |
@@ -352,13 +352,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
352 | private uint _everyoneMask = (uint)PermissionMask.None; | 352 | private uint _everyoneMask = (uint)PermissionMask.None; |
353 | private uint _nextOwnerMask = (uint)PermissionMask.All; | 353 | private uint _nextOwnerMask = (uint)PermissionMask.All; |
354 | private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; | 354 | private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; |
355 | 355 | ||
356 | public LLUUID CreatorID { | 356 | public LLUUID CreatorID { |
357 | get | 357 | get |
358 | { | 358 | { |
359 | return _creatorID; | 359 | return _creatorID; |
360 | } | 360 | } |
361 | set | 361 | set |
362 | { | 362 | { |
363 | _creatorID = value; | 363 | _creatorID = value; |
364 | } | 364 | } |
@@ -390,26 +390,26 @@ namespace OpenSim.Region.Environment.Scenes | |||
390 | { | 390 | { |
391 | get { return (uint)_flags; } | 391 | get { return (uint)_flags; } |
392 | set { _flags = (LLObject.ObjectFlags)value; } | 392 | set { _flags = (LLObject.ObjectFlags)value; } |
393 | } | 393 | } |
394 | 394 | ||
395 | public LLUUID UUID | 395 | public LLUUID UUID |
396 | { | 396 | { |
397 | get { return m_uuid; } | 397 | get { return m_uuid; } |
398 | set { m_uuid = value; } | 398 | set { m_uuid = value; } |
399 | } | 399 | } |
400 | 400 | ||
401 | public uint LocalId | 401 | public uint LocalId |
402 | { | 402 | { |
403 | get { return m_localId; } | 403 | get { return m_localId; } |
404 | set { m_localId = value; } | 404 | set { m_localId = value; } |
405 | } | 405 | } |
406 | 406 | ||
407 | public virtual string Name | 407 | public virtual string Name |
408 | { | 408 | { |
409 | get { return m_name; } | 409 | get { return m_name; } |
410 | set { m_name = value; } | 410 | set { m_name = value; } |
411 | } | 411 | } |
412 | 412 | ||
413 | public byte Material | 413 | public byte Material |
414 | { | 414 | { |
415 | get { return (byte) m_material; } | 415 | get { return (byte) m_material; } |
@@ -607,13 +607,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
607 | /// <summary></summary> | 607 | /// <summary></summary> |
608 | public LLVector3 AngularVelocity | 608 | public LLVector3 AngularVelocity |
609 | { | 609 | { |
610 | get | 610 | get |
611 | { | 611 | { |
612 | if ((PhysActor != null) && PhysActor.IsPhysical) | 612 | if ((PhysActor != null) && PhysActor.IsPhysical) |
613 | { | 613 | { |
614 | m_angularVelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(), 0); | 614 | m_angularVelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(), 0); |
615 | } | 615 | } |
616 | return m_angularVelocity; | 616 | return m_angularVelocity; |
617 | } | 617 | } |
618 | set { m_angularVelocity = value; } | 618 | set { m_angularVelocity = value; } |
619 | } | 619 | } |
@@ -631,7 +631,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
631 | get { return m_description; } | 631 | get { return m_description; } |
632 | set { m_description = value; } | 632 | set { m_description = value; } |
633 | } | 633 | } |
634 | 634 | ||
635 | public Color Color | 635 | public Color Color |
636 | { | 636 | { |
637 | get { return m_color; } | 637 | get { return m_color; } |
@@ -702,7 +702,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
702 | // set of attributes on shape change. For instance, | 702 | // set of attributes on shape change. For instance, |
703 | // changing the lighting on a shape shouldn't cause | 703 | // changing the lighting on a shape shouldn't cause |
704 | // this. | 704 | // this. |
705 | if (m_shape != null) | 705 | if (m_shape != null) |
706 | shape_changed = true; | 706 | shape_changed = true; |
707 | 707 | ||
708 | m_shape = value; | 708 | m_shape = value; |
@@ -740,7 +740,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
740 | } | 740 | } |
741 | 741 | ||
742 | #endregion | 742 | #endregion |
743 | 743 | ||
744 | //--------------- | 744 | //--------------- |
745 | 745 | ||
746 | 746 | ||
@@ -771,7 +771,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
771 | get { return m_parentGroup; } | 771 | get { return m_parentGroup; } |
772 | } | 772 | } |
773 | 773 | ||
774 | 774 | ||
775 | 775 | ||
776 | public scriptEvents ScriptEvents | 776 | public scriptEvents ScriptEvents |
777 | { | 777 | { |
@@ -802,8 +802,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
802 | 802 | ||
803 | public LLQuaternion SitTargetOrientationLL | 803 | public LLQuaternion SitTargetOrientationLL |
804 | { | 804 | { |
805 | get | 805 | get |
806 | { | 806 | { |
807 | return new LLQuaternion( | 807 | return new LLQuaternion( |
808 | m_sitTargetOrientation.x, | 808 | m_sitTargetOrientation.x, |
809 | m_sitTargetOrientation.y, | 809 | m_sitTargetOrientation.y, |
@@ -830,97 +830,97 @@ namespace OpenSim.Region.Environment.Scenes | |||
830 | } | 830 | } |
831 | } | 831 | } |
832 | 832 | ||
833 | public uint ParentID | 833 | public uint ParentID |
834 | { | 834 | { |
835 | get { return _parentID; } | 835 | get { return _parentID; } |
836 | set { _parentID = value; } | 836 | set { _parentID = value; } |
837 | } | 837 | } |
838 | 838 | ||
839 | public int CreationDate | 839 | public int CreationDate |
840 | { | 840 | { |
841 | get { return _creationDate; } | 841 | get { return _creationDate; } |
842 | set { _creationDate = value; } | 842 | set { _creationDate = value; } |
843 | } | 843 | } |
844 | 844 | ||
845 | public uint Category | 845 | public uint Category |
846 | { | 846 | { |
847 | get { return _category; } | 847 | get { return _category; } |
848 | set { _category = value; } | 848 | set { _category = value; } |
849 | } | 849 | } |
850 | 850 | ||
851 | public int SalePrice | 851 | public int SalePrice |
852 | { | 852 | { |
853 | get { return _salePrice; } | 853 | get { return _salePrice; } |
854 | set { _salePrice = value; } | 854 | set { _salePrice = value; } |
855 | } | 855 | } |
856 | 856 | ||
857 | public byte ObjectSaleType | 857 | public byte ObjectSaleType |
858 | { | 858 | { |
859 | get { return _objectSaleType; } | 859 | get { return _objectSaleType; } |
860 | set { _objectSaleType = value; } | 860 | set { _objectSaleType = value; } |
861 | } | 861 | } |
862 | 862 | ||
863 | public int OwnershipCost | 863 | public int OwnershipCost |
864 | { | 864 | { |
865 | get { return _ownershipCost; } | 865 | get { return _ownershipCost; } |
866 | set { _ownershipCost = value; } | 866 | set { _ownershipCost = value; } |
867 | } | 867 | } |
868 | 868 | ||
869 | public LLUUID GroupID | 869 | public LLUUID GroupID |
870 | { | 870 | { |
871 | get { return _groupID; } | 871 | get { return _groupID; } |
872 | set { _groupID = value; } | 872 | set { _groupID = value; } |
873 | } | 873 | } |
874 | 874 | ||
875 | public LLUUID OwnerID | 875 | public LLUUID OwnerID |
876 | { | 876 | { |
877 | get { return _ownerID; } | 877 | get { return _ownerID; } |
878 | set { _ownerID = value; } | 878 | set { _ownerID = value; } |
879 | } | 879 | } |
880 | 880 | ||
881 | public LLUUID LastOwnerID | 881 | public LLUUID LastOwnerID |
882 | { | 882 | { |
883 | get { return _lastOwnerID; } | 883 | get { return _lastOwnerID; } |
884 | set { _lastOwnerID = value; } | 884 | set { _lastOwnerID = value; } |
885 | } | 885 | } |
886 | 886 | ||
887 | public uint BaseMask | 887 | public uint BaseMask |
888 | { | 888 | { |
889 | get { return _baseMask; } | 889 | get { return _baseMask; } |
890 | set { _baseMask = value; } | 890 | set { _baseMask = value; } |
891 | } | 891 | } |
892 | 892 | ||
893 | public uint OwnerMask | 893 | public uint OwnerMask |
894 | { | 894 | { |
895 | get { return _ownerMask; } | 895 | get { return _ownerMask; } |
896 | set { _ownerMask = value; } | 896 | set { _ownerMask = value; } |
897 | } | 897 | } |
898 | 898 | ||
899 | public uint GroupMask | 899 | public uint GroupMask |
900 | { | 900 | { |
901 | get { return _groupMask; } | 901 | get { return _groupMask; } |
902 | set { _groupMask = value; } | 902 | set { _groupMask = value; } |
903 | } | 903 | } |
904 | 904 | ||
905 | public uint EveryoneMask | 905 | public uint EveryoneMask |
906 | { | 906 | { |
907 | get { return _everyoneMask; } | 907 | get { return _everyoneMask; } |
908 | set { _everyoneMask = value; } | 908 | set { _everyoneMask = value; } |
909 | } | 909 | } |
910 | 910 | ||
911 | public uint NextOwnerMask | 911 | public uint NextOwnerMask |
912 | { | 912 | { |
913 | get { return _nextOwnerMask; } | 913 | get { return _nextOwnerMask; } |
914 | set { _nextOwnerMask = value; } | 914 | set { _nextOwnerMask = value; } |
915 | } | 915 | } |
916 | 916 | ||
917 | public libsecondlife.LLObject.ObjectFlags Flags | 917 | public libsecondlife.LLObject.ObjectFlags Flags |
918 | { | 918 | { |
919 | get { return _flags; } | 919 | get { return _flags; } |
920 | set { _flags = value; } | 920 | set { _flags = value; } |
921 | } | 921 | } |
922 | 922 | ||
923 | public LLUUID SitTargetAvatar | 923 | public LLUUID SitTargetAvatar |
924 | { | 924 | { |
925 | get { return m_sitTargetAvatar; } | 925 | get { return m_sitTargetAvatar; } |
926 | set { m_sitTargetAvatar = value; } | 926 | set { m_sitTargetAvatar = value; } |
@@ -929,8 +929,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
929 | [XmlIgnore] | 929 | [XmlIgnore] |
930 | public virtual LLUUID RegionID | 930 | public virtual LLUUID RegionID |
931 | { | 931 | { |
932 | get | 932 | get |
933 | { | 933 | { |
934 | if (ParentGroup != null && ParentGroup.Scene != null) | 934 | if (ParentGroup != null && ParentGroup.Scene != null) |
935 | return ParentGroup.Scene.RegionInfo.RegionID; | 935 | return ParentGroup.Scene.RegionInfo.RegionID; |
936 | else | 936 | else |
@@ -943,9 +943,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
943 | [XmlIgnore] | 943 | [XmlIgnore] |
944 | public LLUUID ParentUUID | 944 | public LLUUID ParentUUID |
945 | { | 945 | { |
946 | get | 946 | get |
947 | { | 947 | { |
948 | if (ParentGroup != null) | 948 | if (ParentGroup != null) |
949 | { | 949 | { |
950 | _parentUUID = ParentGroup.UUID; | 950 | _parentUUID = ParentGroup.UUID; |
951 | } | 951 | } |
@@ -953,7 +953,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
953 | } | 953 | } |
954 | set { _parentUUID = value; } | 954 | set { _parentUUID = value; } |
955 | } | 955 | } |
956 | 956 | ||
957 | #endregion Public Properties with only Get | 957 | #endregion Public Properties with only Get |
958 | 958 | ||
959 | #region Private Methods | 959 | #region Private Methods |
@@ -2460,7 +2460,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2460 | return; | 2460 | return; |
2461 | } | 2461 | } |
2462 | } | 2462 | } |
2463 | 2463 | ||
2464 | 2464 | ||
2465 | 2465 | ||
2466 | if (m_parentGroup.GetSceneMaxUndo() > 0) | 2466 | if (m_parentGroup.GetSceneMaxUndo() > 0) |
@@ -2914,7 +2914,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2914 | ScaleOffset = Math.Abs(ScaleOffset); | 2914 | ScaleOffset = Math.Abs(ScaleOffset); |
2915 | Vector3 offset = returnresult.normal * ScaleOffset; | 2915 | Vector3 offset = returnresult.normal * ScaleOffset; |
2916 | returnresult.ipoint = AXpos + offset; | 2916 | returnresult.ipoint = AXpos + offset; |
2917 | 2917 | ||
2918 | ///pos = (intersectionpoint + offset); | 2918 | ///pos = (intersectionpoint + offset); |
2919 | } | 2919 | } |
2920 | else | 2920 | else |
@@ -3354,27 +3354,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
3354 | public void SetCameraAtOffset(LLVector3 v) { | 3354 | public void SetCameraAtOffset(LLVector3 v) { |
3355 | m_cameraAtOffset = v; | 3355 | m_cameraAtOffset = v; |
3356 | } | 3356 | } |
3357 | 3357 | ||
3358 | public void SetCameraEyeOffset(LLVector3 v) { | 3358 | public void SetCameraEyeOffset(LLVector3 v) { |
3359 | m_cameraEyeOffset = v; | 3359 | m_cameraEyeOffset = v; |
3360 | } | 3360 | } |
3361 | 3361 | ||
3362 | public void SetForceMouselook(bool force) { | 3362 | public void SetForceMouselook(bool force) { |
3363 | m_forceMouselook = force; | 3363 | m_forceMouselook = force; |
3364 | } | 3364 | } |
3365 | 3365 | ||
3366 | public LLVector3 GetCameraAtOffset() { | 3366 | public LLVector3 GetCameraAtOffset() { |
3367 | return m_cameraAtOffset; | 3367 | return m_cameraAtOffset; |
3368 | } | 3368 | } |
3369 | 3369 | ||
3370 | public LLVector3 GetCameraEyeOffset() { | 3370 | public LLVector3 GetCameraEyeOffset() { |
3371 | return m_cameraEyeOffset; | 3371 | return m_cameraEyeOffset; |
3372 | } | 3372 | } |
3373 | 3373 | ||
3374 | public bool GetForceMouselook() { | 3374 | public bool GetForceMouselook() { |
3375 | return m_forceMouselook; | 3375 | return m_forceMouselook; |
3376 | } | 3376 | } |
3377 | 3377 | ||
3378 | #endregion Public Methods | 3378 | #endregion Public Methods |
3379 | } | 3379 | } |
3380 | } | 3380 | } |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index cad2496..5669af6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1198,7 +1198,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1198 | RemoveFromPhysicalScene(); | 1198 | RemoveFromPhysicalScene(); |
1199 | } | 1199 | } |
1200 | } | 1200 | } |
1201 | 1201 | ||
1202 | cameraAtOffset = part.GetCameraAtOffset(); | 1202 | cameraAtOffset = part.GetCameraAtOffset(); |
1203 | cameraEyeOffset = part.GetCameraEyeOffset(); | 1203 | cameraEyeOffset = part.GetCameraEyeOffset(); |
1204 | forceMouselook = part.GetForceMouselook(); | 1204 | forceMouselook = part.GetForceMouselook(); |
@@ -1347,7 +1347,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1347 | 1347 | ||
1348 | RemoveAnimation(animID); | 1348 | RemoveAnimation(animID); |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | public LLUUID[] GetAnimationArray() | 1351 | public LLUUID[] GetAnimationArray() |
1352 | { | 1352 | { |
1353 | LLUUID[] animIDs; | 1353 | LLUUID[] animIDs; |
@@ -1696,7 +1696,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1696 | 1696 | ||
1697 | 1697 | ||
1698 | /// <summary> | 1698 | /// <summary> |
1699 | /// Do everything required once a client completes its movement into a region | 1699 | /// Do everything required once a client completes its movement into a region |
1700 | /// </summary> | 1700 | /// </summary> |
1701 | public void SendInitialData() | 1701 | public void SendInitialData() |
1702 | { | 1702 | { |
@@ -1898,7 +1898,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1898 | { | 1898 | { |
1899 | if (IsChildAgent) | 1899 | if (IsChildAgent) |
1900 | return; | 1900 | return; |
1901 | 1901 | ||
1902 | LLVector3 pos2 = AbsolutePosition; | 1902 | LLVector3 pos2 = AbsolutePosition; |
1903 | LLVector3 vel = Velocity; | 1903 | LLVector3 vel = Velocity; |
1904 | 1904 | ||
@@ -1968,9 +1968,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1968 | // This means we need to remove the current caps handler here and possibly compensate later, | 1968 | // This means we need to remove the current caps handler here and possibly compensate later, |
1969 | // in case both scenes are being hosted on the same region server. Messy | 1969 | // in case both scenes are being hosted on the same region server. Messy |
1970 | m_scene.RemoveCapsHandler(UUID); | 1970 | m_scene.RemoveCapsHandler(UUID); |
1971 | newpos = newpos + (vel); | 1971 | newpos = newpos + (vel); |
1972 | 1972 | ||
1973 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); | 1973 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); |
1974 | if (userInfo != null) | 1974 | if (userInfo != null) |
1975 | { | 1975 | { |
1976 | userInfo.DropInventory(); | 1976 | userInfo.DropInventory(); |
@@ -1978,11 +1978,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1978 | else | 1978 | else |
1979 | { | 1979 | { |
1980 | m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); | 1980 | m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); |
1981 | } | 1981 | } |
1982 | 1982 | ||
1983 | bool crossingSuccessful = | 1983 | bool crossingSuccessful = |
1984 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, | 1984 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, |
1985 | m_physicsActor.Flying); | 1985 | m_physicsActor.Flying); |
1986 | if (crossingSuccessful) | 1986 | if (crossingSuccessful) |
1987 | { | 1987 | { |
1988 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | 1988 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); |
@@ -1998,8 +1998,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1998 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, | 1998 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, |
1999 | capsPath); | 1999 | capsPath); |
2000 | MakeChildAgent(); | 2000 | MakeChildAgent(); |
2001 | CrossAttachmentsIntoNewRegion(neighbourHandle); | 2001 | CrossAttachmentsIntoNewRegion(neighbourHandle); |
2002 | 2002 | ||
2003 | m_scene.SendKillObject(m_localId); | 2003 | m_scene.SendKillObject(m_localId); |
2004 | m_scene.NotifyMyCoarseLocationChange(); | 2004 | m_scene.NotifyMyCoarseLocationChange(); |
2005 | // the user may change thier profile information in other region, | 2005 | // the user may change thier profile information in other region, |
@@ -2010,7 +2010,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2010 | else | 2010 | else |
2011 | { | 2011 | { |
2012 | // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing | 2012 | // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing |
2013 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); | 2013 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); |
2014 | m_scene.AddCapsHandler(UUID); | 2014 | m_scene.AddCapsHandler(UUID); |
2015 | } | 2015 | } |
2016 | } | 2016 | } |
@@ -2825,7 +2825,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2825 | } | 2825 | } |
2826 | } | 2826 | } |
2827 | } | 2827 | } |
2828 | 2828 | ||
2829 | LastCommands = allflags; | 2829 | LastCommands = allflags; |
2830 | } | 2830 | } |
2831 | 2831 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index f46aba4..0e551cb 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | |||
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
126 | m_report.Interval = statsUpdatesEveryMS; | 126 | m_report.Interval = statsUpdatesEveryMS; |
127 | m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); | 127 | m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); |
128 | m_report.Enabled = true; | 128 | m_report.Enabled = true; |
129 | 129 | ||
130 | if (StatsManager.SimExtraStats != null) | 130 | if (StatsManager.SimExtraStats != null) |
131 | OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; | 131 | OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; |
132 | } | 132 | } |
diff --git a/OpenSim/Region/Environment/Scenes/UndoState.cs b/OpenSim/Region/Environment/Scenes/UndoState.cs index 5d1f6a0..fdbfa8c 100644 --- a/OpenSim/Region/Environment/Scenes/UndoState.cs +++ b/OpenSim/Region/Environment/Scenes/UndoState.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
41 | Rotation = rot; | 41 | Rotation = rot; |
42 | Scale = scale; | 42 | Scale = scale; |
43 | } | 43 | } |
44 | 44 | ||
45 | public UndoState(SceneObjectPart part) | 45 | public UndoState(SceneObjectPart part) |
46 | { | 46 | { |
47 | if (part != null) | 47 | if (part != null) |
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
50 | { | 50 | { |
51 | Position = part.AbsolutePosition; | 51 | Position = part.AbsolutePosition; |
52 | Rotation = part.RotationOffset; | 52 | Rotation = part.RotationOffset; |
53 | 53 | ||
54 | } | 54 | } |
55 | else | 55 | else |
56 | { | 56 | { |
@@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
90 | if (part != null) | 90 | if (part != null) |
91 | { | 91 | { |
92 | part.Undoing = true; | 92 | part.Undoing = true; |
93 | 93 | ||
94 | if (part.ParentID == 0) | 94 | if (part.ParentID == 0) |
95 | { | 95 | { |
96 | part.ParentGroup.AbsolutePosition = Position; | 96 | part.ParentGroup.AbsolutePosition = Position; |
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
105 | part.ScheduleTerseUpdate(); | 105 | part.ScheduleTerseUpdate(); |
106 | } | 106 | } |
107 | part.Undoing = false; | 107 | part.Undoing = false; |
108 | 108 | ||
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index d83bba6..16636e0 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs | |||
@@ -49,7 +49,6 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
49 | 49 | ||
50 | public RotatingWheel() | 50 | public RotatingWheel() |
51 | { | 51 | { |
52 | |||
53 | } | 52 | } |
54 | 53 | ||
55 | public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, | 54 | public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, |
@@ -78,7 +77,6 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
78 | 77 | ||
79 | public ComplexObject() | 78 | public ComplexObject() |
80 | { | 79 | { |
81 | |||
82 | } | 80 | } |
83 | 81 | ||
84 | public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) | 82 | public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) |
diff --git a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs index 6a18091..e7d5db8 100644 --- a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
59 | { | 59 | { |
60 | float cpu = m_counter.NextValue()/40f; | 60 | float cpu = m_counter.NextValue()/40f; |
61 | LLVector3 size = new LLVector3(cpu, cpu, cpu); | 61 | LLVector3 size = new LLVector3(cpu, cpu, cpu); |
62 | 62 | ||
63 | RootPart.Resize(size); | 63 | RootPart.Resize(size); |
64 | 64 | ||
65 | base.UpdateMovement(); | 65 | base.UpdateMovement(); |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 213f1d4..3bf0956 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
70 | public BasicScene() | 70 | public BasicScene() |
71 | { | 71 | { |
72 | } | 72 | } |
73 | 73 | ||
74 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | 74 | public override void Initialise(IMesher meshmerizer, IConfigSource config) |
75 | { | 75 | { |
76 | // Does nothing right now | 76 | // Does nothing right now |
diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/Physics/Manager/IMesher.cs index 48e4ba6..0042c40 100644 --- a/OpenSim/Region/Physics/Manager/IMesher.cs +++ b/OpenSim/Region/Physics/Manager/IMesher.cs | |||
@@ -48,6 +48,5 @@ namespace OpenSim.Region.Physics.Manager | |||
48 | int[] getIndexListAsIntLocked(); | 48 | int[] getIndexListAsIntLocked(); |
49 | float[] getVertexListAsFloatLocked(); | 49 | float[] getVertexListAsFloatLocked(); |
50 | void releasePinned(); | 50 | void releasePinned(); |
51 | |||
52 | } | 51 | } |
53 | } | 52 | } |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index beca4da..d4af271 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -209,10 +209,8 @@ namespace OpenSim.Region.Physics.Manager | |||
209 | public override bool Stopped | 209 | public override bool Stopped |
210 | { | 210 | { |
211 | get{ return false; } | 211 | get{ return false; } |
212 | |||
213 | } | 212 | } |
214 | 213 | ||
215 | |||
216 | public override PhysicsVector Position | 214 | public override PhysicsVector Position |
217 | { | 215 | { |
218 | get { return PhysicsVector.Zero; } | 216 | get { return PhysicsVector.Zero; } |
diff --git a/OpenSim/Region/Physics/Meshing/Extruder.cs b/OpenSim/Region/Physics/Meshing/Extruder.cs index b14deeb..0c94669 100644 --- a/OpenSim/Region/Physics/Meshing/Extruder.cs +++ b/OpenSim/Region/Physics/Meshing/Extruder.cs | |||
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
286 | // It's not quite clear what pushY (Y top shear) does, but subtracting it from the start and end | 286 | // It's not quite clear what pushY (Y top shear) does, but subtracting it from the start and end |
287 | // angles appears to approximate it's effects on path cut. Likewise, adding it to the angle used | 287 | // angles appears to approximate it's effects on path cut. Likewise, adding it to the angle used |
288 | // to calculate the sine for generating the path radius appears to approximate it's effects there | 288 | // to calculate the sine for generating the path radius appears to approximate it's effects there |
289 | // too, but there are some subtle differences in the radius which are noticeable as the prim size | 289 | // too, but there are some subtle differences in the radius which are noticeable as the prim size |
290 | // increases and it may affect megaprims quite a bit. The effect of the Y top shear parameter on | 290 | // increases and it may affect megaprims quite a bit. The effect of the Y top shear parameter on |
291 | // the meshes generated with this technique appear nearly identical in shape to the same prims when | 291 | // the meshes generated with this technique appear nearly identical in shape to the same prims when |
292 | // displayed by the viewer. | 292 | // displayed by the viewer. |
@@ -369,28 +369,26 @@ namespace OpenSim.Region.Physics.Meshing | |||
369 | float yOffset; | 369 | float yOffset; |
370 | float zOffset; | 370 | float zOffset; |
371 | 371 | ||
372 | |||
373 | xOffset = 0.5f * (skewStart + totalSkew * (float)percentOfPath); | 372 | xOffset = 0.5f * (skewStart + totalSkew * (float)percentOfPath); |
374 | xOffset += (float) System.Math.Sin(angle) * pushX * 0.45f; | 373 | xOffset += (float) System.Math.Sin(angle) * pushX * 0.45f; |
375 | yOffset = (float)(System.Math.Cos(angle) * (0.5f - yPathScale)) * radiusScale; | 374 | yOffset = (float)(System.Math.Cos(angle) * (0.5f - yPathScale)) * radiusScale; |
376 | zOffset = (float)(System.Math.Sin(angle + pushY * 0.9f) * (0.5f - yPathScale)) * radiusScale; | 375 | zOffset = (float)(System.Math.Sin(angle + pushY * 0.9f) * (0.5f - yPathScale)) * radiusScale; |
377 | 376 | ||
378 | 377 | // next apply twist rotation to the profile layer | |
379 | // next apply twist rotation to the profile layer | 378 | if (twistTotal != 0.0f || twistBot != 0.0f) |
380 | if (twistTotal != 0.0f || twistBot != 0.0f) | 379 | { |
380 | Quaternion profileRot = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist); | ||
381 | foreach (Vertex v in newLayer.vertices) | ||
381 | { | 382 | { |
382 | Quaternion profileRot = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist); | 383 | if (v != null) |
383 | foreach (Vertex v in newLayer.vertices) | ||
384 | { | 384 | { |
385 | if (v != null) | 385 | vTemp = v * profileRot; |
386 | { | 386 | v.X = vTemp.X; |
387 | vTemp = v * profileRot; | 387 | v.Y = vTemp.Y; |
388 | v.X = vTemp.X; | 388 | v.Z = vTemp.Z; |
389 | v.Y = vTemp.Y; | ||
390 | v.Z = vTemp.Z; | ||
391 | } | ||
392 | } | 389 | } |
393 | } | 390 | } |
391 | } | ||
394 | 392 | ||
395 | // now orient the rotation of the profile layer relative to it's position on the path | 393 | // now orient the rotation of the profile layer relative to it's position on the path |
396 | // adding pushY to the angle used to generate the quat appears to approximate the viewer | 394 | // adding pushY to the angle used to generate the quat appears to approximate the viewer |
diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/Physics/Meshing/HelperTypes.cs index 816b6bb..2cb8d04 100644 --- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs +++ b/OpenSim/Region/Physics/Meshing/HelperTypes.cs | |||
@@ -118,7 +118,7 @@ public class Vertex : PhysicsVector, IComparable<Vertex> | |||
118 | { | 118 | { |
119 | return new Vertex(Y * v.Z - Z * v.Y, Z * v.X - X * v.Z, X * v.Y - Y * v.X); | 119 | return new Vertex(Y * v.Z - Z * v.Y, Z * v.X - X * v.Z, X * v.Y - Y * v.X); |
120 | } | 120 | } |
121 | 121 | ||
122 | // disable warning: mono compiler moans about overloading | 122 | // disable warning: mono compiler moans about overloading |
123 | // operators hiding base operator but should not according to C# | 123 | // operators hiding base operator but should not according to C# |
124 | // language spec | 124 | // language spec |
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index f041aec..a038dc2 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -941,7 +941,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
941 | extr.twistBot = (float)primShape.PathTwistBegin * (float)Math.PI * 0.01f; | 941 | extr.twistBot = (float)primShape.PathTwistBegin * (float)Math.PI * 0.01f; |
942 | extr.pathBegin = primShape.PathBegin; | 942 | extr.pathBegin = primShape.PathBegin; |
943 | extr.pathEnd = primShape.PathEnd; | 943 | extr.pathEnd = primShape.PathEnd; |
944 | 944 | ||
945 | //System.Console.WriteLine("[MESH]: twistTop = " + twistTop.ToString() + "|" + extr.twistTop.ToString() + ", twistMid = " + twistMid.ToString() + "|" + extr.twistMid.ToString() + ", twistbot = " + twistBot.ToString() + "|" + extr.twistBot.ToString()); | 945 | //System.Console.WriteLine("[MESH]: twistTop = " + twistTop.ToString() + "|" + extr.twistTop.ToString() + ", twistMid = " + twistMid.ToString() + "|" + extr.twistMid.ToString() + ", twistbot = " + twistBot.ToString() + "|" + extr.twistBot.ToString()); |
946 | //Mesh result = extr.Extrude(m); | 946 | //Mesh result = extr.Extrude(m); |
947 | Mesh result = extr.ExtrudeLinearPath(m); | 947 | Mesh result = extr.ExtrudeLinearPath(m); |
@@ -1340,7 +1340,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1340 | } | 1340 | } |
1341 | 1341 | ||
1342 | /// <summary> | 1342 | /// <summary> |
1343 | /// Creates a mesh for prim types torus, ring, tube, and sphere | 1343 | /// Creates a mesh for prim types torus, ring, tube, and sphere |
1344 | /// </summary> | 1344 | /// </summary> |
1345 | /// <param name="primName"></param> | 1345 | /// <param name="primName"></param> |
1346 | /// <param name="primShape"></param> | 1346 | /// <param name="primShape"></param> |
@@ -1655,7 +1655,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1655 | 1655 | ||
1656 | // Vertex vTemp = new Vertex(0.0f, 0.0f, 0.0f); | 1656 | // Vertex vTemp = new Vertex(0.0f, 0.0f, 0.0f); |
1657 | 1657 | ||
1658 | 1658 | ||
1659 | float skew = primShape.PathSkew * 0.01f; | 1659 | float skew = primShape.PathSkew * 0.01f; |
1660 | float pathScaleX = (float)(200 - primShape.PathScaleX) * 0.01f; | 1660 | float pathScaleX = (float)(200 - primShape.PathScaleX) * 0.01f; |
1661 | float pathScaleY = (float)(200 - primShape.PathScaleY) * 0.01f; | 1661 | float pathScaleY = (float)(200 - primShape.PathScaleY) * 0.01f; |
@@ -1700,7 +1700,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1700 | //System.Console.WriteLine("primShape.PathTaperX: " + primShape.PathTaperX.ToString()); | 1700 | //System.Console.WriteLine("primShape.PathTaperX: " + primShape.PathTaperX.ToString()); |
1701 | //System.Console.WriteLine("primShape.PathTaperY: " + primShape.PathTaperY.ToString()); | 1701 | //System.Console.WriteLine("primShape.PathTaperY: " + primShape.PathTaperY.ToString()); |
1702 | 1702 | ||
1703 | 1703 | ||
1704 | //System.Console.WriteLine("primShape.PathRadiusOffset: " + primShape.PathRadiusOffset.ToString()); | 1704 | //System.Console.WriteLine("primShape.PathRadiusOffset: " + primShape.PathRadiusOffset.ToString()); |
1705 | #endif | 1705 | #endif |
1706 | 1706 | ||
@@ -1875,7 +1875,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1875 | 1875 | ||
1876 | if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0) | 1876 | if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0) |
1877 | { | 1877 | { |
1878 | 1878 | ||
1879 | SculptMesh smesh = CreateSculptMesh(primName, primShape, size, lod); | 1879 | SculptMesh smesh = CreateSculptMesh(primName, primShape, size, lod); |
1880 | mesh = (Mesh)smesh; | 1880 | mesh = (Mesh)smesh; |
1881 | CalcNormals(mesh); | 1881 | CalcNormals(mesh); |
@@ -1967,7 +1967,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1967 | float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; | 1967 | float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; |
1968 | float pathBegin = (float)primShape.PathBegin * 2.0e-5f; | 1968 | float pathBegin = (float)primShape.PathBegin * 2.0e-5f; |
1969 | float pathEnd = 1.0f - (float)primShape.PathEnd * 2.0e-5f; | 1969 | float pathEnd = 1.0f - (float)primShape.PathEnd * 2.0e-5f; |
1970 | 1970 | ||
1971 | float profileBegin = (float)primShape.ProfileBegin * 2.0e-5f; | 1971 | float profileBegin = (float)primShape.ProfileBegin * 2.0e-5f; |
1972 | float profileEnd = 1.0f - (float)primShape.ProfileEnd * 2.0e-5f; | 1972 | float profileEnd = 1.0f - (float)primShape.ProfileEnd * 2.0e-5f; |
1973 | 1973 | ||
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index 95a244d..1c3153a 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
52 | { | 52 | { |
53 | if (_lod == 2f || _lod == 4f || _lod == 8f || _lod == 16f || _lod == 32f || _lod == 64f) | 53 | if (_lod == 2f || _lod == 4f || _lod == 8f || _lod == 16f || _lod == 32f || _lod == 64f) |
54 | lod = (int)_lod; | 54 | lod = (int)_lod; |
55 | 55 | ||
56 | try | 56 | try |
57 | { | 57 | { |
58 | idata = OpenJPEG.DecodeToImage(jpegData); | 58 | idata = OpenJPEG.DecodeToImage(jpegData); |
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | } | 85 | } |
86 | private Vertex ColorToVertex(Color input) | 86 | private Vertex ColorToVertex(Color input) |
87 | { | 87 | { |
@@ -225,7 +225,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
225 | // Create a vertex position from the RGB channels in the current pixel | 225 | // Create a vertex position from the RGB channels in the current pixel |
226 | // int ypos = y * bLOD.Width; | 226 | // int ypos = y * bLOD.Width; |
227 | 227 | ||
228 | 228 | ||
229 | if (y == 0) | 229 | if (y == 0) |
230 | { | 230 | { |
231 | v1 = northpole; | 231 | v1 = northpole; |
@@ -291,7 +291,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
291 | Add(tri2); | 291 | Add(tri2); |
292 | } | 292 | } |
293 | } | 293 | } |
294 | 294 | ||
295 | } | 295 | } |
296 | //Vertex vt31 = sVertices[(y * x_max + x)]; | 296 | //Vertex vt31 = sVertices[(y * x_max + x)]; |
297 | //Vertex vt32 = sVertices[(y * x_max + 0)]; | 297 | //Vertex vt32 = sVertices[(y * x_max + 0)]; |
@@ -311,7 +311,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
311 | //Add(tri3); | 311 | //Add(tri3); |
312 | // } | 312 | // } |
313 | //} | 313 | //} |
314 | 314 | ||
315 | //Vertex vt41 = sVertices[(y * x_max + x)]; | 315 | //Vertex vt41 = sVertices[(y * x_max + x)]; |
316 | //Vertex vt42 = sVertices[((y + 1) * x_max + 0)]; | 316 | //Vertex vt42 = sVertices[((y + 1) * x_max + 0)]; |
317 | //Vertex vt43 = sVertices[((y + 1) * x_max + x)]; | 317 | //Vertex vt43 = sVertices[((y + 1) * x_max + x)]; |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
329 | //Add(tri4); | 329 | //Add(tri4); |
330 | //} | 330 | //} |
331 | //} | 331 | //} |
332 | 332 | ||
333 | } | 333 | } |
334 | } | 334 | } |
335 | } | 335 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs index bc2ad69..074170a 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
40 | private OdePlugin cbt; | 40 | private OdePlugin cbt; |
41 | private PhysicsScene ps; | 41 | private PhysicsScene ps; |
42 | private IMeshingPlugin imp; | 42 | private IMeshingPlugin imp; |
43 | 43 | ||
44 | [SetUp] | 44 | [SetUp] |
45 | public void Initialize() | 45 | public void Initialize() |
46 | { | 46 | { |
@@ -96,11 +96,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
96 | 96 | ||
97 | Assert.That(!oprim.m_taintadd); | 97 | Assert.That(!oprim.m_taintadd); |
98 | Console.WriteLine("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString()); | 98 | Console.WriteLine("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString()); |
99 | 99 | ||
100 | // Make sure we're above the ground | 100 | // Make sure we're above the ground |
101 | //Assert.That(prim.Position.Z > 20f); | 101 | //Assert.That(prim.Position.Z > 20f); |
102 | //Console.WriteLine("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore); | 102 | //Console.WriteLine("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore); |
103 | 103 | ||
104 | // Make sure we've got a Body | 104 | // Make sure we've got a Body |
105 | Assert.That(oprim.Body != (IntPtr)0); | 105 | Assert.That(oprim.Body != (IntPtr)0); |
106 | //Console.WriteLine( | 106 | //Console.WriteLine( |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 3f8aa26..f285911 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -252,7 +252,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
252 | public int physics_logging_interval = 0; | 252 | public int physics_logging_interval = 0; |
253 | public bool physics_logging_append_existing_logfile = false; | 253 | public bool physics_logging_append_existing_logfile = false; |
254 | 254 | ||
255 | |||
256 | /// <summary> | 255 | /// <summary> |
257 | /// Initiailizes the scene | 256 | /// Initiailizes the scene |
258 | /// Sets many properties that ODE requires to be stable | 257 | /// Sets many properties that ODE requires to be stable |
@@ -352,14 +351,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
352 | 351 | ||
353 | geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", 10.000006836f); | 352 | geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", 10.000006836f); |
354 | bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", 20); | 353 | bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", 20); |
355 | 354 | ||
356 | bodyPIDD = physicsconfig.GetFloat("body_pid_derivative", 35f); | 355 | bodyPIDD = physicsconfig.GetFloat("body_pid_derivative", 35f); |
357 | bodyPIDG = physicsconfig.GetFloat("body_pid_gain", 25f); | 356 | bodyPIDG = physicsconfig.GetFloat("body_pid_gain", 25f); |
358 | 357 | ||
359 | meshSculptedPrim = physicsconfig.GetBoolean("mesh_sculpted_prim", true); | 358 | meshSculptedPrim = physicsconfig.GetBoolean("mesh_sculpted_prim", true); |
360 | meshSculptLOD = physicsconfig.GetFloat("mesh_lod", 32f); | 359 | meshSculptLOD = physicsconfig.GetFloat("mesh_lod", 32f); |
361 | MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", 16f); | 360 | MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", 16f); |
362 | |||
363 | 361 | ||
364 | if (Environment.OSVersion.Platform == PlatformID.Unix) | 362 | if (Environment.OSVersion.Platform == PlatformID.Unix) |
365 | { | 363 | { |
@@ -367,7 +365,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
367 | avPIDP = physicsconfig.GetFloat("av_pid_proportional_linux", 1400.0f); | 365 | avPIDP = physicsconfig.GetFloat("av_pid_proportional_linux", 1400.0f); |
368 | avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_linux", 2000000f); | 366 | avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_linux", 2000000f); |
369 | bodyMotorJointMaxforceTensor = physicsconfig.GetFloat("body_motor_joint_maxforce_tensor_linux", 2f); | 367 | bodyMotorJointMaxforceTensor = physicsconfig.GetFloat("body_motor_joint_maxforce_tensor_linux", 2f); |
370 | |||
371 | } | 368 | } |
372 | else | 369 | else |
373 | { | 370 | { |
@@ -547,7 +544,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
547 | } | 544 | } |
548 | catch (AccessViolationException) | 545 | catch (AccessViolationException) |
549 | { | 546 | { |
550 | |||
551 | m_log.Warn("[PHYSICS]: Unable to collide test an object"); | 547 | m_log.Warn("[PHYSICS]: Unable to collide test an object"); |
552 | return; | 548 | return; |
553 | } | 549 | } |
@@ -603,7 +599,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
603 | p2.CollidingGround = true; | 599 | p2.CollidingGround = true; |
604 | break; | 600 | break; |
605 | } | 601 | } |
606 | |||
607 | 602 | ||
608 | // we don't want prim or avatar to explode | 603 | // we don't want prim or avatar to explode |
609 | 604 | ||
@@ -850,87 +845,87 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
850 | case ActorTypes.Agent: | 845 | case ActorTypes.Agent: |
851 | cc2 = (OdeCharacter)p2; | 846 | cc2 = (OdeCharacter)p2; |
852 | 847 | ||
853 | // obj1LocalID = cc2.m_localID; | 848 | // obj1LocalID = cc2.m_localID; |
854 | switch ((ActorTypes)p1.PhysicsActorType) | 849 | switch ((ActorTypes)p1.PhysicsActorType) |
855 | { | 850 | { |
856 | case ActorTypes.Agent: | 851 | case ActorTypes.Agent: |
857 | cc1 = (OdeCharacter)p1; | 852 | cc1 = (OdeCharacter)p1; |
858 | obj2LocalID = cc1.m_localID; | 853 | obj2LocalID = cc1.m_localID; |
859 | cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); | 854 | cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); |
860 | //ctype = (int)CollisionCategories.Character; | 855 | //ctype = (int)CollisionCategories.Character; |
861 | 856 | ||
862 | //if (cc1.CollidingObj) | 857 | //if (cc1.CollidingObj) |
863 | //cStartStop = (int)StatusIndicators.Generic; | 858 | //cStartStop = (int)StatusIndicators.Generic; |
864 | //else | 859 | //else |
865 | //cStartStop = (int)StatusIndicators.Start; | 860 | //cStartStop = (int)StatusIndicators.Start; |
866 | 861 | ||
867 | //returncollisions = true; | 862 | //returncollisions = true; |
868 | break; | 863 | break; |
869 | case ActorTypes.Prim: | 864 | case ActorTypes.Prim: |
870 | cp1 = (OdePrim)p1; | 865 | cp1 = (OdePrim)p1; |
871 | obj2LocalID = cp1.m_localID; | 866 | obj2LocalID = cp1.m_localID; |
872 | cp1.AddCollisionEvent(cc2.m_localID, collisiondepth); | 867 | cp1.AddCollisionEvent(cc2.m_localID, collisiondepth); |
873 | //ctype = (int)CollisionCategories.Geom; | 868 | //ctype = (int)CollisionCategories.Geom; |
874 | 869 | ||
875 | //if (cp1.CollidingObj) | 870 | //if (cp1.CollidingObj) |
876 | //cStartStop = (int)StatusIndicators.Generic; | 871 | //cStartStop = (int)StatusIndicators.Generic; |
877 | //else | 872 | //else |
878 | //cStartStop = (int)StatusIndicators.Start; | 873 | //cStartStop = (int)StatusIndicators.Start; |
879 | 874 | ||
880 | //returncollisions = true; | 875 | //returncollisions = true; |
881 | break; | 876 | break; |
882 | 877 | ||
883 | case ActorTypes.Ground: | 878 | case ActorTypes.Ground: |
884 | case ActorTypes.Unknown: | 879 | case ActorTypes.Unknown: |
885 | obj2LocalID = 0; | 880 | obj2LocalID = 0; |
886 | //ctype = (int)CollisionCategories.Land; | 881 | //ctype = (int)CollisionCategories.Land; |
887 | //returncollisions = true; | 882 | //returncollisions = true; |
888 | break; | 883 | break; |
889 | } | 884 | } |
890 | 885 | ||
891 | cc2.AddCollisionEvent(obj2LocalID, collisiondepth); | 886 | cc2.AddCollisionEvent(obj2LocalID, collisiondepth); |
892 | break; | 887 | break; |
893 | case ActorTypes.Prim: | 888 | case ActorTypes.Prim: |
894 | cp2 = (OdePrim)p2; | 889 | cp2 = (OdePrim)p2; |
895 | 890 | ||
896 | // obj1LocalID = cp2.m_localID; | 891 | // obj1LocalID = cp2.m_localID; |
897 | switch ((ActorTypes)p1.PhysicsActorType) | 892 | switch ((ActorTypes)p1.PhysicsActorType) |
898 | { | 893 | { |
899 | case ActorTypes.Agent: | 894 | case ActorTypes.Agent: |
900 | cc1 = (OdeCharacter)p1; | 895 | cc1 = (OdeCharacter)p1; |
901 | obj2LocalID = cc1.m_localID; | 896 | obj2LocalID = cc1.m_localID; |
902 | cc1.AddCollisionEvent(cp2.m_localID, collisiondepth); | 897 | cc1.AddCollisionEvent(cp2.m_localID, collisiondepth); |
903 | //ctype = (int)CollisionCategories.Character; | 898 | //ctype = (int)CollisionCategories.Character; |
904 | 899 | ||
905 | //if (cc1.CollidingObj) | 900 | //if (cc1.CollidingObj) |
906 | //cStartStop = (int)StatusIndicators.Generic; | 901 | //cStartStop = (int)StatusIndicators.Generic; |
907 | //else | 902 | //else |
908 | //cStartStop = (int)StatusIndicators.Start; | 903 | //cStartStop = (int)StatusIndicators.Start; |
909 | //returncollisions = true; | 904 | //returncollisions = true; |
910 | 905 | ||
911 | break; | 906 | break; |
912 | case ActorTypes.Prim: | 907 | case ActorTypes.Prim: |
913 | cp1 = (OdePrim)p1; | 908 | cp1 = (OdePrim)p1; |
914 | obj2LocalID = cp1.m_localID; | 909 | obj2LocalID = cp1.m_localID; |
915 | cp1.AddCollisionEvent(cp2.m_localID, collisiondepth); | 910 | cp1.AddCollisionEvent(cp2.m_localID, collisiondepth); |
916 | //ctype = (int)CollisionCategories.Geom; | 911 | //ctype = (int)CollisionCategories.Geom; |
917 | 912 | ||
918 | //if (cp1.CollidingObj) | 913 | //if (cp1.CollidingObj) |
919 | //cStartStop = (int)StatusIndicators.Generic; | 914 | //cStartStop = (int)StatusIndicators.Generic; |
920 | //else | 915 | //else |
921 | //cStartStop = (int)StatusIndicators.Start; | 916 | //cStartStop = (int)StatusIndicators.Start; |
922 | 917 | ||
923 | //returncollisions = true; | 918 | //returncollisions = true; |
924 | break; | 919 | break; |
925 | 920 | ||
926 | case ActorTypes.Ground: | 921 | case ActorTypes.Ground: |
927 | case ActorTypes.Unknown: | 922 | case ActorTypes.Unknown: |
928 | obj2LocalID = 0; | 923 | obj2LocalID = 0; |
929 | //ctype = (int)CollisionCategories.Land; | 924 | //ctype = (int)CollisionCategories.Land; |
930 | 925 | ||
931 | //returncollisions = true; | 926 | //returncollisions = true; |
932 | break; | 927 | break; |
933 | } | 928 | } |
934 | 929 | ||
935 | cp2.AddCollisionEvent(obj2LocalID, collisiondepth); | 930 | cp2.AddCollisionEvent(obj2LocalID, collisiondepth); |
936 | break; | 931 | break; |
@@ -1015,7 +1010,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1015 | /// <param name="timeStep"></param> | 1010 | /// <param name="timeStep"></param> |
1016 | private void collision_optimized(float timeStep) | 1011 | private void collision_optimized(float timeStep) |
1017 | { | 1012 | { |
1018 | |||
1019 | foreach (OdeCharacter chr in _characters) | 1013 | foreach (OdeCharacter chr in _characters) |
1020 | { | 1014 | { |
1021 | // Reset the collision values to false | 1015 | // Reset the collision values to false |
@@ -1579,7 +1573,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1579 | // if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) | 1573 | // if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) |
1580 | // return true; | 1574 | // return true; |
1581 | 1575 | ||
1582 | 1576 | ||
1583 | 1577 | ||
1584 | // return false; | 1578 | // return false; |
1585 | 1579 | ||
@@ -1625,7 +1619,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1625 | //m_log.Info(timeStep.ToString()); | 1619 | //m_log.Info(timeStep.ToString()); |
1626 | step_time += timeStep; | 1620 | step_time += timeStep; |
1627 | 1621 | ||
1628 | |||
1629 | // If We're loaded down by something else, | 1622 | // If We're loaded down by something else, |
1630 | // or debugging with the Visual Studio project on pause | 1623 | // or debugging with the Visual Studio project on pause |
1631 | // skip a few frames to catch up gracefully. | 1624 | // skip a few frames to catch up gracefully. |
@@ -1739,7 +1732,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1739 | } | 1732 | } |
1740 | 1733 | ||
1741 | d.WorldQuickStep(world, ODE_STEPSIZE); | 1734 | d.WorldQuickStep(world, ODE_STEPSIZE); |
1742 | |||
1743 | d.JointGroupEmpty(contactgroup); | 1735 | d.JointGroupEmpty(contactgroup); |
1744 | //ode.dunlock(world); | 1736 | //ode.dunlock(world); |
1745 | } | 1737 | } |
@@ -2075,7 +2067,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2075 | if (resultarr2[y, x] <= 0) | 2067 | if (resultarr2[y, x] <= 0) |
2076 | { | 2068 | { |
2077 | returnarr[i] = 0.0000001f; | 2069 | returnarr[i] = 0.0000001f; |
2078 | 2070 | ||
2079 | } | 2071 | } |
2080 | else | 2072 | else |
2081 | returnarr[i] = resultarr2[y, x]; | 2073 | returnarr[i] = resultarr2[y, x]; |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 25c0d9a..9195063 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -361,23 +361,23 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
361 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting | 361 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting |
362 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. | 362 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. |
363 | */ | 363 | */ |
364 | 364 | ||
365 | /* How we arrived at this llEuler2Rot | 365 | /* How we arrived at this llEuler2Rot |
366 | * | 366 | * |
367 | * Experiment in SL to determine conventions: | 367 | * Experiment in SL to determine conventions: |
368 | * llEuler2Rot(<PI,0,0>)=<1,0,0,0> | 368 | * llEuler2Rot(<PI,0,0>)=<1,0,0,0> |
369 | * llEuler2Rot(<0,PI,0>)=<0,1,0,0> | 369 | * llEuler2Rot(<0,PI,0>)=<0,1,0,0> |
370 | * llEuler2Rot(<0,0,PI>)=<0,0,1,0> | 370 | * llEuler2Rot(<0,0,PI>)=<0,0,1,0> |
371 | * | 371 | * |
372 | * Important facts about Quaternions | 372 | * Important facts about Quaternions |
373 | * - multiplication is non-commutative (a*b != b*a) | 373 | * - multiplication is non-commutative (a*b != b*a) |
374 | * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication | 374 | * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication |
375 | * | 375 | * |
376 | * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): | 376 | * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): |
377 | * Qx = c1+i*s1 | 377 | * Qx = c1+i*s1 |
378 | * Qy = c2+j*s2; | 378 | * Qy = c2+j*s2; |
379 | * Qz = c3+k*s3; | 379 | * Qz = c3+k*s3; |
380 | * | 380 | * |
381 | * Rotations applied in order (from above) Z, Y, X | 381 | * Rotations applied in order (from above) Z, Y, X |
382 | * Q = (Qz * Qy) * Qx | 382 | * Q = (Qz * Qy) * Qx |
383 | * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) | 383 | * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) |
@@ -389,23 +389,23 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
389 | * y=j*(c1*s2*c3-s1*c2*s3) | 389 | * y=j*(c1*s2*c3-s1*c2*s3) |
390 | * z=k*(s1*s2*c3+c1*c2*s3) | 390 | * z=k*(s1*s2*c3+c1*c2*s3) |
391 | * s= c1*c2*c3-s1*s2*s3 | 391 | * s= c1*c2*c3-s1*s2*s3 |
392 | * | 392 | * |
393 | * This implementation agrees with the functions found here: | 393 | * This implementation agrees with the functions found here: |
394 | * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions | 394 | * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions |
395 | * And with the results in SL. | 395 | * And with the results in SL. |
396 | * | 396 | * |
397 | * It's also possible to calculate llEuler2Rot by direct multiplication of | 397 | * It's also possible to calculate llEuler2Rot by direct multiplication of |
398 | * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function | 398 | * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function |
399 | * from the wiki). | 399 | * from the wiki). |
400 | * Apparently in some cases this is better from a numerical precision perspective? | 400 | * Apparently in some cases this is better from a numerical precision perspective? |
401 | */ | 401 | */ |
402 | 402 | ||
403 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) | 403 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) |
404 | { | 404 | { |
405 | m_host.AddScriptLPS(1); | 405 | m_host.AddScriptLPS(1); |
406 | 406 | ||
407 | double x,y,z,s; | 407 | double x,y,z,s; |
408 | 408 | ||
409 | double c1 = Math.Cos(v.x/2.0); | 409 | double c1 = Math.Cos(v.x/2.0); |
410 | double c2 = Math.Cos(v.y/2.0); | 410 | double c2 = Math.Cos(v.y/2.0); |
411 | double c3 = Math.Cos(v.z/2.0); | 411 | double c3 = Math.Cos(v.z/2.0); |
@@ -417,7 +417,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
417 | y = c1*s2*c3-s1*c2*s3; | 417 | y = c1*s2*c3-s1*c2*s3; |
418 | z = s1*s2*c3+c1*c2*s3; | 418 | z = s1*s2*c3+c1*c2*s3; |
419 | s = c1*c2*c3-s1*s2*s3; | 419 | s = c1*c2*c3-s1*s2*s3; |
420 | 420 | ||
421 | return new LSL_Types.Quaternion(x, y, z, s); | 421 | return new LSL_Types.Quaternion(x, y, z, s); |
422 | } | 422 | } |
423 | 423 | ||
@@ -427,7 +427,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
427 | double x,y,z,s; | 427 | double x,y,z,s; |
428 | int f=0; | 428 | int f=0; |
429 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> | 429 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> |
430 | // Computing quaternion x,y,z,s values | 430 | // Computing quaternion x,y,z,s values |
431 | x = ((fwd.x - left.y - up.z + 1) / 4); | 431 | x = ((fwd.x - left.y - up.z + 1) / 4); |
432 | x *= x; | 432 | x *= x; |
433 | x = Math.Sqrt(Math.Sqrt(x)); | 433 | x = Math.Sqrt(Math.Sqrt(x)); |
@@ -441,7 +441,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
441 | s *= s; | 441 | s *= s; |
442 | s = Math.Sqrt(Math.Sqrt(s)); | 442 | s = Math.Sqrt(Math.Sqrt(s)); |
443 | 443 | ||
444 | // Set f for signs detection | 444 | // Set f for signs detection |
445 | if (fwd.y+left.x >= 0){f+=1;} | 445 | if (fwd.y+left.x >= 0){f+=1;} |
446 | if (fwd.z+up.x >= 0){f+=2;} | 446 | if (fwd.z+up.x >= 0){f+=2;} |
447 | if (left.z-up.y >= 0){f+=4;} | 447 | if (left.z-up.y >= 0){f+=4;} |
@@ -510,7 +510,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
510 | x = 2 * (r.x * r.y - r.z * r.s); | 510 | x = 2 * (r.x * r.y - r.z * r.s); |
511 | y = -r.x * r.x + r.y * r.y - r.z * r.z + r.s * r.s; | 511 | y = -r.x * r.x + r.y * r.y - r.z * r.z + r.s * r.s; |
512 | z = 2 * (r.x * r.s + r.y * r.z); | 512 | z = 2 * (r.x * r.s + r.y * r.z); |
513 | return (new LSL_Types.Vector3(x, y, z)); | 513 | return (new LSL_Types.Vector3(x, y, z)); |
514 | } | 514 | } |
515 | 515 | ||
516 | public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) | 516 | public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) |
@@ -536,7 +536,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
536 | z = -r.x * r.x - r.y * r.y + r.z * r.z + r.s * r.s; | 536 | z = -r.x * r.x - r.y * r.y + r.z * r.z + r.s * r.s; |
537 | return (new LSL_Types.Vector3(x, y, z)); | 537 | return (new LSL_Types.Vector3(x, y, z)); |
538 | } | 538 | } |
539 | 539 | ||
540 | public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) | 540 | public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) |
541 | { | 541 | { |
542 | //A and B should both be normalized | 542 | //A and B should both be normalized |
@@ -1215,7 +1215,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1215 | 1215 | ||
1216 | /// <summary> | 1216 | /// <summary> |
1217 | /// Set flexi parameters of a part. | 1217 | /// Set flexi parameters of a part. |
1218 | /// | 1218 | /// |
1219 | /// FIXME: Much of this code should probably be within the part itself. | 1219 | /// FIXME: Much of this code should probably be within the part itself. |
1220 | /// </summary> | 1220 | /// </summary> |
1221 | /// <param name="part"></param> | 1221 | /// <param name="part"></param> |
@@ -1226,7 +1226,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1226 | /// <param name="wind"></param> | 1226 | /// <param name="wind"></param> |
1227 | /// <param name="tension"></param> | 1227 | /// <param name="tension"></param> |
1228 | /// <param name="Force"></param> | 1228 | /// <param name="Force"></param> |
1229 | private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, | 1229 | private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, |
1230 | float wind, float tension, LSL_Types.Vector3 Force) | 1230 | float wind, float tension, LSL_Types.Vector3 Force) |
1231 | { | 1231 | { |
1232 | if (part == null) | 1232 | if (part == null) |
@@ -1239,7 +1239,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1239 | { | 1239 | { |
1240 | needs_fakedelete = true; | 1240 | needs_fakedelete = true; |
1241 | } | 1241 | } |
1242 | part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do | 1242 | part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do |
1243 | // work once the prim is already flexi | 1243 | // work once the prim is already flexi |
1244 | part.Shape.FlexiSoftness = softness; | 1244 | part.Shape.FlexiSoftness = softness; |
1245 | part.Shape.FlexiGravity = gravity; | 1245 | part.Shape.FlexiGravity = gravity; |
@@ -1265,7 +1265,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1265 | if (needs_fakedelete) | 1265 | if (needs_fakedelete) |
1266 | { | 1266 | { |
1267 | if (part.ParentGroup != null) | 1267 | if (part.ParentGroup != null) |
1268 | { | 1268 | { |
1269 | part.ParentGroup.FakeDeleteGroup(); | 1269 | part.ParentGroup.FakeDeleteGroup(); |
1270 | } | 1270 | } |
1271 | } | 1271 | } |
@@ -1276,7 +1276,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1276 | 1276 | ||
1277 | /// <summary> | 1277 | /// <summary> |
1278 | /// Set a light point on a part | 1278 | /// Set a light point on a part |
1279 | /// | 1279 | /// |
1280 | /// FIXME: Much of this code should probably be in SceneObjectGroup | 1280 | /// FIXME: Much of this code should probably be in SceneObjectGroup |
1281 | /// </summary> | 1281 | /// </summary> |
1282 | /// <param name="part"></param> | 1282 | /// <param name="part"></param> |
@@ -1781,7 +1781,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1781 | m_host.SoundGain = volume; | 1781 | m_host.SoundGain = volume; |
1782 | m_host.SoundFlags = 1; // looping | 1782 | m_host.SoundFlags = 1; // looping |
1783 | m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? | 1783 | m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? |
1784 | 1784 | ||
1785 | m_host.ScheduleFullUpdate(); | 1785 | m_host.ScheduleFullUpdate(); |
1786 | m_host.SendFullUpdateToAllClients(); | 1786 | m_host.SendFullUpdateToAllClients(); |
1787 | } | 1787 | } |
@@ -2908,13 +2908,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2908 | bool found = false; | 2908 | bool found = false; |
2909 | LLUUID destId = LLUUID.Zero; | 2909 | LLUUID destId = LLUUID.Zero; |
2910 | LLUUID objId = LLUUID.Zero; | 2910 | LLUUID objId = LLUUID.Zero; |
2911 | 2911 | ||
2912 | if (!LLUUID.TryParse(destination, out destId)) | 2912 | if (!LLUUID.TryParse(destination, out destId)) |
2913 | { | 2913 | { |
2914 | llSay(0, "Could not parse key " + destination); | 2914 | llSay(0, "Could not parse key " + destination); |
2915 | return; | 2915 | return; |
2916 | } | 2916 | } |
2917 | 2917 | ||
2918 | // move the first object found with this inventory name | 2918 | // move the first object found with this inventory name |
2919 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | 2919 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) |
2920 | { | 2920 | { |
@@ -2931,7 +2931,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2931 | llSay(0, String.Format("Could not find object '{0}'", inventory)); | 2931 | llSay(0, String.Format("Could not find object '{0}'", inventory)); |
2932 | throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); | 2932 | throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); |
2933 | } | 2933 | } |
2934 | 2934 | ||
2935 | // check if destination is an avatar | 2935 | // check if destination is an avatar |
2936 | if (World.GetScenePresence(destId) != null) | 2936 | if (World.GetScenePresence(destId) != null) |
2937 | { | 2937 | { |
@@ -2993,7 +2993,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2993 | { | 2993 | { |
2994 | LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( | 2994 | LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( |
2995 | m_localID, m_itemID, item.AssetID.ToString()); | 2995 | m_localID, m_itemID, item.AssetID.ToString()); |
2996 | 2996 | ||
2997 | LLVector3 region = new LLVector3( | 2997 | LLVector3 region = new LLVector3( |
2998 | World.RegionInfo.RegionLocX * Constants.RegionSize, | 2998 | World.RegionInfo.RegionLocX * Constants.RegionSize, |
2999 | World.RegionInfo.RegionLocY * Constants.RegionSize, | 2999 | World.RegionInfo.RegionLocY * Constants.RegionSize, |
@@ -4155,13 +4155,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4155 | if (LLUUID.TryParse(id,out key)) | 4155 | if (LLUUID.TryParse(id,out key)) |
4156 | { | 4156 | { |
4157 | ScenePresence presence = World.GetScenePresence(key); | 4157 | ScenePresence presence = World.GetScenePresence(key); |
4158 | 4158 | ||
4159 | if (presence != null) | 4159 | if (presence != null) |
4160 | { | 4160 | { |
4161 | return presence.ControllingClient.Name; | 4161 | return presence.ControllingClient.Name; |
4162 | //return presence.Name; | 4162 | //return presence.Name; |
4163 | } | 4163 | } |
4164 | 4164 | ||
4165 | if (World.GetSceneObjectPart(key) != null) | 4165 | if (World.GetSceneObjectPart(key) != null) |
4166 | { | 4166 | { |
4167 | return World.GetSceneObjectPart(key).Name; | 4167 | return World.GetSceneObjectPart(key).Name; |
@@ -4516,7 +4516,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4516 | private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() | 4516 | private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() |
4517 | { | 4517 | { |
4518 | Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); | 4518 | Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); |
4519 | 4519 | ||
4520 | // TODO find out about the other defaults and add them here | 4520 | // TODO find out about the other defaults and add them here |
4521 | ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); | 4521 | ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); |
4522 | ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); | 4522 | ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); |
@@ -4530,7 +4530,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4530 | ps.PartMaxAge = 10.0f; | 4530 | ps.PartMaxAge = 10.0f; |
4531 | return ps; | 4531 | return ps; |
4532 | } | 4532 | } |
4533 | 4533 | ||
4534 | public void llParticleSystem(LSL_Types.list rules) | 4534 | public void llParticleSystem(LSL_Types.list rules) |
4535 | { | 4535 | { |
4536 | m_host.AddScriptLPS(1); | 4536 | m_host.AddScriptLPS(1); |
@@ -4725,7 +4725,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4725 | itemList.Add(itemID); | 4725 | itemList.Add(itemID); |
4726 | } | 4726 | } |
4727 | } | 4727 | } |
4728 | 4728 | ||
4729 | if (itemList.Count == 0) | 4729 | if (itemList.Count == 0) |
4730 | return; | 4730 | return; |
4731 | 4731 | ||
@@ -4973,7 +4973,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4973 | public void llSetRemoteScriptAccessPin(int pin) | 4973 | public void llSetRemoteScriptAccessPin(int pin) |
4974 | { | 4974 | { |
4975 | m_host.AddScriptLPS(1); | 4975 | m_host.AddScriptLPS(1); |
4976 | 4976 | ||
4977 | m_host.ScriptAccessPin = pin; | 4977 | m_host.ScriptAccessPin = pin; |
4978 | } | 4978 | } |
4979 | 4979 | ||
@@ -4983,19 +4983,19 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4983 | bool found = false; | 4983 | bool found = false; |
4984 | LLUUID destId = LLUUID.Zero; | 4984 | LLUUID destId = LLUUID.Zero; |
4985 | LLUUID srcId = LLUUID.Zero; | 4985 | LLUUID srcId = LLUUID.Zero; |
4986 | 4986 | ||
4987 | if (!LLUUID.TryParse(target, out destId)) | 4987 | if (!LLUUID.TryParse(target, out destId)) |
4988 | { | 4988 | { |
4989 | llSay(0, "Could not parse key " + target); | 4989 | llSay(0, "Could not parse key " + target); |
4990 | return; | 4990 | return; |
4991 | } | 4991 | } |
4992 | 4992 | ||
4993 | // target must be a different prim than the one containing the script | 4993 | // target must be a different prim than the one containing the script |
4994 | if (m_host.UUID == destId) | 4994 | if (m_host.UUID == destId) |
4995 | { | 4995 | { |
4996 | return; | 4996 | return; |
4997 | } | 4997 | } |
4998 | 4998 | ||
4999 | // copy the first script found with this inventory name | 4999 | // copy the first script found with this inventory name |
5000 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | 5000 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) |
5001 | { | 5001 | { |
@@ -5010,13 +5010,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5010 | } | 5010 | } |
5011 | } | 5011 | } |
5012 | } | 5012 | } |
5013 | 5013 | ||
5014 | if (!found) | 5014 | if (!found) |
5015 | { | 5015 | { |
5016 | llSay(0, "Could not find script " + name); | 5016 | llSay(0, "Could not find script " + name); |
5017 | return; | 5017 | return; |
5018 | } | 5018 | } |
5019 | 5019 | ||
5020 | // the rest of the permission checks are done in RezScript, so check the pin there as well | 5020 | // the rest of the permission checks are done in RezScript, so check the pin there as well |
5021 | World.RezScript(srcId, m_host, destId, pin, running, start_param); | 5021 | World.RezScript(srcId, m_host, destId, pin, running, start_param); |
5022 | // this will cause the delay even if the script pin or permissions were wrong - seems ok | 5022 | // this will cause the delay even if the script pin or permissions were wrong - seems ok |
@@ -5066,11 +5066,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5066 | m_host.AddScriptLPS(1); | 5066 | m_host.AddScriptLPS(1); |
5067 | return Util.Md5Hash(src + ":" + nonce.ToString()); | 5067 | return Util.Md5Hash(src + ":" + nonce.ToString()); |
5068 | } | 5068 | } |
5069 | 5069 | ||
5070 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) | 5070 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) |
5071 | { | 5071 | { |
5072 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | 5072 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); |
5073 | 5073 | ||
5074 | if (holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_DEFAULT && | 5074 | if (holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_DEFAULT && |
5075 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_CIRCLE && | 5075 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_CIRCLE && |
5076 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_SQUARE && | 5076 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_SQUARE && |
@@ -5128,23 +5128,23 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5128 | } | 5128 | } |
5129 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); | 5129 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); |
5130 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); | 5130 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); |
5131 | 5131 | ||
5132 | shapeBlock.ObjectLocalID = m_host.LocalId; | 5132 | shapeBlock.ObjectLocalID = m_host.LocalId; |
5133 | 5133 | ||
5134 | // retain pathcurve | 5134 | // retain pathcurve |
5135 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | 5135 | shapeBlock.PathCurve = m_host.Shape.PathCurve; |
5136 | 5136 | ||
5137 | return shapeBlock; | 5137 | return shapeBlock; |
5138 | } | 5138 | } |
5139 | 5139 | ||
5140 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) | 5140 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) |
5141 | { | 5141 | { |
5142 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5142 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5143 | 5143 | ||
5144 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5144 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5145 | 5145 | ||
5146 | shapeBlock.ProfileCurve += fudge; | 5146 | shapeBlock.ProfileCurve += fudge; |
5147 | 5147 | ||
5148 | if (taper_b.x < 0f) | 5148 | if (taper_b.x < 0f) |
5149 | { | 5149 | { |
5150 | taper_b.x = 0f; | 5150 | taper_b.x = 0f; |
@@ -5181,25 +5181,25 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5181 | } | 5181 | } |
5182 | shapeBlock.PathShearX = (byte)(100 * topshear.x); | 5182 | shapeBlock.PathShearX = (byte)(100 * topshear.x); |
5183 | shapeBlock.PathShearY = (byte)(100 * topshear.y); | 5183 | shapeBlock.PathShearY = (byte)(100 * topshear.y); |
5184 | 5184 | ||
5185 | m_host.UpdateShape(shapeBlock); | 5185 | m_host.UpdateShape(shapeBlock); |
5186 | } | 5186 | } |
5187 | 5187 | ||
5188 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) | 5188 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) |
5189 | { | 5189 | { |
5190 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5190 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5191 | 5191 | ||
5192 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5192 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5193 | 5193 | ||
5194 | // profile/path swapped for a sphere | 5194 | // profile/path swapped for a sphere |
5195 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | 5195 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; |
5196 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | 5196 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; |
5197 | 5197 | ||
5198 | shapeBlock.ProfileCurve += fudge; | 5198 | shapeBlock.ProfileCurve += fudge; |
5199 | 5199 | ||
5200 | shapeBlock.PathScaleX = 100; | 5200 | shapeBlock.PathScaleX = 100; |
5201 | shapeBlock.PathScaleY = 100; | 5201 | shapeBlock.PathScaleY = 100; |
5202 | 5202 | ||
5203 | if (dimple.x < 0f) | 5203 | if (dimple.x < 0f) |
5204 | { | 5204 | { |
5205 | dimple.x = 0f; | 5205 | dimple.x = 0f; |
@@ -5222,22 +5222,22 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5222 | } | 5222 | } |
5223 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); | 5223 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); |
5224 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); | 5224 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); |
5225 | 5225 | ||
5226 | m_host.UpdateShape(shapeBlock); | 5226 | m_host.UpdateShape(shapeBlock); |
5227 | } | 5227 | } |
5228 | 5228 | ||
5229 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) | 5229 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) |
5230 | { | 5230 | { |
5231 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5231 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5232 | 5232 | ||
5233 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5233 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5234 | 5234 | ||
5235 | shapeBlock.ProfileCurve += fudge; | 5235 | shapeBlock.ProfileCurve += fudge; |
5236 | 5236 | ||
5237 | // profile/path swapped for a torrus, tube, ring | 5237 | // profile/path swapped for a torrus, tube, ring |
5238 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | 5238 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; |
5239 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | 5239 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; |
5240 | 5240 | ||
5241 | if (holesize.x < 0.05f) | 5241 | if (holesize.x < 0.05f) |
5242 | { | 5242 | { |
5243 | holesize.x = 0.05f; | 5243 | holesize.x = 0.05f; |
@@ -5342,15 +5342,15 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5342 | skew = 0.95f; | 5342 | skew = 0.95f; |
5343 | } | 5343 | } |
5344 | shapeBlock.PathSkew = (sbyte)(100 * skew); | 5344 | shapeBlock.PathSkew = (sbyte)(100 * skew); |
5345 | 5345 | ||
5346 | m_host.UpdateShape(shapeBlock); | 5346 | m_host.UpdateShape(shapeBlock); |
5347 | } | 5347 | } |
5348 | 5348 | ||
5349 | private void SetPrimitiveShapeParams(string map, int type) | 5349 | private void SetPrimitiveShapeParams(string map, int type) |
5350 | { | 5350 | { |
5351 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | 5351 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); |
5352 | LLUUID sculptId; | 5352 | LLUUID sculptId; |
5353 | 5353 | ||
5354 | if (!LLUUID.TryParse(map, out sculptId)) | 5354 | if (!LLUUID.TryParse(map, out sculptId)) |
5355 | { | 5355 | { |
5356 | llSay(0, "Could not parse key " + map); | 5356 | llSay(0, "Could not parse key " + map); |
@@ -5360,7 +5360,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5360 | shapeBlock.ObjectLocalID = m_host.LocalId; | 5360 | shapeBlock.ObjectLocalID = m_host.LocalId; |
5361 | shapeBlock.PathScaleX = 100; | 5361 | shapeBlock.PathScaleX = 100; |
5362 | shapeBlock.PathScaleY = 150; | 5362 | shapeBlock.PathScaleY = 150; |
5363 | 5363 | ||
5364 | if (type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_CYLINDER && | 5364 | if (type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_CYLINDER && |
5365 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_PLANE && | 5365 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_PLANE && |
5366 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE && | 5366 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE && |
@@ -5369,7 +5369,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5369 | // default | 5369 | // default |
5370 | type = (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE; | 5370 | type = (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE; |
5371 | } | 5371 | } |
5372 | 5372 | ||
5373 | // retain pathcurve | 5373 | // retain pathcurve |
5374 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | 5374 | shapeBlock.PathCurve = m_host.Shape.PathCurve; |
5375 | 5375 | ||
@@ -5422,7 +5422,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5422 | 5422 | ||
5423 | v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5423 | v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
5424 | SetScale(part, v); | 5424 | SetScale(part, v); |
5425 | 5425 | ||
5426 | break; | 5426 | break; |
5427 | case (int)BuiltIn_Commands_BaseClass.PRIM_ROTATION: | 5427 | case (int)BuiltIn_Commands_BaseClass.PRIM_ROTATION: |
5428 | if (remain < 1) | 5428 | if (remain < 1) |
@@ -5432,13 +5432,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5432 | SetRot(part, q); | 5432 | SetRot(part, q); |
5433 | 5433 | ||
5434 | break; | 5434 | break; |
5435 | 5435 | ||
5436 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE: | 5436 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE: |
5437 | if (remain < 3) | 5437 | if (remain < 3) |
5438 | return; | 5438 | return; |
5439 | 5439 | ||
5440 | code = Convert.ToInt32(rules.Data[idx++]); | 5440 | code = Convert.ToInt32(rules.Data[idx++]); |
5441 | 5441 | ||
5442 | remain = rules.Length - idx; | 5442 | remain = rules.Length - idx; |
5443 | float hollow; | 5443 | float hollow; |
5444 | LSL_Types.Vector3 twist; | 5444 | LSL_Types.Vector3 twist; |
@@ -5449,9 +5449,9 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5449 | float skew; | 5449 | float skew; |
5450 | LSL_Types.Vector3 holesize; | 5450 | LSL_Types.Vector3 holesize; |
5451 | LSL_Types.Vector3 profilecut; | 5451 | LSL_Types.Vector3 profilecut; |
5452 | 5452 | ||
5453 | switch (code) | 5453 | switch (code) |
5454 | { | 5454 | { |
5455 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_BOX: | 5455 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_BOX: |
5456 | if (remain < 6) | 5456 | if (remain < 6) |
5457 | return; | 5457 | return; |
@@ -5465,7 +5465,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5465 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | 5465 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; |
5466 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); | 5466 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); |
5467 | break; | 5467 | break; |
5468 | 5468 | ||
5469 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER: | 5469 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER: |
5470 | if (remain < 6) | 5470 | if (remain < 6) |
5471 | return; | 5471 | return; |
@@ -5480,12 +5480,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5480 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | 5480 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; |
5481 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); | 5481 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); |
5482 | break; | 5482 | break; |
5483 | 5483 | ||
5484 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_PRISM: | 5484 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_PRISM: |
5485 | if (remain < 6) | 5485 | if (remain < 6) |
5486 | return; | 5486 | return; |
5487 | 5487 | ||
5488 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5488 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5489 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5489 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5490 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5490 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5491 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5491 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5507,12 +5507,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5507 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5507 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5508 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); | 5508 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); |
5509 | break; | 5509 | break; |
5510 | 5510 | ||
5511 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TORUS: | 5511 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TORUS: |
5512 | if (remain < 11) | 5512 | if (remain < 11) |
5513 | return; | 5513 | return; |
5514 | 5514 | ||
5515 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5515 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5516 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5516 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5517 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5517 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5518 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5518 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5526,12 +5526,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5526 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5526 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5527 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); | 5527 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); |
5528 | break; | 5528 | break; |
5529 | 5529 | ||
5530 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TUBE: | 5530 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TUBE: |
5531 | if (remain < 11) | 5531 | if (remain < 11) |
5532 | return; | 5532 | return; |
5533 | 5533 | ||
5534 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5534 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5535 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5535 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5536 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5536 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5537 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5537 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5545,12 +5545,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5545 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5545 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5546 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); | 5546 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); |
5547 | break; | 5547 | break; |
5548 | 5548 | ||
5549 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_RING: | 5549 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_RING: |
5550 | if (remain < 11) | 5550 | if (remain < 11) |
5551 | return; | 5551 | return; |
5552 | 5552 | ||
5553 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5553 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5554 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5554 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5555 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5555 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5556 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5556 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5564,7 +5564,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5564 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5564 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5565 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); | 5565 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); |
5566 | break; | 5566 | break; |
5567 | 5567 | ||
5568 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_SCULPT: | 5568 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_SCULPT: |
5569 | if (remain < 2) | 5569 | if (remain < 2) |
5570 | return; | 5570 | return; |
@@ -5575,7 +5575,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5575 | SetPrimitiveShapeParams(map, face); | 5575 | SetPrimitiveShapeParams(map, face); |
5576 | break; | 5576 | break; |
5577 | } | 5577 | } |
5578 | 5578 | ||
5579 | break; | 5579 | break; |
5580 | 5580 | ||
5581 | case (int)BuiltIn_Commands_BaseClass.PRIM_TEXTURE: | 5581 | case (int)BuiltIn_Commands_BaseClass.PRIM_TEXTURE: |
@@ -5630,7 +5630,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5630 | float intensity = (float)Convert.ToDouble(rules.Data[idx++]); | 5630 | float intensity = (float)Convert.ToDouble(rules.Data[idx++]); |
5631 | float radius = (float)Convert.ToDouble(rules.Data[idx++]); | 5631 | float radius = (float)Convert.ToDouble(rules.Data[idx++]); |
5632 | float falloff = (float)Convert.ToDouble(rules.Data[idx++]); | 5632 | float falloff = (float)Convert.ToDouble(rules.Data[idx++]); |
5633 | 5633 | ||
5634 | SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); | 5634 | SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); |
5635 | 5635 | ||
5636 | break; | 5636 | break; |
@@ -5701,7 +5701,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5701 | public LSL_Types.list llGetAnimationList( string id ) | 5701 | public LSL_Types.list llGetAnimationList( string id ) |
5702 | { | 5702 | { |
5703 | m_host.AddScriptLPS(1); | 5703 | m_host.AddScriptLPS(1); |
5704 | 5704 | ||
5705 | LSL_Types.list l = new LSL_Types.list(); | 5705 | LSL_Types.list l = new LSL_Types.list(); |
5706 | ScenePresence av = World.GetScenePresence(id); | 5706 | ScenePresence av = World.GetScenePresence(id); |
5707 | if (av == null) | 5707 | if (av == null) |
@@ -6560,7 +6560,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6560 | IConfigSource config = new IniConfigSource(Application.iniFilePath); | 6560 | IConfigSource config = new IniConfigSource(Application.iniFilePath); |
6561 | if (config.Configs["LL-Functions"] == null) | 6561 | if (config.Configs["LL-Functions"] == null) |
6562 | config.AddConfig("LL-Functions"); | 6562 | config.AddConfig("LL-Functions"); |
6563 | 6563 | ||
6564 | if (config.Configs["LL-Functions"].GetBoolean("AllowGodFunctions", false)) | 6564 | if (config.Configs["LL-Functions"].GetBoolean("AllowGodFunctions", false)) |
6565 | { | 6565 | { |
6566 | if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) | 6566 | if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) |
@@ -6829,7 +6829,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6829 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) | 6829 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) |
6830 | m_host.AddScriptLPS(1); | 6830 | m_host.AddScriptLPS(1); |
6831 | for (int i = 0; i < commandList.Data.Length; i++) | 6831 | for (int i = 0; i < commandList.Data.Length; i++) |
6832 | { | 6832 | { |
6833 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) | 6833 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) |
6834 | { | 6834 | { |
6835 | case ParcelMediaCommandEnum.Play: | 6835 | case ParcelMediaCommandEnum.Play: |
@@ -6839,7 +6839,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6839 | if (!agent.IsChildAgent) | 6839 | if (!agent.IsChildAgent) |
6840 | { | 6840 | { |
6841 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); | 6841 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); |
6842 | } | 6842 | } |
6843 | } | 6843 | } |
6844 | break; | 6844 | break; |
6845 | case ParcelMediaCommandEnum.Stop: | 6845 | case ParcelMediaCommandEnum.Stop: |
@@ -6870,7 +6870,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6870 | { | 6870 | { |
6871 | //Set the new media URL only if the user is the owner of the land | 6871 | //Set the new media URL only if the user is the owner of the land |
6872 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); | 6872 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); |
6873 | 6873 | ||
6874 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); | 6874 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); |
6875 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 6875 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
6876 | //Send an update of the mediaURL to all the clients that are in the parcel | 6876 | //Send an update of the mediaURL to all the clients that are in the parcel |
@@ -6881,8 +6881,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6881 | //Send parcel media update to the client | 6881 | //Send parcel media update to the client |
6882 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); | 6882 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); |
6883 | } | 6883 | } |
6884 | } | 6884 | } |
6885 | 6885 | ||
6886 | } | 6886 | } |
6887 | i++; | 6887 | i++; |
6888 | } | 6888 | } |
@@ -6892,7 +6892,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6892 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); | 6892 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); |
6893 | break; | 6893 | break; |
6894 | }//end switch | 6894 | }//end switch |
6895 | 6895 | ||
6896 | } | 6896 | } |
6897 | 6897 | ||
6898 | 6898 | ||
@@ -6935,7 +6935,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6935 | } | 6935 | } |
6936 | } | 6936 | } |
6937 | return list; | 6937 | return list; |
6938 | 6938 | ||
6939 | } | 6939 | } |
6940 | 6940 | ||
6941 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) | 6941 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) |
@@ -6979,7 +6979,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6979 | { | 6979 | { |
6980 | m_host.AddScriptLPS(1); | 6980 | m_host.AddScriptLPS(1); |
6981 | LLUUID invItemID=InventorySelf(); | 6981 | LLUUID invItemID=InventorySelf(); |
6982 | if (invItemID == LLUUID.Zero) | 6982 | if (invItemID == LLUUID.Zero) |
6983 | return new LSL_Types.Vector3(); | 6983 | return new LSL_Types.Vector3(); |
6984 | if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) | 6984 | if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) |
6985 | return new LSL_Types.Vector3(); | 6985 | return new LSL_Types.Vector3(); |
@@ -6989,7 +6989,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6989 | return new LSL_Types.Vector3(); | 6989 | return new LSL_Types.Vector3(); |
6990 | } | 6990 | } |
6991 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | 6991 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); |
6992 | if (presence != null) | 6992 | if (presence != null) |
6993 | { | 6993 | { |
6994 | LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); | 6994 | LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); |
6995 | return pos; | 6995 | return pos; |
@@ -7111,8 +7111,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
7111 | public void llSetCameraParams(LSL_Types.list rules) | 7111 | public void llSetCameraParams(LSL_Types.list rules) |
7112 | { | 7112 | { |
7113 | m_host.AddScriptLPS(1); | 7113 | m_host.AddScriptLPS(1); |
7114 | 7114 | ||
7115 | // our key in the object we are in | 7115 | // our key in the object we are in |
7116 | LLUUID invItemID=InventorySelf(); | 7116 | LLUUID invItemID=InventorySelf(); |
7117 | if (invItemID == LLUUID.Zero) return; | 7117 | if (invItemID == LLUUID.Zero) return; |
7118 | 7118 | ||
@@ -7126,10 +7126,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
7126 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 7126 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; |
7127 | 7127 | ||
7128 | ScenePresence presence = World.GetScenePresence(agentID); | 7128 | ScenePresence presence = World.GetScenePresence(agentID); |
7129 | 7129 | ||
7130 | // we are not interested in child-agents | 7130 | // we are not interested in child-agents |
7131 | if (presence.IsChildAgent) return; | 7131 | if (presence.IsChildAgent) return; |
7132 | 7132 | ||
7133 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); | 7133 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); |
7134 | object[] data = rules.Data; | 7134 | object[] data = rules.Data; |
7135 | for (int i = 0; i < data.Length; ++i) { | 7135 | for (int i = 0; i < data.Length; ++i) { |
@@ -7142,8 +7142,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
7142 | case BuiltIn_Commands_BaseClass.CAMERA_FOCUS_OFFSET: | 7142 | case BuiltIn_Commands_BaseClass.CAMERA_FOCUS_OFFSET: |
7143 | case BuiltIn_Commands_BaseClass.CAMERA_POSITION: | 7143 | case BuiltIn_Commands_BaseClass.CAMERA_POSITION: |
7144 | LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; | 7144 | LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; |
7145 | parameters.Add(type + 1, (float)v.x); | 7145 | parameters.Add(type + 1, (float)v.x); |
7146 | parameters.Add(type + 2, (float)v.y); | 7146 | parameters.Add(type + 2, (float)v.y); |
7147 | parameters.Add(type + 3, (float)v.z); | 7147 | parameters.Add(type + 3, (float)v.z); |
7148 | break; | 7148 | break; |
7149 | default: | 7149 | default: |
@@ -7163,7 +7163,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
7163 | { | 7163 | { |
7164 | m_host.AddScriptLPS(1); | 7164 | m_host.AddScriptLPS(1); |
7165 | 7165 | ||
7166 | // our key in the object we are in | 7166 | // our key in the object we are in |
7167 | LLUUID invItemID=InventorySelf(); | 7167 | LLUUID invItemID=InventorySelf(); |
7168 | if (invItemID == LLUUID.Zero) return; | 7168 | if (invItemID == LLUUID.Zero) return; |
7169 | 7169 | ||
@@ -7177,10 +7177,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
7177 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 7177 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; |
7178 | 7178 | ||
7179 | ScenePresence presence = World.GetScenePresence(agentID); | 7179 | ScenePresence presence = World.GetScenePresence(agentID); |
7180 | 7180 | ||
7181 | // we are not interested in child-agents | 7181 | // we are not interested in child-agents |
7182 | if (presence.IsChildAgent) return; | 7182 | if (presence.IsChildAgent) return; |
7183 | 7183 | ||
7184 | presence.ControllingClient.SendClearFollowCamProperties(objectID); | 7184 | presence.ControllingClient.SendClearFollowCamProperties(objectID); |
7185 | } | 7185 | } |
7186 | 7186 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index e98dec6..3b317ac 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | |||
@@ -703,7 +703,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
703 | // Otherwise, if we have strings, compare them alphabetically. | 703 | // Otherwise, if we have strings, compare them alphabetically. |
704 | string str1 = new string(space1); | 704 | string str1 = new string(space1); |
705 | string str2 = new string(space2); | 705 | string str2 = new string(space2); |
706 | 706 | ||
707 | int result; | 707 | int result; |
708 | 708 | ||
709 | if (char.IsDigit(space1[0]) && char.IsDigit(space2[0])) | 709 | if (char.IsDigit(space1[0]) && char.IsDigit(space2[0])) |
@@ -1427,22 +1427,22 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1427 | bool ret = i1.value != i2.value; | 1427 | bool ret = i1.value != i2.value; |
1428 | return ret; | 1428 | return ret; |
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | static public LSLInteger operator +(LSLInteger i1, int i2) | 1431 | static public LSLInteger operator +(LSLInteger i1, int i2) |
1432 | { | 1432 | { |
1433 | return new LSLInteger(i1.value + i2); | 1433 | return new LSLInteger(i1.value + i2); |
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | static public LSLInteger operator -(LSLInteger i1, int i2) | 1436 | static public LSLInteger operator -(LSLInteger i1, int i2) |
1437 | { | 1437 | { |
1438 | return new LSLInteger(i1.value - i2); | 1438 | return new LSLInteger(i1.value - i2); |
1439 | } | 1439 | } |
1440 | 1440 | ||
1441 | static public LSLInteger operator *(LSLInteger i1, int i2) | 1441 | static public LSLInteger operator *(LSLInteger i1, int i2) |
1442 | { | 1442 | { |
1443 | return new LSLInteger(i1.value * i2); | 1443 | return new LSLInteger(i1.value * i2); |
1444 | } | 1444 | } |
1445 | 1445 | ||
1446 | static public LSLInteger operator /(LSLInteger i1, int i2) | 1446 | static public LSLInteger operator /(LSLInteger i1, int i2) |
1447 | { | 1447 | { |
1448 | return new LSLInteger(i1.value / i2); | 1448 | return new LSLInteger(i1.value / i2); |
@@ -1452,22 +1452,22 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1452 | { | 1452 | { |
1453 | return new LSLFloat((double)i1.value + f); | 1453 | return new LSLFloat((double)i1.value + f); |
1454 | } | 1454 | } |
1455 | 1455 | ||
1456 | static public LSLFloat operator -(LSLInteger i1, double f) | 1456 | static public LSLFloat operator -(LSLInteger i1, double f) |
1457 | { | 1457 | { |
1458 | return new LSLFloat((double)i1.value - f); | 1458 | return new LSLFloat((double)i1.value - f); |
1459 | } | 1459 | } |
1460 | 1460 | ||
1461 | static public LSLFloat operator *(LSLInteger i1, double f) | 1461 | static public LSLFloat operator *(LSLInteger i1, double f) |
1462 | { | 1462 | { |
1463 | return new LSLFloat((double)i1.value * f); | 1463 | return new LSLFloat((double)i1.value * f); |
1464 | } | 1464 | } |
1465 | 1465 | ||
1466 | static public LSLFloat operator /(LSLInteger i1, double f) | 1466 | static public LSLFloat operator /(LSLInteger i1, double f) |
1467 | { | 1467 | { |
1468 | return new LSLFloat((double)i1.value / f); | 1468 | return new LSLFloat((double)i1.value / f); |
1469 | } | 1469 | } |
1470 | 1470 | ||
1471 | static public LSLInteger operator -(LSLInteger i) | 1471 | static public LSLInteger operator -(LSLInteger i) |
1472 | { | 1472 | { |
1473 | return new LSLInteger(-i.value); | 1473 | return new LSLInteger(-i.value); |
@@ -1623,17 +1623,17 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1623 | f.value--; | 1623 | f.value--; |
1624 | return f; | 1624 | return f; |
1625 | } | 1625 | } |
1626 | 1626 | ||
1627 | static public LSLFloat operator +(LSLFloat f, int i) | 1627 | static public LSLFloat operator +(LSLFloat f, int i) |
1628 | { | 1628 | { |
1629 | return new LSLFloat(f.value + (double)i); | 1629 | return new LSLFloat(f.value + (double)i); |
1630 | } | 1630 | } |
1631 | 1631 | ||
1632 | static public LSLFloat operator -(LSLFloat f, int i) | 1632 | static public LSLFloat operator -(LSLFloat f, int i) |
1633 | { | 1633 | { |
1634 | return new LSLFloat(f.value - (double)i); | 1634 | return new LSLFloat(f.value - (double)i); |
1635 | } | 1635 | } |
1636 | 1636 | ||
1637 | static public LSLFloat operator *(LSLFloat f, int i) | 1637 | static public LSLFloat operator *(LSLFloat f, int i) |
1638 | { | 1638 | { |
1639 | return new LSLFloat(f.value * (double)i); | 1639 | return new LSLFloat(f.value * (double)i); |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs index 5f86c9c..77cc7ea 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs | |||
@@ -88,7 +88,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin | |||
88 | { | 88 | { |
89 | if (!DataserverRequests.ContainsKey(identifier)) | 89 | if (!DataserverRequests.ContainsKey(identifier)) |
90 | return; | 90 | return; |
91 | 91 | ||
92 | ds=DataserverRequests[identifier]; | 92 | ds=DataserverRequests[identifier]; |
93 | DataserverRequests.Remove(identifier); | 93 | DataserverRequests.Remove(identifier); |
94 | } | 94 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index 79c1dde..5c57874 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | |||
@@ -126,7 +126,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
126 | /// Queue containing events waiting to be executed | 126 | /// Queue containing events waiting to be executed |
127 | /// </summary> | 127 | /// </summary> |
128 | public Queue<QueueItemStruct> eventQueue = new Queue<QueueItemStruct>(); | 128 | public Queue<QueueItemStruct> eventQueue = new Queue<QueueItemStruct>(); |
129 | 129 | ||
130 | #region " Queue structures " | 130 | #region " Queue structures " |
131 | /// <summary> | 131 | /// <summary> |
132 | /// Queue item structure | 132 | /// Queue item structure |
@@ -193,7 +193,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
193 | } | 193 | } |
194 | 194 | ||
195 | #endregion | 195 | #endregion |
196 | 196 | ||
197 | #region " Shutdown all threads " | 197 | #region " Shutdown all threads " |
198 | ~EventQueueManager() | 198 | ~EventQueueManager() |
199 | { | 199 | { |
@@ -408,10 +408,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
408 | 408 | ||
409 | // Set flag if script should be removed or not | 409 | // Set flag if script should be removed or not |
410 | EventQueueThread.KillCurrentScript = KillScriptOnMaxFunctionExecutionTime; | 410 | EventQueueThread.KillCurrentScript = KillScriptOnMaxFunctionExecutionTime; |
411 | 411 | ||
412 | // Abort this thread | 412 | // Abort this thread |
413 | AbortThreadClass(EventQueueThread); | 413 | AbortThreadClass(EventQueueThread); |
414 | 414 | ||
415 | // We do not need to start another, MaintenenceThread will do that for us | 415 | // We do not need to start another, MaintenenceThread will do that for us |
416 | //StartNewThreadClass(); | 416 | //StartNewThreadClass(); |
417 | } | 417 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index 255ab99..4376e00 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
44 | public class EventQueueThreadClass : iScriptEngineFunctionModule | 44 | public class EventQueueThreadClass : iScriptEngineFunctionModule |
45 | { | 45 | { |
46 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// How many ms to sleep if queue is empty | 49 | /// How many ms to sleep if queue is empty |
50 | /// </summary> | 50 | /// </summary> |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs index f04ac01..9a465f6 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
73 | void remote_data(uint localID, LLUUID itemID); | 73 | void remote_data(uint localID, LLUUID itemID); |
74 | void http_response(uint localID, LLUUID itemID); | 74 | void http_response(uint localID, LLUUID itemID); |
75 | } | 75 | } |
76 | 76 | ||
77 | public interface ServerRemotingObject | 77 | public interface ServerRemotingObject |
78 | { | 78 | { |
79 | RemoteEvents Events(); | 79 | RemoteEvents Events(); |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index 06c7387..fa3e35b 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | |||
@@ -355,8 +355,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
355 | 355 | ||
356 | private static string CreateYPCompilerScript(string compileScript) | 356 | private static string CreateYPCompilerScript(string compileScript) |
357 | { | 357 | { |
358 | |||
359 | |||
360 | compileScript = String.Empty + | 358 | compileScript = String.Empty + |
361 | "using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog; " + | 359 | "using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog; " + |
362 | "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" + | 360 | "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" + |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs index 3f7b95e..8618d6c 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
61 | myCode = myCode.Substring(0, cs_pointer); | 61 | myCode = myCode.Substring(0, cs_pointer); |
62 | } | 62 | } |
63 | myCode.Replace("//yp", "%YPCode"); | 63 | myCode.Replace("//yp", "%YPCode"); |
64 | 64 | ||
65 | StringWriter myCS_SW = new StringWriter(); | 65 | StringWriter myCS_SW = new StringWriter(); |
66 | StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); | 66 | StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); |
67 | 67 | ||
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs index 999208d..415c646 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
54 | { | 54 | { |
55 | _arity = arity; | 55 | _arity = arity; |
56 | } | 56 | } |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Append the answer to the list and update the indexes, if any. | 59 | /// Append the answer to the list and update the indexes, if any. |
60 | /// Elements of answer must be ground, since arguments with unbound variables make this | 60 | /// Elements of answer must be ground, since arguments with unbound variables make this |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs index 9a1f00d..56ed719 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
54 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. | 54 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. |
55 | /// </summary> | 55 | /// </summary> |
56 | /// <param name="ErrorTerm">the error term of the error</param> | 56 | /// <param name="ErrorTerm">the error term of the error</param> |
57 | /// <param name="Messsage">the message term of the error. If this is a string, it is converted to an | 57 | /// <param name="Messsage">the message term of the error. If this is a string, it is converted to an |
58 | /// Atom so it can be used by Prolog code. | 58 | /// Atom so it can be used by Prolog code. |
59 | /// Message, converted to a string, is use as the printable exception message. | 59 | /// Message, converted to a string, is use as the printable exception message. |
60 | /// </param> | 60 | /// </param> |
@@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
66 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); | 66 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); |
67 | } | 67 | } |
68 | 68 | ||
69 | public class TypeErrorInfo | 69 | public class TypeErrorInfo |
70 | { | 70 | { |
71 | public readonly Atom _Type; | 71 | public readonly Atom _Type; |
72 | public readonly object _Culprit; | 72 | public readonly object _Culprit; |
@@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
116 | /// <returns></returns> | 116 | /// <returns></returns> |
117 | public object getProcedureName() | 117 | public object getProcedureName() |
118 | { | 118 | { |
119 | if (!(_Type._name == "procedure" && | 119 | if (!(_Type._name == "procedure" && |
120 | _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) | 120 | _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) |
121 | return null; | 121 | return null; |
122 | return ((Functor2)_Culprit)._arg1; | 122 | return ((Functor2)_Culprit)._arg1; |
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. | 126 | /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. |
127 | /// Otherwise return -1. | 127 | /// Otherwise return -1. |
128 | /// </summary> | 128 | /// </summary> |
129 | /// <returns></returns> | 129 | /// <returns></returns> |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs index b69f9c4..694e733 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
147 | /// <summary> | 147 | /// <summary> |
148 | /// Convert term to an int. | 148 | /// Convert term to an int. |
149 | /// If term is a single-element List, use its first element | 149 | /// If term is a single-element List, use its first element |
150 | /// (to handle the char types like "a"). | 150 | /// (to handle the char types like "a"). |
151 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only | 151 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only |
152 | /// called from arithmetic functions). | 152 | /// called from arithmetic functions). |
153 | /// </summary> | 153 | /// </summary> |
@@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
172 | { | 172 | { |
173 | throw new PrologException | 173 | throw new PrologException |
174 | (new Functor2 | 174 | (new Functor2 |
175 | ("type_error", Atom.a("evaluable"), | 175 | ("type_error", Atom.a("evaluable"), |
176 | new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), | 176 | new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), |
177 | "Term must be an integer"); | 177 | "Term must be an integer"); |
178 | } | 178 | } |
179 | } | 179 | } |
@@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
181 | /// <summary> | 181 | /// <summary> |
182 | /// Convert term to a double. This may convert an int to a double, etc. | 182 | /// Convert term to a double. This may convert an int to a double, etc. |
183 | /// If term is a single-element List, use its first element | 183 | /// If term is a single-element List, use its first element |
184 | /// (to handle the char types like "a"). | 184 | /// (to handle the char types like "a"). |
185 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only | 185 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only |
186 | /// called from arithmetic functions). | 186 | /// called from arithmetic functions). |
187 | /// </summary> | 187 | /// </summary> |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
195 | // Assume it is a char type like "a". | 195 | // Assume it is a char type like "a". |
196 | term = YP.getValue(((Functor2)term)._arg1); | 196 | term = YP.getValue(((Functor2)term)._arg1); |
197 | if (term is Variable) | 197 | if (term is Variable) |
198 | throw new PrologException(Atom.a("instantiation_error"), | 198 | throw new PrologException(Atom.a("instantiation_error"), |
199 | "Expected a number but the argument is an unbound variable"); | 199 | "Expected a number but the argument is an unbound variable"); |
200 | 200 | ||
201 | try | 201 | try |
@@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
776 | if (term1TypeCode == -2) | 776 | if (term1TypeCode == -2) |
777 | { | 777 | { |
778 | // Variable. | 778 | // Variable. |
779 | // We always check for equality first because we want to be sure | 779 | // We always check for equality first because we want to be sure |
780 | // that less than returns false if the terms are equal, in | 780 | // that less than returns false if the terms are equal, in |
781 | // case that the less than check really behaves like less than or equal. | 781 | // case that the less than check really behaves like less than or equal. |
782 | if ((Variable)Term1 != (Variable)Term2) | 782 | if ((Variable)Term1 != (Variable)Term2) |
783 | // The hash code should be unique to a Variable object. | 783 | // The hash code should be unique to a Variable object. |
@@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
820 | } | 820 | } |
821 | 821 | ||
822 | /// <summary> | 822 | /// <summary> |
823 | /// Type code is -2 if term is a Variable, 0 if it is an Atom, | 823 | /// Type code is -2 if term is a Variable, 0 if it is an Atom, |
824 | /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, | 824 | /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, |
825 | /// 4 if it is Functor. | 825 | /// 4 if it is Functor. |
826 | /// Otherwise, type code is -1. | 826 | /// Otherwise, type code is -1. |
827 | /// This does not call YP.getValue(term). | 827 | /// This does not call YP.getValue(term). |
@@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1167 | "Arg 2 List has an element which is an unbound variable"); | 1167 | "Arg 2 List has an element which is an unbound variable"); |
1168 | if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) | 1168 | if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) |
1169 | throw new PrologException | 1169 | throw new PrologException |
1170 | (new Functor2("type_error", Atom.a("character"), listAtom), | 1170 | (new Functor2("type_error", Atom.a("character"), listAtom), |
1171 | "Arg 2 List has an element which is not a one character atom"); | 1171 | "Arg 2 List has an element which is not a one character atom"); |
1172 | charArray[i] = ((Atom)listAtom)._name[0]; | 1172 | charArray[i] = ((Atom)listAtom)._name[0]; |
1173 | } | 1173 | } |
@@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1209 | int codeInt; | 1209 | int codeInt; |
1210 | if (!getInt(codeArray[i], out codeInt) || codeInt < 0) | 1210 | if (!getInt(codeArray[i], out codeInt) || codeInt < 0) |
1211 | throw new PrologException | 1211 | throw new PrologException |
1212 | (new Functor1("representation_error", Atom.a("character_code")), | 1212 | (new Functor1("representation_error", Atom.a("character_code")), |
1213 | "Element of Arg 2 List is not a character code"); | 1213 | "Element of Arg 2 List is not a character code"); |
1214 | charArray[i] = (char)codeInt; | 1214 | charArray[i] = (char)codeInt; |
1215 | } | 1215 | } |
@@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1323 | { | 1323 | { |
1324 | if (!YP.number(Number)) | 1324 | if (!YP.number(Number)) |
1325 | throw new PrologException | 1325 | throw new PrologException |
1326 | (new Functor2("type_error", Atom.a("number"), Number), | 1326 | (new Functor2("type_error", Atom.a("number"), Number), |
1327 | "Arg 1 Number is not var or number"); | 1327 | "Arg 1 Number is not var or number"); |
1328 | // We just checked, so convertDouble shouldn't throw an exception. | 1328 | // We just checked, so convertDouble shouldn't throw an exception. |
1329 | numberString = YP.doubleToString(YP.convertDouble(Number)); | 1329 | numberString = YP.doubleToString(YP.convertDouble(Number)); |
@@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1413 | { | 1413 | { |
1414 | if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) | 1414 | if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) |
1415 | throw new PrologException | 1415 | throw new PrologException |
1416 | (new Functor2("type_error", Atom.a("character"), Char), | 1416 | (new Functor2("type_error", Atom.a("character"), Char), |
1417 | "Arg 1 Char is not var or one-character atom"); | 1417 | "Arg 1 Char is not var or one-character atom"); |
1418 | 1418 | ||
1419 | if (Code is Variable) | 1419 | if (Code is Variable) |
@@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1795 | IndexedAnswers indexedAnswers; | 1795 | IndexedAnswers indexedAnswers; |
1796 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) | 1796 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) |
1797 | { | 1797 | { |
1798 | // Create an IndexedAnswers as the only clause of the predicate. | 1798 | // Create an IndexedAnswers as the only clause of the predicate. |
1799 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); | 1799 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); |
1800 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); | 1800 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); |
1801 | } | 1801 | } |
@@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1826 | IndexedAnswers indexedAnswers; | 1826 | IndexedAnswers indexedAnswers; |
1827 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) | 1827 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) |
1828 | { | 1828 | { |
1829 | // Create an IndexedAnswers as the only clause of the predicate. | 1829 | // Create an IndexedAnswers as the only clause of the predicate. |
1830 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); | 1830 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); |
1831 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); | 1831 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); |
1832 | } | 1832 | } |
@@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1855 | { | 1855 | { |
1856 | List<IClause> clauses; | 1856 | List<IClause> clauses; |
1857 | if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) | 1857 | if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) |
1858 | return unknownPredicate(name, arguments.Length, | 1858 | return unknownPredicate(name, arguments.Length, |
1859 | "Undefined dynamic predicate: " + name + "/" + arguments.Length); | 1859 | "Undefined dynamic predicate: " + name + "/" + arguments.Length); |
1860 | 1860 | ||
1861 | if (clauses.Count == 1) | 1861 | if (clauses.Count == 1) |
@@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1889 | } | 1889 | } |
1890 | 1890 | ||
1891 | /// <summary> | 1891 | /// <summary> |
1892 | /// If _prologFlags["unknown"] is fail then return fail(), else if | 1892 | /// If _prologFlags["unknown"] is fail then return fail(), else if |
1893 | /// _prologFlags["unknown"] is warning then write the message to YP.write and | 1893 | /// _prologFlags["unknown"] is warning then write the message to YP.write and |
1894 | /// return fail(), else throw a PrologException for existence_error. . | 1894 | /// return fail(), else throw a PrologException for existence_error. . |
1895 | /// </summary> | 1895 | /// </summary> |
@@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1917 | } | 1917 | } |
1918 | 1918 | ||
1919 | /// <summary> | 1919 | /// <summary> |
1920 | /// This is deprecated and just calls matchDynamic. This matches all clauses, | 1920 | /// This is deprecated and just calls matchDynamic. This matches all clauses, |
1921 | /// not just the ones defined with assertFact. | 1921 | /// not just the ones defined with assertFact. |
1922 | /// </summary> | 1922 | /// </summary> |
1923 | /// <param name="name"></param> | 1923 | /// <param name="name"></param> |
@@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2066 | /// dynamic predicate. | 2066 | /// dynamic predicate. |
2067 | /// </summary> | 2067 | /// </summary> |
2068 | /// <param name="NameSlashArity"></param> | 2068 | /// <param name="NameSlashArity"></param> |
2069 | /// <param name="declaringClass">if not null, used to resolve references to the default | 2069 | /// <param name="declaringClass">if not null, used to resolve references to the default |
2070 | /// module Atom.a("")</param> | 2070 | /// module Atom.a("")</param> |
2071 | /// <returns></returns> | 2071 | /// <returns></returns> |
2072 | public static IEnumerable<bool> current_predicate(object NameSlashArity, Type declaringClass) | 2072 | public static IEnumerable<bool> current_predicate(object NameSlashArity, Type declaringClass) |
@@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2078 | Functor2 NameArityFunctor = NameSlashArity as Functor2; | 2078 | Functor2 NameArityFunctor = NameSlashArity as Functor2; |
2079 | if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) | 2079 | if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) |
2080 | throw new PrologException | 2080 | throw new PrologException |
2081 | (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), | 2081 | (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), |
2082 | "Must be a name/arity predicate indicator"); | 2082 | "Must be a name/arity predicate indicator"); |
2083 | object name = YP.getValue(NameArityFunctor._arg1); | 2083 | object name = YP.getValue(NameArityFunctor._arg1); |
2084 | object arity = YP.getValue(NameArityFunctor._arg2); | 2084 | object arity = YP.getValue(NameArityFunctor._arg2); |
@@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2163 | } | 2163 | } |
2164 | 2164 | ||
2165 | /// <summary> | 2165 | /// <summary> |
2166 | /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from | 2166 | /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from |
2167 | /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. | 2167 | /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. |
2168 | /// Otherwise, compile the goal as a single clause predicate and invoke it. | 2168 | /// Otherwise, compile the goal as a single clause predicate and invoke it. |
2169 | /// </summary> | 2169 | /// </summary> |
2170 | /// <param name="Goal"></param> | 2170 | /// <param name="Goal"></param> |
2171 | /// <param name="declaringClass">if not null, used to resolve references to the default | 2171 | /// <param name="declaringClass">if not null, used to resolve references to the default |
2172 | /// module Atom.a("")</param> | 2172 | /// module Atom.a("")</param> |
2173 | /// <returns></returns> | 2173 | /// <returns></returns> |
2174 | public static IEnumerable<bool> getIterator(object Goal, Type declaringClass) | 2174 | public static IEnumerable<bool> getIterator(object Goal, Type declaringClass) |
@@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2259 | (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); | 2259 | (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); |
2260 | if (!_prologFlags.ContainsKey(((Atom)Key)._name)) | 2260 | if (!_prologFlags.ContainsKey(((Atom)Key)._name)) |
2261 | throw new PrologException | 2261 | throw new PrologException |
2262 | (new Functor2("domain_error", Atom.a("prolog_flag"), Key), | 2262 | (new Functor2("domain_error", Atom.a("prolog_flag"), Key), |
2263 | "Arg 1 Key is not a recognized flag"); | 2263 | "Arg 1 Key is not a recognized flag"); |
2264 | 2264 | ||
2265 | foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) | 2265 | foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) |
@@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2343 | string results = ""; | 2343 | string results = ""; |
2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) | 2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) |
2345 | { | 2345 | { |
2346 | //Console.WriteLine( m ); | 2346 | //Console.WriteLine( m ); |
2347 | results += presep+ m + postsep; | 2347 | results += presep+ m + postsep; |
2348 | } | 2348 | } |
2349 | return results; | 2349 | return results; |
@@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2662 | #pragma warning restore 0168 | 2662 | #pragma warning restore 0168 |
2663 | } | 2663 | } |
2664 | } | 2664 | } |
2665 | 2665 | ||
2666 | /// <summary> | 2666 | /// <summary> |
2667 | /// CodeListReader extends TextReader and overrides Read to read the next code from | 2667 | /// CodeListReader extends TextReader and overrides Read to read the next code from |
2668 | /// the CodeList which is a Prolog list of integer character codes. | 2668 | /// the CodeList which is a Prolog list of integer character codes. |
@@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2683 | /// <returns></returns> | 2683 | /// <returns></returns> |
2684 | public override int Read() | 2684 | public override int Read() |
2685 | { | 2685 | { |
2686 | Functor2 CodeListPair = _CodeList as Functor2; | 2686 | Functor2 CodeListPair = _CodeList as Functor2; |
2687 | int code; | 2687 | int code; |
2688 | if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && | 2688 | if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && |
2689 | getInt(CodeListPair._arg1, out code))) | 2689 | getInt(CodeListPair._arg1, out code))) |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 42d9bf8..c94b56a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -39,13 +39,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
39 | public class ScriptManager : Common.ScriptEngineBase.ScriptManager | 39 | public class ScriptManager : Common.ScriptEngineBase.ScriptManager |
40 | { | 40 | { |
41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
42 | 42 | ||
43 | public ScriptManager(Common.ScriptEngineBase.ScriptEngine scriptEngine) | 43 | public ScriptManager(Common.ScriptEngineBase.ScriptEngine scriptEngine) |
44 | : base(scriptEngine) | 44 | : base(scriptEngine) |
45 | { | 45 | { |
46 | base.m_scriptEngine = scriptEngine; | 46 | base.m_scriptEngine = scriptEngine; |
47 | } | 47 | } |
48 | private Compiler.LSL.Compiler LSLCompiler; | 48 | private Compiler.LSL.Compiler LSLCompiler; |
49 | 49 | ||
50 | public override void Initialize() | 50 | public override void Initialize() |
51 | { | 51 | { |
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
63 | public override void _StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez) | 63 | public override void _StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez) |
64 | { | 64 | { |
65 | m_log.DebugFormat( | 65 | m_log.DebugFormat( |
66 | "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", | 66 | "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", |
67 | m_scriptEngine.ScriptEngineName, localID, itemID); | 67 | m_scriptEngine.ScriptEngineName, localID, itemID); |
68 | 68 | ||
69 | //IScriptHost root = host.GetRoot(); | 69 | //IScriptHost root = host.GetRoot(); |
@@ -73,13 +73,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
73 | string CompiledScriptFile = String.Empty; | 73 | string CompiledScriptFile = String.Empty; |
74 | 74 | ||
75 | SceneObjectPart m_host = World.GetSceneObjectPart(localID); | 75 | SceneObjectPart m_host = World.GetSceneObjectPart(localID); |
76 | 76 | ||
77 | if (null == m_host) | 77 | if (null == m_host) |
78 | { | 78 | { |
79 | m_log.ErrorFormat( | 79 | m_log.ErrorFormat( |
80 | "[{0}]: Could not find scene object part corresponding to localID {1} to start script", | 80 | "[{0}]: Could not find scene object part corresponding to localID {1} to start script", |
81 | m_scriptEngine.ScriptEngineName, localID); | 81 | m_scriptEngine.ScriptEngineName, localID); |
82 | 82 | ||
83 | return; | 83 | return; |
84 | } | 84 | } |
85 | 85 | ||
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index 6924dd2..21888fa 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs | |||
@@ -53,12 +53,12 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
53 | public EventManager(ScriptEngine _ScriptEngine) | 53 | public EventManager(ScriptEngine _ScriptEngine) |
54 | { | 54 | { |
55 | myScriptEngine = _ScriptEngine; | 55 | myScriptEngine = _ScriptEngine; |
56 | 56 | ||
57 | m_TCPClient = new TCPClient(); | 57 | m_TCPClient = new TCPClient(); |
58 | RPC = new TRPC_Remote(m_TCPClient); | 58 | RPC = new TRPC_Remote(m_TCPClient); |
59 | RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); | 59 | RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); |
60 | myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort); | 60 | myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort); |
61 | 61 | ||
62 | myScriptEngine.Log.Info("[RemoteEngine]: Hooking up to server events"); | 62 | myScriptEngine.Log.Info("[RemoteEngine]: Hooking up to server events"); |
63 | //myScriptEngine.World.EventManager.OnObjectGrab += touch_start; | 63 | //myScriptEngine.World.EventManager.OnObjectGrab += touch_start; |
64 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; | 64 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9604828..4de207a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -348,23 +348,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
348 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting | 348 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting |
349 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. | 349 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. |
350 | */ | 350 | */ |
351 | 351 | ||
352 | /* How we arrived at this llEuler2Rot | 352 | /* How we arrived at this llEuler2Rot |
353 | * | 353 | * |
354 | * Experiment in SL to determine conventions: | 354 | * Experiment in SL to determine conventions: |
355 | * llEuler2Rot(<PI,0,0>)=<1,0,0,0> | 355 | * llEuler2Rot(<PI,0,0>)=<1,0,0,0> |
356 | * llEuler2Rot(<0,PI,0>)=<0,1,0,0> | 356 | * llEuler2Rot(<0,PI,0>)=<0,1,0,0> |
357 | * llEuler2Rot(<0,0,PI>)=<0,0,1,0> | 357 | * llEuler2Rot(<0,0,PI>)=<0,0,1,0> |
358 | * | 358 | * |
359 | * Important facts about Quaternions | 359 | * Important facts about Quaternions |
360 | * - multiplication is non-commutative (a*b != b*a) | 360 | * - multiplication is non-commutative (a*b != b*a) |
361 | * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication | 361 | * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication |
362 | * | 362 | * |
363 | * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): | 363 | * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): |
364 | * Qx = c1+i*s1 | 364 | * Qx = c1+i*s1 |
365 | * Qy = c2+j*s2; | 365 | * Qy = c2+j*s2; |
366 | * Qz = c3+k*s3; | 366 | * Qz = c3+k*s3; |
367 | * | 367 | * |
368 | * Rotations applied in order (from above) Z, Y, X | 368 | * Rotations applied in order (from above) Z, Y, X |
369 | * Q = (Qz * Qy) * Qx | 369 | * Q = (Qz * Qy) * Qx |
370 | * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) | 370 | * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) |
@@ -376,23 +376,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
376 | * y=j*(c1*s2*c3-s1*c2*s3) | 376 | * y=j*(c1*s2*c3-s1*c2*s3) |
377 | * z=k*(s1*s2*c3+c1*c2*s3) | 377 | * z=k*(s1*s2*c3+c1*c2*s3) |
378 | * s= c1*c2*c3-s1*s2*s3 | 378 | * s= c1*c2*c3-s1*s2*s3 |
379 | * | 379 | * |
380 | * This implementation agrees with the functions found here: | 380 | * This implementation agrees with the functions found here: |
381 | * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions | 381 | * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions |
382 | * And with the results in SL. | 382 | * And with the results in SL. |
383 | * | 383 | * |
384 | * It's also possible to calculate llEuler2Rot by direct multiplication of | 384 | * It's also possible to calculate llEuler2Rot by direct multiplication of |
385 | * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function | 385 | * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function |
386 | * from the wiki). | 386 | * from the wiki). |
387 | * Apparently in some cases this is better from a numerical precision perspective? | 387 | * Apparently in some cases this is better from a numerical precision perspective? |
388 | */ | 388 | */ |
389 | 389 | ||
390 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) | 390 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) |
391 | { | 391 | { |
392 | m_host.AddScriptLPS(1); | 392 | m_host.AddScriptLPS(1); |
393 | 393 | ||
394 | double x,y,z,s; | 394 | double x,y,z,s; |
395 | 395 | ||
396 | double c1 = Math.Cos(v.x/2.0); | 396 | double c1 = Math.Cos(v.x/2.0); |
397 | double c2 = Math.Cos(v.y/2.0); | 397 | double c2 = Math.Cos(v.y/2.0); |
398 | double c3 = Math.Cos(v.z/2.0); | 398 | double c3 = Math.Cos(v.z/2.0); |
@@ -404,7 +404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
404 | y = c1*s2*c3-s1*c2*s3; | 404 | y = c1*s2*c3-s1*c2*s3; |
405 | z = s1*s2*c3+c1*c2*s3; | 405 | z = s1*s2*c3+c1*c2*s3; |
406 | s = c1*c2*c3-s1*s2*s3; | 406 | s = c1*c2*c3-s1*s2*s3; |
407 | 407 | ||
408 | return new LSL_Types.Quaternion(x, y, z, s); | 408 | return new LSL_Types.Quaternion(x, y, z, s); |
409 | } | 409 | } |
410 | 410 | ||
@@ -414,7 +414,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
414 | double x, y, z, s; | 414 | double x, y, z, s; |
415 | int f = 0; | 415 | int f = 0; |
416 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> | 416 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> |
417 | // Computing quaternion x,y,z,s values | 417 | // Computing quaternion x,y,z,s values |
418 | x = ((fwd.x - left.y - up.z + 1) / 4); | 418 | x = ((fwd.x - left.y - up.z + 1) / 4); |
419 | x *= x; | 419 | x *= x; |
420 | x = Math.Sqrt(Math.Sqrt(x)); | 420 | x = Math.Sqrt(Math.Sqrt(x)); |
@@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
428 | s *= s; | 428 | s *= s; |
429 | s = Math.Sqrt(Math.Sqrt(s)); | 429 | s = Math.Sqrt(Math.Sqrt(s)); |
430 | 430 | ||
431 | // Set f for signs detection | 431 | // Set f for signs detection |
432 | if (fwd.y + left.x >= 0) { f += 1; } | 432 | if (fwd.y + left.x >= 0) { f += 1; } |
433 | if (fwd.z + up.x >= 0) { f += 2; } | 433 | if (fwd.z + up.x >= 0) { f += 2; } |
434 | if (left.z - up.y >= 0) { f += 4; } | 434 | if (left.z - up.y >= 0) { f += 4; } |
@@ -1013,9 +1013,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1013 | return; | 1013 | return; |
1014 | } | 1014 | } |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | public void SetGlow(SceneObjectPart part, int face, float glow) | 1017 | public void SetGlow(SceneObjectPart part, int face, float glow) |
1018 | { | 1018 | { |
1019 | LLObject.TextureEntry tex = part.Shape.Textures; | 1019 | LLObject.TextureEntry tex = part.Shape.Textures; |
1020 | if (face > -1) | 1020 | if (face > -1) |
1021 | { | 1021 | { |
@@ -1023,7 +1023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1023 | tex.FaceTextures[face].Glow = glow; | 1023 | tex.FaceTextures[face].Glow = glow; |
1024 | part.UpdateTexture(tex); | 1024 | part.UpdateTexture(tex); |
1025 | return; | 1025 | return; |
1026 | } | 1026 | } |
1027 | else if (face == -1) | 1027 | else if (face == -1) |
1028 | { | 1028 | { |
1029 | for (uint i = 0; i < 32; i++) | 1029 | for (uint i = 0; i < 32; i++) |
@@ -1038,15 +1038,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1038 | return; | 1038 | return; |
1039 | } | 1039 | } |
1040 | } | 1040 | } |
1041 | 1041 | ||
1042 | public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) | 1042 | public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) |
1043 | { | 1043 | { |
1044 | 1044 | ||
1045 | Shininess sval = new Shininess(); | 1045 | Shininess sval = new Shininess(); |
1046 | 1046 | ||
1047 | switch (shiny) | 1047 | switch (shiny) |
1048 | { | 1048 | { |
1049 | case 0: | 1049 | case 0: |
1050 | sval = Shininess.None; | 1050 | sval = Shininess.None; |
1051 | break; | 1051 | break; |
1052 | case 1: | 1052 | case 1: |
@@ -1062,7 +1062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1062 | sval = Shininess.None; | 1062 | sval = Shininess.None; |
1063 | break; | 1063 | break; |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | LLObject.TextureEntry tex = part.Shape.Textures; | 1066 | LLObject.TextureEntry tex = part.Shape.Textures; |
1067 | if (face > -1) | 1067 | if (face > -1) |
1068 | { | 1068 | { |
@@ -1070,8 +1070,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1070 | tex.FaceTextures[face].Shiny = sval; | 1070 | tex.FaceTextures[face].Shiny = sval; |
1071 | tex.FaceTextures[face].Bump = bump; | 1071 | tex.FaceTextures[face].Bump = bump; |
1072 | part.UpdateTexture(tex); | 1072 | part.UpdateTexture(tex); |
1073 | return; | 1073 | return; |
1074 | } | 1074 | } |
1075 | else if (face == -1) | 1075 | else if (face == -1) |
1076 | { | 1076 | { |
1077 | for (uint i = 0; i < 32; i++) | 1077 | for (uint i = 0; i < 32; i++) |
@@ -1088,8 +1088,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1088 | return; | 1088 | return; |
1089 | } | 1089 | } |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | public void SetFullBright(SceneObjectPart part, int face, bool bright) | 1092 | public void SetFullBright(SceneObjectPart part, int face, bool bright) |
1093 | { | 1093 | { |
1094 | LLObject.TextureEntry tex = part.Shape.Textures; | 1094 | LLObject.TextureEntry tex = part.Shape.Textures; |
1095 | if (face > -1) | 1095 | if (face > -1) |
@@ -1106,14 +1106,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1106 | if (tex.FaceTextures[i] != null) | 1106 | if (tex.FaceTextures[i] != null) |
1107 | { | 1107 | { |
1108 | tex.FaceTextures[i].Fullbright = bright; | 1108 | tex.FaceTextures[i].Fullbright = bright; |
1109 | } | 1109 | } |
1110 | } | 1110 | } |
1111 | tex.DefaultTexture.Fullbright = bright; | 1111 | tex.DefaultTexture.Fullbright = bright; |
1112 | part.UpdateTexture(tex); | 1112 | part.UpdateTexture(tex); |
1113 | return; | 1113 | return; |
1114 | } | 1114 | } |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | public double llGetAlpha(int face) | 1117 | public double llGetAlpha(int face) |
1118 | { | 1118 | { |
1119 | m_host.AddScriptLPS(1); | 1119 | m_host.AddScriptLPS(1); |
@@ -1169,7 +1169,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1169 | 1169 | ||
1170 | /// <summary> | 1170 | /// <summary> |
1171 | /// Set flexi parameters of a part. | 1171 | /// Set flexi parameters of a part. |
1172 | /// | 1172 | /// |
1173 | /// FIXME: Much of this code should probably be within the part itself. | 1173 | /// FIXME: Much of this code should probably be within the part itself. |
1174 | /// </summary> | 1174 | /// </summary> |
1175 | /// <param name="part"></param> | 1175 | /// <param name="part"></param> |
@@ -1179,7 +1179,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1179 | /// <param name="friction"></param> | 1179 | /// <param name="friction"></param> |
1180 | /// <param name="wind"></param> | 1180 | /// <param name="wind"></param> |
1181 | /// <param name="tension"></param> | 1181 | /// <param name="tension"></param> |
1182 | /// <param name="Force"></param> | 1182 | /// <param name="Force"></param> |
1183 | private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, | 1183 | private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, |
1184 | float wind, float tension, LSL_Types.Vector3 Force) | 1184 | float wind, float tension, LSL_Types.Vector3 Force) |
1185 | { | 1185 | { |
@@ -1230,7 +1230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1230 | 1230 | ||
1231 | /// <summary> | 1231 | /// <summary> |
1232 | /// Set a light point on a part | 1232 | /// Set a light point on a part |
1233 | /// | 1233 | /// |
1234 | /// FIXME: Much of this code should probably be in SceneObjectGroup | 1234 | /// FIXME: Much of this code should probably be in SceneObjectGroup |
1235 | /// </summary> | 1235 | /// </summary> |
1236 | /// <param name="part"></param> | 1236 | /// <param name="part"></param> |
@@ -1238,7 +1238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1238 | /// <param name="color"></param> | 1238 | /// <param name="color"></param> |
1239 | /// <param name="intensity"></param> | 1239 | /// <param name="intensity"></param> |
1240 | /// <param name="radius"></param> | 1240 | /// <param name="radius"></param> |
1241 | /// <param name="falloff"></param> | 1241 | /// <param name="falloff"></param> |
1242 | private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) | 1242 | private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) |
1243 | { | 1243 | { |
1244 | if (part == null) | 1244 | if (part == null) |
@@ -2880,13 +2880,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2880 | bool found = false; | 2880 | bool found = false; |
2881 | LLUUID destId = LLUUID.Zero; | 2881 | LLUUID destId = LLUUID.Zero; |
2882 | LLUUID objId = LLUUID.Zero; | 2882 | LLUUID objId = LLUUID.Zero; |
2883 | 2883 | ||
2884 | if (!LLUUID.TryParse(destination, out destId)) | 2884 | if (!LLUUID.TryParse(destination, out destId)) |
2885 | { | 2885 | { |
2886 | llSay(0, "Could not parse key " + destination); | 2886 | llSay(0, "Could not parse key " + destination); |
2887 | return; | 2887 | return; |
2888 | } | 2888 | } |
2889 | 2889 | ||
2890 | // move the first object found with this inventory name | 2890 | // move the first object found with this inventory name |
2891 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | 2891 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) |
2892 | { | 2892 | { |
@@ -4451,7 +4451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4451 | private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() | 4451 | private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() |
4452 | { | 4452 | { |
4453 | Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); | 4453 | Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); |
4454 | 4454 | ||
4455 | // TODO find out about the other defaults and add them here | 4455 | // TODO find out about the other defaults and add them here |
4456 | ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); | 4456 | ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); |
4457 | ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); | 4457 | ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); |
@@ -4465,7 +4465,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4465 | ps.PartMaxAge = 10.0f; | 4465 | ps.PartMaxAge = 10.0f; |
4466 | return ps; | 4466 | return ps; |
4467 | } | 4467 | } |
4468 | 4468 | ||
4469 | public void llParticleSystem(LSL_Types.list rules) | 4469 | public void llParticleSystem(LSL_Types.list rules) |
4470 | { | 4470 | { |
4471 | m_host.AddScriptLPS(1); | 4471 | m_host.AddScriptLPS(1); |
@@ -4660,7 +4660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4660 | itemList.Add(itemID); | 4660 | itemList.Add(itemID); |
4661 | } | 4661 | } |
4662 | } | 4662 | } |
4663 | 4663 | ||
4664 | if (itemList.Count == 0) | 4664 | if (itemList.Count == 0) |
4665 | return; | 4665 | return; |
4666 | 4666 | ||
@@ -4936,11 +4936,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4936 | m_host.AddScriptLPS(1); | 4936 | m_host.AddScriptLPS(1); |
4937 | return Util.Md5Hash(src + ":" + nonce.ToString()); | 4937 | return Util.Md5Hash(src + ":" + nonce.ToString()); |
4938 | } | 4938 | } |
4939 | 4939 | ||
4940 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) | 4940 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) |
4941 | { | 4941 | { |
4942 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | 4942 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); |
4943 | 4943 | ||
4944 | if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && | 4944 | if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && |
4945 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE && | 4945 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE && |
4946 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE && | 4946 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE && |
@@ -4998,23 +4998,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4998 | } | 4998 | } |
4999 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); | 4999 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); |
5000 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); | 5000 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); |
5001 | 5001 | ||
5002 | shapeBlock.ObjectLocalID = m_host.LocalId; | 5002 | shapeBlock.ObjectLocalID = m_host.LocalId; |
5003 | 5003 | ||
5004 | // retain pathcurve | 5004 | // retain pathcurve |
5005 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | 5005 | shapeBlock.PathCurve = m_host.Shape.PathCurve; |
5006 | 5006 | ||
5007 | return shapeBlock; | 5007 | return shapeBlock; |
5008 | } | 5008 | } |
5009 | 5009 | ||
5010 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) | 5010 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) |
5011 | { | 5011 | { |
5012 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5012 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5013 | 5013 | ||
5014 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5014 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5015 | 5015 | ||
5016 | shapeBlock.ProfileCurve += fudge; | 5016 | shapeBlock.ProfileCurve += fudge; |
5017 | 5017 | ||
5018 | if (taper_b.x < 0f) | 5018 | if (taper_b.x < 0f) |
5019 | { | 5019 | { |
5020 | taper_b.x = 0f; | 5020 | taper_b.x = 0f; |
@@ -5051,25 +5051,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5051 | } | 5051 | } |
5052 | shapeBlock.PathShearX = (byte)(100 * topshear.x); | 5052 | shapeBlock.PathShearX = (byte)(100 * topshear.x); |
5053 | shapeBlock.PathShearY = (byte)(100 * topshear.y); | 5053 | shapeBlock.PathShearY = (byte)(100 * topshear.y); |
5054 | 5054 | ||
5055 | m_host.UpdateShape(shapeBlock); | 5055 | m_host.UpdateShape(shapeBlock); |
5056 | } | 5056 | } |
5057 | 5057 | ||
5058 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) | 5058 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) |
5059 | { | 5059 | { |
5060 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5060 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5061 | 5061 | ||
5062 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5062 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5063 | 5063 | ||
5064 | // profile/path swapped for a sphere | 5064 | // profile/path swapped for a sphere |
5065 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | 5065 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; |
5066 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | 5066 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; |
5067 | 5067 | ||
5068 | shapeBlock.ProfileCurve += fudge; | 5068 | shapeBlock.ProfileCurve += fudge; |
5069 | 5069 | ||
5070 | shapeBlock.PathScaleX = 100; | 5070 | shapeBlock.PathScaleX = 100; |
5071 | shapeBlock.PathScaleY = 100; | 5071 | shapeBlock.PathScaleY = 100; |
5072 | 5072 | ||
5073 | if (dimple.x < 0f) | 5073 | if (dimple.x < 0f) |
5074 | { | 5074 | { |
5075 | dimple.x = 0f; | 5075 | dimple.x = 0f; |
@@ -5092,22 +5092,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5092 | } | 5092 | } |
5093 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); | 5093 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); |
5094 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); | 5094 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); |
5095 | 5095 | ||
5096 | m_host.UpdateShape(shapeBlock); | 5096 | m_host.UpdateShape(shapeBlock); |
5097 | } | 5097 | } |
5098 | 5098 | ||
5099 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) | 5099 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) |
5100 | { | 5100 | { |
5101 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5101 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5102 | 5102 | ||
5103 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5103 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5104 | 5104 | ||
5105 | shapeBlock.ProfileCurve += fudge; | 5105 | shapeBlock.ProfileCurve += fudge; |
5106 | 5106 | ||
5107 | // profile/path swapped for a torrus, tube, ring | 5107 | // profile/path swapped for a torrus, tube, ring |
5108 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | 5108 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; |
5109 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | 5109 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; |
5110 | 5110 | ||
5111 | if (holesize.x < 0.05f) | 5111 | if (holesize.x < 0.05f) |
5112 | { | 5112 | { |
5113 | holesize.x = 0.05f; | 5113 | holesize.x = 0.05f; |
@@ -5212,15 +5212,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5212 | skew = 0.95f; | 5212 | skew = 0.95f; |
5213 | } | 5213 | } |
5214 | shapeBlock.PathSkew = (sbyte)(100 * skew); | 5214 | shapeBlock.PathSkew = (sbyte)(100 * skew); |
5215 | 5215 | ||
5216 | m_host.UpdateShape(shapeBlock); | 5216 | m_host.UpdateShape(shapeBlock); |
5217 | } | 5217 | } |
5218 | 5218 | ||
5219 | private void SetPrimitiveShapeParams(string map, int type) | 5219 | private void SetPrimitiveShapeParams(string map, int type) |
5220 | { | 5220 | { |
5221 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | 5221 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); |
5222 | LLUUID sculptId; | 5222 | LLUUID sculptId; |
5223 | 5223 | ||
5224 | if (!LLUUID.TryParse(map, out sculptId)) | 5224 | if (!LLUUID.TryParse(map, out sculptId)) |
5225 | { | 5225 | { |
5226 | llSay(0, "Could not parse key " + map); | 5226 | llSay(0, "Could not parse key " + map); |
@@ -5230,7 +5230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5230 | shapeBlock.ObjectLocalID = m_host.LocalId; | 5230 | shapeBlock.ObjectLocalID = m_host.LocalId; |
5231 | shapeBlock.PathScaleX = 100; | 5231 | shapeBlock.PathScaleX = 100; |
5232 | shapeBlock.PathScaleY = 150; | 5232 | shapeBlock.PathScaleY = 150; |
5233 | 5233 | ||
5234 | if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && | 5234 | if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && |
5235 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && | 5235 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && |
5236 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && | 5236 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && |
@@ -5239,7 +5239,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5239 | // default | 5239 | // default |
5240 | type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; | 5240 | type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; |
5241 | } | 5241 | } |
5242 | 5242 | ||
5243 | // retain pathcurve | 5243 | // retain pathcurve |
5244 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | 5244 | shapeBlock.PathCurve = m_host.Shape.PathCurve; |
5245 | 5245 | ||
@@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5256 | public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules) | 5256 | public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules) |
5257 | { | 5257 | { |
5258 | m_host.AddScriptLPS(1); | 5258 | m_host.AddScriptLPS(1); |
5259 | 5259 | ||
5260 | if (m_host.ParentGroup == null) | 5260 | if (m_host.ParentGroup == null) |
5261 | return; | 5261 | return; |
5262 | 5262 | ||
@@ -5302,13 +5302,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5302 | SetRot(part, q); | 5302 | SetRot(part, q); |
5303 | 5303 | ||
5304 | break; | 5304 | break; |
5305 | 5305 | ||
5306 | case (int)ScriptBaseClass.PRIM_TYPE: | 5306 | case (int)ScriptBaseClass.PRIM_TYPE: |
5307 | if (remain < 3) | 5307 | if (remain < 3) |
5308 | return; | 5308 | return; |
5309 | 5309 | ||
5310 | code = Convert.ToInt32(rules.Data[idx++]); | 5310 | code = Convert.ToInt32(rules.Data[idx++]); |
5311 | 5311 | ||
5312 | remain = rules.Length - idx; | 5312 | remain = rules.Length - idx; |
5313 | float hollow; | 5313 | float hollow; |
5314 | LSL_Types.Vector3 twist; | 5314 | LSL_Types.Vector3 twist; |
@@ -5319,9 +5319,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5319 | float skew; | 5319 | float skew; |
5320 | LSL_Types.Vector3 holesize; | 5320 | LSL_Types.Vector3 holesize; |
5321 | LSL_Types.Vector3 profilecut; | 5321 | LSL_Types.Vector3 profilecut; |
5322 | 5322 | ||
5323 | switch (code) | 5323 | switch (code) |
5324 | { | 5324 | { |
5325 | case (int)ScriptBaseClass.PRIM_TYPE_BOX: | 5325 | case (int)ScriptBaseClass.PRIM_TYPE_BOX: |
5326 | if (remain < 6) | 5326 | if (remain < 6) |
5327 | return; | 5327 | return; |
@@ -5335,7 +5335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5335 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | 5335 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; |
5336 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); | 5336 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); |
5337 | break; | 5337 | break; |
5338 | 5338 | ||
5339 | case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: | 5339 | case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: |
5340 | if (remain < 6) | 5340 | if (remain < 6) |
5341 | return; | 5341 | return; |
@@ -5350,12 +5350,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5350 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | 5350 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; |
5351 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); | 5351 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); |
5352 | break; | 5352 | break; |
5353 | 5353 | ||
5354 | case (int)ScriptBaseClass.PRIM_TYPE_PRISM: | 5354 | case (int)ScriptBaseClass.PRIM_TYPE_PRISM: |
5355 | if (remain < 6) | 5355 | if (remain < 6) |
5356 | return; | 5356 | return; |
5357 | 5357 | ||
5358 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5358 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5359 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5359 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5360 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5360 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5361 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5361 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5377,12 +5377,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5377 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5377 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5378 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); | 5378 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); |
5379 | break; | 5379 | break; |
5380 | 5380 | ||
5381 | case (int)ScriptBaseClass.PRIM_TYPE_TORUS: | 5381 | case (int)ScriptBaseClass.PRIM_TYPE_TORUS: |
5382 | if (remain < 11) | 5382 | if (remain < 11) |
5383 | return; | 5383 | return; |
5384 | 5384 | ||
5385 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5385 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5386 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5386 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5387 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5387 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5388 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5388 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5396,12 +5396,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5396 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5396 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5397 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); | 5397 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); |
5398 | break; | 5398 | break; |
5399 | 5399 | ||
5400 | case (int)ScriptBaseClass.PRIM_TYPE_TUBE: | 5400 | case (int)ScriptBaseClass.PRIM_TYPE_TUBE: |
5401 | if (remain < 11) | 5401 | if (remain < 11) |
5402 | return; | 5402 | return; |
5403 | 5403 | ||
5404 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5404 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5405 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5405 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5406 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5406 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5407 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5407 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5415,12 +5415,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5415 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5415 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5416 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); | 5416 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); |
5417 | break; | 5417 | break; |
5418 | 5418 | ||
5419 | case (int)ScriptBaseClass.PRIM_TYPE_RING: | 5419 | case (int)ScriptBaseClass.PRIM_TYPE_RING: |
5420 | if (remain < 11) | 5420 | if (remain < 11) |
5421 | return; | 5421 | return; |
5422 | 5422 | ||
5423 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5423 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5424 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5424 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5425 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5425 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5426 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5426 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5434,7 +5434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5434 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5434 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5435 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); | 5435 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); |
5436 | break; | 5436 | break; |
5437 | 5437 | ||
5438 | case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: | 5438 | case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: |
5439 | if (remain < 2) | 5439 | if (remain < 2) |
5440 | return; | 5440 | return; |
@@ -5445,7 +5445,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5445 | SetPrimitiveShapeParams(map, face); | 5445 | SetPrimitiveShapeParams(map, face); |
5446 | break; | 5446 | break; |
5447 | } | 5447 | } |
5448 | 5448 | ||
5449 | break; | 5449 | break; |
5450 | 5450 | ||
5451 | case (int)ScriptBaseClass.PRIM_TEXTURE: | 5451 | case (int)ScriptBaseClass.PRIM_TEXTURE: |
@@ -5509,31 +5509,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5509 | return; | 5509 | return; |
5510 | face = Convert.ToInt32(rules.Data[idx++]); | 5510 | face = Convert.ToInt32(rules.Data[idx++]); |
5511 | float glow = (float)Convert.ToDouble(rules.Data[idx++]); | 5511 | float glow = (float)Convert.ToDouble(rules.Data[idx++]); |
5512 | 5512 | ||
5513 | SetGlow(part, face, glow); | 5513 | SetGlow(part, face, glow); |
5514 | 5514 | ||
5515 | break; | 5515 | break; |
5516 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | 5516 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
5517 | if (remain < 3) | 5517 | if (remain < 3) |
5518 | return; | 5518 | return; |
5519 | face = Convert.ToInt32(rules.Data[idx++]); | 5519 | face = Convert.ToInt32(rules.Data[idx++]); |
5520 | int shiny = Convert.ToInt32(rules.Data[idx++]); | 5520 | int shiny = Convert.ToInt32(rules.Data[idx++]); |
5521 | Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); | 5521 | Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); |
5522 | 5522 | ||
5523 | SetShiny(part, face, shiny, bump); | 5523 | SetShiny(part, face, shiny, bump); |
5524 | 5524 | ||
5525 | break; | 5525 | break; |
5526 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: | 5526 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: |
5527 | if (remain < 2) | 5527 | if (remain < 2) |
5528 | return; | 5528 | return; |
5529 | face = Convert.ToInt32(rules.Data[idx++]); | 5529 | face = Convert.ToInt32(rules.Data[idx++]); |
5530 | string bv = rules.Data[idx++].ToString(); | 5530 | string bv = rules.Data[idx++].ToString(); |
5531 | bool st; | 5531 | bool st; |
5532 | if (bv.Equals("1")) | 5532 | if (bv.Equals("1")) |
5533 | st = true; | 5533 | st = true; |
5534 | else | 5534 | else |
5535 | st = false; | 5535 | st = false; |
5536 | 5536 | ||
5537 | SetFullBright(part, face , st); | 5537 | SetFullBright(part, face , st); |
5538 | break; | 5538 | break; |
5539 | case (int)ScriptBaseClass.PRIM_MATERIAL: | 5539 | case (int)ScriptBaseClass.PRIM_MATERIAL: |
@@ -5552,29 +5552,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5552 | case (int)ScriptBaseClass.PRIM_PHANTOM: | 5552 | case (int)ScriptBaseClass.PRIM_PHANTOM: |
5553 | if (remain < 1) | 5553 | if (remain < 1) |
5554 | return; | 5554 | return; |
5555 | 5555 | ||
5556 | string ph = rules.Data[idx++].ToString(); | 5556 | string ph = rules.Data[idx++].ToString(); |
5557 | bool phantom; | 5557 | bool phantom; |
5558 | 5558 | ||
5559 | if (ph.Equals("1")) | 5559 | if (ph.Equals("1")) |
5560 | phantom = true; | 5560 | phantom = true; |
5561 | else | 5561 | else |
5562 | phantom = false; | 5562 | phantom = false; |
5563 | 5563 | ||
5564 | part.ScriptSetPhantomStatus(phantom); | 5564 | part.ScriptSetPhantomStatus(phantom); |
5565 | part.ScheduleFullUpdate(); | 5565 | part.ScheduleFullUpdate(); |
5566 | break; | 5566 | break; |
5567 | case (int)ScriptBaseClass.PRIM_PHYSICS: | 5567 | case (int)ScriptBaseClass.PRIM_PHYSICS: |
5568 | if (remain < 1) | 5568 | if (remain < 1) |
5569 | return; | 5569 | return; |
5570 | string phy = rules.Data[idx++].ToString(); | 5570 | string phy = rules.Data[idx++].ToString(); |
5571 | bool physics; | 5571 | bool physics; |
5572 | 5572 | ||
5573 | if (phy.Equals("1")) | 5573 | if (phy.Equals("1")) |
5574 | physics = true; | 5574 | physics = true; |
5575 | else | 5575 | else |
5576 | physics = false; | 5576 | physics = false; |
5577 | 5577 | ||
5578 | m_host.ScriptSetPhysicsStatus(physics); | 5578 | m_host.ScriptSetPhysicsStatus(physics); |
5579 | part.ScheduleFullUpdate(); | 5579 | part.ScheduleFullUpdate(); |
5580 | break; | 5580 | break; |
@@ -5645,7 +5645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5645 | public LSL_Types.list llGetAnimationList( string id ) | 5645 | public LSL_Types.list llGetAnimationList( string id ) |
5646 | { | 5646 | { |
5647 | m_host.AddScriptLPS(1); | 5647 | m_host.AddScriptLPS(1); |
5648 | 5648 | ||
5649 | LSL_Types.list l = new LSL_Types.list(); | 5649 | LSL_Types.list l = new LSL_Types.list(); |
5650 | ScenePresence av = World.GetScenePresence(id); | 5650 | ScenePresence av = World.GetScenePresence(id); |
5651 | if (av == null) | 5651 | if (av == null) |
@@ -6758,7 +6758,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6758 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) | 6758 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) |
6759 | m_host.AddScriptLPS(1); | 6759 | m_host.AddScriptLPS(1); |
6760 | for (int i = 0; i < commandList.Data.Length; i++) | 6760 | for (int i = 0; i < commandList.Data.Length; i++) |
6761 | { | 6761 | { |
6762 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) | 6762 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) |
6763 | { | 6763 | { |
6764 | case ParcelMediaCommandEnum.Play: | 6764 | case ParcelMediaCommandEnum.Play: |
@@ -6768,7 +6768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6768 | if (!agent.IsChildAgent) | 6768 | if (!agent.IsChildAgent) |
6769 | { | 6769 | { |
6770 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); | 6770 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); |
6771 | } | 6771 | } |
6772 | } | 6772 | } |
6773 | break; | 6773 | break; |
6774 | case ParcelMediaCommandEnum.Stop: | 6774 | case ParcelMediaCommandEnum.Stop: |
@@ -6799,7 +6799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6799 | { | 6799 | { |
6800 | //Set the new media URL only if the user is the owner of the land | 6800 | //Set the new media URL only if the user is the owner of the land |
6801 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); | 6801 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); |
6802 | 6802 | ||
6803 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); | 6803 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); |
6804 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 6804 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
6805 | //Send an update of the mediaURL to all the clients that are in the parcel | 6805 | //Send an update of the mediaURL to all the clients that are in the parcel |
@@ -6810,8 +6810,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6810 | //Send parcel media update to the client | 6810 | //Send parcel media update to the client |
6811 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); | 6811 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); |
6812 | } | 6812 | } |
6813 | } | 6813 | } |
6814 | 6814 | ||
6815 | } | 6815 | } |
6816 | i++; | 6816 | i++; |
6817 | } | 6817 | } |
@@ -6821,7 +6821,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6821 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); | 6821 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); |
6822 | break; | 6822 | break; |
6823 | }//end switch | 6823 | }//end switch |
6824 | 6824 | ||
6825 | } | 6825 | } |
6826 | 6826 | ||
6827 | 6827 | ||
@@ -6864,7 +6864,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6864 | } | 6864 | } |
6865 | } | 6865 | } |
6866 | return list; | 6866 | return list; |
6867 | 6867 | ||
6868 | } | 6868 | } |
6869 | 6869 | ||
6870 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) | 6870 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) |
@@ -6908,7 +6908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6908 | { | 6908 | { |
6909 | m_host.AddScriptLPS(1); | 6909 | m_host.AddScriptLPS(1); |
6910 | LLUUID invItemID=InventorySelf(); | 6910 | LLUUID invItemID=InventorySelf(); |
6911 | if (invItemID == LLUUID.Zero) | 6911 | if (invItemID == LLUUID.Zero) |
6912 | return new LSL_Types.Vector3(); | 6912 | return new LSL_Types.Vector3(); |
6913 | if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) | 6913 | if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) |
6914 | return new LSL_Types.Vector3(); | 6914 | return new LSL_Types.Vector3(); |
@@ -7036,8 +7036,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7036 | public void llSetCameraParams(LSL_Types.list rules) | 7036 | public void llSetCameraParams(LSL_Types.list rules) |
7037 | { | 7037 | { |
7038 | m_host.AddScriptLPS(1); | 7038 | m_host.AddScriptLPS(1); |
7039 | 7039 | ||
7040 | // our key in the object we are in | 7040 | // our key in the object we are in |
7041 | LLUUID invItemID=InventorySelf(); | 7041 | LLUUID invItemID=InventorySelf(); |
7042 | if (invItemID == LLUUID.Zero) return; | 7042 | if (invItemID == LLUUID.Zero) return; |
7043 | 7043 | ||
@@ -7051,10 +7051,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7051 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 7051 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; |
7052 | 7052 | ||
7053 | ScenePresence presence = World.GetScenePresence(agentID); | 7053 | ScenePresence presence = World.GetScenePresence(agentID); |
7054 | 7054 | ||
7055 | // we are not interested in child-agents | 7055 | // we are not interested in child-agents |
7056 | if (presence.IsChildAgent) return; | 7056 | if (presence.IsChildAgent) return; |
7057 | 7057 | ||
7058 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); | 7058 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); |
7059 | object[] data = rules.Data; | 7059 | object[] data = rules.Data; |
7060 | for (int i = 0; i < data.Length; ++i) { | 7060 | for (int i = 0; i < data.Length; ++i) { |
@@ -7067,8 +7067,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7067 | case ScriptBaseClass.CAMERA_FOCUS_OFFSET: | 7067 | case ScriptBaseClass.CAMERA_FOCUS_OFFSET: |
7068 | case ScriptBaseClass.CAMERA_POSITION: | 7068 | case ScriptBaseClass.CAMERA_POSITION: |
7069 | LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; | 7069 | LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; |
7070 | parameters.Add(type + 1, (float)v.x); | 7070 | parameters.Add(type + 1, (float)v.x); |
7071 | parameters.Add(type + 2, (float)v.y); | 7071 | parameters.Add(type + 2, (float)v.y); |
7072 | parameters.Add(type + 3, (float)v.z); | 7072 | parameters.Add(type + 3, (float)v.z); |
7073 | break; | 7073 | break; |
7074 | default: | 7074 | default: |
@@ -7088,7 +7088,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7088 | { | 7088 | { |
7089 | m_host.AddScriptLPS(1); | 7089 | m_host.AddScriptLPS(1); |
7090 | 7090 | ||
7091 | // our key in the object we are in | 7091 | // our key in the object we are in |
7092 | LLUUID invItemID=InventorySelf(); | 7092 | LLUUID invItemID=InventorySelf(); |
7093 | if (invItemID == LLUUID.Zero) return; | 7093 | if (invItemID == LLUUID.Zero) return; |
7094 | 7094 | ||
@@ -7102,10 +7102,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7102 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 7102 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; |
7103 | 7103 | ||
7104 | ScenePresence presence = World.GetScenePresence(agentID); | 7104 | ScenePresence presence = World.GetScenePresence(agentID); |
7105 | 7105 | ||
7106 | // we are not interested in child-agents | 7106 | // we are not interested in child-agents |
7107 | if (presence.IsChildAgent) return; | 7107 | if (presence.IsChildAgent) return; |
7108 | 7108 | ||
7109 | presence.ControllingClient.SendClearFollowCamProperties(objectID); | 7109 | presence.ControllingClient.SendClearFollowCamProperties(objectID); |
7110 | } | 7110 | } |
7111 | 7111 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs index 6c88ae86..52d277e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs | |||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
89 | { | 89 | { |
90 | if (!DataserverRequests.ContainsKey(identifier)) | 90 | if (!DataserverRequests.ContainsKey(identifier)) |
91 | return; | 91 | return; |
92 | 92 | ||
93 | ds=DataserverRequests[identifier]; | 93 | ds=DataserverRequests[identifier]; |
94 | DataserverRequests.Remove(identifier); | 94 | DataserverRequests.Remove(identifier); |
95 | } | 95 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs index 89bf51c..3f3cf39 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
70 | new LSL_Types.LSLInteger(rInfo.GetIntValue()), | 70 | new LSL_Types.LSLInteger(rInfo.GetIntValue()), |
71 | new LSL_Types.LSLString(rInfo.GetStrVal()) | 71 | new LSL_Types.LSLString(rInfo.GetStrVal()) |
72 | }; | 72 | }; |
73 | 73 | ||
74 | foreach (AsyncCommandManager m in m_CmdManager.Managers) | 74 | foreach (AsyncCommandManager m in m_CmdManager.Managers) |
75 | { | 75 | { |
76 | if (m.m_ScriptEngine.PostScriptEvent( | 76 | if (m.m_ScriptEngine.PostScriptEvent( |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index 5b32cde..c28aa9a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | |||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
81 | return; | 81 | return; |
82 | 82 | ||
83 | MethodInfo mi = inits[api]; | 83 | MethodInfo mi = inits[api]; |
84 | 84 | ||
85 | Object[] args = new Object[1]; | 85 | Object[] args = new Object[1]; |
86 | args[0] = data; | 86 | args[0] = data; |
87 | 87 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs index 681b2f2..d6a339b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
54 | { | 54 | { |
55 | _arity = arity; | 55 | _arity = arity; |
56 | } | 56 | } |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Append the answer to the list and update the indexes, if any. | 59 | /// Append the answer to the list and update the indexes, if any. |
60 | /// Elements of answer must be ground, since arguments with unbound variables make this | 60 | /// Elements of answer must be ground, since arguments with unbound variables make this |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs index a2fe7ec..9f5ae3d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
54 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. | 54 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. |
55 | /// </summary> | 55 | /// </summary> |
56 | /// <param name="ErrorTerm">the error term of the error</param> | 56 | /// <param name="ErrorTerm">the error term of the error</param> |
57 | /// <param name="Messsage">the message term of the error. If this is a string, it is converted to an | 57 | /// <param name="Messsage">the message term of the error. If this is a string, it is converted to an |
58 | /// Atom so it can be used by Prolog code. | 58 | /// Atom so it can be used by Prolog code. |
59 | /// Message, converted to a string, is use as the printable exception message. | 59 | /// Message, converted to a string, is use as the printable exception message. |
60 | /// </param> | 60 | /// </param> |
@@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
66 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); | 66 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); |
67 | } | 67 | } |
68 | 68 | ||
69 | public class TypeErrorInfo | 69 | public class TypeErrorInfo |
70 | { | 70 | { |
71 | public readonly Atom _Type; | 71 | public readonly Atom _Type; |
72 | public readonly object _Culprit; | 72 | public readonly object _Culprit; |
@@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
116 | /// <returns></returns> | 116 | /// <returns></returns> |
117 | public object getProcedureName() | 117 | public object getProcedureName() |
118 | { | 118 | { |
119 | if (!(_Type._name == "procedure" && | 119 | if (!(_Type._name == "procedure" && |
120 | _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) | 120 | _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) |
121 | return null; | 121 | return null; |
122 | return ((Functor2)_Culprit)._arg1; | 122 | return ((Functor2)_Culprit)._arg1; |
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. | 126 | /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. |
127 | /// Otherwise return -1. | 127 | /// Otherwise return -1. |
128 | /// </summary> | 128 | /// </summary> |
129 | /// <returns></returns> | 129 | /// <returns></returns> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 97c9087..2e90d74 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
147 | /// <summary> | 147 | /// <summary> |
148 | /// Convert term to an int. | 148 | /// Convert term to an int. |
149 | /// If term is a single-element List, use its first element | 149 | /// If term is a single-element List, use its first element |
150 | /// (to handle the char types like "a"). | 150 | /// (to handle the char types like "a"). |
151 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only | 151 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only |
152 | /// called from arithmetic functions). | 152 | /// called from arithmetic functions). |
153 | /// </summary> | 153 | /// </summary> |
@@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
172 | { | 172 | { |
173 | throw new PrologException | 173 | throw new PrologException |
174 | (new Functor2 | 174 | (new Functor2 |
175 | ("type_error", Atom.a("evaluable"), | 175 | ("type_error", Atom.a("evaluable"), |
176 | new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), | 176 | new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), |
177 | "Term must be an integer"); | 177 | "Term must be an integer"); |
178 | } | 178 | } |
179 | } | 179 | } |
@@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
181 | /// <summary> | 181 | /// <summary> |
182 | /// Convert term to a double. This may convert an int to a double, etc. | 182 | /// Convert term to a double. This may convert an int to a double, etc. |
183 | /// If term is a single-element List, use its first element | 183 | /// If term is a single-element List, use its first element |
184 | /// (to handle the char types like "a"). | 184 | /// (to handle the char types like "a"). |
185 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only | 185 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only |
186 | /// called from arithmetic functions). | 186 | /// called from arithmetic functions). |
187 | /// </summary> | 187 | /// </summary> |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
195 | // Assume it is a char type like "a". | 195 | // Assume it is a char type like "a". |
196 | term = YP.getValue(((Functor2)term)._arg1); | 196 | term = YP.getValue(((Functor2)term)._arg1); |
197 | if (term is Variable) | 197 | if (term is Variable) |
198 | throw new PrologException(Atom.a("instantiation_error"), | 198 | throw new PrologException(Atom.a("instantiation_error"), |
199 | "Expected a number but the argument is an unbound variable"); | 199 | "Expected a number but the argument is an unbound variable"); |
200 | 200 | ||
201 | try | 201 | try |
@@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
776 | if (term1TypeCode == -2) | 776 | if (term1TypeCode == -2) |
777 | { | 777 | { |
778 | // Variable. | 778 | // Variable. |
779 | // We always check for equality first because we want to be sure | 779 | // We always check for equality first because we want to be sure |
780 | // that less than returns false if the terms are equal, in | 780 | // that less than returns false if the terms are equal, in |
781 | // case that the less than check really behaves like less than or equal. | 781 | // case that the less than check really behaves like less than or equal. |
782 | if ((Variable)Term1 != (Variable)Term2) | 782 | if ((Variable)Term1 != (Variable)Term2) |
783 | // The hash code should be unique to a Variable object. | 783 | // The hash code should be unique to a Variable object. |
@@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
820 | } | 820 | } |
821 | 821 | ||
822 | /// <summary> | 822 | /// <summary> |
823 | /// Type code is -2 if term is a Variable, 0 if it is an Atom, | 823 | /// Type code is -2 if term is a Variable, 0 if it is an Atom, |
824 | /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, | 824 | /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, |
825 | /// 4 if it is Functor. | 825 | /// 4 if it is Functor. |
826 | /// Otherwise, type code is -1. | 826 | /// Otherwise, type code is -1. |
827 | /// This does not call YP.getValue(term). | 827 | /// This does not call YP.getValue(term). |
@@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1167 | "Arg 2 List has an element which is an unbound variable"); | 1167 | "Arg 2 List has an element which is an unbound variable"); |
1168 | if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) | 1168 | if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) |
1169 | throw new PrologException | 1169 | throw new PrologException |
1170 | (new Functor2("type_error", Atom.a("character"), listAtom), | 1170 | (new Functor2("type_error", Atom.a("character"), listAtom), |
1171 | "Arg 2 List has an element which is not a one character atom"); | 1171 | "Arg 2 List has an element which is not a one character atom"); |
1172 | charArray[i] = ((Atom)listAtom)._name[0]; | 1172 | charArray[i] = ((Atom)listAtom)._name[0]; |
1173 | } | 1173 | } |
@@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1209 | int codeInt; | 1209 | int codeInt; |
1210 | if (!getInt(codeArray[i], out codeInt) || codeInt < 0) | 1210 | if (!getInt(codeArray[i], out codeInt) || codeInt < 0) |
1211 | throw new PrologException | 1211 | throw new PrologException |
1212 | (new Functor1("representation_error", Atom.a("character_code")), | 1212 | (new Functor1("representation_error", Atom.a("character_code")), |
1213 | "Element of Arg 2 List is not a character code"); | 1213 | "Element of Arg 2 List is not a character code"); |
1214 | charArray[i] = (char)codeInt; | 1214 | charArray[i] = (char)codeInt; |
1215 | } | 1215 | } |
@@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1323 | { | 1323 | { |
1324 | if (!YP.number(Number)) | 1324 | if (!YP.number(Number)) |
1325 | throw new PrologException | 1325 | throw new PrologException |
1326 | (new Functor2("type_error", Atom.a("number"), Number), | 1326 | (new Functor2("type_error", Atom.a("number"), Number), |
1327 | "Arg 1 Number is not var or number"); | 1327 | "Arg 1 Number is not var or number"); |
1328 | // We just checked, so convertDouble shouldn't throw an exception. | 1328 | // We just checked, so convertDouble shouldn't throw an exception. |
1329 | numberString = YP.doubleToString(YP.convertDouble(Number)); | 1329 | numberString = YP.doubleToString(YP.convertDouble(Number)); |
@@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1413 | { | 1413 | { |
1414 | if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) | 1414 | if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) |
1415 | throw new PrologException | 1415 | throw new PrologException |
1416 | (new Functor2("type_error", Atom.a("character"), Char), | 1416 | (new Functor2("type_error", Atom.a("character"), Char), |
1417 | "Arg 1 Char is not var or one-character atom"); | 1417 | "Arg 1 Char is not var or one-character atom"); |
1418 | 1418 | ||
1419 | if (Code is Variable) | 1419 | if (Code is Variable) |
@@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1795 | IndexedAnswers indexedAnswers; | 1795 | IndexedAnswers indexedAnswers; |
1796 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) | 1796 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) |
1797 | { | 1797 | { |
1798 | // Create an IndexedAnswers as the only clause of the predicate. | 1798 | // Create an IndexedAnswers as the only clause of the predicate. |
1799 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); | 1799 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); |
1800 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); | 1800 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); |
1801 | } | 1801 | } |
@@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1826 | IndexedAnswers indexedAnswers; | 1826 | IndexedAnswers indexedAnswers; |
1827 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) | 1827 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) |
1828 | { | 1828 | { |
1829 | // Create an IndexedAnswers as the only clause of the predicate. | 1829 | // Create an IndexedAnswers as the only clause of the predicate. |
1830 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); | 1830 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); |
1831 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); | 1831 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); |
1832 | } | 1832 | } |
@@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1855 | { | 1855 | { |
1856 | List<IClause> clauses; | 1856 | List<IClause> clauses; |
1857 | if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) | 1857 | if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) |
1858 | return unknownPredicate(name, arguments.Length, | 1858 | return unknownPredicate(name, arguments.Length, |
1859 | "Undefined dynamic predicate: " + name + "/" + arguments.Length); | 1859 | "Undefined dynamic predicate: " + name + "/" + arguments.Length); |
1860 | 1860 | ||
1861 | if (clauses.Count == 1) | 1861 | if (clauses.Count == 1) |
@@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1889 | } | 1889 | } |
1890 | 1890 | ||
1891 | /// <summary> | 1891 | /// <summary> |
1892 | /// If _prologFlags["unknown"] is fail then return fail(), else if | 1892 | /// If _prologFlags["unknown"] is fail then return fail(), else if |
1893 | /// _prologFlags["unknown"] is warning then write the message to YP.write and | 1893 | /// _prologFlags["unknown"] is warning then write the message to YP.write and |
1894 | /// return fail(), else throw a PrologException for existence_error. . | 1894 | /// return fail(), else throw a PrologException for existence_error. . |
1895 | /// </summary> | 1895 | /// </summary> |
@@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1917 | } | 1917 | } |
1918 | 1918 | ||
1919 | /// <summary> | 1919 | /// <summary> |
1920 | /// This is deprecated and just calls matchDynamic. This matches all clauses, | 1920 | /// This is deprecated and just calls matchDynamic. This matches all clauses, |
1921 | /// not just the ones defined with assertFact. | 1921 | /// not just the ones defined with assertFact. |
1922 | /// </summary> | 1922 | /// </summary> |
1923 | /// <param name="name"></param> | 1923 | /// <param name="name"></param> |
@@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2066 | /// dynamic predicate. | 2066 | /// dynamic predicate. |
2067 | /// </summary> | 2067 | /// </summary> |
2068 | /// <param name="NameSlashArity"></param> | 2068 | /// <param name="NameSlashArity"></param> |
2069 | /// <param name="declaringClass">if not null, used to resolve references to the default | 2069 | /// <param name="declaringClass">if not null, used to resolve references to the default |
2070 | /// module Atom.a("")</param> | 2070 | /// module Atom.a("")</param> |
2071 | /// <returns></returns> | 2071 | /// <returns></returns> |
2072 | public static IEnumerable<bool> current_predicate(object NameSlashArity, Type declaringClass) | 2072 | public static IEnumerable<bool> current_predicate(object NameSlashArity, Type declaringClass) |
@@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2078 | Functor2 NameArityFunctor = NameSlashArity as Functor2; | 2078 | Functor2 NameArityFunctor = NameSlashArity as Functor2; |
2079 | if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) | 2079 | if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) |
2080 | throw new PrologException | 2080 | throw new PrologException |
2081 | (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), | 2081 | (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), |
2082 | "Must be a name/arity predicate indicator"); | 2082 | "Must be a name/arity predicate indicator"); |
2083 | object name = YP.getValue(NameArityFunctor._arg1); | 2083 | object name = YP.getValue(NameArityFunctor._arg1); |
2084 | object arity = YP.getValue(NameArityFunctor._arg2); | 2084 | object arity = YP.getValue(NameArityFunctor._arg2); |
@@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2163 | } | 2163 | } |
2164 | 2164 | ||
2165 | /// <summary> | 2165 | /// <summary> |
2166 | /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from | 2166 | /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from |
2167 | /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. | 2167 | /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. |
2168 | /// Otherwise, compile the goal as a single clause predicate and invoke it. | 2168 | /// Otherwise, compile the goal as a single clause predicate and invoke it. |
2169 | /// </summary> | 2169 | /// </summary> |
2170 | /// <param name="Goal"></param> | 2170 | /// <param name="Goal"></param> |
2171 | /// <param name="declaringClass">if not null, used to resolve references to the default | 2171 | /// <param name="declaringClass">if not null, used to resolve references to the default |
2172 | /// module Atom.a("")</param> | 2172 | /// module Atom.a("")</param> |
2173 | /// <returns></returns> | 2173 | /// <returns></returns> |
2174 | public static IEnumerable<bool> getIterator(object Goal, Type declaringClass) | 2174 | public static IEnumerable<bool> getIterator(object Goal, Type declaringClass) |
@@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2259 | (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); | 2259 | (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); |
2260 | if (!_prologFlags.ContainsKey(((Atom)Key)._name)) | 2260 | if (!_prologFlags.ContainsKey(((Atom)Key)._name)) |
2261 | throw new PrologException | 2261 | throw new PrologException |
2262 | (new Functor2("domain_error", Atom.a("prolog_flag"), Key), | 2262 | (new Functor2("domain_error", Atom.a("prolog_flag"), Key), |
2263 | "Arg 1 Key is not a recognized flag"); | 2263 | "Arg 1 Key is not a recognized flag"); |
2264 | 2264 | ||
2265 | foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) | 2265 | foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) |
@@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2343 | string results = ""; | 2343 | string results = ""; |
2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) | 2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) |
2345 | { | 2345 | { |
2346 | //Console.WriteLine( m ); | 2346 | //Console.WriteLine( m ); |
2347 | results += presep+ m + postsep; | 2347 | results += presep+ m + postsep; |
2348 | } | 2348 | } |
2349 | return results; | 2349 | return results; |
@@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2662 | #pragma warning restore 0168 | 2662 | #pragma warning restore 0168 |
2663 | } | 2663 | } |
2664 | } | 2664 | } |
2665 | 2665 | ||
2666 | /// <summary> | 2666 | /// <summary> |
2667 | /// CodeListReader extends TextReader and overrides Read to read the next code from | 2667 | /// CodeListReader extends TextReader and overrides Read to read the next code from |
2668 | /// the CodeList which is a Prolog list of integer character codes. | 2668 | /// the CodeList which is a Prolog list of integer character codes. |
@@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2683 | /// <returns></returns> | 2683 | /// <returns></returns> |
2684 | public override int Read() | 2684 | public override int Read() |
2685 | { | 2685 | { |
2686 | Functor2 CodeListPair = _CodeList as Functor2; | 2686 | Functor2 CodeListPair = _CodeList as Functor2; |
2687 | int code; | 2687 | int code; |
2688 | if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && | 2688 | if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && |
2689 | getInt(CodeListPair._arg1, out code))) | 2689 | getInt(CodeListPair._arg1, out code))) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs index f9b160d..0f79019 100644 --- a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs | |||
@@ -54,11 +54,11 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
54 | { | 54 | { |
55 | string path = Path.Combine(Directory.GetCurrentDirectory(), | 55 | string path = Path.Combine(Directory.GetCurrentDirectory(), |
56 | Path.Combine(s, assemblyName))+".dll"; | 56 | Path.Combine(s, assemblyName))+".dll"; |
57 | 57 | ||
58 | if (File.Exists(path)) | 58 | if (File.Exists(path)) |
59 | return Assembly.LoadFrom(path); | 59 | return Assembly.LoadFrom(path); |
60 | } | 60 | } |
61 | 61 | ||
62 | return null; | 62 | return null; |
63 | } | 63 | } |
64 | } | 64 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 4962023..db90f3e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -412,8 +412,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
412 | 412 | ||
413 | private static string CreateYPCompilerScript(string compileScript) | 413 | private static string CreateYPCompilerScript(string compileScript) |
414 | { | 414 | { |
415 | |||
416 | |||
417 | compileScript = String.Empty + | 415 | compileScript = String.Empty + |
418 | "using OpenSim.Region.ScriptEngine.Shared.YieldProlog; " + | 416 | "using OpenSim.Region.ScriptEngine.Shared.YieldProlog; " + |
419 | "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + | 417 | "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs index 57e8776..45f92e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs | |||
@@ -87,9 +87,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
87 | string quote = String.Empty; | 87 | string quote = String.Empty; |
88 | bool last_was_escape = false; | 88 | bool last_was_escape = false; |
89 | int quote_replaced_count = 0; | 89 | int quote_replaced_count = 0; |
90 | 90 | ||
91 | string removefwnoncomments = nonCommentFwsl.Replace(Script, "\"\";"); | 91 | string removefwnoncomments = nonCommentFwsl.Replace(Script, "\"\";"); |
92 | 92 | ||
93 | string removecomments = conelinecomments.Replace(removefwnoncomments, ""); | 93 | string removecomments = conelinecomments.Replace(removefwnoncomments, ""); |
94 | removecomments = cstylecomments.Replace(removecomments, ""); | 94 | removecomments = cstylecomments.Replace(removecomments, ""); |
95 | string[] localscript = removecomments.Split('"'); | 95 | string[] localscript = removecomments.Split('"'); |
@@ -120,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
120 | // checks for alpha.alpha way of referring to objects in C# | 120 | // checks for alpha.alpha way of referring to objects in C# |
121 | // ignores alpha.x alpha.y, alpha.z for refering to vector components | 121 | // ignores alpha.x alpha.y, alpha.z for refering to vector components |
122 | Match SecurityM; | 122 | Match SecurityM; |
123 | 123 | ||
124 | // BROKEN: this check is very wrong. It block's any url in strings. | 124 | // BROKEN: this check is very wrong. It block's any url in strings. |
125 | SecurityM = Regex.Match(checkscript, @"(?:[a-zA-Z])\.(?:[a-rt-wA-Z]|[a-zA-Z][a-zA-Z])", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 125 | SecurityM = Regex.Match(checkscript, @"(?:[a-zA-Z])\.(?:[a-rt-wA-Z]|[a-zA-Z][a-zA-Z])", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
126 | 126 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs index 831b918..22b3742 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
61 | myCode = myCode.Substring(0, cs_pointer); | 61 | myCode = myCode.Substring(0, cs_pointer); |
62 | } | 62 | } |
63 | myCode.Replace("//yp", "%YPCode"); | 63 | myCode.Replace("//yp", "%YPCode"); |
64 | 64 | ||
65 | StringWriter myCS_SW = new StringWriter(); | 65 | StringWriter myCS_SW = new StringWriter(); |
66 | StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); | 66 | StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); |
67 | 67 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 8326e16..5497e2c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -1335,22 +1335,22 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1335 | bool ret = i1.value != i2.value; | 1335 | bool ret = i1.value != i2.value; |
1336 | return ret; | 1336 | return ret; |
1337 | } | 1337 | } |
1338 | 1338 | ||
1339 | static public LSLInteger operator +(LSLInteger i1, int i2) | 1339 | static public LSLInteger operator +(LSLInteger i1, int i2) |
1340 | { | 1340 | { |
1341 | return new LSLInteger(i1.value + i2); | 1341 | return new LSLInteger(i1.value + i2); |
1342 | } | 1342 | } |
1343 | 1343 | ||
1344 | static public LSLInteger operator -(LSLInteger i1, int i2) | 1344 | static public LSLInteger operator -(LSLInteger i1, int i2) |
1345 | { | 1345 | { |
1346 | return new LSLInteger(i1.value - i2); | 1346 | return new LSLInteger(i1.value - i2); |
1347 | } | 1347 | } |
1348 | 1348 | ||
1349 | static public LSLInteger operator *(LSLInteger i1, int i2) | 1349 | static public LSLInteger operator *(LSLInteger i1, int i2) |
1350 | { | 1350 | { |
1351 | return new LSLInteger(i1.value * i2); | 1351 | return new LSLInteger(i1.value * i2); |
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | static public LSLInteger operator /(LSLInteger i1, int i2) | 1354 | static public LSLInteger operator /(LSLInteger i1, int i2) |
1355 | { | 1355 | { |
1356 | return new LSLInteger(i1.value / i2); | 1356 | return new LSLInteger(i1.value / i2); |
@@ -1360,22 +1360,22 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1360 | { | 1360 | { |
1361 | return new LSLFloat((double)i1.value + f); | 1361 | return new LSLFloat((double)i1.value + f); |
1362 | } | 1362 | } |
1363 | 1363 | ||
1364 | static public LSLFloat operator -(LSLInteger i1, double f) | 1364 | static public LSLFloat operator -(LSLInteger i1, double f) |
1365 | { | 1365 | { |
1366 | return new LSLFloat((double)i1.value - f); | 1366 | return new LSLFloat((double)i1.value - f); |
1367 | } | 1367 | } |
1368 | 1368 | ||
1369 | static public LSLFloat operator *(LSLInteger i1, double f) | 1369 | static public LSLFloat operator *(LSLInteger i1, double f) |
1370 | { | 1370 | { |
1371 | return new LSLFloat((double)i1.value * f); | 1371 | return new LSLFloat((double)i1.value * f); |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | static public LSLFloat operator /(LSLInteger i1, double f) | 1374 | static public LSLFloat operator /(LSLInteger i1, double f) |
1375 | { | 1375 | { |
1376 | return new LSLFloat((double)i1.value / f); | 1376 | return new LSLFloat((double)i1.value / f); |
1377 | } | 1377 | } |
1378 | 1378 | ||
1379 | static public LSLInteger operator -(LSLInteger i) | 1379 | static public LSLInteger operator -(LSLInteger i) |
1380 | { | 1380 | { |
1381 | return new LSLInteger(-i.value); | 1381 | return new LSLInteger(-i.value); |
@@ -1536,17 +1536,17 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1536 | f.value--; | 1536 | f.value--; |
1537 | return f; | 1537 | return f; |
1538 | } | 1538 | } |
1539 | 1539 | ||
1540 | static public LSLFloat operator +(LSLFloat f, int i) | 1540 | static public LSLFloat operator +(LSLFloat f, int i) |
1541 | { | 1541 | { |
1542 | return new LSLFloat(f.value + (double)i); | 1542 | return new LSLFloat(f.value + (double)i); |
1543 | } | 1543 | } |
1544 | 1544 | ||
1545 | static public LSLFloat operator -(LSLFloat f, int i) | 1545 | static public LSLFloat operator -(LSLFloat f, int i) |
1546 | { | 1546 | { |
1547 | return new LSLFloat(f.value - (double)i); | 1547 | return new LSLFloat(f.value - (double)i); |
1548 | } | 1548 | } |
1549 | 1549 | ||
1550 | static public LSLFloat operator *(LSLFloat f, int i) | 1550 | static public LSLFloat operator *(LSLFloat f, int i) |
1551 | { | 1551 | { |
1552 | return new LSLFloat(f.value * (double)i); | 1552 | return new LSLFloat(f.value * (double)i); |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index cdba1ac..c528c02 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -363,7 +363,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
363 | new WorkItemCallback( | 363 | new WorkItemCallback( |
364 | this.DoOnRezScriptQueue), new Object[0]); | 364 | this.DoOnRezScriptQueue), new Object[0]); |
365 | } | 365 | } |
366 | else | 366 | else |
367 | { | 367 | { |
368 | m_CurrentCompile = null; | 368 | m_CurrentCompile = null; |
369 | } | 369 | } |
@@ -394,7 +394,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
394 | new WorkItemCallback( | 394 | new WorkItemCallback( |
395 | this.DoOnRezScriptQueue), new Object[0]); | 395 | this.DoOnRezScriptQueue), new Object[0]); |
396 | } | 396 | } |
397 | else | 397 | else |
398 | { | 398 | { |
399 | m_CurrentCompile = null; | 399 | m_CurrentCompile = null; |
400 | } | 400 | } |
@@ -1113,7 +1113,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1113 | { | 1113 | { |
1114 | string savedState = Path.Combine(Path.GetDirectoryName(m_Assembly), | 1114 | string savedState = Path.Combine(Path.GetDirectoryName(m_Assembly), |
1115 | m_ItemID.ToString() + ".state"); | 1115 | m_ItemID.ToString() + ".state"); |
1116 | 1116 | ||
1117 | try | 1117 | try |
1118 | { | 1118 | { |
1119 | File.Delete(savedState); | 1119 | File.Delete(savedState); |