aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMandarinka Tasty2016-12-14 01:14:23 +0100
committerUbitUmarov2016-12-14 00:24:52 +0000
commitec883d0f1504e8573f763882231cb1da06bdc2a1 (patch)
tree5146fdae277ad5ce482093df5a8cbc2011d5254c
parentRemove the AllowAlternatePorts option. It wasn't implemented anyway. (diff)
downloadopensim-SC_OLD-ec883d0f1504e8573f763882231cb1da06bdc2a1.zip
opensim-SC_OLD-ec883d0f1504e8573f763882231cb1da06bdc2a1.tar.gz
opensim-SC_OLD-ec883d0f1504e8573f763882231cb1da06bdc2a1.tar.bz2
opensim-SC_OLD-ec883d0f1504e8573f763882231cb1da06bdc2a1.tar.xz
New OSSL function: osNpcSetProfileImage(LSL_Key npc, string image); This patch gives possibility to set image in created NPC's profile. You can use UUID of the texture or name of texture included in prim's inventory.
Signed-off-by: Mandarinka Tasty <mandarinka.tasty@gmail.com> Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/INPCModule.cs1
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs29
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
6 files changed, 45 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index ce5816b..5314927 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -1011,7 +1011,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1011 { 1011 {
1012 remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, ((INPC)(p.ControllingClient)).Born, 1012 remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, ((INPC)(p.ControllingClient)).Born,
1013 Utils.StringToBytes("Non Player Character (NPC)"), "NPCs have no life", 16, 1013 Utils.StringToBytes("Non Player Character (NPC)"), "NPCs have no life", 16,
1014 UUID.Zero, UUID.Zero, "", UUID.Zero); 1014 UUID.Zero, ((INPC)(p.ControllingClient)).profileImage, "", UUID.Zero);
1015 remoteClient.SendAvatarInterestsReply(avatarID, 0, "", 1015 remoteClient.SendAvatarInterestsReply(avatarID, 0, "",
1016 0, "Getting into trouble", "Droidspeak"); 1016 0, "Getting into trouble", "Droidspeak");
1017 return; 1017 return;
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
index dd4226c..813be4f 100644
--- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
@@ -59,6 +59,7 @@ namespace OpenSim.Region.Framework.Interfaces
59 UUID ActiveGroupId { get; set; } 59 UUID ActiveGroupId { get; set; }
60 UUID Owner { get; } 60 UUID Owner { get; }
61 string profileAbout { get; set; } 61 string profileAbout { get; set; }
62 UUID profileImage { get; set; }
62 string Born { get; set; } 63 string Born { get; set; }
63 } 64 }
64 65
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index a929e80..0cabe47 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -70,6 +70,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
70 private readonly UUID m_ownerID; 70 private readonly UUID m_ownerID;
71 private UUID m_hostGroupID; 71 private UUID m_hostGroupID;
72 private string m_profileAbout = ""; 72 private string m_profileAbout = "";
73 private UUID m_profileImage = UUID.Zero;
73 private string m_born; 74 private string m_born;
74 public List<uint> SelectedObjects {get; private set;} 75 public List<uint> SelectedObjects {get; private set;}
75 76
@@ -110,6 +111,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
110 m_profileAbout = value; 111 m_profileAbout = value;
111 } 112 }
112 } 113 }
114
115 public UUID profileImage
116 {
117 get { return m_profileImage; }
118 set { m_profileImage = value; }
119 }
120
113 public IScene Scene 121 public IScene Scene
114 { 122 {
115 get { return m_scene; } 123 get { return m_scene; }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index b101cf9..dd4da0a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -3018,6 +3018,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3018 } 3018 }
3019 } 3019 }
3020 3020
3021 public void osNpcSetProfileImage(LSL_Key npc, string image)
3022 {
3023 CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
3024 m_host.AddScriptLPS(1);
3025
3026 INPCModule module = World.RequestModuleInterface<INPCModule>();
3027 if (module != null)
3028 {
3029 UUID npcId = new UUID(npc.m_string);
3030
3031 if (!module.CheckPermissions(npcId, m_host.OwnerID))
3032 return;
3033
3034 UUID ImageID = new UUID();
3035
3036 ImageID = ScriptUtils.GetAssetIdFromItemName(m_host, image, (int)AssetType.Texture);
3037
3038 if (ImageID == null || ImageID == UUID.Zero)
3039 {
3040 if (!UUID.TryParse(image, out ImageID))
3041 return;
3042 }
3043
3044 ScenePresence sp = World.GetScenePresence(npcId);
3045 if (sp != null)
3046 ((INPC)(sp.ControllingClient)).profileImage = ImageID;
3047 }
3048 }
3049
3021 public void osNpcSay(LSL_Key npc, string message) 3050 public void osNpcSay(LSL_Key npc, string message)
3022 { 3051 {
3023 osNpcSay(npc, 0, message); 3052 osNpcSay(npc, 0, message);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 87b0967..cf3e6df 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -344,6 +344,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
344 void osNpcSetRot(LSL_Key npc, rotation rot); 344 void osNpcSetRot(LSL_Key npc, rotation rot);
345 void osNpcStopMoveToTarget(LSL_Key npc); 345 void osNpcStopMoveToTarget(LSL_Key npc);
346 void osNpcSetProfileAbout(LSL_Key npc, string about); 346 void osNpcSetProfileAbout(LSL_Key npc, string about);
347 void osNpcSetProfileImage(LSL_Key npc, string image);
347 void osNpcSay(key npc, string message); 348 void osNpcSay(key npc, string message);
348 void osNpcSay(key npc, int channel, string message); 349 void osNpcSay(key npc, int channel, string message);
349 void osNpcShout(key npc, int channel, string message); 350 void osNpcShout(key npc, int channel, string message);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 5bc998e..2e8a76c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -642,6 +642,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
642 m_OSSL_Functions.osNpcSetProfileAbout(npc, about); 642 m_OSSL_Functions.osNpcSetProfileAbout(npc, about);
643 } 643 }
644 644
645 public void osNpcSetProfileImage(LSL_Key npc, string image)
646 {
647 m_OSSL_Functions.osNpcSetProfileImage(npc, image);
648 }
649
645 public void osNpcSay(key npc, string message) 650 public void osNpcSay(key npc, string message)
646 { 651 {
647 m_OSSL_Functions.osNpcSay(npc, message); 652 m_OSSL_Functions.osNpcSay(npc, message);