aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-30 23:29:44 +0000
committerTeravus Ovares2007-12-30 23:29:44 +0000
commit57a11325851b92e2201b0e727596b4920009246f (patch)
tree0b4b2450189c84cc3c618a867711d31d3c69c8ba /OpenSim
parentComments + fix = in theory stand alone script server + "RemoteSevrver" Script... (diff)
downloadopensim-SC_OLD-57a11325851b92e2201b0e727596b4920009246f.zip
opensim-SC_OLD-57a11325851b92e2201b0e727596b4920009246f.tar.gz
opensim-SC_OLD-57a11325851b92e2201b0e727596b4920009246f.tar.bz2
opensim-SC_OLD-57a11325851b92e2201b0e727596b4920009246f.tar.xz
* Fixed References in Prebuild so the project compiles
* Added Friends List methods to IUserData interface * Created Stub friendslist Database Methods
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Data.DB4o/DB4oUserData.cs25
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs25
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLUserData.cs25
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteUserData.cs25
-rw-r--r--OpenSim/Framework/FriendListItem.cs47
-rw-r--r--OpenSim/Framework/IUserData.cs34
-rw-r--r--OpenSim/Region/Environment/Modules/FriendsModule.cs43
-rw-r--r--OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs4
8 files changed, 224 insertions, 4 deletions
diff --git a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
index e0973f1..acd14fa 100644
--- a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
+++ b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
@@ -133,6 +133,31 @@ namespace OpenSim.Framework.Data.DB4o
133 } 133 }
134 } 134 }
135 135
136 #region User Friends List Data
137
138 public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
139 {
140 //MainLog.Instance.Verbose("FRIEND", "Stub AddNewUserFriend called");
141 }
142
143 public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
144 {
145 //MainLog.Instance.Verbose("FRIEND", "Stub RemoveUserFriend called");
146 }
147 public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
148 {
149 //MainLog.Instance.Verbose("FRIEND", "Stub UpdateUserFriendPerms called");
150 }
151
152
153 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
154 {
155 //MainLog.Instance.Verbose("FRIEND", "Stub GetUserFriendList called");
156 return new List<FriendListItem>();
157 }
158
159 #endregion
160
136 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) 161 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
137 { 162 {
138 //Do nothing yet 163 //Do nothing yet
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs
index 01ef559..2c1d6d5 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs
@@ -99,6 +99,31 @@ namespace OpenSim.Framework.Data.MSSQL
99 } 99 }
100 } 100 }
101 101
102 #region User Friends List Data
103
104 public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
105 {
106 MainLog.Instance.Verbose("FRIEND", "Stub AddNewUserFriend called");
107 }
108
109 public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
110 {
111 MainLog.Instance.Verbose("FRIEND", "Stub RemoveUserFriend called");
112 }
113 public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
114 {
115 MainLog.Instance.Verbose("FRIEND", "Stub UpdateUserFriendPerms called");
116 }
117
118
119 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
120 {
121 MainLog.Instance.Verbose("FRIEND", "Stub GetUserFriendList called");
122 return new List<FriendListItem>();
123 }
124
125 #endregion
126
102 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) 127 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
103 { 128 {
104 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>(); 129 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>();
diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
index 2d96f6e..c8f0517 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
@@ -145,6 +145,31 @@ namespace OpenSim.Framework.Data.MySQL
145 } 145 }
146 } 146 }
147 147
148 #region User Friends List Data
149
150 public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
151 {
152 MainLog.Instance.Verbose("FRIEND", "Stub AddNewUserFriend called");
153 }
154
155 public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
156 {
157 MainLog.Instance.Verbose("FRIEND", "Stub RemoveUserFriend called");
158 }
159 public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
160 {
161 MainLog.Instance.Verbose("FRIEND", "Stub UpdateUserFriendPerms called");
162 }
163
164
165 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
166 {
167 MainLog.Instance.Verbose("FRIEND", "Stub GetUserFriendList called");
168 return new List<FriendListItem>();
169 }
170
171 #endregion
172
148 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) 173 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
149 { 174 {
150 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>(); 175 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>();
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
index a719fa2..48a09d3 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
@@ -117,6 +117,31 @@ namespace OpenSim.Framework.Data.SQLite
117 } 117 }
118 } 118 }
119 119
120 #region User Friends List Data
121
122 public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
123 {
124 MainLog.Instance.Verbose("FRIEND", "Stub AddNewUserFriend called");
125 }
126
127 public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
128 {
129 MainLog.Instance.Verbose("FRIEND", "Stub RemoveUserFriend called");
130 }
131 public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
132 {
133 MainLog.Instance.Verbose("FRIEND", "Stub UpdateUserFriendPerms called");
134 }
135
136
137 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
138 {
139 MainLog.Instance.Verbose("FRIEND", "Stub GetUserFriendList called");
140 return new List<FriendListItem>();
141 }
142
143 #endregion
144
120 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) 145 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
121 { 146 {
122 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>(); 147 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>();
diff --git a/OpenSim/Framework/FriendListItem.cs b/OpenSim/Framework/FriendListItem.cs
new file mode 100644
index 0000000..0d7cb75
--- /dev/null
+++ b/OpenSim/Framework/FriendListItem.cs
@@ -0,0 +1,47 @@
1/*
2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28
29using System;
30using System.Collections.Generic;
31using libsecondlife;
32
33namespace OpenSim.Framework
34{
35 public class FriendListItem
36 {
37 public LLUUID FriendListOwner;
38 public LLUUID Friend;
39
40 // These are what the list owner gives the friend permission to do
41 public uint FriendPerms;
42
43 // These are what the friend gives the listowner permission to do
44 public uint FriendListOwnerPerms;
45
46 }
47}
diff --git a/OpenSim/Framework/IUserData.cs b/OpenSim/Framework/IUserData.cs
index d06784c..4e576b9 100644
--- a/OpenSim/Framework/IUserData.cs
+++ b/OpenSim/Framework/IUserData.cs
@@ -50,6 +50,12 @@ namespace OpenSim.Framework
50 /// <returns>The user data profile</returns> 50 /// <returns>The user data profile</returns>
51 UserProfileData GetUserByName(string fname, string lname); 51 UserProfileData GetUserByName(string fname, string lname);
52 52
53 /// <summary>
54 /// Returns a list of UUIDs firstnames and lastnames that match string query entered into the avatar picker.
55 /// </summary>
56 /// <param name="queryID">ID associated with the user's query. This must match what the client sent</param>
57 /// <param name="query">The filtered contents of the search box when the user hit search.</param>
58 /// <returns>The user data profile</returns>
53 List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query); 59 List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query);
54 60
55 /// <summary> 61 /// <summary>
@@ -93,6 +99,34 @@ namespace OpenSim.Framework
93 void AddNewUserAgent(UserAgentData agent); 99 void AddNewUserAgent(UserAgentData agent);
94 100
95 /// <summary> 101 /// <summary>
102 /// Adds a new friend to the database for XUser
103 /// </summary>
104 /// <param name="friendlistowner">The agent that who's friends list is being added to</param>
105 /// <param name="friend">The agent that being added to the friends list of the friends list owner</param>
106 /// <param name="perms">A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects </param>
107 void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms);
108
109 /// <summary>
110 /// Delete friend on friendlistowner's friendlist.
111 /// </summary>
112 /// <param name="friendlistowner">The agent that who's friends list is being updated</param>
113 /// <param name="friend">The Ex-friend agent</param>
114 void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend);
115
116 /// <summary>
117 /// Update permissions for friend on friendlistowner's friendlist.
118 /// </summary>
119 /// <param name="friendlistowner">The agent that who's friends list is being updated</param>
120 /// <param name="friend">The agent that is getting or loosing permissions</param>
121 /// <param name="perms">A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects </param>
122 void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms);
123
124 /// <summary>
125 /// Returns a list of FriendsListItems that describe the friends and permissions in the friend relationship for LLUUID friendslistowner
126 /// </summary>
127 /// <param name="friendlistowner">The agent that we're retreiving the friends Data.</param>
128 List<FriendListItem> GetUserFriendList(LLUUID friendlistowner);
129 /// <summary>
96 /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES) 130 /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES)
97 /// </summary> 131 /// </summary>
98 /// <param name="from">The account to transfer from</param> 132 /// <param name="from">The account to transfer from</param>
diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs
index d9f09f7..d2fcba9 100644
--- a/OpenSim/Region/Environment/Modules/FriendsModule.cs
+++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs
@@ -27,24 +27,61 @@
27*/ 27*/
28 28
29using Nini.Config; 29using Nini.Config;
30using System;
31using System.Collections;
32using System.Collections.Generic;
33using OpenSim.Framework;
34using OpenSim.Framework.Console;
30using OpenSim.Region.Environment.Interfaces; 35using OpenSim.Region.Environment.Interfaces;
31using OpenSim.Region.Environment.Scenes; 36using OpenSim.Region.Environment.Scenes;
37using libsecondlife;
38using libsecondlife.Packets;
32 39
33namespace OpenSim.Region.Environment.Modules 40namespace OpenSim.Region.Environment.Modules
34{ 41{
35 public class FriendsModule : IRegionModule 42 public class FriendsModule : IRegionModule
36 { 43 {
37 private Scene m_scene; 44 private List<Scene> m_scenes = new List<Scene>();
45 private LogBase m_log;
38 46
39 public void Initialise(Scene scene, IConfigSource config) 47 public void Initialise(Scene scene, IConfigSource config)
40 { 48 {
41 m_scene = scene; 49 m_log = MainLog.Instance;
50 if (!m_scenes.Contains(scene))
51 {
52 m_scenes.Add(scene);
53 scene.EventManager.OnNewClient += OnNewClient;
54 }
55 }
56
57 private void OnNewClient(IClientAPI client)
58 {
59 FormFriendship(client,new Guid("c43a67ab-b196-4d62-936c-b40369547dee"));
60 FormFriendship(client, new Guid("0a2f777b-f44c-4662-8b22-c90ae038a3e6"));
42 } 61 }
43 62
44 public void PostInitialise() 63 public void PostInitialise()
45 { 64 {
46 } 65 }
47 66
67 private void FormFriendship(IClientAPI client, Guid friend)
68 {
69 foreach (Scene scene in m_scenes)
70 {
71 if (scene.Entities.ContainsKey(client.AgentId) && scene.Entities[client.AgentId] is ScenePresence)
72 {
73 OnlineNotificationPacket ONPack = new OnlineNotificationPacket();
74 OnlineNotificationPacket.AgentBlockBlock[] AgentBlock = new OnlineNotificationPacket.AgentBlockBlock[1];
75
76 AgentBlock[0] = new OnlineNotificationPacket.AgentBlockBlock();
77 AgentBlock[0].AgentID = new LLUUID(friend);
78 ONPack.AgentBlock = AgentBlock;
79 client.OutPacket(ONPack,ThrottleOutPacketType.Task);
80 }
81 }
82
83 }
84
48 public void Close() 85 public void Close()
49 { 86 {
50 } 87 }
@@ -56,7 +93,7 @@ namespace OpenSim.Region.Environment.Modules
56 93
57 public bool IsSharedModule 94 public bool IsSharedModule
58 { 95 {
59 get { return false; } 96 get { return true; }
60 } 97 }
61 } 98 }
62} \ No newline at end of file 99} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
index d539dc4..1e56b94 100644
--- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
@@ -29,6 +29,8 @@
29using System; 29using System;
30using libsecondlife; 30using libsecondlife;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Grid.ScriptServer;
33using OpenSim.Region.ScriptEngine.DotNetEngine;
32 34
33namespace OpenSim.Region.ScriptEngine.RemoteServer 35namespace OpenSim.Region.ScriptEngine.RemoteServer
34{ 36{
@@ -39,7 +41,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
39 internal class EventManager 41 internal class EventManager
40 { 42 {
41 43
42 System.Collections.Generic.Dictionary<uint, OpenSim.Grid.ScriptServer.RemotingObject> remoteScript = new System.Collections.Generic.Dictionary<uint, OpenSim.Grid.ScriptServer.RemotingObject>(); 44 System.Collections.Generic.Dictionary<uint, RemotingObject> remoteScript = new System.Collections.Generic.Dictionary<uint, OpenSim.Grid.ScriptServer.RemotingObject>();
43 45
44 46
45 private ScriptEngine myScriptEngine; 47 private ScriptEngine myScriptEngine;