mirror of
https://github.com/opensim/opensim.git
synced 2026-06-06 19:35:46 +08:00
Removed asset/user config in grid mode in the region server Added "create user" command in the user server console Begun buggy code to send sim details to the grid at startup Drank whole pack of red bull in one night and made stupid jokes in SVN logs and C# comments
85 lines
3.4 KiB
C#
85 lines
3.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections;
|
|
using System.Xml;
|
|
using System.Text;
|
|
using libsecondlife;
|
|
using Nwc.XmlRpc;
|
|
|
|
namespace OpenSim.Framework.Sims
|
|
{
|
|
public class SimProfile : SimProfileBase
|
|
{
|
|
public SimProfile LoadFromGrid(ulong region_handle, string GridURL, string SendKey, string RecvKey)
|
|
{
|
|
try
|
|
{
|
|
Hashtable GridReqParams = new Hashtable();
|
|
GridReqParams["region_handle"] = region_handle.ToString();
|
|
GridReqParams["authkey"] = SendKey;
|
|
ArrayList SendParams = new ArrayList();
|
|
SendParams.Add(GridReqParams);
|
|
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
|
|
|
|
XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
|
|
|
|
Hashtable RespData = (Hashtable)GridResp.Value;
|
|
this.UUID = new LLUUID((string)RespData["UUID"]);
|
|
this.regionhandle = (ulong)Convert.ToUInt64(RespData["regionhandle"]);
|
|
this.regionname = (string)RespData["regionname"];
|
|
this.sim_ip = (string)RespData["sim_ip"];
|
|
this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
|
|
this.caps_url = (string)RespData["caps_url"];
|
|
this.RegionLocX = (uint)Convert.ToUInt32(RespData["RegionLocX"]);
|
|
this.RegionLocY = (uint)Convert.ToUInt32(RespData["RegionLocY"]);
|
|
this.sendkey = (string)RespData["sendkey"];
|
|
this.recvkey = (string)RespData["recvkey"];
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Console.WriteLine(e.ToString());
|
|
}
|
|
return this;
|
|
}
|
|
|
|
public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey)
|
|
{
|
|
try
|
|
{
|
|
Hashtable GridReqParams = new Hashtable();
|
|
GridReqParams["UUID"] = UUID.ToString();
|
|
GridReqParams["caller"] = "userserver";
|
|
GridReqParams["authkey"] = SendKey;
|
|
ArrayList SendParams = new ArrayList();
|
|
SendParams.Add(GridReqParams);
|
|
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
|
|
|
|
XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
|
|
|
|
Hashtable RespData = (Hashtable)GridResp.Value;
|
|
this.UUID = new LLUUID((string)RespData["UUID"]);
|
|
this.regionhandle = (ulong)Convert.ToUInt64(RespData["regionhandle"]);
|
|
this.regionname = (string)RespData["regionname"];
|
|
this.sim_ip = (string)RespData["sim_ip"];
|
|
this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
|
|
this.caps_url = (string)RespData["caps_url"];
|
|
this.RegionLocX = (uint)Convert.ToUInt32(RespData["RegionLocX"]);
|
|
this.RegionLocY = (uint)Convert.ToUInt32(RespData["RegionLocY"]);
|
|
this.sendkey = (string)RespData["sendkey"];
|
|
this.recvkey = (string)RespData["recvkey"];
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Console.WriteLine(e.ToString());
|
|
}
|
|
return this;
|
|
}
|
|
|
|
|
|
public SimProfile()
|
|
{
|
|
}
|
|
}
|
|
|
|
}
|