Fixed bug where client crashes on login if in sandbox mode and region is set to anything other than 997,996
parent
9f881f90d3
commit
26002559c0
|
@ -330,7 +330,7 @@ namespace OpenSim
|
|||
bool sandBoxWithLoginServer = m_loginserver && m_sandbox;
|
||||
if (sandBoxWithLoginServer)
|
||||
{
|
||||
loginServer = new LoginServer(gridServer, regionData.IPListenAddr, regionData.IPListenPort, this.user_accounts);
|
||||
loginServer = new LoginServer(gridServer, regionData.IPListenAddr, regionData.IPListenPort,regionData.RegionLocX, regionData.RegionLocY, this.user_accounts);
|
||||
loginServer.Startup();
|
||||
|
||||
if (user_accounts)
|
||||
|
|
|
@ -43,12 +43,16 @@ namespace OpenSim.UserServer
|
|||
private IGridServer m_gridServer;
|
||||
private int m_port;
|
||||
private string m_ipAddr;
|
||||
private uint regionX;
|
||||
private uint regionY;
|
||||
|
||||
public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr)
|
||||
public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY)
|
||||
{
|
||||
m_gridServer = gridServer;
|
||||
m_port = simPort;
|
||||
m_ipAddr = ipAddr;
|
||||
regionX = regX;
|
||||
regionY = regY;
|
||||
}
|
||||
|
||||
public override void InitUserProfiles()
|
||||
|
@ -63,8 +67,8 @@ namespace OpenSim.UserServer
|
|||
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() + "]}";
|
||||
response["sim_port"] = m_port;
|
||||
response["sim_ip"] = m_ipAddr;
|
||||
response["region_y"] = (Int32)996 * 256;
|
||||
response["region_x"] = (Int32)997* 256;
|
||||
response["region_y"] = (Int32)regionY* 256;
|
||||
response["region_x"] = (Int32)regionX* 256;
|
||||
|
||||
string first;
|
||||
string last;
|
||||
|
|
|
@ -87,11 +87,16 @@ namespace OpenSim.UserServer
|
|||
private XmlRpcResponse defaultXmlRpcResponse;
|
||||
private string defaultTextResponse;
|
||||
|
||||
public LoginResponse()
|
||||
private uint regionX;
|
||||
private uint regionY;
|
||||
|
||||
public LoginResponse(uint regX, uint regY)
|
||||
{
|
||||
this.loginFlags = new ArrayList();
|
||||
this.globalTextures = new ArrayList();
|
||||
this.SetDefaultValues();
|
||||
regionX = regX;
|
||||
regionY = regY;
|
||||
} // LoginServer
|
||||
|
||||
// This will go away as we replace new-login.dat:
|
||||
|
@ -197,6 +202,8 @@ namespace OpenSim.UserServer
|
|||
responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
responseData["login-flags"] = this.loginFlags;
|
||||
responseData["global-textures"] = this.globalTextures;
|
||||
responseData["region_y"] = (Int32)regionY * 256;
|
||||
responseData["region_x"] = (Int32)regionX * 256;
|
||||
|
||||
return (this.xmlRpcResponse);
|
||||
|
||||
|
|
|
@ -62,6 +62,8 @@ namespace OpenSim.UserServer
|
|||
private LocalUserProfileManager userManager;
|
||||
private int m_simPort;
|
||||
private string m_simAddr;
|
||||
private uint regionX;
|
||||
private uint regionY;
|
||||
|
||||
public LocalUserProfileManager LocalUserManager
|
||||
{
|
||||
|
@ -71,11 +73,13 @@ namespace OpenSim.UserServer
|
|||
}
|
||||
}
|
||||
|
||||
public LoginServer(IGridServer gridServer, string simAddr, int simPort, bool useAccounts)
|
||||
public LoginServer(IGridServer gridServer, string simAddr, int simPort, uint regX, uint regY, bool useAccounts)
|
||||
{
|
||||
m_gridServer = gridServer;
|
||||
m_simPort = simPort;
|
||||
m_simAddr = simAddr;
|
||||
regionX = regX;
|
||||
regionY = regY;
|
||||
this.userAccounts = useAccounts;
|
||||
}
|
||||
|
||||
|
@ -97,7 +101,7 @@ namespace OpenSim.UserServer
|
|||
|
||||
this._mpasswd = EncodePassword("testpass");
|
||||
|
||||
userManager = new LocalUserProfileManager(this.m_gridServer, m_simPort, m_simAddr);
|
||||
userManager = new LocalUserProfileManager(this.m_gridServer, m_simPort, m_simAddr, regionX, regionY);
|
||||
//userManager.InitUserProfiles();
|
||||
userManager.SetKeys("", "", "", "Welcome to OpenSim");
|
||||
}
|
||||
|
@ -112,7 +116,7 @@ namespace OpenSim.UserServer
|
|||
LLUUID Agent;
|
||||
LLUUID Session;
|
||||
|
||||
LoginResponse loginResponse = new LoginResponse();
|
||||
LoginResponse loginResponse = new LoginResponse(regionX, regionY);
|
||||
|
||||
//get login name
|
||||
if (requestData.Contains("first"))
|
||||
|
|
Loading…
Reference in New Issue