* minor refactorings
parent
04cf04600c
commit
b112539f95
|
@ -1,10 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.Framework.Data;
|
using OpenSim.Framework.Data;
|
||||||
|
|
||||||
namespace OpenSim.Framework.InventoryServiceBase
|
namespace OpenSim.Framework.InventoryServiceBase
|
||||||
|
|
|
@ -27,29 +27,22 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using libsecondlife;
|
using System.Text;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework.Communications.Caches;
|
||||||
using OpenSim.Framework.Communications;
|
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Data;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Configuration;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.Region.Physics.Manager;
|
|
||||||
|
|
||||||
using OpenSim.Region.ClientStack;
|
using OpenSim.Region.ClientStack;
|
||||||
using OpenSim.Region.Communications.Local;
|
using OpenSim.Region.Communications.Local;
|
||||||
using OpenSim.Region.Communications.OGS1;
|
using OpenSim.Region.Communications.OGS1;
|
||||||
using OpenSim.Framework.Communications.Caches;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Modules;
|
|
||||||
using OpenSim.Region.Environment;
|
using OpenSim.Region.Environment;
|
||||||
using System.Text;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
using System.Collections.Generic;
|
using OpenSim.Region.Physics.Manager;
|
||||||
using OpenSim.Framework.Utilities;
|
|
||||||
|
|
||||||
namespace OpenSim
|
namespace OpenSim
|
||||||
{
|
{
|
||||||
|
@ -75,7 +68,7 @@ namespace OpenSim
|
||||||
protected List<Scene> m_localScenes = new List<Scene>();
|
protected List<Scene> m_localScenes = new List<Scene>();
|
||||||
|
|
||||||
private bool m_silent;
|
private bool m_silent;
|
||||||
private string m_logFilename = ("region-console.log");
|
private readonly string m_logFilename = ("region-console.log");
|
||||||
private bool m_permissions = false;
|
private bool m_permissions = false;
|
||||||
|
|
||||||
private bool m_DefaultModules = true;
|
private bool m_DefaultModules = true;
|
||||||
|
|
|
@ -34,6 +34,7 @@ using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.Framework.Data;
|
using OpenSim.Framework.Data;
|
||||||
using OpenSim.Framework.UserManagement;
|
using OpenSim.Framework.UserManagement;
|
||||||
|
using libsecondlife;
|
||||||
|
|
||||||
namespace OpenSim.Region.Communications.Local
|
namespace OpenSim.Region.Communications.Local
|
||||||
{
|
{
|
||||||
|
@ -79,44 +80,54 @@ namespace OpenSim.Region.Communications.Local
|
||||||
switch (cmmdParams[0])
|
switch (cmmdParams[0])
|
||||||
{
|
{
|
||||||
case "user":
|
case "user":
|
||||||
string tempfirstname;
|
string firstName;
|
||||||
string templastname;
|
string lastName;
|
||||||
string tempMD5Passwd;
|
string password;
|
||||||
uint regX = 1000;
|
uint regX = 1000;
|
||||||
uint regY = 1000;
|
uint regY = 1000;
|
||||||
|
|
||||||
if (cmmdParams.Length < 2)
|
if (cmmdParams.Length < 2)
|
||||||
{
|
{
|
||||||
|
|
||||||
tempfirstname = MainLog.Instance.CmdPrompt("First name", "Default");
|
firstName = MainLog.Instance.CmdPrompt("First name", "Default");
|
||||||
templastname = MainLog.Instance.CmdPrompt("Last name", "User");
|
lastName = MainLog.Instance.CmdPrompt("Last name", "User");
|
||||||
tempMD5Passwd = MainLog.Instance.PasswdPrompt("Password");
|
password = MainLog.Instance.PasswdPrompt("Password");
|
||||||
regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X", "1000"));
|
regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X", "1000"));
|
||||||
regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y", "1000"));
|
regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y", "1000"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tempfirstname = cmmdParams[1];
|
firstName = cmmdParams[1];
|
||||||
templastname = cmmdParams[2];
|
lastName = cmmdParams[2];
|
||||||
tempMD5Passwd = cmmdParams[3];
|
password = cmmdParams[3];
|
||||||
regX = Convert.ToUInt32(cmmdParams[4]);
|
regX = Convert.ToUInt32(cmmdParams[4]);
|
||||||
regY = Convert.ToUInt32(cmmdParams[5]);
|
regY = Convert.ToUInt32(cmmdParams[5]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + "");
|
AddUser(firstName, lastName, password, regX, regY);
|
||||||
|
|
||||||
this.UserServices.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
|
|
||||||
UserProfileData userProf = this.UserServer.GetUserProfile(tempfirstname, templastname);
|
|
||||||
if (userProf != null)
|
|
||||||
{
|
|
||||||
this.InvenServices.CreateNewUserInventory(userProf.UUID);
|
|
||||||
Console.WriteLine("Created new inventory set for " + tempfirstname + " " + templastname);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LLUUID AddUser(string firstName, string lastName, string password, uint regX, uint regY)
|
||||||
|
{
|
||||||
|
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + "");
|
||||||
|
|
||||||
|
this.UserServices.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY);
|
||||||
|
UserProfileData userProf = this.UserServer.GetUserProfile(firstName, lastName);
|
||||||
|
if (userProf == null)
|
||||||
|
{
|
||||||
|
return LLUUID.Zero;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.InvenServices.CreateNewUserInventory(userProf.UUID);
|
||||||
|
Console.WriteLine("Created new inventory set for " + firstName + " " + lastName);
|
||||||
|
return userProf.UUID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class LocalSettings
|
public class LocalSettings
|
||||||
{
|
{
|
||||||
public string WelcomeMessage = "";
|
public string WelcomeMessage = "";
|
||||||
|
|
Loading…
Reference in New Issue