aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications
diff options
context:
space:
mode:
authorMW2007-10-03 06:20:00 +0000
committerMW2007-10-03 06:20:00 +0000
commit9b1eefbcdeb21e42e0feb5336c0a084def2b4aa8 (patch)
treed204137ab678095e2636decf1067cf00074691c1 /OpenSim/Region/Communications
parentDroppin da fyzyx bomb on ya (diff)
downloadopensim-SC_OLD-9b1eefbcdeb21e42e0feb5336c0a084def2b4aa8.zip
opensim-SC_OLD-9b1eefbcdeb21e42e0feb5336c0a084def2b4aa8.tar.gz
opensim-SC_OLD-9b1eefbcdeb21e42e0feb5336c0a084def2b4aa8.tar.bz2
opensim-SC_OLD-9b1eefbcdeb21e42e0feb5336c0a084def2b4aa8.tar.xz
Some continuation of lbsa71's refactoring of the CommunicationsManager.
Diffstat (limited to 'OpenSim/Region/Communications')
-rw-r--r--OpenSim/Region/Communications/Local/CommunicationsLocal.cs64
1 files changed, 4 insertions, 60 deletions
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index 76814cf..f51f564 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -38,14 +38,11 @@ using OpenSim.Framework.Utilities;
38namespace OpenSim.Region.Communications.Local 38namespace OpenSim.Region.Communications.Local
39{ 39{
40 public class CommunicationsLocal : CommunicationsManager 40 public class CommunicationsLocal : CommunicationsManager
41 { 41 {
42 public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings, LocalUserServices userService) 42 public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings, LocalUserServices userService, LocalInventoryService inventoryService)
43 : base(serversInfo, httpServer, assetCache) 43 : base(serversInfo, httpServer, assetCache)
44 { 44 {
45 LocalInventoryService inventoryService = new LocalInventoryService();
46 inventoryService.AddPlugin(settings.InventoryPlugin);
47 m_inventoryService = inventoryService; 45 m_inventoryService = inventoryService;
48
49 m_userService = userService; 46 m_userService = userService;
50 47
51 LocalBackEndServices backendService = new LocalBackEndServices(); 48 LocalBackEndServices backendService = new LocalBackEndServices();
@@ -58,70 +55,17 @@ namespace OpenSim.Region.Communications.Local
58 httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); 55 httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod);
59 } 56 }
60 57
61 public void doCreate(string[] cmmdParams) 58
62 {
63 switch (cmmdParams[0])
64 {
65 case "user":
66 string firstName;
67 string lastName;
68 string password;
69 uint regX = 1000;
70 uint regY = 1000;
71
72 if (cmmdParams.Length < 2)
73 {
74
75 firstName = MainLog.Instance.CmdPrompt("First name", "Default");
76 lastName = MainLog.Instance.CmdPrompt("Last name", "User");
77 password = MainLog.Instance.PasswdPrompt("Password");
78 regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X", "1000"));
79 regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y", "1000"));
80 }
81 else
82 {
83 firstName = cmmdParams[1];
84 lastName = cmmdParams[2];
85 password = cmmdParams[3];
86 regX = Convert.ToUInt32(cmmdParams[4]);
87 regY = Convert.ToUInt32(cmmdParams[5]);
88
89 }
90
91 AddUser(firstName, lastName, password, regX, regY);
92 break;
93 }
94 }
95
96 public LLUUID AddUser(string firstName, string lastName, string password, uint regX, uint regY)
97 {
98 string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + "");
99
100 m_userService.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY);
101 UserProfileData userProf = this.UserService.GetUserProfile(firstName, lastName);
102 if (userProf == null)
103 {
104 return LLUUID.Zero;
105 }
106 else
107 {
108 this.m_inventoryService.CreateNewUserInventory(userProf.UUID);
109 Console.WriteLine("Created new inventory set for " + firstName + " " + lastName);
110 return userProf.UUID;
111 }
112 }
113 59
114 public class LocalSettings 60 public class LocalSettings
115 { 61 {
116 public string WelcomeMessage; 62 public string WelcomeMessage;
117 public bool AccountAuthentication = false; 63 public bool AccountAuthentication = false;
118 public string InventoryPlugin;
119 64
120 public LocalSettings(string welcomeMessage, bool accountsAuthenticate, string inventoryPlugin) 65 public LocalSettings(string welcomeMessage, bool accountsAuthenticate)
121 { 66 {
122 WelcomeMessage = welcomeMessage; 67 WelcomeMessage = welcomeMessage;
123 AccountAuthentication = accountsAuthenticate; 68 AccountAuthentication = accountsAuthenticate;
124 InventoryPlugin = inventoryPlugin;
125 } 69 }
126 } 70 }
127 71