diff options
author | Jeff Ames | 2008-05-01 18:28:32 +0000 |
---|---|---|
committer | Jeff Ames | 2008-05-01 18:28:32 +0000 |
commit | c1e901989ae16f782801aeb12ec12712a2fdd85a (patch) | |
tree | 657d6b24e8dae448eb04a7bc4f10bb4492a4171b | |
parent | * Rolled back a few changes. (diff) | |
download | opensim-SC_OLD-c1e901989ae16f782801aeb12ec12712a2fdd85a.zip opensim-SC_OLD-c1e901989ae16f782801aeb12ec12712a2fdd85a.tar.gz opensim-SC_OLD-c1e901989ae16f782801aeb12ec12712a2fdd85a.tar.bz2 opensim-SC_OLD-c1e901989ae16f782801aeb12ec12712a2fdd85a.tar.xz |
Load grid list in LaunchSLClient from .ini file at run-time.
Add script to build LaunchSLClient.app on OS X.
-rw-r--r-- | OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs | 74 | ||||
-rw-r--r-- | OpenSim/Tools/LaunchSLClient/LaunchSLClient/Grid.cs | 38 | ||||
-rw-r--r-- | OpenSim/Tools/LaunchSLClient/LaunchSLClient/Program.cs | 2 | ||||
-rwxr-xr-x | OpenSim/Tools/LaunchSLClient/make-OSX-app.sh | 38 | ||||
-rw-r--r-- | OpenSim/Tools/LaunchSLClient/prebuild.xml | 1 | ||||
-rw-r--r-- | bin/LaunchSLClient.ini | 15 |
6 files changed, 150 insertions, 18 deletions
diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs index a0eca6e..a827c76 100644 --- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs +++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs | |||
@@ -36,15 +36,12 @@ using System.Drawing; | |||
36 | using System.Text; | 36 | using System.Text; |
37 | using System.Text.RegularExpressions; | 37 | using System.Text.RegularExpressions; |
38 | using System.Windows.Forms; | 38 | using System.Windows.Forms; |
39 | using Nini.Config; | ||
39 | 40 | ||
40 | namespace LaunchSLClient | 41 | namespace LaunchSLClient |
41 | { | 42 | { |
42 | public partial class Form1 : Form | 43 | public partial class Form1 : Form |
43 | { | 44 | { |
44 | const string deepGridUrl = "http://user.deepgrid.com:8002/"; | ||
45 | const string osGridUrl = "http://www.osgrid.org:8002/"; | ||
46 | const string openLifeGridUrl = "http://logingrid.net:8002/"; | ||
47 | |||
48 | string gridUrl = ""; | 45 | string gridUrl = ""; |
49 | string sandboxUrl = ""; | 46 | string sandboxUrl = ""; |
50 | string runUrl = ""; | 47 | string runUrl = ""; |
@@ -53,23 +50,26 @@ namespace LaunchSLClient | |||
53 | string exePath = ""; | 50 | string exePath = ""; |
54 | 51 | ||
55 | private MachineConfig m_machineConfig; | 52 | private MachineConfig m_machineConfig; |
53 | private List<Grid> m_grids = new List<Grid>(); | ||
56 | 54 | ||
57 | public Form1() | 55 | public Form1() |
58 | { | 56 | { |
59 | InitializeComponent(); | 57 | InitializeComponent(); |
60 | ArrayList menuItems = new ArrayList(); | ||
61 | 58 | ||
62 | m_machineConfig = getMachineConfig(); | 59 | m_machineConfig = getMachineConfig(); |
63 | m_machineConfig.GetClient(ref exePath, ref runLine, ref exeFlags); | 60 | m_machineConfig.GetClient(ref exePath, ref runLine, ref exeFlags); |
64 | 61 | ||
62 | initializeGrids(); | ||
63 | |||
64 | ArrayList menuItems = new ArrayList(); | ||
65 | menuItems.Add("Please select one:"); | 65 | menuItems.Add("Please select one:"); |
66 | 66 | ||
67 | addLocalSims(ref menuItems); | 67 | addLocalSims(ref menuItems); |
68 | 68 | ||
69 | menuItems.Add("OSGrid - www.osgrid.org"); | 69 | foreach (Grid grid in m_grids) |
70 | menuItems.Add("DeepGrid - www.deepgrid.com"); | 70 | { |
71 | menuItems.Add("OpenlifeGrid - www.openlifegrid.com"); | 71 | menuItems.Add(grid.Name + " - " + grid.URL); |
72 | menuItems.Add("Linden Labs - www.secondlife.com"); | 72 | } |
73 | 73 | ||
74 | comboBox1.DataSource = menuItems; | 74 | comboBox1.DataSource = menuItems; |
75 | } | 75 | } |
@@ -93,6 +93,27 @@ namespace LaunchSLClient | |||
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | private void initializeGrids() | ||
97 | { | ||
98 | string iniFile = "LaunchSLClient.ini"; | ||
99 | |||
100 | if (!File.Exists(iniFile)) | ||
101 | return; | ||
102 | |||
103 | IniConfigSource configSource = new IniConfigSource(iniFile); | ||
104 | |||
105 | foreach (IConfig config in configSource.Configs) | ||
106 | { | ||
107 | Grid grid = new Grid(); | ||
108 | |||
109 | grid.Name = config.Name; | ||
110 | grid.LoginURI = config.GetString("loginURI", ""); | ||
111 | grid.URL = config.GetString("URL", ""); | ||
112 | |||
113 | m_grids.Add(grid); | ||
114 | } | ||
115 | } | ||
116 | |||
96 | private void addLocalSandbox(ref ArrayList menuItems) | 117 | private void addLocalSandbox(ref ArrayList menuItems) |
97 | { | 118 | { |
98 | // build sandbox URL from Regions/default.xml | 119 | // build sandbox URL from Regions/default.xml |
@@ -134,7 +155,6 @@ namespace LaunchSLClient | |||
134 | private void addLocalGrid(ref ArrayList menuItems) | 155 | private void addLocalGrid(ref ArrayList menuItems) |
135 | { | 156 | { |
136 | //build local grid URL from network_servers_information.xml | 157 | //build local grid URL from network_servers_information.xml |
137 | // this is highly dependant on a standard default.xml | ||
138 | if (File.Exists("network_servers_information.xml")) | 158 | if (File.Exists("network_servers_information.xml")) |
139 | { | 159 | { |
140 | string text; | 160 | string text; |
@@ -180,13 +200,33 @@ namespace LaunchSLClient | |||
180 | 200 | ||
181 | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) | 201 | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) |
182 | { | 202 | { |
183 | if (comboBox1.Text == "Please select one:") { return; } | 203 | if (comboBox1.Text == "Please select one:") |
184 | if (comboBox1.Text == "Local Sandbox") { runUrl=" -loginuri " + sandboxUrl;} | 204 | { |
185 | if (comboBox1.Text == "Local Grid Server") { runUrl = " -loginuri " + gridUrl; } | 205 | return; |
186 | if (comboBox1.Text == "DeepGrid - www.deepgrid.com") { runUrl = " -loginuri " + deepGridUrl; } | 206 | } |
187 | if (comboBox1.Text == "OSGrid - www.osgrid.org") { runUrl = " -loginuri " + osGridUrl; } | 207 | else if (comboBox1.Text == "Local Sandbox") |
188 | if (comboBox1.Text == "OpenlifeGrid - www.openlifegrid.com") { runUrl = " -loginuri " + openLifeGridUrl; } | 208 | { |
189 | if (comboBox1.Text == "Linden Labs - www.secondlife.com") { runUrl = ""; } | 209 | runUrl=" -loginuri " + sandboxUrl; |
210 | } | ||
211 | else if (comboBox1.Text == "Local Grid Server") | ||
212 | { | ||
213 | runUrl = " -loginuri " + gridUrl; | ||
214 | } | ||
215 | else | ||
216 | { | ||
217 | foreach (Grid grid in m_grids) | ||
218 | { | ||
219 | if (comboBox1.Text == grid.Name + " - " + grid.URL) | ||
220 | { | ||
221 | if (grid.LoginURI != string.Empty) | ||
222 | runUrl = " -loginuri " + grid.LoginURI; | ||
223 | else | ||
224 | runUrl = ""; | ||
225 | |||
226 | break; | ||
227 | } | ||
228 | } | ||
229 | } | ||
190 | 230 | ||
191 | System.Diagnostics.Process proc = new System.Diagnostics.Process(); | 231 | System.Diagnostics.Process proc = new System.Diagnostics.Process(); |
192 | proc.StartInfo.FileName = runLine; | 232 | proc.StartInfo.FileName = runLine; |
diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Grid.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Grid.cs new file mode 100644 index 0000000..89fcefe --- /dev/null +++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Grid.cs | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | |||
30 | namespace LaunchSLClient | ||
31 | { | ||
32 | public struct Grid | ||
33 | { | ||
34 | public string Name; | ||
35 | public string LoginURI; | ||
36 | public string URL; | ||
37 | } | ||
38 | } | ||
diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Program.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Program.cs index 1d715a5..53ea9f8 100644 --- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Program.cs +++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Program.cs | |||
@@ -44,7 +44,7 @@ namespace LaunchSLClient | |||
44 | } | 44 | } |
45 | catch (Exception ex) | 45 | catch (Exception ex) |
46 | { | 46 | { |
47 | MessageBox.Show(ex.Message,"Unhandled Error"); | 47 | MessageBox.Show(ex.ToString(), "Error"); |
48 | } | 48 | } |
49 | } | 49 | } |
50 | } | 50 | } |
diff --git a/OpenSim/Tools/LaunchSLClient/make-OSX-app.sh b/OpenSim/Tools/LaunchSLClient/make-OSX-app.sh new file mode 100755 index 0000000..9b9177e --- /dev/null +++ b/OpenSim/Tools/LaunchSLClient/make-OSX-app.sh | |||
@@ -0,0 +1,38 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # This script will build LaunchSLClient.app from the .exe, .dll's, and | ||
4 | # other necessary files. | ||
5 | # | ||
6 | # This should be run from the bin directory. | ||
7 | |||
8 | APP_NAME="LaunchSLClient" | ||
9 | |||
10 | # Note that proper form is to copy Frameworks to | ||
11 | # *.app/Contents/Frameworks, but because @executable_path resolves to | ||
12 | # [...]/Resources/bin, and the libraries reference | ||
13 | # @executable_path/../Frameworks, we put frameworks in | ||
14 | # Contents/Resources instead. | ||
15 | FRAMEWORKS_PATH="${APP_NAME}.app/Contents/Resources/Frameworks" | ||
16 | |||
17 | if [ ! -e ${APP_NAME}.exe ]; then | ||
18 | echo "Error: Could not find ${APP_NAME}.exe." >& 2 | ||
19 | echo "Have you built it, and are you currently in the bin directory?" >& 2 | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
23 | CMDFLAGS="-m console -n ${APP_NAME} -a ${APP_NAME}.exe" | ||
24 | |||
25 | REFERENCES="-r /Library/Frameworks/Mono.framework/Versions/Current/lib/ \ | ||
26 | -r Nini.dll \ | ||
27 | -r ${APP_NAME}.ini" | ||
28 | |||
29 | if [ -f ${APP_NAME}.icns ]; then | ||
30 | CMDFLAGS="${CMDFLAGS} -i ${APP_NAME}.icns" | ||
31 | else | ||
32 | echo "Warning: no icon file found. Will use default application icon." >&2 | ||
33 | fi | ||
34 | |||
35 | if [ -d ${APP_NAME}.app ]; then rm -rf ${APP_NAME}.app; fi | ||
36 | macpack ${REFERENCES} ${CMDFLAGS} | ||
37 | |||
38 | mkdir -p ${FRAMEWORKS_PATH} | ||
diff --git a/OpenSim/Tools/LaunchSLClient/prebuild.xml b/OpenSim/Tools/LaunchSLClient/prebuild.xml index c51d59a..4a13365 100644 --- a/OpenSim/Tools/LaunchSLClient/prebuild.xml +++ b/OpenSim/Tools/LaunchSLClient/prebuild.xml | |||
@@ -57,6 +57,7 @@ | |||
57 | <Reference name="System.Text.RegularExpressions" localCopy="false"/> | 57 | <Reference name="System.Text.RegularExpressions" localCopy="false"/> |
58 | <Reference name="System.Windows.Forms" localCopy="false"/> | 58 | <Reference name="System.Windows.Forms" localCopy="false"/> |
59 | <Reference name="Microsoft.Win32" localCopy="false"/> | 59 | <Reference name="Microsoft.Win32" localCopy="false"/> |
60 | <Reference name="Nini.dll"/> | ||
60 | 61 | ||
61 | <Files> | 62 | <Files> |
62 | <Match pattern="*.cs" recurse="true"/> | 63 | <Match pattern="*.cs" recurse="true"/> |
diff --git a/bin/LaunchSLClient.ini b/bin/LaunchSLClient.ini new file mode 100644 index 0000000..9250a7b --- /dev/null +++ b/bin/LaunchSLClient.ini | |||
@@ -0,0 +1,15 @@ | |||
1 | [DeepGrid] | ||
2 | loginURI = http://user.deepgrid.com:8002/ | ||
3 | URL = www.deepgrid.com | ||
4 | |||
5 | [OSGrid] | ||
6 | loginURI = http://www.osgrid.org:8002/ | ||
7 | URL = www.osgrid.org | ||
8 | |||
9 | [OpenlifeGrid] | ||
10 | loginURI = http://logingrid.net:8002/ | ||
11 | URL = www.openlifegrid.com | ||
12 | |||
13 | [Linden Lab] | ||
14 | loginURI = | ||
15 | URL = www.secondlife.com | ||