diff options
* minor refactorings
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Communications/Local/CommunicationsLocal.cs | 47 |
1 files changed, 29 insertions, 18 deletions
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 = ""; |