[Opensim-users] Change console prompt
Gudule Lapointe
gudule at spekuloos.be
Fri Oct 28 16:11:20 UTC 2011
OK, it didn't work the way you said (things "not defined in this context") and after tweaking a bit, it kinda worked, but didn't fetch the values with configSource.Configs
But I think I get it now. Here is what I have done:
added
protected string m_custom_prompt;
in public class OpenSim
and
m_custom_prompt = startupConfig.GetString("custom_prompt", "Region");
after startupConfig (under "if(startupConfig != NULL)
and then
m_console.DefaultPrompt = String.Format("{0} ({1}) ", m_custom_prompt, regionName);
at the original place
Now, I can set up the custom_prompt value in OpenSim.ini or GridCommon.ini, and if it is not set, it defaults to the current "Region" prompt.
In short, I patched OpenSim/Region/Application/OpenSim.cs this way:
58a59
> protected string m_custom_prompt;
110a112
> m_custom_prompt = startupConfig.GetString("custom_prompt", "Region");
831d832
<
834c835
< m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName);
---
> m_console.DefaultPrompt = String.Format("{0} ({1}) ", m_custom_prompt, regionName);
Le 28 oct. 2011 à 16:49, Garmin Kawaguichi a écrit :
>> ----- Original Message ----- From: "Gudule Lapointe" <gudule at spekuloos.be>
>> Sent: Friday, October 28, 2011 4:32 PM
>> Subject: Re: [Opensim-users] Change console prompt
>> In
>> string m_custom_prompt = configSource.Configs["Startup"].GetString("custom_prompt", String.Empty);
>> does "String.Empty" defines the value to use if custom_prompt is not set?
>> In this case, I guess we should use "Region" (the current value) instead?
>
> Yes, it seems to be the "default value"
>
> There is an example of string used as default in OpenSim.cs line 569
> and an example without default value in LoadImageURLModule.cs lines 109-110
>
> GCI
> _______________________________________________
> Opensim-users mailing list
> Opensim-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-users
More information about the Opensim-users
mailing list