From 31b895681aa4ab5874ac68d69a95fe6f9c834879 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 28 Aug 2007 18:09:36 +0000 Subject: As part of our "we aim to please" commitment, have added the ability to create a user in one command line: "create user firstname secondname passwrd regionX regionY". This allows the use of the "command-script" feature. So to add a bunch of new accounts, just create a text file, and add a line as above for each account. Then in the opensim console, type: "command-script filename". --- OpenSim/Region/Application/OpenSimMain.cs | 4 +-- .../Communications/Local/CommunicationsLocal.cs | 33 +++++++++++++++------- 2 files changed, 25 insertions(+), 12 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 8377d84..af21a81 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -52,7 +52,7 @@ using OpenSim.Framework.Utilities; namespace OpenSim { - public delegate void ConsoleCommand(string comParams); + public delegate void ConsoleCommand(string[] comParams); public class OpenSimMain : RegionApplicationBase, conscmd_callback { @@ -455,7 +455,7 @@ namespace OpenSim case "create": if (CreateAccount != null) { - CreateAccount(cmdparams[0]); + CreateAccount(cmdparams); } break; diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 19c8860..97b2fbe 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -43,10 +43,10 @@ namespace OpenSim.Region.Communications.Local public LocalUserServices UserServices; public LocalLoginService LoginServices; public LocalInventoryService InvenServices; - // public CAPSService CapsServices; + // public CAPSService CapsServices; private LocalSettings m_settings; - public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings ) + public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings) : base(serversInfo, httpServer, assetCache) { m_settings = settings; @@ -64,7 +64,7 @@ namespace OpenSim.Region.Communications.Local InterRegion = InstanceServices; //CapsServices = new CAPSService(httpServer); - + LoginServices = new LocalLoginService(UserServices, m_settings.WelcomeMessage, this, serversInfo, m_settings.AccountAuthentication); httpServer.AddXmlRPCHandler("login_to_simulator", LoginServices.XmlRpcLoginMethod); } @@ -74,9 +74,9 @@ namespace OpenSim.Region.Communications.Local this.InstanceServices.AddNewSession(regionHandle, login); } - public void doCreate(string what) + public void doCreate(string[] cmmdParams) { - switch (what) + switch (cmmdParams[0]) { case "user": string tempfirstname; @@ -85,11 +85,24 @@ namespace OpenSim.Region.Communications.Local uint regX = 1000; uint regY = 1000; - tempfirstname = MainLog.Instance.CmdPrompt("First name", "Default"); - templastname = MainLog.Instance.CmdPrompt("Last name", "User"); - tempMD5Passwd = MainLog.Instance.PasswdPrompt("Password"); - regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X", "1000")); - regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y" , "1000")); + if (cmmdParams.Length < 2) + { + + tempfirstname = MainLog.Instance.CmdPrompt("First name", "Default"); + templastname = MainLog.Instance.CmdPrompt("Last name", "User"); + tempMD5Passwd = MainLog.Instance.PasswdPrompt("Password"); + regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X", "1000")); + regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y", "1000")); + } + else + { + tempfirstname = cmmdParams[1]; + templastname = cmmdParams[2]; + tempMD5Passwd = cmmdParams[3]; + regX = Convert.ToUInt32(cmmdParams[4]); + regY = Convert.ToUInt32(cmmdParams[5]); + + } tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + ""); -- cgit v1.1