diff options
author | lbsa71 | 2007-09-11 14:20:09 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-11 14:20:09 +0000 |
commit | b112539f9514143c9c43e8e7960e0fedd87ed34d (patch) | |
tree | e441b695f7f966b290c05816432e1edc130cdcb7 /OpenSim/Region | |
parent | Applied ldvoipeng's patch [#360], sorry for it taking so long to apply it. I... (diff) | |
download | opensim-SC-b112539f9514143c9c43e8e7960e0fedd87ed34d.zip opensim-SC-b112539f9514143c9c43e8e7960e0fedd87ed34d.tar.gz opensim-SC-b112539f9514143c9c43e8e7960e0fedd87ed34d.tar.bz2 opensim-SC-b112539f9514143c9c43e8e7960e0fedd87ed34d.tar.xz |
* minor refactorings
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 21 | ||||
-rw-r--r-- | OpenSim/Region/Communications/Local/CommunicationsLocal.cs | 47 |
2 files changed, 36 insertions, 32 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index c1522b1..9ac5117 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -27,29 +27,22 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | ||
30 | using System.IO; | 31 | using System.IO; |
31 | using libsecondlife; | 32 | using System.Text; |
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework.Communications.Caches; |
34 | using OpenSim.Framework.Communications; | ||
35 | using OpenSim.Framework.Console; | 35 | using OpenSim.Framework.Console; |
36 | using OpenSim.Framework.Data; | ||
37 | using OpenSim.Framework.Interfaces; | 36 | using OpenSim.Framework.Interfaces; |
38 | using OpenSim.Framework.Servers; | 37 | using OpenSim.Framework.Servers; |
39 | using OpenSim.Framework.Types; | 38 | using OpenSim.Framework.Types; |
40 | using OpenSim.Framework.Configuration; | 39 | using OpenSim.Framework.Utilities; |
41 | using OpenSim.Region.Physics.Manager; | ||
42 | |||
43 | using OpenSim.Region.ClientStack; | 40 | using OpenSim.Region.ClientStack; |
44 | using OpenSim.Region.Communications.Local; | 41 | using OpenSim.Region.Communications.Local; |
45 | using OpenSim.Region.Communications.OGS1; | 42 | using OpenSim.Region.Communications.OGS1; |
46 | using OpenSim.Framework.Communications.Caches; | ||
47 | using OpenSim.Region.Environment.Scenes; | ||
48 | using OpenSim.Region.Environment.Modules; | ||
49 | using OpenSim.Region.Environment; | 43 | using OpenSim.Region.Environment; |
50 | using System.Text; | 44 | using OpenSim.Region.Environment.Scenes; |
51 | using System.Collections.Generic; | 45 | using OpenSim.Region.Physics.Manager; |
52 | using OpenSim.Framework.Utilities; | ||
53 | 46 | ||
54 | namespace OpenSim | 47 | namespace OpenSim |
55 | { | 48 | { |
@@ -75,7 +68,7 @@ namespace OpenSim | |||
75 | protected List<Scene> m_localScenes = new List<Scene>(); | 68 | protected List<Scene> m_localScenes = new List<Scene>(); |
76 | 69 | ||
77 | private bool m_silent; | 70 | private bool m_silent; |
78 | private string m_logFilename = ("region-console.log"); | 71 | private readonly string m_logFilename = ("region-console.log"); |
79 | private bool m_permissions = false; | 72 | private bool m_permissions = false; |
80 | 73 | ||
81 | private bool m_DefaultModules = true; | 74 | private bool m_DefaultModules = true; |
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index cf0e871..e326a1e 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs | |||
@@ -34,6 +34,7 @@ using OpenSim.Framework.Console; | |||
34 | using OpenSim.Framework.Utilities; | 34 | using OpenSim.Framework.Utilities; |
35 | using OpenSim.Framework.Data; | 35 | using OpenSim.Framework.Data; |
36 | using OpenSim.Framework.UserManagement; | 36 | using OpenSim.Framework.UserManagement; |
37 | using libsecondlife; | ||
37 | 38 | ||
38 | namespace OpenSim.Region.Communications.Local | 39 | namespace OpenSim.Region.Communications.Local |
39 | { | 40 | { |
@@ -79,44 +80,54 @@ namespace OpenSim.Region.Communications.Local | |||
79 | switch (cmmdParams[0]) | 80 | switch (cmmdParams[0]) |
80 | { | 81 | { |
81 | case "user": | 82 | case "user": |
82 | string tempfirstname; | 83 | string firstName; |
83 | string templastname; | 84 | string lastName; |
84 | string tempMD5Passwd; | 85 | string password; |
85 | uint regX = 1000; | 86 | uint regX = 1000; |
86 | uint regY = 1000; | 87 | uint regY = 1000; |
87 | 88 | ||
88 | if (cmmdParams.Length < 2) | 89 | if (cmmdParams.Length < 2) |
89 | { | 90 | { |
90 | 91 | ||
91 | tempfirstname = MainLog.Instance.CmdPrompt("First name", "Default"); | 92 | firstName = MainLog.Instance.CmdPrompt("First name", "Default"); |
92 | templastname = MainLog.Instance.CmdPrompt("Last name", "User"); | 93 | lastName = MainLog.Instance.CmdPrompt("Last name", "User"); |
93 | tempMD5Passwd = MainLog.Instance.PasswdPrompt("Password"); | 94 | password = MainLog.Instance.PasswdPrompt("Password"); |
94 | regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X", "1000")); | 95 | regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X", "1000")); |
95 | regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y", "1000")); | 96 | regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y", "1000")); |
96 | } | 97 | } |
97 | else | 98 | else |
98 | { | 99 | { |
99 | tempfirstname = cmmdParams[1]; | 100 | firstName = cmmdParams[1]; |
100 | templastname = cmmdParams[2]; | 101 | lastName = cmmdParams[2]; |
101 | tempMD5Passwd = cmmdParams[3]; | 102 | password = cmmdParams[3]; |
102 | regX = Convert.ToUInt32(cmmdParams[4]); | 103 | regX = Convert.ToUInt32(cmmdParams[4]); |
103 | regY = Convert.ToUInt32(cmmdParams[5]); | 104 | regY = Convert.ToUInt32(cmmdParams[5]); |
104 | 105 | ||
105 | } | 106 | } |
106 | 107 | ||
107 | tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + ""); | 108 | AddUser(firstName, lastName, password, regX, regY); |
108 | |||
109 | this.UserServices.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); | ||
110 | UserProfileData userProf = this.UserServer.GetUserProfile(tempfirstname, templastname); | ||
111 | if (userProf != null) | ||
112 | { | ||
113 | this.InvenServices.CreateNewUserInventory(userProf.UUID); | ||
114 | Console.WriteLine("Created new inventory set for " + tempfirstname + " " + templastname); | ||
115 | } | ||
116 | break; | 109 | break; |
117 | } | 110 | } |
118 | } | 111 | } |
119 | 112 | ||
113 | public LLUUID AddUser(string firstName, string lastName, string password, uint regX, uint regY) | ||
114 | { | ||
115 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + ""); | ||
116 | |||
117 | this.UserServices.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY); | ||
118 | UserProfileData userProf = this.UserServer.GetUserProfile(firstName, lastName); | ||
119 | if (userProf == null) | ||
120 | { | ||
121 | return LLUUID.Zero; | ||
122 | } | ||
123 | else | ||
124 | { | ||
125 | this.InvenServices.CreateNewUserInventory(userProf.UUID); | ||
126 | Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); | ||
127 | return userProf.UUID; | ||
128 | } | ||
129 | } | ||
130 | |||
120 | public class LocalSettings | 131 | public class LocalSettings |
121 | { | 132 | { |
122 | public string WelcomeMessage = ""; | 133 | public string WelcomeMessage = ""; |