diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/OpenSim.RegionServer/RegionInfo.cs | 147 |
1 files changed, 0 insertions, 147 deletions
diff --git a/OpenSim/OpenSim.RegionServer/RegionInfo.cs b/OpenSim/OpenSim.RegionServer/RegionInfo.cs deleted file mode 100644 index d148d0f..0000000 --- a/OpenSim/OpenSim.RegionServer/RegionInfo.cs +++ /dev/null | |||
@@ -1,147 +0,0 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.Net; | ||
5 | using System.Web; | ||
6 | using System.IO; | ||
7 | using OpenSim.Framework.Interfaces; | ||
8 | using OpenSim.Framework.Utilities; | ||
9 | using libsecondlife; | ||
10 | using OpenSim.Framework.Types; | ||
11 | |||
12 | namespace OpenSim | ||
13 | { | ||
14 | public class RegionInfo : RegionInfoBase | ||
15 | { | ||
16 | |||
17 | private bool isSandbox; | ||
18 | |||
19 | public string DataStore; | ||
20 | |||
21 | public RegionInfo() | ||
22 | { | ||
23 | |||
24 | } | ||
25 | |||
26 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | ||
27 | { | ||
28 | this.isSandbox = sandboxMode; | ||
29 | try | ||
30 | { | ||
31 | // Sim UUID | ||
32 | string attri = ""; | ||
33 | attri = configData.GetAttribute("SimUUID"); | ||
34 | if (attri == "") | ||
35 | { | ||
36 | this.SimUUID = LLUUID.Random(); | ||
37 | configData.SetAttribute("SimUUID", this.SimUUID.ToString()); | ||
38 | } | ||
39 | else | ||
40 | { | ||
41 | this.SimUUID = new LLUUID(attri); | ||
42 | } | ||
43 | |||
44 | // Sim name | ||
45 | attri = ""; | ||
46 | attri = configData.GetAttribute("SimName"); | ||
47 | if (attri == "") | ||
48 | { | ||
49 | this.RegionName = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Name", "OpenSim test"); | ||
50 | configData.SetAttribute("SimName", this.RegionName); | ||
51 | } | ||
52 | else | ||
53 | { | ||
54 | this.RegionName = attri; | ||
55 | } | ||
56 | // Sim/Grid location X | ||
57 | attri = ""; | ||
58 | attri = configData.GetAttribute("SimLocationX"); | ||
59 | if (attri == "") | ||
60 | { | ||
61 | string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location X", "997"); | ||
62 | configData.SetAttribute("SimLocationX", location); | ||
63 | this.RegionLocX = (uint)Convert.ToUInt32(location); | ||
64 | } | ||
65 | else | ||
66 | { | ||
67 | this.RegionLocX = (uint)Convert.ToUInt32(attri); | ||
68 | } | ||
69 | // Sim/Grid location Y | ||
70 | attri = ""; | ||
71 | attri = configData.GetAttribute("SimLocationY"); | ||
72 | if (attri == "") | ||
73 | { | ||
74 | string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location Y", "996"); | ||
75 | configData.SetAttribute("SimLocationY", location); | ||
76 | this.RegionLocY = (uint)Convert.ToUInt32(location); | ||
77 | } | ||
78 | else | ||
79 | { | ||
80 | this.RegionLocY = (uint)Convert.ToUInt32(attri); | ||
81 | } | ||
82 | |||
83 | // Local storage datastore | ||
84 | attri = ""; | ||
85 | attri = configData.GetAttribute("Datastore"); | ||
86 | if (attri == "") | ||
87 | { | ||
88 | string datastore = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Filename for local storage", "localworld.yap"); | ||
89 | configData.SetAttribute("Datastore", datastore); | ||
90 | this.DataStore = datastore; | ||
91 | } | ||
92 | else | ||
93 | { | ||
94 | this.DataStore = attri; | ||
95 | } | ||
96 | |||
97 | //Sim Listen Port | ||
98 | attri = ""; | ||
99 | attri = configData.GetAttribute("SimListenPort"); | ||
100 | if (attri == "") | ||
101 | { | ||
102 | string port = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("UDP port for client connections", "9000"); | ||
103 | configData.SetAttribute("SimListenPort", port); | ||
104 | this.IPListenPort = Convert.ToInt32(port); | ||
105 | } | ||
106 | else | ||
107 | { | ||
108 | this.IPListenPort = Convert.ToInt32(attri); | ||
109 | } | ||
110 | //Sim Listen Address | ||
111 | attri = ""; | ||
112 | attri = configData.GetAttribute("SimListenAddress"); | ||
113 | if (attri == "") | ||
114 | { | ||
115 | this.IPListenAddr = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("IP Address to listen on for client connections", "127.0.0.1"); | ||
116 | configData.SetAttribute("SimListenAddress", this.IPListenAddr); | ||
117 | } | ||
118 | else | ||
119 | { | ||
120 | this.IPListenAddr = attri; | ||
121 | } | ||
122 | |||
123 | |||
124 | this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); | ||
125 | |||
126 | configData.Commit(); | ||
127 | } | ||
128 | catch (Exception e) | ||
129 | { | ||
130 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Config.cs:InitConfig() - Exception occured"); | ||
131 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); | ||
132 | } | ||
133 | |||
134 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Sim settings loaded:"); | ||
135 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "UUID: " + this.SimUUID.ToStringHyphenated()); | ||
136 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Name: " + this.RegionName); | ||
137 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); | ||
138 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Region Handle: " + this.RegionHandle.ToString()); | ||
139 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort); | ||
140 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Sandbox Mode? " + isSandbox.ToString()); | ||
141 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Asset URL: " + this.AssetURL); | ||
142 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Asset key: " + this.AssetSendKey); | ||
143 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Grid URL: " + this.GridURL); | ||
144 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Grid key: " + this.GridSendKey); | ||
145 | } | ||
146 | } | ||
147 | } | ||