aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/MessagingServer/Main.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-01-06 18:18:19 +0000
committerTeravus Ovares2008-01-06 18:18:19 +0000
commitb8efd5f2949dd247590c1e40509e71031faf3413 (patch)
tree02307ef3edef08bf1a393d89cd772ad8d0ee7ae5 /OpenSim/Grid/MessagingServer/Main.cs
parentSet svn:eol-style. (diff)
downloadopensim-SC_OLD-b8efd5f2949dd247590c1e40509e71031faf3413.zip
opensim-SC_OLD-b8efd5f2949dd247590c1e40509e71031faf3413.tar.gz
opensim-SC_OLD-b8efd5f2949dd247590c1e40509e71031faf3413.tar.bz2
opensim-SC_OLD-b8efd5f2949dd247590c1e40509e71031faf3413.tar.xz
* Added some userserver glue for communications with the message server
* Added some code for the message server, fixed a few references and starting to flesh it out.
Diffstat (limited to 'OpenSim/Grid/MessagingServer/Main.cs')
-rw-r--r--OpenSim/Grid/MessagingServer/Main.cs88
1 files changed, 14 insertions, 74 deletions
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs
index a69cef3..8f64113 100644
--- a/OpenSim/Grid/MessagingServer/Main.cs
+++ b/OpenSim/Grid/MessagingServer/Main.cs
@@ -39,9 +39,9 @@ namespace OpenSim.Grid.MessagingServer
39{ 39{
40 /// <summary> 40 /// <summary>
41 /// </summary> 41 /// </summary>
42 public class OpenUser_Main : conscmd_callback 42 public class OpenMessage_Main : conscmd_callback
43 { 43 {
44 private UserConfig Cfg; 44 private MessageServerConfig Cfg;
45 45
46 //public UserManager m_userManager; 46 //public UserManager m_userManager;
47 //public UserLoginService m_loginService; 47 //public UserLoginService m_loginService;
@@ -52,22 +52,22 @@ namespace OpenSim.Grid.MessagingServer
52 [STAThread] 52 [STAThread]
53 public static void Main(string[] args) 53 public static void Main(string[] args)
54 { 54 {
55 Console.WriteLine("Launching UserServer..."); 55 Console.WriteLine("Launching MessagingServer...");
56 56
57 OpenUser_Main userserver = new OpenUser_Main(); 57 OpenMessage_Main messageserver = new OpenMessage_Main();
58 58
59 userserver.Startup(); 59 messageserver.Startup();
60 userserver.Work(); 60 messageserver.Work();
61 } 61 }
62 62
63 private OpenUser_Main() 63 private OpenMessage_Main()
64 { 64 {
65 if (!Directory.Exists(Util.logDir())) 65 if (!Directory.Exists(Util.logDir()))
66 { 66 {
67 Directory.CreateDirectory(Util.logDir()); 67 Directory.CreateDirectory(Util.logDir());
68 } 68 }
69 m_console = 69 m_console =
70 new LogBase((Path.Combine(Util.logDir(), "opengrid-messagingserver-console.log")), "OpenUser", this, true); 70 new LogBase((Path.Combine(Util.logDir(), "opengrid-messagingserver-console.log")), "OpenMessage", this, true);
71 MainLog.Instance = m_console; 71 MainLog.Instance = m_console;
72 } 72 }
73 73
@@ -83,9 +83,9 @@ namespace OpenSim.Grid.MessagingServer
83 83
84 public void Startup() 84 public void Startup()
85 { 85 {
86 Cfg = new UserConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); 86 Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml")));
87 87
88 MainLog.Instance.Verbose("REGION", "Establishing data connection"); 88 //MainLog.Instance.Verbose("REGION", "Establishing data connection");
89 //m_userManager = new UserManager(); 89 //m_userManager = new UserManager();
90 //m_userManager._config = Cfg; 90 //m_userManager._config = Cfg;
91 //m_userManager.AddPlugin(Cfg.DatabaseProvider); 91 //m_userManager.AddPlugin(Cfg.DatabaseProvider);
@@ -120,21 +120,7 @@ namespace OpenSim.Grid.MessagingServer
120 switch (what) 120 switch (what)
121 { 121 {
122 case "user": 122 case "user":
123 string tempfirstname; 123
124 string templastname;
125 string tempMD5Passwd;
126 uint regX = 1000;
127 uint regY = 1000;
128
129 tempfirstname = m_console.CmdPrompt("First name");
130 templastname = m_console.CmdPrompt("Last name");
131 tempMD5Passwd = m_console.PasswdPrompt("Password");
132 regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X"));
133 regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y"));
134
135 tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + "");
136
137 LLUUID userID = new LLUUID();
138 try 124 try
139 { 125 {
140 //userID = 126 //userID =
@@ -153,7 +139,7 @@ namespace OpenSim.Grid.MessagingServer
153 { 139 {
154 m_console.Error("SERVER", "Error creating inventory for user: {0}", ex.ToString()); 140 m_console.Error("SERVER", "Error creating inventory for user: {0}", ex.ToString());
155 } 141 }
156 m_lastCreatedUser = userID; 142 // m_lastCreatedUser = userID;
157 break; 143 break;
158 } 144 }
159 } 145 }
@@ -163,64 +149,18 @@ namespace OpenSim.Grid.MessagingServer
163 switch (cmd) 149 switch (cmd)
164 { 150 {
165 case "help": 151 case "help":
166 m_console.Notice("create user - create a new user"); 152 m_console.Notice("shutdown - shutdown the message server (USE CAUTION!)");
167 m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)");
168 break;
169
170 case "create":
171 do_create(cmdparams[0]);
172 break; 153 break;
173 154
174 case "shutdown": 155 case "shutdown":
175 m_console.Close(); 156 m_console.Close();
176 Environment.Exit(0); 157 Environment.Exit(0);
177 break; 158 break;
178
179 case "test-inventory":
180 // RestObjectPosterResponse<List<InventoryFolderBase>> requester = new RestObjectPosterResponse<List<InventoryFolderBase>>();
181 // requester.ReturnResponseVal = TestResponse;
182 // requester.BeginPostObject<LLUUID>(m_userManager._config.InventoryUrl + "RootFolders/", m_lastCreatedUser);
183 //List<InventoryFolderBase> folders =
184 //SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>("POST",
185 //m_userManager.
186 //_config.
187 //InventoryUrl +
188 //"RootFolders/",
189 //m_lastCreatedUser);
190 break;
191 } 159 }
192 } 160 }
193 161
194 public void TestResponse(List<InventoryFolderBase> resp)
195 {
196 Console.WriteLine("response got");
197 }
198
199 /*private void ConfigDB(IGenericConfig configData)
200 {
201 try
202 {
203 string attri = "";
204 attri = configData.GetAttribute("DataBaseProvider");
205 if (attri == "")
206 {
207 StorageDll = "OpenSim.Framework.Data.DB4o.dll";
208 configData.SetAttribute("DataBaseProvider", "OpenSim.Framework.Data.DB4o.dll");
209 }
210 else
211 {
212 StorageDll = attri;
213 }
214 configData.Commit();
215 }
216 catch
217 {
218
219 }
220 }*/
221
222 public void Show(string ShowWhat) 162 public void Show(string ShowWhat)
223 { 163 {
224 } 164 }
225 } 165 }
226} \ No newline at end of file 166}