diff options
Fixed bug where client crashes on login if in sandbox mode and region is set to anything other than 997,996
-rw-r--r-- | OpenSim.RegionServer/OpenSimMain.cs | 2 | ||||
-rw-r--r-- | OpenSim.Servers/LocalUserProfileManager.cs | 10 | ||||
-rw-r--r-- | OpenSim.Servers/LoginResponse.cs | 9 | ||||
-rw-r--r-- | OpenSim.Servers/LoginServer.cs | 10 |
4 files changed, 23 insertions, 8 deletions
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs index af88d24..8d89c6a 100644 --- a/OpenSim.RegionServer/OpenSimMain.cs +++ b/OpenSim.RegionServer/OpenSimMain.cs | |||
@@ -330,7 +330,7 @@ namespace OpenSim | |||
330 | bool sandBoxWithLoginServer = m_loginserver && m_sandbox; | 330 | bool sandBoxWithLoginServer = m_loginserver && m_sandbox; |
331 | if (sandBoxWithLoginServer) | 331 | if (sandBoxWithLoginServer) |
332 | { | 332 | { |
333 | loginServer = new LoginServer(gridServer, regionData.IPListenAddr, regionData.IPListenPort, this.user_accounts); | 333 | loginServer = new LoginServer(gridServer, regionData.IPListenAddr, regionData.IPListenPort,regionData.RegionLocX, regionData.RegionLocY, this.user_accounts); |
334 | loginServer.Startup(); | 334 | loginServer.Startup(); |
335 | 335 | ||
336 | if (user_accounts) | 336 | if (user_accounts) |
diff --git a/OpenSim.Servers/LocalUserProfileManager.cs b/OpenSim.Servers/LocalUserProfileManager.cs index 989af22..2a119c5 100644 --- a/OpenSim.Servers/LocalUserProfileManager.cs +++ b/OpenSim.Servers/LocalUserProfileManager.cs | |||
@@ -43,12 +43,16 @@ namespace OpenSim.UserServer | |||
43 | private IGridServer m_gridServer; | 43 | private IGridServer m_gridServer; |
44 | private int m_port; | 44 | private int m_port; |
45 | private string m_ipAddr; | 45 | private string m_ipAddr; |
46 | private uint regionX; | ||
47 | private uint regionY; | ||
46 | 48 | ||
47 | public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr) | 49 | public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY) |
48 | { | 50 | { |
49 | m_gridServer = gridServer; | 51 | m_gridServer = gridServer; |
50 | m_port = simPort; | 52 | m_port = simPort; |
51 | m_ipAddr = ipAddr; | 53 | m_ipAddr = ipAddr; |
54 | regionX = regX; | ||
55 | regionY = regY; | ||
52 | } | 56 | } |
53 | 57 | ||
54 | public override void InitUserProfiles() | 58 | public override void InitUserProfiles() |
@@ -63,8 +67,8 @@ namespace OpenSim.UserServer | |||
63 | response["home"] = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}"; | 67 | response["home"] = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}"; |
64 | response["sim_port"] = m_port; | 68 | response["sim_port"] = m_port; |
65 | response["sim_ip"] = m_ipAddr; | 69 | response["sim_ip"] = m_ipAddr; |
66 | response["region_y"] = (Int32)996 * 256; | 70 | response["region_y"] = (Int32)regionY* 256; |
67 | response["region_x"] = (Int32)997* 256; | 71 | response["region_x"] = (Int32)regionX* 256; |
68 | 72 | ||
69 | string first; | 73 | string first; |
70 | string last; | 74 | string last; |
diff --git a/OpenSim.Servers/LoginResponse.cs b/OpenSim.Servers/LoginResponse.cs index 4b446d2..5169231 100644 --- a/OpenSim.Servers/LoginResponse.cs +++ b/OpenSim.Servers/LoginResponse.cs | |||
@@ -87,11 +87,16 @@ namespace OpenSim.UserServer | |||
87 | private XmlRpcResponse defaultXmlRpcResponse; | 87 | private XmlRpcResponse defaultXmlRpcResponse; |
88 | private string defaultTextResponse; | 88 | private string defaultTextResponse; |
89 | 89 | ||
90 | public LoginResponse() | 90 | private uint regionX; |
91 | private uint regionY; | ||
92 | |||
93 | public LoginResponse(uint regX, uint regY) | ||
91 | { | 94 | { |
92 | this.loginFlags = new ArrayList(); | 95 | this.loginFlags = new ArrayList(); |
93 | this.globalTextures = new ArrayList(); | 96 | this.globalTextures = new ArrayList(); |
94 | this.SetDefaultValues(); | 97 | this.SetDefaultValues(); |
98 | regionX = regX; | ||
99 | regionY = regY; | ||
95 | } // LoginServer | 100 | } // LoginServer |
96 | 101 | ||
97 | // This will go away as we replace new-login.dat: | 102 | // This will go away as we replace new-login.dat: |
@@ -197,6 +202,8 @@ namespace OpenSim.UserServer | |||
197 | responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | 202 | responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; |
198 | responseData["login-flags"] = this.loginFlags; | 203 | responseData["login-flags"] = this.loginFlags; |
199 | responseData["global-textures"] = this.globalTextures; | 204 | responseData["global-textures"] = this.globalTextures; |
205 | responseData["region_y"] = (Int32)regionY * 256; | ||
206 | responseData["region_x"] = (Int32)regionX * 256; | ||
200 | 207 | ||
201 | return (this.xmlRpcResponse); | 208 | return (this.xmlRpcResponse); |
202 | 209 | ||
diff --git a/OpenSim.Servers/LoginServer.cs b/OpenSim.Servers/LoginServer.cs index c56dbc1..795ce15 100644 --- a/OpenSim.Servers/LoginServer.cs +++ b/OpenSim.Servers/LoginServer.cs | |||
@@ -62,6 +62,8 @@ namespace OpenSim.UserServer | |||
62 | private LocalUserProfileManager userManager; | 62 | private LocalUserProfileManager userManager; |
63 | private int m_simPort; | 63 | private int m_simPort; |
64 | private string m_simAddr; | 64 | private string m_simAddr; |
65 | private uint regionX; | ||
66 | private uint regionY; | ||
65 | 67 | ||
66 | public LocalUserProfileManager LocalUserManager | 68 | public LocalUserProfileManager LocalUserManager |
67 | { | 69 | { |
@@ -71,11 +73,13 @@ namespace OpenSim.UserServer | |||
71 | } | 73 | } |
72 | } | 74 | } |
73 | 75 | ||
74 | public LoginServer(IGridServer gridServer, string simAddr, int simPort, bool useAccounts) | 76 | public LoginServer(IGridServer gridServer, string simAddr, int simPort, uint regX, uint regY, bool useAccounts) |
75 | { | 77 | { |
76 | m_gridServer = gridServer; | 78 | m_gridServer = gridServer; |
77 | m_simPort = simPort; | 79 | m_simPort = simPort; |
78 | m_simAddr = simAddr; | 80 | m_simAddr = simAddr; |
81 | regionX = regX; | ||
82 | regionY = regY; | ||
79 | this.userAccounts = useAccounts; | 83 | this.userAccounts = useAccounts; |
80 | } | 84 | } |
81 | 85 | ||
@@ -97,7 +101,7 @@ namespace OpenSim.UserServer | |||
97 | 101 | ||
98 | this._mpasswd = EncodePassword("testpass"); | 102 | this._mpasswd = EncodePassword("testpass"); |
99 | 103 | ||
100 | userManager = new LocalUserProfileManager(this.m_gridServer, m_simPort, m_simAddr); | 104 | userManager = new LocalUserProfileManager(this.m_gridServer, m_simPort, m_simAddr, regionX, regionY); |
101 | //userManager.InitUserProfiles(); | 105 | //userManager.InitUserProfiles(); |
102 | userManager.SetKeys("", "", "", "Welcome to OpenSim"); | 106 | userManager.SetKeys("", "", "", "Welcome to OpenSim"); |
103 | } | 107 | } |
@@ -112,7 +116,7 @@ namespace OpenSim.UserServer | |||
112 | LLUUID Agent; | 116 | LLUUID Agent; |
113 | LLUUID Session; | 117 | LLUUID Session; |
114 | 118 | ||
115 | LoginResponse loginResponse = new LoginResponse(); | 119 | LoginResponse loginResponse = new LoginResponse(regionX, regionY); |
116 | 120 | ||
117 | //get login name | 121 | //get login name |
118 | if (requestData.Contains("first")) | 122 | if (requestData.Contains("first")) |