From 240ab951b52aa87434cc02736a4ef84d95470082 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 6 Dec 2016 16:15:57 +0000 Subject: let NPCs have profile --- .../Avatar/UserProfiles/UserProfileModule.cs | 33 ++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs') diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 61835f9..47914cc 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -320,13 +320,12 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles UUID targetID; UUID.TryParse(args[0], out targetID); - // Can't handle NPC yet... - ScenePresence p = FindPresence(targetID); - if (null != p) + ScenePresence p = FindPresence(targetID); + if (p != null && p.isNPC) { - if (p.PresenceType == PresenceType.Npc) - return; + remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), new Dictionary()); + return; } string serverURI = string.Empty; @@ -575,10 +574,10 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles // Can't handle NPC yet... ScenePresence p = FindPresence(targetId); - if (null != p) + if (p != null && p.isNPC) { - if (p.PresenceType == PresenceType.Npc) - return; + remoteClient.SendAvatarPicksReply(new UUID(args[0]), new Dictionary()); + return; } string serverURI = string.Empty; @@ -860,6 +859,14 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles /// public void NotesUpdate(IClientAPI remoteClient, UUID queryTargetID, string queryNotes) { + ScenePresence p = FindPresence(queryTargetID); + if (p != null && p.isNPC) + { + remoteClient.SendAgentAlertMessage( + "Notes for NPCs not avaiable", false); + return; + } + UserProfileNotes note = new UserProfileNotes(); note.UserId = remoteClient.AgentId; @@ -1000,10 +1007,14 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles // Can't handle NPC yet... ScenePresence p = FindPresence(avatarID); - if (null != p) + if (p != null && p.isNPC) { - if (p.PresenceType == PresenceType.Npc) - return; + remoteClient.SendAvatarProperties(avatarID, "im a happy NPC", "5/25/1977" , + Utils.StringToBytes("NPC"), "NPCs have no life", 0, + UUID.Zero, UUID.Zero, "", UUID.Zero); + remoteClient.SendAvatarInterestsReply(avatarID, 0, "", + 0, "Getting into trouble", "Droidspeak"); + return; } string serverURI = string.Empty; -- cgit v1.1 From d4e285b1a1da036220d9b3a7141ebe1b865c5d35 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 6 Dec 2016 17:05:02 +0000 Subject: add osNpcSetProfileAbout(LSL_Key npc, string about) to set NPCs profile About text. requires OsNpcCreate rights --- OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs') diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 47914cc..94dc5f5 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -863,7 +863,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles if (p != null && p.isNPC) { remoteClient.SendAgentAlertMessage( - "Notes for NPCs not avaiable", false); + "Notes for NPCs not available", false); return; } @@ -1009,7 +1009,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles if (p != null && p.isNPC) { - remoteClient.SendAvatarProperties(avatarID, "im a happy NPC", "5/25/1977" , + remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, "5/25/1977", Utils.StringToBytes("NPC"), "NPCs have no life", 0, UUID.Zero, UUID.Zero, "", UUID.Zero); remoteClient.SendAvatarInterestsReply(avatarID, 0, "", -- cgit v1.1 From de36092d23736f448f5612cbe8b1965422e13a6c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 6 Dec 2016 17:16:47 +0000 Subject: if we have profile then npc is online --- OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs') diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 94dc5f5..5be8556 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -1010,7 +1010,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles if (p != null && p.isNPC) { remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, "5/25/1977", - Utils.StringToBytes("NPC"), "NPCs have no life", 0, + Utils.StringToBytes("Non Player Character (NPC)"), "NPCs have no life", 16, UUID.Zero, UUID.Zero, "", UUID.Zero); remoteClient.SendAvatarInterestsReply(avatarID, 0, "", 0, "Getting into trouble", "Droidspeak"); -- cgit v1.1