Skip to content

Commit f96d5eb

Browse files
committed
Redo format of Grids.json so it's a simplier array format.
1 parent 94e78cd commit f96d5eb

4 files changed

Lines changed: 97 additions & 101 deletions

File tree

Grids.json

Lines changed: 67 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,70 @@
11
{
2-
"GridConfig": {
3-
"Grids": {
4-
"Localhost:9000": {
5-
"GridName": "Localhost:9000",
6-
"GridNick": "Localhost",
7-
"LoginURI": "http://localhost:9000",
8-
"slurl_base": "hop://localhost:9000/"
9-
},
10-
"nyxxx": {
11-
"GridName": "nyxxx",
12-
"GridNick": "nyxxx",
13-
"LoginURI": "http://192.168.86.56:9000",
14-
"Platform": "OpenSim",
15-
"slurl_base": "hop://192.168.86.56:9000/"
16-
},
17-
"OpenSim Conference": {
18-
"GridName": "OpenSim Community Conference",
19-
"GridNick": "OpenSimCC",
20-
"LoginURI": "http://cc.opensimulator.org:8002/",
21-
"HelperURI": "http://cc.opensimulator.org/helper/",
22-
"SupportURI": "",
23-
"AccountURI": "http://cc.opensimulator.org:8005/wifi/user/account",
24-
"PasswordURI": "http://cc.opensimulator.org:8005/wifi/forgotpassword",
25-
"WebSite": "http://cc.opensimulator.org:8005/wifi/welcome.html",
26-
"Platform": "OpenSim",
27-
"Slurl_base": "hop://cc.opensimulator.org:8002/"
28-
},
29-
"Kitely": {
30-
"GridName": "Kitely Grid",
31-
"GridNick": "Kitely",
32-
"LoginURI": "http://grid.kitely.com:8002/",
33-
"HelperURI": "http://grid.kitely.com:8002/",
34-
"SupportURI": "",
35-
"Platform": "OpenSim",
36-
"slurl_base": "hop://grid.kitely.com:8002/"
37-
},
38-
"WolfTerritories": {
39-
"GridName": "Wolf Territories Grid",
40-
"GridNick": "WolfTerritories",
41-
"LoginURI": "http://grid.wolfterritories.org:8002/",
42-
"HelperURI": "http://helper.wolfterritories.org/",
43-
"AccountURI": "https://www.wolf-grid.com/index.php?f=newuser",
44-
"WebSite": "https://www.wolf-grid.com",
45-
"Platform": "OpenSim",
46-
"slurl_base": "hop://grid.wolfterritories.org:8002/"
47-
},
48-
"OSGrid": {
49-
"GridName": "OSGrid",
50-
"GridNick": "osgrid",
51-
"HelperURI": "http://helper.osgrid.org/",
52-
"loginpage": "http://www.osgrid.org/splash/",
53-
"LoginURI": "http://login.osgrid.org",
54-
"WebSite": "http://www.osgrid.org/",
55-
"AccountURI": "http://www.osgrid.org/",
56-
"PasswordURI": "http://www.osgrid.org/",
57-
"Platform": "OpenSim",
58-
"slurl_base": "hop://login.osgrid.org/",
59-
"web_profile_url": "http://my.osgrid.org/?name=[AGENT_NAME]"
60-
},
61-
"SecondLife": {
62-
"GridName": "Second Life",
63-
"GridNick": "agni",
64-
"app_slurl_base": "secondlife:///app",
65-
"LoginURI": "https://login.agni.lindenlab.com/cgi-bin/login.cgi",
66-
"HelperURI": "https://secondlife.com/helpers/",
67-
"slurl_base": "http://maps.secondlife.com/secondlife/",
68-
"web_profile_url": "https://my.secondlife.com/"
69-
}
2+
"Grids": [
3+
{
4+
"GridName": "Localhost:9000",
5+
"GridNick": "Localhost",
6+
"LoginURI": "http://localhost:9000",
7+
"slurl_base": "hop://localhost:9000/"
8+
},
9+
{
10+
"GridName": "nyxxx",
11+
"GridNick": "nyxxx",
12+
"LoginURI": "http://192.168.86.56:9000",
13+
"Platform": "OpenSim",
14+
"slurl_base": "hop://192.168.86.56:9000/"
15+
},
16+
{
17+
"GridName": "OpenSim Community Conference",
18+
"GridNick": "OpenSimCC",
19+
"LoginURI": "http://cc.opensimulator.org:8002/",
20+
"HelperURI": "http://cc.opensimulator.org/helper/",
21+
"SupportURI": "",
22+
"AccountURI": "http://cc.opensimulator.org:8005/wifi/user/account",
23+
"PasswordURI": "http://cc.opensimulator.org:8005/wifi/forgotpassword",
24+
"WebSite": "http://cc.opensimulator.org:8005/wifi/welcome.html",
25+
"Platform": "OpenSim",
26+
"Slurl_base": "hop://cc.opensimulator.org:8002/"
27+
},
28+
{
29+
"GridName": "Kitely Grid",
30+
"GridNick": "Kitely",
31+
"LoginURI": "http://grid.kitely.com:8002/",
32+
"HelperURI": "http://grid.kitely.com:8002/",
33+
"SupportURI": "",
34+
"Platform": "OpenSim",
35+
"slurl_base": "hop://grid.kitely.com:8002/"
36+
},
37+
{
38+
"GridName": "Wolf Territories Grid",
39+
"GridNick": "WolfTerritories",
40+
"LoginURI": "http://grid.wolfterritories.org:8002/",
41+
"HelperURI": "http://helper.wolfterritories.org/",
42+
"AccountURI": "https://www.wolf-grid.com/index.php?f=newuser",
43+
"WebSite": "https://www.wolf-grid.com",
44+
"Platform": "OpenSim",
45+
"slurl_base": "hop://grid.wolfterritories.org:8002/"
46+
},
47+
{
48+
"GridName": "OSGrid",
49+
"GridNick": "osgrid",
50+
"HelperURI": "https://helper.osgrid.org/",
51+
"loginpage": "https://www.osgrid.org/splash/",
52+
"LoginURI": "http://login.osgrid.org",
53+
"WebSite": "https://www.osgrid.org/",
54+
"AccountURI": "https://www.osgrid.org/",
55+
"PasswordURI": "https://www.osgrid.org/",
56+
"Platform": "OpenSim",
57+
"slurl_base": "hop://login.osgrid.org/",
58+
"web_profile_url": "http://my.osgrid.org/?name=[AGENT_NAME]"
59+
},
60+
{
61+
"GridName": "Second Life",
62+
"GridNick": "agni",
63+
"app_slurl_base": "secondlife:///app",
64+
"LoginURI": "https://login.agni.lindenlab.com/cgi-bin/login.cgi",
65+
"HelperURI": "https://secondlife.com/helpers/",
66+
"slurl_base": "http://maps.secondlife.com/secondlife/",
67+
"web_profile_url": "https://my.secondlife.com/"
7068
}
71-
}
69+
]
7270
}

appsettings.Debug.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"DWORKQUEUEDETAIL": false,
1010
"DUIDETAIL": true,
1111
"DCOMM": true,
12-
"DCOMMDETAIL": false,
12+
"DCOMMDETAIL": true,
1313
"DWORLD": true,
1414
"DWORLDDETAIL": true,
1515
"DUPDATE": true,

src/KeeKee.Config/GridConfig.cs

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,31 @@
1010
// limitations under the License.
1111

1212
namespace KeeKee.Config {
13-
public class GridConfig {
14-
public static string subSectionName { get; } = "GridConfig";
15-
16-
public class GridDefinition {
17-
public string GridName { get; set; } = "SecondLife";
18-
public string GridNick { get; set; } = "SecondLife";
19-
// URI to use for login. Accepts HTTP POST of login form.
20-
public string LoginURI { get; set; } = "https://login.angi.lindenlab.com/cgi-bin/login.cgi";
21-
// Helper for support
22-
public string? SupportURI { get; set; } = "https://secondlife.com/";
23-
// helper for account management
24-
public string? AccountURI { get; set; } = "https://secondlife.com/";
25-
// Helper for password reset
26-
public string? PasswordURI { get; set; } = "https://secondlife.com/";
27-
// The main website for the grid
28-
public string? WebSite { get; set; } = "https://secondlife.com/";
29-
// Name of the platform (SecondLife, OpenSim, etc)
30-
public string? Platform { get; set; } = "SecondLife";
31-
// Base URL for SLURLs (hop://maps.secondlife.com/secondlife/Region/X/Y/Z)
32-
public string? slurl_base { get; set; } = "hop://maps.secondlife.com/secondlife/";
33-
// Base URL for app SLURLs (secondlife:///app/...)
34-
public string? app_slurl_base { get; set; } = "secondlife:///app";
35-
// Base URL for web profiles. May include "[AGENT_NAME]" to be replaced with avatar name.
36-
public string? web_profile_url { get; set; } = "https://my.secondlife.com/";
37-
}
13+
public class GridConfig : List<GridDefinition> {
14+
public static string subSectionName { get; } = "Grids";
15+
}
3816

39-
public Dictionary<string, GridDefinition> Grids { get; set; } = new Dictionary<string, GridDefinition>();
17+
public class GridDefinition {
18+
public string GridName { get; set; } = "SecondLife";
19+
public string GridNick { get; set; } = "SecondLife";
20+
// URI to use for login. Accepts HTTP POST of login form.
21+
public string LoginURI { get; set; } = "https://login.angi.lindenlab.com/cgi-bin/login.cgi";
22+
// Helper for support
23+
public string? SupportURI { get; set; } = "https://secondlife.com/";
24+
// helper for account management
25+
public string? AccountURI { get; set; } = "https://secondlife.com/";
26+
// Helper for password reset
27+
public string? PasswordURI { get; set; } = "https://secondlife.com/";
28+
// The main website for the grid
29+
public string? WebSite { get; set; } = "https://secondlife.com/";
30+
// Name of the platform (SecondLife, OpenSim, etc)
31+
public string? Platform { get; set; } = "SecondLife";
32+
// Base URL for SLURLs (hop://maps.secondlife.com/secondlife/Region/X/Y/Z)
33+
public string? slurl_base { get; set; } = "hop://maps.secondlife.com/secondlife/";
34+
// Base URL for app SLURLs (secondlife:///app/...)
35+
public string? app_slurl_base { get; set; } = "secondlife:///app";
36+
// Base URL for web profiles. May include "[AGENT_NAME]" to be replaced with avatar name.
37+
public string? web_profile_url { get; set; } = "https://my.secondlife.com/";
4038
}
4139
}
4240

src/KeeKee.World/Grids.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public void SetCurrentGrid(string currentGrid) {
4949
/// </summary>
5050
/// <param name="gridName"></param>
5151
/// <returns></returns>
52-
public GridConfig.GridDefinition? GetGridDefinition(string gridName) {
53-
GridConfig.GridDefinition? ret = null;
52+
public GridDefinition? GetGridDefinition(string gridName) {
53+
GridDefinition? ret = null;
5454
try {
5555
ForEach((gd) => {
5656
if (gd.GridNick.ToLower() == gridName.ToLower())
@@ -65,10 +65,10 @@ public void SetCurrentGrid(string currentGrid) {
6565
}
6666

6767
// Performs an action on each map which describes a grid ("Name", "LoginURL", ...)
68-
public void ForEach(Action<GridConfig.GridDefinition> act) {
68+
public void ForEach(Action<GridDefinition> act) {
6969
try {
70-
foreach (var kvp in m_gridConfig.Value.Grids) {
71-
act(kvp.Value);
70+
foreach (var gd in m_gridConfig.Value.ToArray()) {
71+
act(gd);
7272
}
7373
;
7474
} catch (Exception e) {

0 commit comments

Comments
 (0)