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;
|
bool sandBoxWithLoginServer = m_loginserver && m_sandbox;
|
||||||
if (sandBoxWithLoginServer)
|
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();
|
loginServer.Startup();
|
||||||
|
|
||||||
if (user_accounts)
|
if (user_accounts)
|
||||||
|
|
|
@ -43,12 +43,16 @@ namespace OpenSim.UserServer
|
||||||
private IGridServer m_gridServer;
|
private IGridServer m_gridServer;
|
||||||
private int m_port;
|
private int m_port;
|
||||||
private string m_ipAddr;
|
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_gridServer = gridServer;
|
||||||
m_port = simPort;
|
m_port = simPort;
|
||||||
m_ipAddr = ipAddr;
|
m_ipAddr = ipAddr;
|
||||||
|
regionX = regX;
|
||||||
|
regionY = regY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void InitUserProfiles()
|
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["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_port"] = m_port;
|
||||||
response["sim_ip"] = m_ipAddr;
|
response["sim_ip"] = m_ipAddr;
|
||||||
response["region_y"] = (Int32)996 * 256;
|
response["region_y"] = (Int32)regionY* 256;
|
||||||
response["region_x"] = (Int32)997* 256;
|
response["region_x"] = (Int32)regionX* 256;
|
||||||
|
|
||||||
string first;
|
string first;
|
||||||
string last;
|
string last;
|
||||||
|
|
|
@ -87,11 +87,16 @@ namespace OpenSim.UserServer
|
||||||
private XmlRpcResponse defaultXmlRpcResponse;
|
private XmlRpcResponse defaultXmlRpcResponse;
|
||||||
private string defaultTextResponse;
|
private string defaultTextResponse;
|
||||||
|
|
||||||
public LoginResponse()
|
private uint regionX;
|
||||||
|
private uint regionY;
|
||||||
|
|
||||||
|
public LoginResponse(uint regX, uint regY)
|
||||||
{
|
{
|
||||||
this.loginFlags = new ArrayList();
|
this.loginFlags = new ArrayList();
|
||||||
this.globalTextures = new ArrayList();
|
this.globalTextures = new ArrayList();
|
||||||
this.SetDefaultValues();
|
this.SetDefaultValues();
|
||||||
|
regionX = regX;
|
||||||
|
regionY = regY;
|
||||||
} // LoginServer
|
} // LoginServer
|
||||||
|
|
||||||
// This will go away as we replace new-login.dat:
|
// 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["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||||
responseData["login-flags"] = this.loginFlags;
|
responseData["login-flags"] = this.loginFlags;
|
||||||
responseData["global-textures"] = this.globalTextures;
|
responseData["global-textures"] = this.globalTextures;
|
||||||
|
responseData["region_y"] = (Int32)regionY * 256;
|
||||||
|
responseData["region_x"] = (Int32)regionX * 256;
|
||||||
|
|
||||||
return (this.xmlRpcResponse);
|
return (this.xmlRpcResponse);
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,8 @@ namespace OpenSim.UserServer
|
||||||
private LocalUserProfileManager userManager;
|
private LocalUserProfileManager userManager;
|
||||||
private int m_simPort;
|
private int m_simPort;
|
||||||
private string m_simAddr;
|
private string m_simAddr;
|
||||||
|
private uint regionX;
|
||||||
|
private uint regionY;
|
||||||
|
|
||||||
public LocalUserProfileManager LocalUserManager
|
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_gridServer = gridServer;
|
||||||
m_simPort = simPort;
|
m_simPort = simPort;
|
||||||
m_simAddr = simAddr;
|
m_simAddr = simAddr;
|
||||||
|
regionX = regX;
|
||||||
|
regionY = regY;
|
||||||
this.userAccounts = useAccounts;
|
this.userAccounts = useAccounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +101,7 @@ namespace OpenSim.UserServer
|
||||||
|
|
||||||
this._mpasswd = EncodePassword("testpass");
|
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.InitUserProfiles();
|
||||||
userManager.SetKeys("", "", "", "Welcome to OpenSim");
|
userManager.SetKeys("", "", "", "Welcome to OpenSim");
|
||||||
}
|
}
|
||||||
|
@ -112,7 +116,7 @@ namespace OpenSim.UserServer
|
||||||
LLUUID Agent;
|
LLUUID Agent;
|
||||||
LLUUID Session;
|
LLUUID Session;
|
||||||
|
|
||||||
LoginResponse loginResponse = new LoginResponse();
|
LoginResponse loginResponse = new LoginResponse(regionX, regionY);
|
||||||
|
|
||||||
//get login name
|
//get login name
|
||||||
if (requestData.Contains("first"))
|
if (requestData.Contains("first"))
|
||||||
|
|
Loading…
Reference in New Issue