aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/General/NetworkServersInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/General/NetworkServersInfo.cs')
-rw-r--r--OpenSim/Framework/General/NetworkServersInfo.cs94
1 files changed, 94 insertions, 0 deletions
diff --git a/OpenSim/Framework/General/NetworkServersInfo.cs b/OpenSim/Framework/General/NetworkServersInfo.cs
new file mode 100644
index 0000000..358e496
--- /dev/null
+++ b/OpenSim/Framework/General/NetworkServersInfo.cs
@@ -0,0 +1,94 @@
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*/
28using System;
29using OpenSim.Framework.Console;
30using OpenSim.Framework.Interfaces;
31using OpenSim.Framework;
32
33using Nini.Config;
34namespace OpenSim.Framework
35{
36 public class NetworkServersInfo
37 {
38 public string AssetURL = "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/";
39 public string AssetSendKey = "";
40
41 public string GridURL = "";
42 public string GridSendKey = "";
43 public string GridRecvKey = "";
44 public string UserURL = "";
45 public string UserSendKey = "";
46 public string UserRecvKey = "";
47 public bool isSandbox;
48
49 public static int DefaultHttpListenerPort = 9000;
50 public int HttpListenerPort = DefaultHttpListenerPort;
51
52 public static int RemotingListenerPort = 8895;
53
54
55 public NetworkServersInfo()
56 {
57 }
58
59 public NetworkServersInfo(uint defaultHomeLocX, uint defaultHomeLocY)
60 {
61 m_defaultHomeLocX = defaultHomeLocX;
62 m_defaultHomeLocY = defaultHomeLocY;
63 }
64
65 private uint? m_defaultHomeLocX;
66 public uint DefaultHomeLocX
67 {
68 get { return m_defaultHomeLocX.Value; }
69 }
70
71 private uint? m_defaultHomeLocY;
72 public uint DefaultHomeLocY
73 {
74 get { return m_defaultHomeLocY.Value; }
75 }
76
77 public void loadFromConfiguration(IConfigSource config)
78 {
79 m_defaultHomeLocX = (uint)config.Configs["StandAlone"].GetInt("default_location_x", 1000);
80 m_defaultHomeLocY = (uint)config.Configs["StandAlone"].GetInt("default_location_y", 1000);
81
82 HttpListenerPort = config.Configs["Network"].GetInt("http_listener_port", DefaultHttpListenerPort);
83 RemotingListenerPort = config.Configs["Network"].GetInt("remoting_listener_port", RemotingListenerPort);
84 GridURL = config.Configs["Network"].GetString("grid_server_url", "http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString());
85 GridSendKey = config.Configs["Network"].GetString("grid_send_key", "null");
86 GridRecvKey = config.Configs["Network"].GetString("grid_recv_key", "null");
87 UserURL = config.Configs["Network"].GetString("user_server_url", "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString());
88 UserSendKey = config.Configs["Network"].GetString("user_send_key", "null");
89 UserRecvKey = config.Configs["Network"].GetString("user_recv_key", "null");
90 AssetURL = config.Configs["Network"].GetString("asset_server_url", AssetURL);
91
92 }
93 }
94}