mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Make the text mode remote console really work. It can now be used to send
multi-word commands with proper quoting, handles arguments with spaces and allows interactive use, e.g. user creation.
This commit is contained in:
committed by
Melanie
parent
a246cbce8d
commit
a791689ceb
@@ -106,8 +106,15 @@ namespace OpenSim.Framework.Console
|
||||
|
||||
public override string ReadLine(string p, bool isCommand, bool e)
|
||||
{
|
||||
if (isCommand)
|
||||
Output("+++"+p);
|
||||
else
|
||||
Output("-++"+p);
|
||||
|
||||
m_DataEvent.WaitOne();
|
||||
|
||||
string cmdinput;
|
||||
|
||||
lock (m_InputData)
|
||||
{
|
||||
if (m_InputData.Count == 0)
|
||||
@@ -116,29 +123,30 @@ namespace OpenSim.Framework.Console
|
||||
return "";
|
||||
}
|
||||
|
||||
string cmdinput = m_InputData[0];
|
||||
cmdinput = m_InputData[0];
|
||||
m_InputData.RemoveAt(0);
|
||||
if (m_InputData.Count == 0)
|
||||
m_DataEvent.Reset();
|
||||
|
||||
if (isCommand)
|
||||
{
|
||||
string[] cmd = Commands.Resolve(Parser.Parse(cmdinput));
|
||||
|
||||
if (cmd.Length != 0)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0 ; i < cmd.Length ; i++)
|
||||
{
|
||||
if (cmd[i].Contains(" "))
|
||||
cmd[i] = "\"" + cmd[i] + "\"";
|
||||
}
|
||||
return String.Empty;
|
||||
}
|
||||
}
|
||||
return cmdinput;
|
||||
}
|
||||
|
||||
if (isCommand)
|
||||
{
|
||||
string[] cmd = Commands.Resolve(Parser.Parse(cmdinput));
|
||||
|
||||
if (cmd.Length != 0)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0 ; i < cmd.Length ; i++)
|
||||
{
|
||||
if (cmd[i].Contains(" "))
|
||||
cmd[i] = "\"" + cmd[i] + "\"";
|
||||
}
|
||||
return String.Empty;
|
||||
}
|
||||
}
|
||||
return cmdinput;
|
||||
}
|
||||
|
||||
private void DoExpire()
|
||||
@@ -308,7 +316,7 @@ namespace OpenSim.Framework.Console
|
||||
return reply;
|
||||
}
|
||||
|
||||
if (post["COMMAND"] == null || post["COMMAND"].ToString() == String.Empty)
|
||||
if (post["COMMAND"] == null)
|
||||
return reply;
|
||||
|
||||
lock (m_InputData)
|
||||
|
||||
Reference in New Issue
Block a user