0.1-prestable
parent
950389a263
commit
435d61661b
|
@ -90,8 +90,10 @@ namespace OpenSim.Framework.User
|
|||
|
||||
LLUUID AgentID = TheUser.UUID;
|
||||
TheUser.InitSessionData();
|
||||
SimProfile SimInfo = new SimProfile();
|
||||
SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey);
|
||||
|
||||
//for loading data from a grid server, make any changes in CustomiseResponse() (or create a sub class of this and override that method)
|
||||
//SimProfile SimInfo = new SimProfile();
|
||||
//SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey);
|
||||
|
||||
|
||||
Hashtable GlobalT = new Hashtable();
|
||||
|
@ -146,7 +148,7 @@ namespace OpenSim.Framework.User
|
|||
InitialOutfit.Add(InitialOutfitHash);
|
||||
|
||||
uint circode = (uint)(Util.RandomClass.Next());
|
||||
TheUser.AddSimCircuit(circode, SimInfo.UUID);
|
||||
//TheUser.AddSimCircuit(circode, SimInfo.UUID);
|
||||
|
||||
responseData["last_name"] = TheUser.lastname;
|
||||
responseData["ui-config"] = ui_config;
|
||||
|
|
|
@ -39,35 +39,37 @@ namespace OpenSim
|
|||
|
||||
}
|
||||
|
||||
public void SaveToGrid()
|
||||
{
|
||||
string reqtext;
|
||||
reqtext="<authkey>" + this.GridSendKey + "</authkey>";
|
||||
reqtext+="<sim>";
|
||||
reqtext+="<uuid>" + this.SimUUID.ToString() + "</uuid>";
|
||||
reqtext+="<regionname>" + this.RegionName + "</regionname>";
|
||||
reqtext+="<sim_ip>" + this.IPListenAddr + "</sim_ip>";
|
||||
reqtext+="<sim_port>" + this.IPListenPort.ToString() + "</sim_port>";
|
||||
reqtext+="<region_locx>" + this.RegionLocX.ToString() + "</region_locx>";
|
||||
reqtext+="<region_locy>" + this.RegionLocY.ToString() + "</region_locy>";
|
||||
reqtext+="<estate_id>1</estate_id>";
|
||||
reqtext+="</sim>";
|
||||
public void SaveToGrid()
|
||||
{
|
||||
//we really want to keep any server connection code out of here and out of the code code
|
||||
// and put it in the server connection classes (those inheriting from IGridServer etc)
|
||||
string reqtext;
|
||||
reqtext = "<authkey>" + this.GridSendKey + "</authkey>";
|
||||
reqtext += "<sim>";
|
||||
reqtext += "<uuid>" + this.SimUUID.ToString() + "</uuid>";
|
||||
reqtext += "<regionname>" + this.RegionName + "</regionname>";
|
||||
reqtext += "<sim_ip>" + this.IPListenAddr + "</sim_ip>";
|
||||
reqtext += "<sim_port>" + this.IPListenPort.ToString() + "</sim_port>";
|
||||
reqtext += "<region_locx>" + this.RegionLocX.ToString() + "</region_locx>";
|
||||
reqtext += "<region_locy>" + this.RegionLocY.ToString() + "</region_locy>";
|
||||
reqtext += "<estate_id>1</estate_id>";
|
||||
reqtext += "</sim>";
|
||||
|
||||
WebRequest GridSaveReq = WebRequest.Create(this.GridURL + "sims/" + this.SimUUID.ToString());
|
||||
GridSaveReq.Method = "POST";
|
||||
GridSaveReq.ContentType = "text/plaintext";
|
||||
GridSaveReq.ContentLength = reqtext.Length;
|
||||
WebRequest GridSaveReq = WebRequest.Create(this.GridURL + "sims/" + this.SimUUID.ToString());
|
||||
GridSaveReq.Method = "POST";
|
||||
GridSaveReq.ContentType = "text/plaintext";
|
||||
GridSaveReq.ContentLength = reqtext.Length;
|
||||
|
||||
StreamWriter stOut = new StreamWriter(GridSaveReq.GetRequestStream(), System.Text.Encoding.ASCII);
|
||||
stOut.Write(reqtext);
|
||||
stOut.Close();
|
||||
StreamWriter stOut = new StreamWriter(GridSaveReq.GetRequestStream(), System.Text.Encoding.ASCII);
|
||||
stOut.Write(reqtext);
|
||||
stOut.Close();
|
||||
|
||||
StreamReader stIn = new StreamReader(GridSaveReq.GetResponse().GetResponseStream());
|
||||
string GridResponse = stIn.ReadToEnd();
|
||||
stIn.Close();
|
||||
StreamReader stIn = new StreamReader(GridSaveReq.GetResponse().GetResponseStream());
|
||||
string GridResponse = stIn.ReadToEnd();
|
||||
stIn.Close();
|
||||
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse);
|
||||
}
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse);
|
||||
}
|
||||
|
||||
public void InitConfig(bool sandboxMode, IGenericConfig configData)
|
||||
{
|
||||
|
@ -197,7 +199,10 @@ namespace OpenSim
|
|||
|
||||
}
|
||||
this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
|
||||
this.SaveToGrid();
|
||||
if (!this.isSandbox)
|
||||
{
|
||||
this.SaveToGrid();
|
||||
}
|
||||
configData.Commit();
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Loading…
Reference in New Issue