From 8f0b03597b0bc8ea6873af9a55495407fae1ec56 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 19 Sep 2007 00:30:55 +0000 Subject: * Modernized ScriptManager to new interface-based module calls. * 'remove redundant this qualifier' ftw --- .../Environment/Modules/AssetDownloadModule.cs | 21 +++----- .../Environment/Modules/AvatarProfilesModule.cs | 32 +++++-------- OpenSim/Region/Environment/Modules/ChatModule.cs | 50 ++++++++++--------- .../Environment/Modules/DynamicTextureModule.cs | 56 +++++++++++----------- OpenSim/Region/Environment/Modules/EmailModule.cs | 8 +--- .../Region/Environment/Modules/FriendsModule.cs | 17 ++----- OpenSim/Region/Environment/Modules/GroupsModule.cs | 17 ++----- .../Environment/Modules/InstantMessageModule.cs | 19 +++----- .../Region/Environment/Modules/InventoryModule.cs | 19 +++----- .../Environment/Modules/ScriptsHttpRequests.cs | 8 +--- .../Region/Environment/Modules/TeleportModule.cs | 8 +--- .../Environment/Modules/TextureDownloadModule.cs | 26 ++++------ OpenSim/Region/Environment/Modules/XferModule.cs | 41 +++++++--------- 13 files changed, 126 insertions(+), 196 deletions(-) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs index 7a53f6f..511b5f6 100644 --- a/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs @@ -1,12 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.Interfaces; - - +using OpenSim.Framework.Interfaces; +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment.Modules { public class AssetDownloadModule : IRegionModule @@ -14,8 +9,7 @@ namespace OpenSim.Region.Environment.Modules private Scene m_scene; public AssetDownloadModule() - { - + { } public void Initialise(Scene scene) @@ -25,8 +19,7 @@ namespace OpenSim.Region.Environment.Modules } public void PostInitialise() - { - + { } public void CloseDown() @@ -47,4 +40,4 @@ namespace OpenSim.Region.Environment.Modules { } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs index c349888..ea5f787 100644 --- a/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs +++ b/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs @@ -1,21 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.Interfaces; - +using libsecondlife; +using OpenSim.Framework.Interfaces; +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment.Modules { - public class AvatarProfilesModule :IRegionModule - { - + public class AvatarProfilesModule : IRegionModule + { private Scene m_scene; public AvatarProfilesModule() - { - + { } public void Initialise(Scene scene) @@ -25,13 +20,11 @@ namespace OpenSim.Region.Environment.Modules } public void PostInitialise() - { - + { } public void CloseDown() - { - + { } public string GetName() @@ -65,7 +58,8 @@ namespace OpenSim.Region.Environment.Modules string bornOn = "Before now"; string flAbout = "First life? What is one of those? OpenSim is my life!"; LLUUID partner = new LLUUID("11111111-1111-0000-0000-000100bba000"); - remoteClient.SendAvatarProperties(avatarID, about, bornOn, "", flAbout, 0, LLUUID.Zero, LLUUID.Zero, "", partner); + remoteClient.SendAvatarProperties(avatarID, about, bornOn, "", flAbout, 0, LLUUID.Zero, LLUUID.Zero, "", + partner); } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index 8d3a553..468a5b7 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs @@ -1,17 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Net; -using System.Net.Sockets; -using System.Threading; -using System.IO; -using libsecondlife; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.Interfaces; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Console; - +using System; +using System.IO; +using System.Net.Sockets; +using System.Threading; +using libsecondlife; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Utilities; +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment.Modules { public class ChatModule : IRegionModule, ISimChat @@ -20,18 +16,18 @@ namespace OpenSim.Region.Environment.Modules private string m_server = "irc2.choopa.net"; - // private int m_port = 6668; + // private int m_port = 6668; //private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot"; private string m_nick = "OSimBot"; private string m_channel = "#opensim"; - // private NetworkStream m_stream; - private TcpClient m_irc; + // private NetworkStream m_stream; + private TcpClient m_irc; private StreamWriter m_ircWriter; - private StreamReader m_ircReader; + private StreamReader m_ircReader; - // private Thread pingSender; - // private Thread listener; + // private Thread pingSender; + // private Thread listener; private bool connected = false; @@ -127,16 +123,18 @@ namespace OpenSim.Region.Environment.Modules { string mess = inputLine.Substring(inputLine.IndexOf(m_channel)); m_scene.ForEachScenePresence(delegate(ScenePresence presence) - { - presence.ControllingClient.SendChatMessage(Helpers.StringToField(mess), 255, pos, "IRC:", - LLUUID.Zero); - }); + { + presence.ControllingClient.SendChatMessage( + Helpers.StringToField(mess), 255, pos, "IRC:", + LLUUID.Zero); + }); } } } } - public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName, LLUUID fromAgentID) + public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName, + LLUUID fromAgentID) { ScenePresence avatar = null; avatar = m_scene.RequestAvatar(fromAgentID); @@ -213,4 +211,4 @@ namespace OpenSim.Region.Environment.Modules } } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs index bbd9810..3f737e1 100644 --- a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs @@ -1,23 +1,20 @@ -using System.Text; -using System.Net; -using System.Net.Sockets; -using System.Threading; -using System.IO; -using System.Collections.Generic; -using libsecondlife; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.Interfaces; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Console; -using OpenSim.Framework.Types; - +using System; +using System.Collections.Generic; +using libsecondlife; +using OpenSim.Framework.Types; +using OpenSim.Framework.Utilities; +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment.Modules { - public class DynamicTextureModule :IRegionModule, IDynamicTextureManager + public class DynamicTextureModule : IRegionModule, IDynamicTextureManager { - private Dictionary RegisteredScenes = new Dictionary(); - private Dictionary RenderPlugins= new Dictionary(); + private Dictionary RegisteredScenes = new Dictionary(); + + private Dictionary RenderPlugins = + new Dictionary(); + private Dictionary Updaters = new Dictionary(); public void Initialise(Scene scene) @@ -30,8 +27,7 @@ namespace OpenSim.Region.Environment.Modules } public void PostInitialise() - { - + { } public void CloseDown() @@ -69,10 +65,11 @@ namespace OpenSim.Region.Environment.Modules } } - public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, string extraParams, int updateTimer) + public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, + string extraParams, int updateTimer) { - System.Console.WriteLine("dynamic texture being created: " + url + " of type " + contentType); - if (this.RenderPlugins.ContainsKey(contentType)) + Console.WriteLine("dynamic texture being created: " + url + " of type " + contentType); + if (RenderPlugins.ContainsKey(contentType)) { DynamicTextureUpdater updater = new DynamicTextureUpdater(); updater.SimUUID = simID; @@ -83,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules updater.UpdaterID = LLUUID.Random(); updater.Params = extraParams; - if (!this.Updaters.ContainsKey(updater.UpdaterID)) + if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Add(updater.UpdaterID, updater); } @@ -94,9 +91,10 @@ namespace OpenSim.Region.Environment.Modules return LLUUID.Zero; } - public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, string extraParams, int updateTimer) + public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, + string extraParams, int updateTimer) { - if (this.RenderPlugins.ContainsKey(contentType)) + if (RenderPlugins.ContainsKey(contentType)) { DynamicTextureUpdater updater = new DynamicTextureUpdater(); updater.SimUUID = simID; @@ -107,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules updater.UpdaterID = LLUUID.Random(); updater.Params = extraParams; - if (!this.Updaters.ContainsKey(updater.UpdaterID)) + if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Add(updater.UpdaterID, updater); } @@ -140,7 +138,7 @@ namespace OpenSim.Region.Environment.Modules public void DataReceived(byte[] data, Scene scene) { //TODO delete the last asset(data), if it was a dynamic texture - + AssetBase asset = new AssetBase(); asset.FullID = LLUUID.Random(); asset.Data = data; @@ -148,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules asset.Type = 0; scene.commsManager.AssetCache.AddAsset(asset); - this.LastAssetID = asset.FullID; + LastAssetID = asset.FullID; SceneObjectPart part = scene.GetSceneObjectPart(PrimID); part.Shape.TextureEntry = new LLObject.TextureEntry(asset.FullID).ToBytes(); @@ -156,4 +154,4 @@ namespace OpenSim.Region.Environment.Modules } } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/EmailModule.cs b/OpenSim/Region/Environment/Modules/EmailModule.cs index fff9539..7a61373 100644 --- a/OpenSim/Region/Environment/Modules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/EmailModule.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace OpenSim.Region.Environment.Modules { - class EmailModule + internal class EmailModule { } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs index 411b838..c2a7291 100644 --- a/OpenSim/Region/Environment/Modules/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.Interfaces; - - +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment.Modules { public class FriendsModule : IRegionModule @@ -19,8 +13,7 @@ namespace OpenSim.Region.Environment.Modules } public void PostInitialise() - { - + { } public void CloseDown() @@ -37,4 +30,4 @@ namespace OpenSim.Region.Environment.Modules return false; } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/GroupsModule.cs b/OpenSim/Region/Environment/Modules/GroupsModule.cs index 9ed0e96..dcef2c5 100644 --- a/OpenSim/Region/Environment/Modules/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/GroupsModule.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.Interfaces; - +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment.Modules { public class GroupsModule : IRegionModule @@ -18,8 +13,7 @@ namespace OpenSim.Region.Environment.Modules } public void PostInitialise() - { - + { } public void CloseDown() @@ -36,5 +30,4 @@ namespace OpenSim.Region.Environment.Modules return false; } } -} - +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs index 25c118a..14f2b65 100644 --- a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs +++ b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.Interfaces; - - +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment.Modules { - public class InstantMessageModule :IRegionModule + public class InstantMessageModule : IRegionModule { private Scene m_scene; @@ -19,8 +13,7 @@ namespace OpenSim.Region.Environment.Modules } public void PostInitialise() - { - + { } public void CloseDown() @@ -37,4 +30,4 @@ namespace OpenSim.Region.Environment.Modules return false; } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/InventoryModule.cs b/OpenSim/Region/Environment/Modules/InventoryModule.cs index bfcb7d7..40bd37e 100644 --- a/OpenSim/Region/Environment/Modules/InventoryModule.cs +++ b/OpenSim/Region/Environment/Modules/InventoryModule.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.Interfaces; - - +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment.Modules { - public class InventoryModule :IRegionModule + public class InventoryModule : IRegionModule { private Scene m_scene; @@ -19,8 +13,7 @@ namespace OpenSim.Region.Environment.Modules } public void PostInitialise() - { - + { } public void CloseDown() @@ -37,4 +30,4 @@ namespace OpenSim.Region.Environment.Modules return false; } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs index e47cc9e..1e84a59 100644 --- a/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs +++ b/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace OpenSim.Region.Environment.Modules { - class ScriptsHttpRequests + internal class ScriptsHttpRequests { } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/TeleportModule.cs b/OpenSim/Region/Environment/Modules/TeleportModule.cs index 1c01b27..f331a9c 100644 --- a/OpenSim/Region/Environment/Modules/TeleportModule.cs +++ b/OpenSim/Region/Environment/Modules/TeleportModule.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace OpenSim.Region.Environment.Modules { - class TeleportModule + internal class TeleportModule { } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs index 59c0839..f107d77 100644 --- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs @@ -1,20 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.Interfaces; - +using libsecondlife; +using OpenSim.Framework.Interfaces; +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment.Modules { - public class TextureDownloadModule :IRegionModule + public class TextureDownloadModule : IRegionModule { private Scene m_scene; public TextureDownloadModule() - { - + { } public void Initialise(Scene scene) @@ -24,8 +20,7 @@ namespace OpenSim.Region.Environment.Modules } public void PostInitialise() - { - + { } public void CloseDown() @@ -47,8 +42,7 @@ namespace OpenSim.Region.Environment.Modules } public void TextureAssetCallback(LLUUID texture, byte[] data) - { - + { } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/XferModule.cs b/OpenSim/Region/Environment/Modules/XferModule.cs index 216d10a..7f8c5c1 100644 --- a/OpenSim/Region/Environment/Modules/XferModule.cs +++ b/OpenSim/Region/Environment/Modules/XferModule.cs @@ -1,13 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Text; - -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.Interfaces; - +using System; +using System.Collections.Generic; +using libsecondlife; +using OpenSim.Framework.Interfaces; +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment.Modules { public class XferModule : IRegionModule, IXfer @@ -18,8 +15,7 @@ namespace OpenSim.Region.Environment.Modules private Scene m_scene; public XferModule() - { - + { } public void Initialise(Scene scene) @@ -31,13 +27,11 @@ namespace OpenSim.Region.Environment.Modules } public void PostInitialise() - { - + { } public void CloseDown() - { - + { } public string GetName() @@ -67,7 +61,7 @@ namespace OpenSim.Region.Environment.Modules lock (NewFiles) { if (NewFiles.ContainsKey(fileName)) - { + { if (!Transfers.ContainsKey(xferID)) { byte[] fileData = NewFiles[fileName]; @@ -82,7 +76,7 @@ namespace OpenSim.Region.Environment.Modules public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet) { - if (this.Transfers.ContainsKey(xferID)) + if (Transfers.ContainsKey(xferID)) { Transfers[xferID].AckPacket(packet); } @@ -125,8 +119,7 @@ namespace OpenSim.Region.Environment.Modules } public XferDownLoad() - { - + { } public void StartSend() @@ -142,10 +135,10 @@ namespace OpenSim.Region.Environment.Modules } else { - byte[] transferData = new byte[1000 +4]; + byte[] transferData = new byte[1000 + 4]; Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); Array.Copy(Data, 0, transferData, 4, 1000); - Client.SendXferPacket(XferID, 0 , transferData); + Client.SendXferPacket(XferID, 0, transferData); Packet++; DataPointer = 1000; } @@ -167,7 +160,7 @@ namespace OpenSim.Region.Environment.Modules { byte[] transferData = new byte[Data.Length - DataPointer]; Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); - uint endPacket = Packet |= (uint)0x80000000; + uint endPacket = Packet |= (uint) 0x80000000; Client.SendXferPacket(XferID, endPacket, transferData); Packet++; DataPointer += (Data.Length - DataPointer); @@ -177,4 +170,4 @@ namespace OpenSim.Region.Environment.Modules } } } -} +} \ No newline at end of file -- cgit v1.1