diff options
author | MW | 2007-10-03 06:20:00 +0000 |
---|---|---|
committer | MW | 2007-10-03 06:20:00 +0000 |
commit | 9b1eefbcdeb21e42e0feb5336c0a084def2b4aa8 (patch) | |
tree | d204137ab678095e2636decf1067cf00074691c1 /OpenSim/Framework/Communications/CommunicationsManager.cs | |
parent | Droppin da fyzyx bomb on ya (diff) | |
download | opensim-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/Framework/Communications/CommunicationsManager.cs')
-rw-r--r-- | OpenSim/Framework/Communications/CommunicationsManager.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 6ea3c29..cd5d901 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | ||
28 | using libsecondlife; | 29 | using libsecondlife; |
29 | using OpenSim.Framework.Communications.Cache; | 30 | using OpenSim.Framework.Communications.Cache; |
30 | using OpenSim.Framework.Communications.Caches; | 31 | using OpenSim.Framework.Communications.Caches; |
@@ -32,6 +33,8 @@ using OpenSim.Framework.Data; | |||
32 | using OpenSim.Framework.Interfaces; | 33 | using OpenSim.Framework.Interfaces; |
33 | using OpenSim.Framework.Servers; | 34 | using OpenSim.Framework.Servers; |
34 | using OpenSim.Framework.Types; | 35 | using OpenSim.Framework.Types; |
36 | using OpenSim.Framework.Console; | ||
37 | using OpenSim.Framework.Utilities; | ||
35 | 38 | ||
36 | namespace OpenSim.Framework.Communications | 39 | namespace OpenSim.Framework.Communications |
37 | { | 40 | { |
@@ -93,6 +96,58 @@ namespace OpenSim.Framework.Communications | |||
93 | m_transactionsManager = new AssetTransactionManager(this); | 96 | m_transactionsManager = new AssetTransactionManager(this); |
94 | } | 97 | } |
95 | 98 | ||
99 | public void doCreate(string[] cmmdParams) | ||
100 | { | ||
101 | switch (cmmdParams[0]) | ||
102 | { | ||
103 | case "user": | ||
104 | string firstName; | ||
105 | string lastName; | ||
106 | string password; | ||
107 | uint regX = 1000; | ||
108 | uint regY = 1000; | ||
109 | |||
110 | if (cmmdParams.Length < 2) | ||
111 | { | ||
112 | |||
113 | firstName = MainLog.Instance.CmdPrompt("First name", "Default"); | ||
114 | lastName = MainLog.Instance.CmdPrompt("Last name", "User"); | ||
115 | password = MainLog.Instance.PasswdPrompt("Password"); | ||
116 | regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X", "1000")); | ||
117 | regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y", "1000")); | ||
118 | } | ||
119 | else | ||
120 | { | ||
121 | firstName = cmmdParams[1]; | ||
122 | lastName = cmmdParams[2]; | ||
123 | password = cmmdParams[3]; | ||
124 | regX = Convert.ToUInt32(cmmdParams[4]); | ||
125 | regY = Convert.ToUInt32(cmmdParams[5]); | ||
126 | |||
127 | } | ||
128 | |||
129 | AddUser(firstName, lastName, password, regX, regY); | ||
130 | break; | ||
131 | } | ||
132 | } | ||
133 | |||
134 | public LLUUID AddUser(string firstName, string lastName, string password, uint regX, uint regY) | ||
135 | { | ||
136 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + ""); | ||
137 | |||
138 | m_userService.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY); | ||
139 | UserProfileData userProf = UserService.GetUserProfile(firstName, lastName); | ||
140 | if (userProf == null) | ||
141 | { | ||
142 | return LLUUID.Zero; | ||
143 | } | ||
144 | else | ||
145 | { | ||
146 | this.m_inventoryService.CreateNewUserInventory(userProf.UUID); | ||
147 | System.Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); | ||
148 | return userProf.UUID; | ||
149 | } | ||
150 | } | ||
96 | 151 | ||
97 | #region Packet Handlers | 152 | #region Packet Handlers |
98 | 153 | ||