diff options
author | UbitUmarov | 2015-09-30 02:45:11 +0100 |
---|---|---|
committer | UbitUmarov | 2015-09-30 02:45:11 +0100 |
commit | feb78b29104cc1c7f5d327bab45edd4d00a88944 (patch) | |
tree | 86a1e500e2824d5ca741c8af676dee38f8e63cf4 /OpenSim/Region/OptionalModules | |
parent | remove some restrictions on NPCs creation (diff) | |
download | opensim-SC_OLD-feb78b29104cc1c7f5d327bab45edd4d00a88944.zip opensim-SC_OLD-feb78b29104cc1c7f5d327bab45edd4d00a88944.tar.gz opensim-SC_OLD-feb78b29104cc1c7f5d327bab45edd4d00a88944.tar.bz2 opensim-SC_OLD-feb78b29104cc1c7f5d327bab45edd4d00a88944.tar.xz |
add several options for NPC creation so abusive use can be reduced (restrictive by default) UNTESTED
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 9dc4489..97c15a9 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -52,6 +52,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
52 | private Dictionary<UUID, NPCAvatar> m_avatars = | 52 | private Dictionary<UUID, NPCAvatar> m_avatars = |
53 | new Dictionary<UUID, NPCAvatar>(); | 53 | new Dictionary<UUID, NPCAvatar>(); |
54 | 54 | ||
55 | |||
56 | |||
57 | private NPCOptionsFlags m_NPCOptionFlags; | ||
58 | public NPCOptionsFlags NPCOptionFlags {get {return m_NPCOptionFlags;}} | ||
59 | |||
55 | public bool Enabled { get; private set; } | 60 | public bool Enabled { get; private set; } |
56 | 61 | ||
57 | public void Initialise(IConfigSource source) | 62 | public void Initialise(IConfigSource source) |
@@ -59,6 +64,27 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
59 | IConfig config = source.Configs["NPC"]; | 64 | IConfig config = source.Configs["NPC"]; |
60 | 65 | ||
61 | Enabled = (config != null && config.GetBoolean("Enabled", false)); | 66 | Enabled = (config != null && config.GetBoolean("Enabled", false)); |
67 | m_NPCOptionFlags = NPCOptionsFlags.None; | ||
68 | if(Enabled) | ||
69 | { | ||
70 | bool opt = false; | ||
71 | |||
72 | opt = config.GetBoolean("AllowNotOwned", false); | ||
73 | if(opt) | ||
74 | m_NPCOptionFlags |= NPCOptionsFlags.AllowNotOwned; | ||
75 | |||
76 | opt = config.GetBoolean("AllowSenseAsAvatar", false); | ||
77 | if(opt) | ||
78 | m_NPCOptionFlags |= NPCOptionsFlags.AllowSenseAsAvatar; | ||
79 | |||
80 | opt = config.GetBoolean("AllowCloneOtherAvatars", false); | ||
81 | if(opt) | ||
82 | m_NPCOptionFlags |= NPCOptionsFlags.AllowCloneOtherAvatars; | ||
83 | |||
84 | opt = config.GetBoolean("NoNPCGroup", false); | ||
85 | if(opt) | ||
86 | m_NPCOptionFlags |= NPCOptionsFlags.NoNPCGroup; | ||
87 | } | ||
62 | } | 88 | } |
63 | 89 | ||
64 | public void AddRegion(Scene scene) | 90 | public void AddRegion(Scene scene) |