Clean up a bit and added missing files
parent
0b99f56f2b
commit
740a21330e
|
@ -58,15 +58,15 @@ namespace OpenSim.Assets
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public AssetCache( IAssetServer assetServer)
|
public AssetCache(IAssetServer assetServer)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Creating Asset cache");
|
Console.WriteLine("Creating Asset cache");
|
||||||
_assetServer = assetServer;
|
_assetServer = assetServer;
|
||||||
_assetServer.SetReceiver(this);
|
_assetServer.SetReceiver(this);
|
||||||
Assets = new Dictionary<libsecondlife.LLUUID, AssetInfo> ();
|
Assets = new Dictionary<libsecondlife.LLUUID, AssetInfo>();
|
||||||
Textures = new Dictionary<libsecondlife.LLUUID, TextureImage> ();
|
Textures = new Dictionary<libsecondlife.LLUUID, TextureImage>();
|
||||||
IncomingAssets = new Dictionary<libsecondlife.LLUUID, AssetBase>();
|
IncomingAssets = new Dictionary<libsecondlife.LLUUID, AssetBase>();
|
||||||
this._assetCacheThread = new Thread( new ThreadStart(RunAssetManager));
|
this._assetCacheThread = new Thread(new ThreadStart(RunAssetManager));
|
||||||
this._assetCacheThread.IsBackground = true;
|
this._assetCacheThread.IsBackground = true;
|
||||||
this._assetCacheThread.Start();
|
this._assetCacheThread.Start();
|
||||||
|
|
||||||
|
@ -77,14 +77,15 @@ namespace OpenSim.Assets
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void RunAssetManager()
|
public void RunAssetManager()
|
||||||
{
|
{
|
||||||
while(true)
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
try{
|
|
||||||
this.ProcessAssetQueue();
|
this.ProcessAssetQueue();
|
||||||
this.ProcessTextureQueue();
|
this.ProcessTextureQueue();
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine(e.Message);
|
Console.WriteLine(e.Message);
|
||||||
}
|
}
|
||||||
|
@ -96,7 +97,7 @@ namespace OpenSim.Assets
|
||||||
//hack: so we can give each user a set of textures
|
//hack: so we can give each user a set of textures
|
||||||
textureList[0] = new LLUUID("00000000-0000-0000-9999-000000000001");
|
textureList[0] = new LLUUID("00000000-0000-0000-9999-000000000001");
|
||||||
textureList[1] = new LLUUID("00000000-0000-0000-9999-000000000002");
|
textureList[1] = new LLUUID("00000000-0000-0000-9999-000000000002");
|
||||||
for(int i = 0; i< textureList.Length; i++)
|
for (int i = 0; i < textureList.Length; i++)
|
||||||
{
|
{
|
||||||
this._assetServer.RequestAsset(textureList[i], true);
|
this._assetServer.RequestAsset(textureList[i], true);
|
||||||
}
|
}
|
||||||
|
@ -106,9 +107,9 @@ namespace OpenSim.Assets
|
||||||
public AssetBase[] CreateNewInventorySet(LLUUID agentID)
|
public AssetBase[] CreateNewInventorySet(LLUUID agentID)
|
||||||
{
|
{
|
||||||
AssetBase[] inventorySet = new AssetBase[this.textureList.Length];
|
AssetBase[] inventorySet = new AssetBase[this.textureList.Length];
|
||||||
for(int i = 0; i< textureList.Length; i++)
|
for (int i = 0; i < textureList.Length; i++)
|
||||||
{
|
{
|
||||||
if(this.Textures.ContainsKey(textureList[i]))
|
if (this.Textures.ContainsKey(textureList[i]))
|
||||||
{
|
{
|
||||||
inventorySet[i] = this.CloneImage(agentID, this.Textures[textureList[i]]);
|
inventorySet[i] = this.CloneImage(agentID, this.Textures[textureList[i]]);
|
||||||
TextureImage image = new TextureImage(inventorySet[i]);
|
TextureImage image = new TextureImage(inventorySet[i]);
|
||||||
|
@ -123,31 +124,31 @@ namespace OpenSim.Assets
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void ProcessTextureQueue()
|
private void ProcessTextureQueue()
|
||||||
{
|
{
|
||||||
if(this.TextureRequests.Count == 0)
|
if (this.TextureRequests.Count == 0)
|
||||||
{
|
{
|
||||||
//no requests waiting
|
//no requests waiting
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
if(this.TextureRequests.Count < 5)
|
if (this.TextureRequests.Count < 5)
|
||||||
{
|
{
|
||||||
//lower than 5 so do all of them
|
//lower than 5 so do all of them
|
||||||
num = this.TextureRequests.Count;
|
num = this.TextureRequests.Count;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
num=5;
|
num = 5;
|
||||||
}
|
}
|
||||||
AssetRequest req;
|
AssetRequest req;
|
||||||
for(int i = 0; i < num; i++)
|
for (int i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
req=(AssetRequest)this.TextureRequests[i];
|
req = (AssetRequest)this.TextureRequests[i];
|
||||||
|
|
||||||
if(req.PacketCounter == 0)
|
if (req.PacketCounter == 0)
|
||||||
{
|
{
|
||||||
//first time for this request so send imagedata packet
|
//first time for this request so send imagedata packet
|
||||||
if(req.NumPackets == 1)
|
if (req.NumPackets == 1)
|
||||||
{
|
{
|
||||||
//only one packet so send whole file
|
//only one packet so send whole file
|
||||||
ImageDataPacket im = new ImageDataPacket();
|
ImageDataPacket im = new ImageDataPacket();
|
||||||
|
@ -184,10 +185,10 @@ namespace OpenSim.Assets
|
||||||
ImagePacketPacket im = new ImagePacketPacket();
|
ImagePacketPacket im = new ImagePacketPacket();
|
||||||
im.ImageID.Packet = (ushort)req.PacketCounter;
|
im.ImageID.Packet = (ushort)req.PacketCounter;
|
||||||
im.ImageID.ID = req.ImageInfo.FullID;
|
im.ImageID.ID = req.ImageInfo.FullID;
|
||||||
int size = req.ImageInfo.Data.Length - 600 - 1000*(req.PacketCounter - 1);
|
int size = req.ImageInfo.Data.Length - 600 - 1000 * (req.PacketCounter - 1);
|
||||||
if(size > 1000) size = 1000;
|
if (size > 1000) size = 1000;
|
||||||
im.ImageData.Data = new byte[size];
|
im.ImageData.Data = new byte[size];
|
||||||
Array.Copy(req.ImageInfo.Data, 600 + 1000*(req.PacketCounter - 1), im.ImageData.Data, 0, size);
|
Array.Copy(req.ImageInfo.Data, 600 + 1000 * (req.PacketCounter - 1), im.ImageData.Data, 0, size);
|
||||||
req.RequestUser.OutPacket(im);
|
req.RequestUser.OutPacket(im);
|
||||||
req.PacketCounter++;
|
req.PacketCounter++;
|
||||||
//req.ImageInfo.last_used = time;
|
//req.ImageInfo.last_used = time;
|
||||||
|
@ -197,10 +198,10 @@ namespace OpenSim.Assets
|
||||||
|
|
||||||
//remove requests that have been completed
|
//remove requests that have been completed
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for(int i = 0; i < num; i++)
|
for (int i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
req=(AssetRequest)this.TextureRequests[count];
|
req = (AssetRequest)this.TextureRequests[count];
|
||||||
if(req.PacketCounter == req.NumPackets)
|
if (req.PacketCounter == req.NumPackets)
|
||||||
{
|
{
|
||||||
this.TextureRequests.Remove(req);
|
this.TextureRequests.Remove(req);
|
||||||
}
|
}
|
||||||
|
@ -214,17 +215,17 @@ namespace OpenSim.Assets
|
||||||
public void AssetReceived(AssetBase asset, bool IsTexture)
|
public void AssetReceived(AssetBase asset, bool IsTexture)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server
|
if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server
|
||||||
{
|
{
|
||||||
//check if it is a texture or not
|
//check if it is a texture or not
|
||||||
//then add to the correct cache list
|
//then add to the correct cache list
|
||||||
//then check for waiting requests for this asset/texture (in the Requested lists)
|
//then check for waiting requests for this asset/texture (in the Requested lists)
|
||||||
//and move those requests into the Requests list.
|
//and move those requests into the Requests list.
|
||||||
if(IsTexture)
|
if (IsTexture)
|
||||||
{
|
{
|
||||||
TextureImage image = new TextureImage(asset);
|
TextureImage image = new TextureImage(asset);
|
||||||
this.Textures.Add(image.FullID, image);
|
this.Textures.Add(image.FullID, image);
|
||||||
if(this.RequestedTextures.ContainsKey(image.FullID))
|
if (this.RequestedTextures.ContainsKey(image.FullID))
|
||||||
{
|
{
|
||||||
AssetRequest req = this.RequestedTextures[image.FullID];
|
AssetRequest req = this.RequestedTextures[image.FullID];
|
||||||
req.ImageInfo = image;
|
req.ImageInfo = image;
|
||||||
|
@ -236,7 +237,7 @@ namespace OpenSim.Assets
|
||||||
{
|
{
|
||||||
AssetInfo assetInf = new AssetInfo(asset);
|
AssetInfo assetInf = new AssetInfo(asset);
|
||||||
this.Assets.Add(assetInf.FullID, assetInf);
|
this.Assets.Add(assetInf.FullID, assetInf);
|
||||||
if(this.RequestedAssets.ContainsKey(assetInf.FullID))
|
if (this.RequestedAssets.ContainsKey(assetInf.FullID))
|
||||||
{
|
{
|
||||||
AssetRequest req = this.RequestedAssets[assetInf.FullID];
|
AssetRequest req = this.RequestedAssets[assetInf.FullID];
|
||||||
req.AssetInf = assetInf;
|
req.AssetInf = assetInf;
|
||||||
|
@ -263,7 +264,7 @@ namespace OpenSim.Assets
|
||||||
{
|
{
|
||||||
LLUUID requestID = new LLUUID(transferRequest.TransferInfo.Params, 0);
|
LLUUID requestID = new LLUUID(transferRequest.TransferInfo.Params, 0);
|
||||||
//check to see if asset is in local cache, if not we need to request it from asset server.
|
//check to see if asset is in local cache, if not we need to request it from asset server.
|
||||||
if(!this.Assets.ContainsKey(requestID))
|
if (!this.Assets.ContainsKey(requestID))
|
||||||
{
|
{
|
||||||
//not found asset
|
//not found asset
|
||||||
// so request from asset server
|
// so request from asset server
|
||||||
|
@ -271,7 +272,7 @@ namespace OpenSim.Assets
|
||||||
request.RequestUser = userInfo;
|
request.RequestUser = userInfo;
|
||||||
request.RequestAssetID = requestID;
|
request.RequestAssetID = requestID;
|
||||||
request.TransferRequestID = transferRequest.TransferInfo.TransferID;
|
request.TransferRequestID = transferRequest.TransferInfo.TransferID;
|
||||||
this.RequestedAssets.Add(requestID,request);
|
this.RequestedAssets.Add(requestID, request);
|
||||||
this._assetServer.RequestAsset(requestID, false);
|
this._assetServer.RequestAsset(requestID, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -286,10 +287,10 @@ namespace OpenSim.Assets
|
||||||
req.TransferRequestID = transferRequest.TransferInfo.TransferID;
|
req.TransferRequestID = transferRequest.TransferInfo.TransferID;
|
||||||
req.AssetInf = asset;
|
req.AssetInf = asset;
|
||||||
|
|
||||||
if(asset.Data.LongLength>600)
|
if (asset.Data.LongLength > 600)
|
||||||
{
|
{
|
||||||
//over 600 bytes so split up file
|
//over 600 bytes so split up file
|
||||||
req.NumPackets = 1 + (int)(asset.Data.Length-600+999)/1000;
|
req.NumPackets = 1 + (int)(asset.Data.Length - 600 + 999) / 1000;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -304,26 +305,26 @@ namespace OpenSim.Assets
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void ProcessAssetQueue()
|
private void ProcessAssetQueue()
|
||||||
{
|
{
|
||||||
if(this.AssetRequests.Count == 0)
|
if (this.AssetRequests.Count == 0)
|
||||||
{
|
{
|
||||||
//no requests waiting
|
//no requests waiting
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
if(this.AssetRequests.Count < 5)
|
if (this.AssetRequests.Count < 5)
|
||||||
{
|
{
|
||||||
//lower than 5 so do all of them
|
//lower than 5 so do all of them
|
||||||
num = this.AssetRequests.Count;
|
num = this.AssetRequests.Count;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
num=5;
|
num = 5;
|
||||||
}
|
}
|
||||||
AssetRequest req;
|
AssetRequest req;
|
||||||
for(int i = 0; i < num; i++)
|
for (int i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
req=(AssetRequest)this.AssetRequests[i];
|
req = (AssetRequest)this.AssetRequests[i];
|
||||||
|
|
||||||
TransferInfoPacket Transfer = new TransferInfoPacket();
|
TransferInfoPacket Transfer = new TransferInfoPacket();
|
||||||
Transfer.TransferInfo.ChannelType = 2;
|
Transfer.TransferInfo.ChannelType = 2;
|
||||||
|
@ -334,12 +335,12 @@ namespace OpenSim.Assets
|
||||||
Transfer.TransferInfo.TransferID = req.TransferRequestID;
|
Transfer.TransferInfo.TransferID = req.TransferRequestID;
|
||||||
req.RequestUser.OutPacket(Transfer);
|
req.RequestUser.OutPacket(Transfer);
|
||||||
|
|
||||||
if(req.NumPackets == 1)
|
if (req.NumPackets == 1)
|
||||||
{
|
{
|
||||||
TransferPacketPacket TransferPacket = new TransferPacketPacket();
|
TransferPacketPacket TransferPacket = new TransferPacketPacket();
|
||||||
TransferPacket.TransferData.Packet = 0;
|
TransferPacket.TransferData.Packet = 0;
|
||||||
TransferPacket.TransferData.ChannelType = 2;
|
TransferPacket.TransferData.ChannelType = 2;
|
||||||
TransferPacket.TransferData.TransferID=req.TransferRequestID;
|
TransferPacket.TransferData.TransferID = req.TransferRequestID;
|
||||||
TransferPacket.TransferData.Data = req.AssetInf.Data;
|
TransferPacket.TransferData.Data = req.AssetInf.Data;
|
||||||
TransferPacket.TransferData.Status = 1;
|
TransferPacket.TransferData.Status = 1;
|
||||||
req.RequestUser.OutPacket(TransferPacket);
|
req.RequestUser.OutPacket(TransferPacket);
|
||||||
|
@ -350,9 +351,9 @@ namespace OpenSim.Assets
|
||||||
TransferPacketPacket TransferPacket = new TransferPacketPacket();
|
TransferPacketPacket TransferPacket = new TransferPacketPacket();
|
||||||
TransferPacket.TransferData.Packet = 0;
|
TransferPacket.TransferData.Packet = 0;
|
||||||
TransferPacket.TransferData.ChannelType = 2;
|
TransferPacket.TransferData.ChannelType = 2;
|
||||||
TransferPacket.TransferData.TransferID=req.TransferRequestID;
|
TransferPacket.TransferData.TransferID = req.TransferRequestID;
|
||||||
byte[] chunk = new byte[1000];
|
byte[] chunk = new byte[1000];
|
||||||
Array.Copy(req.AssetInf.Data,chunk,1000);
|
Array.Copy(req.AssetInf.Data, chunk, 1000);
|
||||||
TransferPacket.TransferData.Data = chunk;
|
TransferPacket.TransferData.Data = chunk;
|
||||||
TransferPacket.TransferData.Status = 0;
|
TransferPacket.TransferData.Status = 0;
|
||||||
req.RequestUser.OutPacket(TransferPacket);
|
req.RequestUser.OutPacket(TransferPacket);
|
||||||
|
@ -361,7 +362,7 @@ namespace OpenSim.Assets
|
||||||
TransferPacket.TransferData.Packet = 1;
|
TransferPacket.TransferData.Packet = 1;
|
||||||
TransferPacket.TransferData.ChannelType = 2;
|
TransferPacket.TransferData.ChannelType = 2;
|
||||||
TransferPacket.TransferData.TransferID = req.TransferRequestID;
|
TransferPacket.TransferData.TransferID = req.TransferRequestID;
|
||||||
byte[] chunk1 = new byte[(req.AssetInf.Data.Length-1000)];
|
byte[] chunk1 = new byte[(req.AssetInf.Data.Length - 1000)];
|
||||||
Array.Copy(req.AssetInf.Data, 1000, chunk1, 0, chunk1.Length);
|
Array.Copy(req.AssetInf.Data, 1000, chunk1, 0, chunk1.Length);
|
||||||
TransferPacket.TransferData.Data = chunk1;
|
TransferPacket.TransferData.Data = chunk1;
|
||||||
TransferPacket.TransferData.Status = 1;
|
TransferPacket.TransferData.Status = 1;
|
||||||
|
@ -371,7 +372,7 @@ namespace OpenSim.Assets
|
||||||
}
|
}
|
||||||
|
|
||||||
//remove requests that have been completed
|
//remove requests that have been completed
|
||||||
for(int i = 0; i < num; i++)
|
for (int i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
this.AssetRequests.RemoveAt(0);
|
this.AssetRequests.RemoveAt(0);
|
||||||
}
|
}
|
||||||
|
@ -386,7 +387,7 @@ namespace OpenSim.Assets
|
||||||
newAsset.FullID = LLUUID.Random();
|
newAsset.FullID = LLUUID.Random();
|
||||||
newAsset.Type = sourceAsset.Type;
|
newAsset.Type = sourceAsset.Type;
|
||||||
newAsset.InvType = sourceAsset.InvType;
|
newAsset.InvType = sourceAsset.InvType;
|
||||||
return(newAsset);
|
return (newAsset);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -399,9 +400,9 @@ namespace OpenSim.Assets
|
||||||
public void AddTextureRequest(OpenSimClient userInfo, LLUUID imageID)
|
public void AddTextureRequest(OpenSimClient userInfo, LLUUID imageID)
|
||||||
{
|
{
|
||||||
//check to see if texture is in local cache, if not request from asset server
|
//check to see if texture is in local cache, if not request from asset server
|
||||||
if(!this.Textures.ContainsKey(imageID))
|
if (!this.Textures.ContainsKey(imageID))
|
||||||
{
|
{
|
||||||
if(!this.RequestedTextures.ContainsKey(imageID))
|
if (!this.RequestedTextures.ContainsKey(imageID))
|
||||||
{
|
{
|
||||||
//not is cache so request from asset server
|
//not is cache so request from asset server
|
||||||
AssetRequest request = new AssetRequest();
|
AssetRequest request = new AssetRequest();
|
||||||
|
@ -421,10 +422,10 @@ namespace OpenSim.Assets
|
||||||
req.IsTextureRequest = true;
|
req.IsTextureRequest = true;
|
||||||
req.ImageInfo = imag;
|
req.ImageInfo = imag;
|
||||||
|
|
||||||
if(imag.Data.LongLength>600)
|
if (imag.Data.LongLength > 600)
|
||||||
{
|
{
|
||||||
//over 600 bytes so split up file
|
//over 600 bytes so split up file
|
||||||
req.NumPackets = 1 + (int)(imag.Data.Length-600+999)/1000;
|
req.NumPackets = 1 + (int)(imag.Data.Length - 600 + 999) / 1000;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -438,11 +439,11 @@ namespace OpenSim.Assets
|
||||||
{
|
{
|
||||||
TextureImage newImage = new TextureImage();
|
TextureImage newImage = new TextureImage();
|
||||||
newImage.Data = new byte[source.Data.Length];
|
newImage.Data = new byte[source.Data.Length];
|
||||||
Array.Copy(source.Data,newImage.Data,source.Data.Length);
|
Array.Copy(source.Data, newImage.Data, source.Data.Length);
|
||||||
//newImage.filename = source.filename;
|
//newImage.filename = source.filename;
|
||||||
newImage.FullID = LLUUID.Random();
|
newImage.FullID = LLUUID.Random();
|
||||||
newImage.Name = source.Name;
|
newImage.Name = source.Name;
|
||||||
return(newImage);
|
return (newImage);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -525,11 +526,11 @@ namespace OpenSim.Assets
|
||||||
|
|
||||||
public AssetInfo(AssetBase aBase)
|
public AssetInfo(AssetBase aBase)
|
||||||
{
|
{
|
||||||
Data= aBase.Data;
|
Data = aBase.Data;
|
||||||
FullID = aBase.FullID;
|
FullID = aBase.FullID;
|
||||||
Type = aBase.Type;
|
Type = aBase.Type;
|
||||||
InvType = aBase.InvType;
|
InvType = aBase.InvType;
|
||||||
Name= aBase.Name;
|
Name = aBase.Name;
|
||||||
Description = aBase.Description;
|
Description = aBase.Description;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -543,11 +544,11 @@ namespace OpenSim.Assets
|
||||||
|
|
||||||
public TextureImage(AssetBase aBase)
|
public TextureImage(AssetBase aBase)
|
||||||
{
|
{
|
||||||
Data= aBase.Data;
|
Data = aBase.Data;
|
||||||
FullID = aBase.FullID;
|
FullID = aBase.FullID;
|
||||||
Type = aBase.Type;
|
Type = aBase.Type;
|
||||||
InvType = aBase.InvType;
|
InvType = aBase.InvType;
|
||||||
Name= aBase.Name;
|
Name = aBase.Name;
|
||||||
Description = aBase.Description;
|
Description = aBase.Description;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace OpenSim.Assets
|
||||||
|
|
||||||
public InventoryManager()
|
public InventoryManager()
|
||||||
{
|
{
|
||||||
_agentsInventory = new Dictionary<LLUUID,AgentInventory>();
|
_agentsInventory = new Dictionary<LLUUID, AgentInventory>();
|
||||||
_serverRequests = new List<UserServerRequest>();
|
_serverRequests = new List<UserServerRequest>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ namespace OpenSim.Assets
|
||||||
|
|
||||||
public void ClientLeaving(LLUUID clientID)
|
public void ClientLeaving(LLUUID clientID)
|
||||||
{
|
{
|
||||||
if(this._agentsInventory.ContainsKey(clientID))
|
if (this._agentsInventory.ContainsKey(clientID))
|
||||||
{
|
{
|
||||||
this._agentsInventory.Remove(clientID);
|
this._agentsInventory.Remove(clientID);
|
||||||
}
|
}
|
||||||
|
@ -66,9 +66,9 @@ namespace OpenSim.Assets
|
||||||
public bool CreateNewInventoryFolder(OpenSimClient remoteClient, LLUUID folderID)
|
public bool CreateNewInventoryFolder(OpenSimClient remoteClient, LLUUID folderID)
|
||||||
{
|
{
|
||||||
bool res = false;
|
bool res = false;
|
||||||
if(folderID != LLUUID.Zero) //don't create a folder with a zero id
|
if (folderID != LLUUID.Zero) //don't create a folder with a zero id
|
||||||
{
|
{
|
||||||
if(this._agentsInventory.ContainsKey(remoteClient.AgentID))
|
if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
|
||||||
{
|
{
|
||||||
res = this._agentsInventory[remoteClient.AgentID].CreateNewFolder(folderID);
|
res = this._agentsInventory[remoteClient.AgentID].CreateNewFolder(folderID);
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ namespace OpenSim.Assets
|
||||||
public LLUUID AddNewInventoryItem(OpenSimClient remoteClient, LLUUID folderID, AssetBase asset)
|
public LLUUID AddNewInventoryItem(OpenSimClient remoteClient, LLUUID folderID, AssetBase asset)
|
||||||
{
|
{
|
||||||
LLUUID newItem = null;
|
LLUUID newItem = null;
|
||||||
if(this._agentsInventory.ContainsKey(remoteClient.AgentID))
|
if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
|
||||||
{
|
{
|
||||||
newItem = this._agentsInventory[remoteClient.AgentID].AddToInventory(folderID, asset);
|
newItem = this._agentsInventory[remoteClient.AgentID].AddToInventory(folderID, asset);
|
||||||
}
|
}
|
||||||
|
@ -89,12 +89,12 @@ namespace OpenSim.Assets
|
||||||
|
|
||||||
public void FetchInventoryDescendents(OpenSimClient userInfo, FetchInventoryDescendentsPacket FetchDescend)
|
public void FetchInventoryDescendents(OpenSimClient userInfo, FetchInventoryDescendentsPacket FetchDescend)
|
||||||
{
|
{
|
||||||
if(this._agentsInventory.ContainsKey(userInfo.AgentID))
|
if (this._agentsInventory.ContainsKey(userInfo.AgentID))
|
||||||
{
|
{
|
||||||
AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID];
|
AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID];
|
||||||
if(FetchDescend.InventoryData.FetchItems)
|
if (FetchDescend.InventoryData.FetchItems)
|
||||||
{
|
{
|
||||||
if(agentInventory.Folders.ContainsKey(FetchDescend.InventoryData.FolderID))
|
if (agentInventory.Folders.ContainsKey(FetchDescend.InventoryData.FolderID))
|
||||||
{
|
{
|
||||||
InventoryFolder Folder = agentInventory.Folders[FetchDescend.InventoryData.FolderID];
|
InventoryFolder Folder = agentInventory.Folders[FetchDescend.InventoryData.FolderID];
|
||||||
InventoryDescendentsPacket Descend = new InventoryDescendentsPacket();
|
InventoryDescendentsPacket Descend = new InventoryDescendentsPacket();
|
||||||
|
@ -106,31 +106,31 @@ namespace OpenSim.Assets
|
||||||
|
|
||||||
|
|
||||||
Descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[Folder.Items.Count];
|
Descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[Folder.Items.Count];
|
||||||
for(int i = 0; i < Folder.Items.Count ; i++)
|
for (int i = 0; i < Folder.Items.Count; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryItem Item=Folder.Items[i];
|
InventoryItem Item = Folder.Items[i];
|
||||||
Descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock();
|
Descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock();
|
||||||
Descend.ItemData[i].ItemID = Item.ItemID;
|
Descend.ItemData[i].ItemID = Item.ItemID;
|
||||||
Descend.ItemData[i].AssetID = Item.AssetID;
|
Descend.ItemData[i].AssetID = Item.AssetID;
|
||||||
Descend.ItemData[i].CreatorID = Item.CreatorID;
|
Descend.ItemData[i].CreatorID = Item.CreatorID;
|
||||||
Descend.ItemData[i].BaseMask = FULL_MASK_PERMISSIONS;
|
Descend.ItemData[i].BaseMask = FULL_MASK_PERMISSIONS;
|
||||||
Descend.ItemData[i].CreationDate = 1000;
|
Descend.ItemData[i].CreationDate = 1000;
|
||||||
Descend.ItemData[i].Description = _enc.GetBytes(Item.Description+"\0");
|
Descend.ItemData[i].Description = _enc.GetBytes(Item.Description + "\0");
|
||||||
Descend.ItemData[i].EveryoneMask = FULL_MASK_PERMISSIONS;
|
Descend.ItemData[i].EveryoneMask = FULL_MASK_PERMISSIONS;
|
||||||
Descend.ItemData[i].Flags = 1;
|
Descend.ItemData[i].Flags = 1;
|
||||||
Descend.ItemData[i].FolderID = Item.FolderID;
|
Descend.ItemData[i].FolderID = Item.FolderID;
|
||||||
Descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
|
Descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
|
||||||
Descend.ItemData[i].GroupMask = FULL_MASK_PERMISSIONS;
|
Descend.ItemData[i].GroupMask = FULL_MASK_PERMISSIONS;
|
||||||
Descend.ItemData[i].InvType = Item.InvType;
|
Descend.ItemData[i].InvType = Item.InvType;
|
||||||
Descend.ItemData[i].Name = _enc.GetBytes(Item.Name+"\0");
|
Descend.ItemData[i].Name = _enc.GetBytes(Item.Name + "\0");
|
||||||
Descend.ItemData[i].NextOwnerMask = FULL_MASK_PERMISSIONS;
|
Descend.ItemData[i].NextOwnerMask = FULL_MASK_PERMISSIONS;
|
||||||
Descend.ItemData[i].OwnerID = Item.OwnerID;
|
Descend.ItemData[i].OwnerID = Item.OwnerID;
|
||||||
Descend.ItemData[i].OwnerMask = FULL_MASK_PERMISSIONS;
|
Descend.ItemData[i].OwnerMask = FULL_MASK_PERMISSIONS;
|
||||||
Descend.ItemData[i].SalePrice = 100;
|
Descend.ItemData[i].SalePrice = 100;
|
||||||
Descend.ItemData[i].SaleType = 0;
|
Descend.ItemData[i].SaleType = 0;
|
||||||
Descend.ItemData[i].Type = Item.Type;
|
Descend.ItemData[i].Type = Item.Type;
|
||||||
Descend.ItemData[i].CRC=libsecondlife.Helpers.InventoryCRC(1000, 0, Descend.ItemData[i].InvType, Descend.ItemData[i].Type, Descend.ItemData[i].AssetID, Descend.ItemData[i].GroupID, 100, Descend.ItemData[i].OwnerID, Descend.ItemData[i].CreatorID, Descend.ItemData[i].ItemID, Descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
|
Descend.ItemData[i].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, Descend.ItemData[i].InvType, Descend.ItemData[i].Type, Descend.ItemData[i].AssetID, Descend.ItemData[i].GroupID, 100, Descend.ItemData[i].OwnerID, Descend.ItemData[i].CreatorID, Descend.ItemData[i].ItemID, Descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
|
||||||
}
|
}
|
||||||
userInfo.OutPacket(Descend);
|
userInfo.OutPacket(Descend);
|
||||||
|
|
||||||
|
@ -145,13 +145,13 @@ namespace OpenSim.Assets
|
||||||
|
|
||||||
public void FetchInventory(OpenSimClient userInfo, FetchInventoryPacket FetchItems)
|
public void FetchInventory(OpenSimClient userInfo, FetchInventoryPacket FetchItems)
|
||||||
{
|
{
|
||||||
if(this._agentsInventory.ContainsKey(userInfo.AgentID))
|
if (this._agentsInventory.ContainsKey(userInfo.AgentID))
|
||||||
{
|
{
|
||||||
AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID];
|
AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID];
|
||||||
|
|
||||||
for(int i = 0; i < FetchItems.InventoryData.Length; i++)
|
for (int i = 0; i < FetchItems.InventoryData.Length; i++)
|
||||||
{
|
{
|
||||||
if(agentInventory.Items.ContainsKey(FetchItems.InventoryData[i].ItemID))
|
if (agentInventory.Items.ContainsKey(FetchItems.InventoryData[i].ItemID))
|
||||||
{
|
{
|
||||||
InventoryItem Item = agentInventory.Items[FetchItems.InventoryData[i].ItemID];
|
InventoryItem Item = agentInventory.Items[FetchItems.InventoryData[i].ItemID];
|
||||||
FetchInventoryReplyPacket InventoryReply = new FetchInventoryReplyPacket();
|
FetchInventoryReplyPacket InventoryReply = new FetchInventoryReplyPacket();
|
||||||
|
@ -163,14 +163,14 @@ namespace OpenSim.Assets
|
||||||
InventoryReply.InventoryData[0].CreatorID = Item.CreatorID;
|
InventoryReply.InventoryData[0].CreatorID = Item.CreatorID;
|
||||||
InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS;
|
InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS;
|
||||||
InventoryReply.InventoryData[0].CreationDate = 1000;
|
InventoryReply.InventoryData[0].CreationDate = 1000;
|
||||||
InventoryReply.InventoryData[0].Description = _enc.GetBytes( Item.Description+"\0");
|
InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0");
|
||||||
InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
|
InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
|
||||||
InventoryReply.InventoryData[0].Flags = 1;
|
InventoryReply.InventoryData[0].Flags = 1;
|
||||||
InventoryReply.InventoryData[0].FolderID = Item.FolderID;
|
InventoryReply.InventoryData[0].FolderID = Item.FolderID;
|
||||||
InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
|
InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
|
||||||
InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
|
InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
|
||||||
InventoryReply.InventoryData[0].InvType = Item.InvType;
|
InventoryReply.InventoryData[0].InvType = Item.InvType;
|
||||||
InventoryReply.InventoryData[0].Name = _enc.GetBytes(Item.Name+"\0");
|
InventoryReply.InventoryData[0].Name = _enc.GetBytes(Item.Name + "\0");
|
||||||
InventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS;
|
InventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS;
|
||||||
InventoryReply.InventoryData[0].OwnerID = Item.OwnerID;
|
InventoryReply.InventoryData[0].OwnerID = Item.OwnerID;
|
||||||
InventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS;
|
InventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS;
|
||||||
|
@ -199,7 +199,7 @@ namespace OpenSim.Assets
|
||||||
Folders = new Dictionary<LLUUID, InventoryFolder>();
|
Folders = new Dictionary<LLUUID, InventoryFolder>();
|
||||||
Items = new Dictionary<LLUUID, InventoryItem>();
|
Items = new Dictionary<LLUUID, InventoryItem>();
|
||||||
Wearables = new AvatarWearable[2];
|
Wearables = new AvatarWearable[2];
|
||||||
for(int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
Wearables[i] = new AvatarWearable();
|
Wearables[i] = new AvatarWearable();
|
||||||
}
|
}
|
||||||
|
@ -212,12 +212,12 @@ namespace OpenSim.Assets
|
||||||
Folder.OwnerID = this.AgentID;
|
Folder.OwnerID = this.AgentID;
|
||||||
this.Folders.Add(Folder.FolderID, Folder);
|
this.Folders.Add(Folder.FolderID, Folder);
|
||||||
|
|
||||||
return(true);
|
return (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LLUUID AddToInventory( LLUUID folderID, AssetBase asset)
|
public LLUUID AddToInventory(LLUUID folderID, AssetBase asset)
|
||||||
{
|
{
|
||||||
if(this.Folders.ContainsKey(folderID))
|
if (this.Folders.ContainsKey(folderID))
|
||||||
{
|
{
|
||||||
LLUUID NewItemID = LLUUID.Random();
|
LLUUID NewItemID = LLUUID.Random();
|
||||||
|
|
||||||
|
@ -233,11 +233,11 @@ namespace OpenSim.Assets
|
||||||
this.Items.Add(Item.ItemID, Item);
|
this.Items.Add(Item.ItemID, Item);
|
||||||
InventoryFolder Folder = Folders[Item.FolderID];
|
InventoryFolder Folder = Folders[Item.FolderID];
|
||||||
Folder.Items.Add(Item);
|
Folder.Items.Add(Item);
|
||||||
return(Item.ItemID);
|
return (Item.ItemID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return(null);
|
return (null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,175 @@
|
||||||
|
/*
|
||||||
|
Copyright (c) OpenSimCAPS project, http://osgrid.org/
|
||||||
|
|
||||||
|
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the <organization> nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Text;
|
||||||
|
using Nwc.XmlRpc;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Net;
|
||||||
|
using System.IO;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using libsecondlife;
|
||||||
|
using ServerConsole;
|
||||||
|
using OpenSim.GridServers;
|
||||||
|
|
||||||
|
namespace OpenSim
|
||||||
|
{
|
||||||
|
// Dummy HTTP server, does nothing useful for now
|
||||||
|
|
||||||
|
public class SimCAPSHTTPServer
|
||||||
|
{
|
||||||
|
public Thread HTTPD;
|
||||||
|
public HttpListener Listener;
|
||||||
|
|
||||||
|
public SimCAPSHTTPServer()
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("Starting up HTTP Server");
|
||||||
|
HTTPD = new Thread(new ThreadStart(StartHTTP));
|
||||||
|
HTTPD.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartHTTP()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("SimHttp.cs:StartHTTP() - Spawned main thread OK");
|
||||||
|
Listener = new HttpListener();
|
||||||
|
|
||||||
|
Listener.Prefixes.Add("http://+:" + OpenSim_Main.cfg.IPListenPort + "/");
|
||||||
|
Listener.Start();
|
||||||
|
|
||||||
|
HttpListenerContext context;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
context = Listener.GetContext();
|
||||||
|
ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine(e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static string ParseXMLRPC(string requestBody)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
|
||||||
|
|
||||||
|
Hashtable requestData = (Hashtable)request.Params[0];
|
||||||
|
switch (request.MethodName)
|
||||||
|
{
|
||||||
|
case "expect_user":
|
||||||
|
GridServers.agentcircuitdata agent_data = new GridServers.agentcircuitdata();
|
||||||
|
agent_data.SessionID = new LLUUID((string)requestData["session_id"]);
|
||||||
|
agent_data.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
|
||||||
|
agent_data.firstname = (string)requestData["firstname"];
|
||||||
|
agent_data.lastname = (string)requestData["lastname"];
|
||||||
|
agent_data.AgentID = new LLUUID((string)requestData["agent_id"]);
|
||||||
|
agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
|
||||||
|
if (OpenSim_Main.gridServers.GridServer.GetName() == "Remote")
|
||||||
|
{
|
||||||
|
((RemoteGridBase)OpenSim_Main.gridServers.GridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data);
|
||||||
|
}
|
||||||
|
return "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e.ToString());
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
static string ParseREST(string requestBody, string requestURL)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
static string ParseLLSDXML(string requestBody)
|
||||||
|
{
|
||||||
|
// dummy function for now - IMPLEMENT ME!
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
static void HandleRequest(Object stateinfo)
|
||||||
|
{
|
||||||
|
HttpListenerContext context = (HttpListenerContext)stateinfo;
|
||||||
|
|
||||||
|
HttpListenerRequest request = context.Request;
|
||||||
|
HttpListenerResponse response = context.Response;
|
||||||
|
|
||||||
|
response.KeepAlive = false;
|
||||||
|
response.SendChunked = false;
|
||||||
|
|
||||||
|
System.IO.Stream body = request.InputStream;
|
||||||
|
System.Text.Encoding encoding = System.Text.Encoding.UTF8;
|
||||||
|
System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding);
|
||||||
|
|
||||||
|
string requestBody = reader.ReadToEnd();
|
||||||
|
body.Close();
|
||||||
|
reader.Close();
|
||||||
|
|
||||||
|
string responseString = "";
|
||||||
|
switch (request.ContentType)
|
||||||
|
{
|
||||||
|
case "text/xml":
|
||||||
|
// must be XML-RPC, so pass to the XML-RPC parser
|
||||||
|
|
||||||
|
responseString = ParseXMLRPC(requestBody);
|
||||||
|
response.AddHeader("Content-type", "text/xml");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "application/xml":
|
||||||
|
// probably LLSD we hope, otherwise it should be ignored by the parser
|
||||||
|
responseString = ParseLLSDXML(requestBody);
|
||||||
|
response.AddHeader("Content-type", "application/xml");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case null:
|
||||||
|
// must be REST or invalid crap, so pass to the REST parser
|
||||||
|
responseString = ParseREST(request.Url.OriginalString, requestBody);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
|
||||||
|
System.IO.Stream output = response.OutputStream;
|
||||||
|
response.SendChunked = false;
|
||||||
|
response.ContentLength64 = buffer.Length;
|
||||||
|
output.Write(buffer, 0, buffer.Length);
|
||||||
|
output.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -8,7 +8,7 @@
|
||||||
<ProjectGuid>{B063760D-DB8D-4F64-B6FE-335FAD1E650A}</ProjectGuid>
|
<ProjectGuid>{B063760D-DB8D-4F64-B6FE-335FAD1E650A}</ProjectGuid>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>..\..\..\bin\</OutputPath>
|
||||||
<Optimize>False</Optimize>
|
<Optimize>False</Optimize>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<DebugSymbols>True</DebugSymbols>
|
<DebugSymbols>True</DebugSymbols>
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>..\..\..\bin\</OutputPath>
|
||||||
<Optimize>True</Optimize>
|
<Optimize>True</Optimize>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<DebugSymbols>False</DebugSymbols>
|
<DebugSymbols>False</DebugSymbols>
|
||||||
|
|
|
@ -32,6 +32,7 @@ using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
using OpenSim;
|
||||||
|
|
||||||
namespace OpenSim.GridServers
|
namespace OpenSim.GridServers
|
||||||
{
|
{
|
||||||
|
@ -40,20 +41,47 @@ namespace OpenSim.GridServers
|
||||||
/// also Sim to Sim connections?
|
/// also Sim to Sim connections?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public interface IGridServer
|
public interface IGridServer
|
||||||
{
|
{
|
||||||
bool RequestConnection();
|
|
||||||
UUIDBlock RequestUUIDBlock();
|
UUIDBlock RequestUUIDBlock();
|
||||||
void RequestNeighbours(); //should return a array of neighbouring regions
|
void RequestNeighbours(); //should return a array of neighbouring regions
|
||||||
AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
|
AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
|
||||||
bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
|
bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
|
||||||
|
string GetName();
|
||||||
|
bool RequestConnection();
|
||||||
void SetServerInfo(string ServerUrl, string ServerKey);
|
void SetServerInfo(string ServerUrl, string ServerKey);
|
||||||
void Close();
|
void Close();
|
||||||
void AddNewSession(Login session); // only used by local version of grid server
|
}
|
||||||
// and didn't use to be part of this interface until we put this in a dll
|
|
||||||
|
public abstract class RemoteGridBase : IGridServer
|
||||||
|
{
|
||||||
|
public abstract Dictionary<uint, agentcircuitdata> agentcircuits
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract UUIDBlock RequestUUIDBlock();
|
||||||
|
public abstract void RequestNeighbours();
|
||||||
|
public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
|
||||||
|
public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
|
||||||
|
public abstract string GetName();
|
||||||
|
public abstract bool RequestConnection();
|
||||||
|
public abstract void SetServerInfo(string ServerUrl, string ServerKey);
|
||||||
|
public abstract void Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract class LocalGridBase : IGridServer
|
||||||
|
{
|
||||||
|
public abstract UUIDBlock RequestUUIDBlock();
|
||||||
|
public abstract void RequestNeighbours();
|
||||||
|
public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
|
||||||
|
public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
|
||||||
|
public abstract string GetName();
|
||||||
|
public abstract bool RequestConnection();
|
||||||
|
public abstract void SetServerInfo(string ServerUrl, string ServerKey);
|
||||||
|
public abstract void AddNewSession(Login session);
|
||||||
|
public abstract void Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct UUIDBlock
|
public struct UUIDBlock
|
||||||
|
@ -92,4 +120,17 @@ namespace OpenSim.GridServers
|
||||||
{
|
{
|
||||||
IGridServer GetGridServer();
|
IGridServer GetGridServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class agentcircuitdata
|
||||||
|
{
|
||||||
|
public agentcircuitdata() { }
|
||||||
|
public LLUUID AgentID;
|
||||||
|
public LLUUID SessionID;
|
||||||
|
public LLUUID SecureSessionID;
|
||||||
|
public string firstname;
|
||||||
|
public string lastname;
|
||||||
|
public uint circuitcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace GridInterfaces
|
||||||
public LLVector3 Scale;
|
public LLVector3 Scale;
|
||||||
public byte PathCurve;
|
public byte PathCurve;
|
||||||
public byte ProfileCurve;
|
public byte ProfileCurve;
|
||||||
public uint ParentID=0;
|
public uint ParentID = 0;
|
||||||
public byte ProfileHollow;
|
public byte ProfileHollow;
|
||||||
public sbyte PathRadiusOffset;
|
public sbyte PathRadiusOffset;
|
||||||
public byte PathRevolutions;
|
public byte PathRevolutions;
|
||||||
|
|
|
@ -140,7 +140,6 @@ namespace OpenSim.GridServers
|
||||||
// ProxyLogin: proxy a login request
|
// ProxyLogin: proxy a login request
|
||||||
private void LoginRequest(StreamReader reader, StreamWriter writer)
|
private void LoginRequest(StreamReader reader, StreamWriter writer)
|
||||||
{
|
{
|
||||||
Console.WriteLine("LoginServer - new Login attempt");
|
|
||||||
lock(this)
|
lock(this)
|
||||||
{
|
{
|
||||||
string line;
|
string line;
|
||||||
|
@ -217,6 +216,21 @@ namespace OpenSim.GridServers
|
||||||
int SessionRand = this.RandomClass.Next(1,999);
|
int SessionRand = this.RandomClass.Next(1,999);
|
||||||
Session = new LLUUID("aaaabbbb-0200-"+SessionRand.ToString("0000")+"-8664-58f53e442797");
|
Session = new LLUUID("aaaabbbb-0200-"+SessionRand.ToString("0000")+"-8664-58f53e442797");
|
||||||
|
|
||||||
|
//create some login info
|
||||||
|
Hashtable LoginFlagsHash = new Hashtable();
|
||||||
|
LoginFlagsHash["daylight_savings"]="N";
|
||||||
|
LoginFlagsHash["stipend_since_login"]="N";
|
||||||
|
LoginFlagsHash["gendered"]="Y";
|
||||||
|
LoginFlagsHash["ever_logged_in"]="Y";
|
||||||
|
ArrayList LoginFlags=new ArrayList();
|
||||||
|
LoginFlags.Add(LoginFlagsHash);
|
||||||
|
|
||||||
|
Hashtable GlobalT = new Hashtable();
|
||||||
|
GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271";
|
||||||
|
GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
|
||||||
|
GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
|
||||||
|
ArrayList GlobalTextures = new ArrayList();
|
||||||
|
GlobalTextures.Add(GlobalT);
|
||||||
|
|
||||||
XmlRpcResponse response =(XmlRpcResponse)(new XmlRpcResponseDeserializer()).Deserialize(this._defaultResponse);
|
XmlRpcResponse response =(XmlRpcResponse)(new XmlRpcResponseDeserializer()).Deserialize(this._defaultResponse);
|
||||||
Hashtable responseData = (Hashtable)response.Value;
|
Hashtable responseData = (Hashtable)response.Value;
|
||||||
|
@ -225,6 +239,11 @@ namespace OpenSim.GridServers
|
||||||
responseData["sim_ip"] = OpenSim_Main.cfg.IPListenAddr;
|
responseData["sim_ip"] = OpenSim_Main.cfg.IPListenAddr;
|
||||||
responseData["agent_id"] = Agent.ToStringHyphenated();
|
responseData["agent_id"] = Agent.ToStringHyphenated();
|
||||||
responseData["session_id"] = Session.ToStringHyphenated();
|
responseData["session_id"] = Session.ToStringHyphenated();
|
||||||
|
responseData["seconds_since_epoch"]=(Int32)(DateTime.UtcNow - new DateTime(1970,1,1)).TotalSeconds;
|
||||||
|
responseData["login-flags"]=LoginFlags;
|
||||||
|
responseData["global-textures"]=GlobalTextures;
|
||||||
|
|
||||||
|
//inventory
|
||||||
ArrayList InventoryList = (ArrayList) responseData["inventory-skeleton"];
|
ArrayList InventoryList = (ArrayList) responseData["inventory-skeleton"];
|
||||||
Hashtable Inventory1 = (Hashtable)InventoryList[0];
|
Hashtable Inventory1 = (Hashtable)InventoryList[0];
|
||||||
Hashtable Inventory2 = (Hashtable)InventoryList[1];
|
Hashtable Inventory2 = (Hashtable)InventoryList[1];
|
||||||
|
@ -232,7 +251,7 @@ namespace OpenSim.GridServers
|
||||||
LLUUID InventoryFolderID = LLUUID.Random();
|
LLUUID InventoryFolderID = LLUUID.Random();
|
||||||
Inventory2["name"] = "Base";
|
Inventory2["name"] = "Base";
|
||||||
Inventory2["folder_id"] = BaseFolderID.ToStringHyphenated();
|
Inventory2["folder_id"] = BaseFolderID.ToStringHyphenated();
|
||||||
Inventory2["type_default"] =0;
|
Inventory2["type_default"] =6;
|
||||||
Inventory1["folder_id"] = InventoryFolderID.ToStringHyphenated();
|
Inventory1["folder_id"] = InventoryFolderID.ToStringHyphenated();
|
||||||
|
|
||||||
ArrayList InventoryRoot = (ArrayList) responseData["inventory-root"];
|
ArrayList InventoryRoot = (ArrayList) responseData["inventory-root"];
|
||||||
|
@ -250,8 +269,11 @@ namespace OpenSim.GridServers
|
||||||
_login.BaseFolder = BaseFolderID;
|
_login.BaseFolder = BaseFolderID;
|
||||||
_login.InventoryFolder = InventoryFolderID;
|
_login.InventoryFolder = InventoryFolderID;
|
||||||
|
|
||||||
//working on local computer so lets add to the gridserver's list of sessions
|
//working on local computer if so lets add to the gridserver's list of sessions?
|
||||||
this._gridServer.AddNewSession(_login);
|
if(OpenSim_Main.gridServers.GridServer.GetName() == "Local")
|
||||||
|
{
|
||||||
|
((LocalGridBase)this._gridServer).AddNewSession(_login);
|
||||||
|
}
|
||||||
|
|
||||||
// forward the XML-RPC response to the client
|
// forward the XML-RPC response to the client
|
||||||
writer.WriteLine("HTTP/1.0 200 OK");
|
writer.WriteLine("HTTP/1.0 200 OK");
|
||||||
|
|
|
@ -240,7 +240,7 @@ namespace LocalGridServers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LocalGridServer :IGridServer
|
public class LocalGridServer : LocalGridBase
|
||||||
{
|
{
|
||||||
public List<Login> Sessions = new List<Login>();
|
public List<Login> Sessions = new List<Login>();
|
||||||
|
|
||||||
|
@ -250,11 +250,17 @@ namespace LocalGridServers
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Local Grid Server class created");
|
ServerConsole.MainConsole.Instance.WriteLine("Local Grid Server class created");
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RequestConnection()
|
public override bool RequestConnection()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
|
|
||||||
|
public override string GetName()
|
||||||
|
{
|
||||||
|
return "Local";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
|
||||||
{
|
{
|
||||||
//we are running local
|
//we are running local
|
||||||
AuthenticateResponse user = new AuthenticateResponse();
|
AuthenticateResponse user = new AuthenticateResponse();
|
||||||
|
@ -274,36 +280,37 @@ namespace LocalGridServers
|
||||||
return(user);
|
return(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
|
public override bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
|
||||||
{
|
{
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUIDBlock RequestUUIDBlock()
|
public override UUIDBlock RequestUUIDBlock()
|
||||||
{
|
{
|
||||||
UUIDBlock uuidBlock = new UUIDBlock();
|
UUIDBlock uuidBlock = new UUIDBlock();
|
||||||
return(uuidBlock);
|
return(uuidBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestNeighbours()
|
public override void RequestNeighbours()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetServerInfo(string ServerUrl, string ServerKey)
|
public override void SetServerInfo(string ServerUrl, string ServerKey)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
public override void Close()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// used by the local login server to inform us of new sessions
|
/// used by the local login server to inform us of new sessions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="session"></param>
|
/// <param name="session"></param>
|
||||||
public void AddNewSession(Login session)
|
public override void AddNewSession(Login session)
|
||||||
{
|
{
|
||||||
lock(this.Sessions)
|
lock(this.Sessions)
|
||||||
{
|
{
|
||||||
|
|
83
src/Main.cs
83
src/Main.cs
|
@ -57,13 +57,14 @@ namespace OpenSim
|
||||||
public static World local_world;
|
public static World local_world;
|
||||||
public static Grid gridServers;
|
public static Grid gridServers;
|
||||||
|
|
||||||
public static Socket Server;
|
public SimCAPSHTTPServer http_server;
|
||||||
private static IPEndPoint ServerIncoming;
|
public Socket Server;
|
||||||
private static byte[] RecvBuffer = new byte[4096];
|
private IPEndPoint ServerIncoming;
|
||||||
|
private byte[] RecvBuffer = new byte[4096];
|
||||||
private byte[] ZeroBuffer = new byte[8192];
|
private byte[] ZeroBuffer = new byte[8192];
|
||||||
private static IPEndPoint ipeSender;
|
private IPEndPoint ipeSender;
|
||||||
private static EndPoint epSender;
|
private EndPoint epSender;
|
||||||
private static AsyncCallback ReceivedData;
|
private AsyncCallback ReceivedData;
|
||||||
|
|
||||||
public AssetCache assetCache;
|
public AssetCache assetCache;
|
||||||
public InventoryManager inventoryManager;
|
public InventoryManager inventoryManager;
|
||||||
|
@ -77,34 +78,38 @@ namespace OpenSim
|
||||||
public bool loginserver = false;
|
public bool loginserver = false;
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
public static void Main( string[] args )
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
|
Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
|
||||||
Console.WriteLine("Starting...\n");
|
Console.WriteLine("Starting...\n");
|
||||||
ServerConsole.MainConsole.Instance = new MServerConsole(ServerConsole.ConsoleBase.ConsoleType.Local,"",0);
|
ServerConsole.MainConsole.Instance = new MServerConsole(ServerConsole.ConsoleBase.ConsoleType.Local, "", 0);
|
||||||
|
|
||||||
sim = new OpenSim_Main();
|
sim = new OpenSim_Main();
|
||||||
|
|
||||||
|
sim.sandbox = false;
|
||||||
|
sim.loginserver = false;
|
||||||
|
sim._physicsEngine = "PhysX";
|
||||||
|
|
||||||
for (int i = 0; i < args.Length; i++)
|
for (int i = 0; i < args.Length; i++)
|
||||||
{
|
{
|
||||||
if(args[i] == "-sandbox")
|
if (args[i] == "-sandbox")
|
||||||
{
|
{
|
||||||
sim.sandbox = true;
|
sim.sandbox = true;
|
||||||
}
|
}
|
||||||
if(args[i] == "-loginserver")
|
|
||||||
|
if (args[i] == "-loginserver")
|
||||||
{
|
{
|
||||||
sim.loginserver = true;
|
sim.loginserver = true;
|
||||||
}
|
}
|
||||||
if(args[i] == "-realphysx")
|
if (args[i] == "-realphysx")
|
||||||
{
|
{
|
||||||
sim._physicsEngine = "RealPhysX";
|
sim._physicsEngine = "RealPhysX";
|
||||||
OpenSim.world.Avatar.PhysicsEngineFlying = true;
|
OpenSim.world.Avatar.PhysicsEngineFlying = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//sim.SetUpAssetDatabase();
|
|
||||||
OpenSim_Main.gridServers = new Grid();
|
OpenSim_Main.gridServers = new Grid();
|
||||||
if(sim.sandbox)
|
if (sim.sandbox)
|
||||||
{
|
{
|
||||||
OpenSim_Main.gridServers.AssetDll = "LocalGridServers.dll";
|
OpenSim_Main.gridServers.AssetDll = "LocalGridServers.dll";
|
||||||
OpenSim_Main.gridServers.GridDll = "LocalGridServers.dll";
|
OpenSim_Main.gridServers.GridDll = "LocalGridServers.dll";
|
||||||
|
@ -119,27 +124,29 @@ namespace OpenSim
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Starting in Grid mode");
|
ServerConsole.MainConsole.Instance.WriteLine("Starting in Grid mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sim.loginserver && sim.sandbox)
|
if (sim.loginserver && sim.sandbox)
|
||||||
{
|
{
|
||||||
LoginServer loginServer = new LoginServer(OpenSim_Main.gridServers.GridServer);
|
LoginServer loginServer = new LoginServer(OpenSim_Main.gridServers.GridServer);
|
||||||
loginServer.Startup();
|
loginServer.Startup();
|
||||||
}
|
}
|
||||||
|
|
||||||
sim.assetCache = new AssetCache(OpenSim_Main.gridServers.AssetServer);
|
sim.assetCache = new AssetCache(OpenSim_Main.gridServers.AssetServer);
|
||||||
sim.inventoryManager = new InventoryManager();
|
sim.inventoryManager = new InventoryManager();
|
||||||
|
|
||||||
sim.Startup();
|
sim.Startup();
|
||||||
|
|
||||||
while(true) {
|
while (true)
|
||||||
|
{
|
||||||
ServerConsole.MainConsole.Instance.MainConsolePrompt();
|
ServerConsole.MainConsole.Instance.MainConsolePrompt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private OpenSim_Main() {
|
private OpenSim_Main()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Startup() {
|
private void Startup()
|
||||||
startuptime=DateTime.Now;
|
{
|
||||||
|
startuptime = DateTime.Now;
|
||||||
|
|
||||||
// We check our local database first, then the grid for config options
|
// We check our local database first, then the grid for config options
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Loading configuration");
|
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Loading configuration");
|
||||||
|
@ -164,13 +171,19 @@ namespace OpenSim
|
||||||
local_world.LoadStorageDLL("Db4LocalStorage.dll"); //all these dll names shouldn't be hard coded.
|
local_world.LoadStorageDLL("Db4LocalStorage.dll"); //all these dll names shouldn't be hard coded.
|
||||||
local_world.LoadPrimsFromStorage();
|
local_world.LoadPrimsFromStorage();
|
||||||
|
|
||||||
|
if (this.sandbox)
|
||||||
|
{
|
||||||
this.assetCache.LoadDefaultTextureSet();
|
this.assetCache.LoadDefaultTextureSet();
|
||||||
MainServerListener();
|
}
|
||||||
|
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Starting CAPS HTTP server");
|
||||||
|
http_server = new SimCAPSHTTPServer();
|
||||||
|
|
||||||
timer1.Enabled = true;
|
timer1.Enabled = true;
|
||||||
timer1.Interval = 100;
|
timer1.Interval = 100;
|
||||||
timer1.Elapsed +=new ElapsedEventHandler( this.Timer1Tick );
|
timer1.Elapsed += new ElapsedEventHandler(this.Timer1Tick);
|
||||||
|
|
||||||
|
MainServerListener();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +215,8 @@ namespace OpenSim
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnReceivedData(IAsyncResult result) {
|
private void OnReceivedData(IAsyncResult result)
|
||||||
|
{
|
||||||
ipeSender = new IPEndPoint(IPAddress.Any, 0);
|
ipeSender = new IPEndPoint(IPAddress.Any, 0);
|
||||||
epSender = (EndPoint)ipeSender;
|
epSender = (EndPoint)ipeSender;
|
||||||
Packet packet = null;
|
Packet packet = null;
|
||||||
|
@ -211,18 +225,24 @@ namespace OpenSim
|
||||||
packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
|
packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
|
||||||
|
|
||||||
// This is either a new client or a packet to send to an old one
|
// This is either a new client or a packet to send to an old one
|
||||||
if(ClientThreads.ContainsKey(epSender)) {
|
if (ClientThreads.ContainsKey(epSender))
|
||||||
|
{
|
||||||
ClientThreads[epSender].InPacket(packet);
|
ClientThreads[epSender].InPacket(packet);
|
||||||
} else if( packet.Type == PacketType.UseCircuitCode ) { // new client
|
}
|
||||||
OpenSimClient newuser = new OpenSimClient(epSender,(UseCircuitCodePacket)packet);
|
else if (packet.Type == PacketType.UseCircuitCode)
|
||||||
|
{ // new client
|
||||||
|
OpenSimClient newuser = new OpenSimClient(epSender, (UseCircuitCodePacket)packet);
|
||||||
ClientThreads.Add(epSender, newuser);
|
ClientThreads.Add(epSender, newuser);
|
||||||
} else { // invalid client
|
}
|
||||||
|
else
|
||||||
|
{ // invalid client
|
||||||
Console.Error.WriteLine("Main.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString());
|
Console.Error.WriteLine("Main.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString());
|
||||||
}
|
}
|
||||||
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
|
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainServerListener() {
|
private void MainServerListener()
|
||||||
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:MainServerListener() - New thread started");
|
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:MainServerListener() - New thread started");
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:MainServerListener() - Opening UDP socket on " + cfg.IPListenAddr + ":" + cfg.IPListenPort);
|
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:MainServerListener() - Opening UDP socket on " + cfg.IPListenAddr + ":" + cfg.IPListenPort);
|
||||||
|
|
||||||
|
@ -233,7 +253,7 @@ namespace OpenSim
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:MainServerListener() - UDP socket bound, getting ready to listen");
|
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:MainServerListener() - UDP socket bound, getting ready to listen");
|
||||||
|
|
||||||
ipeSender = new IPEndPoint(IPAddress.Any, 0);
|
ipeSender = new IPEndPoint(IPAddress.Any, 0);
|
||||||
epSender = (EndPoint) ipeSender;
|
epSender = (EndPoint)ipeSender;
|
||||||
ReceivedData = new AsyncCallback(this.OnReceivedData);
|
ReceivedData = new AsyncCallback(this.OnReceivedData);
|
||||||
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
|
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
|
||||||
|
|
||||||
|
@ -241,7 +261,8 @@ namespace OpenSim
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Shutdown() {
|
public static void Shutdown()
|
||||||
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Closing all threads");
|
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Closing all threads");
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Killing listener thread");
|
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Killing listener thread");
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Killing clients");
|
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Shutdown() - Killing clients");
|
||||||
|
@ -253,7 +274,7 @@ namespace OpenSim
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Timer1Tick( object sender, System.EventArgs e )
|
void Timer1Tick(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
local_world.Update();
|
local_world.Update();
|
||||||
|
@ -276,12 +297,12 @@ namespace OpenSim
|
||||||
this.AssetServer = this.LoadAssetDll(this.AssetDll);
|
this.AssetServer = this.LoadAssetDll(this.AssetDll);
|
||||||
this.GridServer = this.LoadGridDll(this.GridDll);
|
this.GridServer = this.LoadGridDll(this.GridDll);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
this.AssetServer.Close();
|
this.AssetServer.Close();
|
||||||
this.GridServer.Close();
|
this.GridServer.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private IAssetServer LoadAssetDll(string dllName)
|
private IAssetServer LoadAssetDll(string dllName)
|
||||||
{
|
{
|
||||||
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
|
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
|
||||||
|
|
|
@ -44,7 +44,8 @@ namespace OpenSim
|
||||||
/// Handles new client connections
|
/// Handles new client connections
|
||||||
/// Constructor takes a single Packet and authenticates everything
|
/// Constructor takes a single Packet and authenticates everything
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class OpenSimClient {
|
public class OpenSimClient
|
||||||
|
{
|
||||||
|
|
||||||
public LLUUID AgentID;
|
public LLUUID AgentID;
|
||||||
public LLUUID SessionID;
|
public LLUUID SessionID;
|
||||||
|
@ -66,7 +67,8 @@ namespace OpenSim
|
||||||
private LLUUID newAssetFolder = LLUUID.Zero;
|
private LLUUID newAssetFolder = LLUUID.Zero;
|
||||||
private bool debug = false;
|
private bool debug = false;
|
||||||
|
|
||||||
public void ack_pack(Packet Pack) {
|
public void ack_pack(Packet Pack)
|
||||||
|
{
|
||||||
//libsecondlife.Packets.PacketAckPacket ack_it = new PacketAckPacket();
|
//libsecondlife.Packets.PacketAckPacket ack_it = new PacketAckPacket();
|
||||||
//ack_it.Packets = new PacketAckPacket.PacketsBlock[1];
|
//ack_it.Packets = new PacketAckPacket.PacketsBlock[1];
|
||||||
//ack_it.Packets[0] = new PacketAckPacket.PacketsBlock();
|
//ack_it.Packets[0] = new PacketAckPacket.PacketsBlock();
|
||||||
|
@ -75,24 +77,28 @@ namespace OpenSim
|
||||||
|
|
||||||
//OutPacket(ack_it);
|
//OutPacket(ack_it);
|
||||||
|
|
||||||
if (Pack.Header.Reliable) {
|
if (Pack.Header.Reliable)
|
||||||
lock (PendingAcks) {
|
{
|
||||||
|
lock (PendingAcks)
|
||||||
|
{
|
||||||
uint sequence = (uint)Pack.Header.Sequence;
|
uint sequence = (uint)Pack.Header.Sequence;
|
||||||
if (!PendingAcks.ContainsKey(sequence)) { PendingAcks[sequence] = sequence; }
|
if (!PendingAcks.ContainsKey(sequence)) { PendingAcks[sequence] = sequence; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ProcessInPacket(Packet Pack) {
|
public void ProcessInPacket(Packet Pack)
|
||||||
ack_pack(Pack);
|
|
||||||
if(debug)
|
|
||||||
{
|
{
|
||||||
if(Pack.Type != PacketType.AgentUpdate)
|
ack_pack(Pack);
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
if (Pack.Type != PacketType.AgentUpdate)
|
||||||
{
|
{
|
||||||
Console.WriteLine(Pack.Type.ToString());
|
Console.WriteLine(Pack.Type.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch(Pack.Type) {
|
switch (Pack.Type)
|
||||||
|
{
|
||||||
case PacketType.CompleteAgentMovement:
|
case PacketType.CompleteAgentMovement:
|
||||||
ClientAvatar.CompleteMovement(OpenSim_Main.local_world);
|
ClientAvatar.CompleteMovement(OpenSim_Main.local_world);
|
||||||
ClientAvatar.SendInitialPosition();
|
ClientAvatar.SendInitialPosition();
|
||||||
|
@ -102,8 +108,9 @@ namespace OpenSim
|
||||||
break;
|
break;
|
||||||
case PacketType.AgentWearablesRequest:
|
case PacketType.AgentWearablesRequest:
|
||||||
ClientAvatar.SendInitialAppearance();
|
ClientAvatar.SendInitialAppearance();
|
||||||
foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
|
foreach (OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values)
|
||||||
if(client.AgentID != this.AgentID)
|
{
|
||||||
|
if (client.AgentID != this.AgentID)
|
||||||
{
|
{
|
||||||
ObjectUpdatePacket objupdate = client.ClientAvatar.CreateUpdatePacket();
|
ObjectUpdatePacket objupdate = client.ClientAvatar.CreateUpdatePacket();
|
||||||
this.OutPacket(objupdate);
|
this.OutPacket(objupdate);
|
||||||
|
@ -123,55 +130,55 @@ namespace OpenSim
|
||||||
break;
|
break;
|
||||||
case PacketType.ObjectShape:
|
case PacketType.ObjectShape:
|
||||||
ObjectShapePacket shape = (ObjectShapePacket)Pack;
|
ObjectShapePacket shape = (ObjectShapePacket)Pack;
|
||||||
for(int i =0; i <shape.ObjectData.Length; i++)
|
for (int i = 0; i < shape.ObjectData.Length; i++)
|
||||||
{
|
{
|
||||||
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
||||||
{
|
{
|
||||||
if(ent.localid == shape.ObjectData[i].ObjectLocalID)
|
if (ent.localid == shape.ObjectData[i].ObjectLocalID)
|
||||||
{
|
{
|
||||||
((OpenSim.world.Primitive)ent).UpdateShape(shape.ObjectData[i]);
|
((OpenSim.world.Primitive)ent).UpdateShape(shape.ObjectData[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PacketType.MultipleObjectUpdate :
|
case PacketType.MultipleObjectUpdate:
|
||||||
MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)Pack;
|
MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)Pack;
|
||||||
|
|
||||||
for( int i = 0; i < multipleupdate.ObjectData.Length; i++ )
|
for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
|
||||||
{
|
{
|
||||||
if( multipleupdate.ObjectData[ i ].Type == 9 ) //change position
|
if (multipleupdate.ObjectData[i].Type == 9) //change position
|
||||||
{
|
{
|
||||||
libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[ i ].Data, 0 );
|
libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
|
||||||
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
||||||
{
|
{
|
||||||
if(ent.localid == multipleupdate.ObjectData[ i ].ObjectLocalID)
|
if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
|
||||||
{
|
{
|
||||||
((OpenSim.world.Primitive)ent).UpdatePosition( pos);
|
((OpenSim.world.Primitive)ent).UpdatePosition(pos);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//should update stored position of the prim
|
//should update stored position of the prim
|
||||||
}
|
}
|
||||||
else if(multipleupdate.ObjectData[i].Type == 10 )//rotation
|
else if (multipleupdate.ObjectData[i].Type == 10)//rotation
|
||||||
{
|
{
|
||||||
libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
|
libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
|
||||||
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
||||||
{
|
{
|
||||||
if(ent.localid == multipleupdate.ObjectData[ i ].ObjectLocalID)
|
if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
|
||||||
{
|
{
|
||||||
ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.W);
|
ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.W);
|
||||||
((OpenSim.world.Primitive)ent).UpdateFlag = true;
|
((OpenSim.world.Primitive)ent).UpdateFlag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(multipleupdate.ObjectData[i].Type == 13 )//scale
|
else if (multipleupdate.ObjectData[i].Type == 13)//scale
|
||||||
{
|
{
|
||||||
|
|
||||||
libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[ i ].Data, 12 );
|
libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
|
||||||
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
||||||
{
|
{
|
||||||
if(ent.localid == multipleupdate.ObjectData[ i ].ObjectLocalID)
|
if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
|
||||||
{
|
{
|
||||||
((OpenSim.world.Primitive)ent).Scale = scale;
|
((OpenSim.world.Primitive)ent).Scale = scale;
|
||||||
}
|
}
|
||||||
|
@ -180,8 +187,8 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PacketType.RequestImage:
|
case PacketType.RequestImage:
|
||||||
RequestImagePacket imageRequest = (RequestImagePacket) Pack;
|
RequestImagePacket imageRequest = (RequestImagePacket)Pack;
|
||||||
for( int i = 0; i < imageRequest.RequestImage.Length; i++ )
|
for (int i = 0; i < imageRequest.RequestImage.Length; i++)
|
||||||
{
|
{
|
||||||
OpenSim_Main.sim.assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image);
|
OpenSim_Main.sim.assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image);
|
||||||
}
|
}
|
||||||
|
@ -196,16 +203,26 @@ namespace OpenSim
|
||||||
break;
|
break;
|
||||||
case PacketType.LogoutRequest:
|
case PacketType.LogoutRequest:
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got a logout request");
|
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got a logout request");
|
||||||
|
//send reply to let the client logout
|
||||||
|
LogoutReplyPacket logReply = new LogoutReplyPacket();
|
||||||
|
logReply.AgentData.AgentID = this.AgentID;
|
||||||
|
logReply.AgentData.SessionID = this.SessionID;
|
||||||
|
logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
|
||||||
|
logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
|
||||||
|
logReply.InventoryData[0].ItemID = LLUUID.Zero;
|
||||||
|
OutPacket(logReply);
|
||||||
//tell all clients to kill our object
|
//tell all clients to kill our object
|
||||||
KillObjectPacket kill = new KillObjectPacket();
|
KillObjectPacket kill = new KillObjectPacket();
|
||||||
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
||||||
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
||||||
kill.ObjectData[0].ID = this.ClientAvatar.localid;
|
kill.ObjectData[0].ID = this.ClientAvatar.localid;
|
||||||
foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
|
foreach (OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values)
|
||||||
|
{
|
||||||
client.OutPacket(kill);
|
client.OutPacket(kill);
|
||||||
}
|
}
|
||||||
OpenSim_Main.gridServers.GridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
|
OpenSim_Main.gridServers.GridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
|
||||||
lock(OpenSim_Main.local_world.Entities) {
|
lock (OpenSim_Main.local_world.Entities)
|
||||||
|
{
|
||||||
OpenSim_Main.local_world.Entities.Remove(this.AgentID);
|
OpenSim_Main.local_world.Entities.Remove(this.AgentID);
|
||||||
}
|
}
|
||||||
//need to do other cleaning up here too
|
//need to do other cleaning up here too
|
||||||
|
@ -214,7 +231,7 @@ namespace OpenSim
|
||||||
break;
|
break;
|
||||||
case PacketType.ChatFromViewer:
|
case PacketType.ChatFromViewer:
|
||||||
ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
|
ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
|
||||||
if(Helpers.FieldToString(inchatpack.ChatData.Message)=="") break;
|
if (Helpers.FieldToString(inchatpack.ChatData.Message) == "") break;
|
||||||
|
|
||||||
System.Text.Encoding _enc = System.Text.Encoding.ASCII;
|
System.Text.Encoding _enc = System.Text.Encoding.ASCII;
|
||||||
libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
|
libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
|
||||||
|
@ -226,17 +243,18 @@ namespace OpenSim
|
||||||
reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0");
|
reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0");
|
||||||
reply.ChatData.OwnerID = this.AgentID;
|
reply.ChatData.OwnerID = this.AgentID;
|
||||||
reply.ChatData.SourceID = this.AgentID;
|
reply.ChatData.SourceID = this.AgentID;
|
||||||
foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
|
foreach (OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values)
|
||||||
|
{
|
||||||
client.OutPacket(reply);
|
client.OutPacket(reply);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PacketType.ObjectImage:
|
case PacketType.ObjectImage:
|
||||||
ObjectImagePacket imagePack =(ObjectImagePacket) Pack;
|
ObjectImagePacket imagePack = (ObjectImagePacket)Pack;
|
||||||
for(int i = 0 ; i < imagePack.ObjectData.Length; i++)
|
for (int i = 0; i < imagePack.ObjectData.Length; i++)
|
||||||
{
|
{
|
||||||
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
||||||
{
|
{
|
||||||
if(ent.localid == imagePack.ObjectData[i].ObjectLocalID)
|
if (ent.localid == imagePack.ObjectData[i].ObjectLocalID)
|
||||||
{
|
{
|
||||||
((OpenSim.world.Primitive)ent).UpdateTexture(imagePack.ObjectData[i].TextureEntry);
|
((OpenSim.world.Primitive)ent).UpdateTexture(imagePack.ObjectData[i].TextureEntry);
|
||||||
}
|
}
|
||||||
|
@ -244,10 +262,10 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PacketType.ObjectFlagUpdate:
|
case PacketType.ObjectFlagUpdate:
|
||||||
ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket) Pack;
|
ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack;
|
||||||
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
|
||||||
{
|
{
|
||||||
if(ent.localid == flags.AgentData.ObjectLocalID)
|
if (ent.localid == flags.AgentData.ObjectLocalID)
|
||||||
{
|
{
|
||||||
((OpenSim.world.Primitive)ent).UpdateObjectFlags(flags);
|
((OpenSim.world.Primitive)ent).UpdateObjectFlags(flags);
|
||||||
}
|
}
|
||||||
|
@ -370,7 +388,8 @@ namespace OpenSim
|
||||||
ResendUnacked();
|
ResendUnacked();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ProcessOutPacket(Packet Pack) {
|
public void ProcessOutPacket(Packet Pack)
|
||||||
|
{
|
||||||
|
|
||||||
// Keep track of when this packet was sent out
|
// Keep track of when this packet was sent out
|
||||||
Pack.TickCount = Environment.TickCount;
|
Pack.TickCount = Environment.TickCount;
|
||||||
|
@ -437,21 +456,28 @@ namespace OpenSim
|
||||||
byte[] sendbuffer;
|
byte[] sendbuffer;
|
||||||
sendbuffer = Pack.ToBytes();
|
sendbuffer = Pack.ToBytes();
|
||||||
|
|
||||||
try {
|
try
|
||||||
if (Pack.Header.Zerocoded) {
|
{
|
||||||
|
if (Pack.Header.Zerocoded)
|
||||||
|
{
|
||||||
int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
|
int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
|
||||||
OpenSim_Main.Server.SendTo(ZeroOutBuffer, packetsize, SocketFlags.None,userEP);
|
OpenSim_Main.sim.Server.SendTo(ZeroOutBuffer, packetsize, SocketFlags.None, userEP);
|
||||||
} else {
|
|
||||||
OpenSim_Main.Server.SendTo(sendbuffer, sendbuffer.Length, SocketFlags.None,userEP);
|
|
||||||
}
|
}
|
||||||
} catch (Exception) {
|
else
|
||||||
|
{
|
||||||
|
OpenSim_Main.sim.Server.SendTo(sendbuffer, sendbuffer.Length, SocketFlags.None, userEP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread");
|
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread");
|
||||||
ClientThread.Abort();
|
ClientThread.Abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InPacket(Packet NewPack) {
|
public void InPacket(Packet NewPack)
|
||||||
|
{
|
||||||
// Handle appended ACKs
|
// Handle appended ACKs
|
||||||
if (NewPack.Header.AppendedAcks)
|
if (NewPack.Header.AppendedAcks)
|
||||||
{
|
{
|
||||||
|
@ -476,7 +502,9 @@ namespace OpenSim
|
||||||
NeedAck.Remove(block.ID);
|
NeedAck.Remove(block.ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if( ( NewPack.Type == PacketType.StartPingCheck ) ) {
|
}
|
||||||
|
else if ((NewPack.Type == PacketType.StartPingCheck))
|
||||||
|
{
|
||||||
//reply to pingcheck
|
//reply to pingcheck
|
||||||
libsecondlife.Packets.StartPingCheckPacket startPing = (libsecondlife.Packets.StartPingCheckPacket)NewPack;
|
libsecondlife.Packets.StartPingCheckPacket startPing = (libsecondlife.Packets.StartPingCheckPacket)NewPack;
|
||||||
libsecondlife.Packets.CompletePingCheckPacket endPing = new CompletePingCheckPacket();
|
libsecondlife.Packets.CompletePingCheckPacket endPing = new CompletePingCheckPacket();
|
||||||
|
@ -493,14 +521,16 @@ namespace OpenSim
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OutPacket(Packet NewPack) {
|
public void OutPacket(Packet NewPack)
|
||||||
|
{
|
||||||
QueItem item = new QueItem();
|
QueItem item = new QueItem();
|
||||||
item.Packet = NewPack;
|
item.Packet = NewPack;
|
||||||
item.Incoming = false;
|
item.Incoming = false;
|
||||||
this.PacketQueue.Enqueue(item);
|
this.PacketQueue.Enqueue(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpenSimClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack) {
|
public OpenSimClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack)
|
||||||
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs - Started up new client thread to handle incoming request");
|
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs - Started up new client thread to handle incoming request");
|
||||||
cirpack = initialcirpack;
|
cirpack = initialcirpack;
|
||||||
userEP = remoteEP;
|
userEP = remoteEP;
|
||||||
|
@ -514,11 +544,13 @@ namespace OpenSim
|
||||||
ClientThread.Start();
|
ClientThread.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ClientLoop() {
|
private void ClientLoop()
|
||||||
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ClientLoop() - Entered loop");
|
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:ClientLoop() - Entered loop");
|
||||||
while(true) {
|
while (true)
|
||||||
|
{
|
||||||
QueItem nextPacket = PacketQueue.Dequeue();
|
QueItem nextPacket = PacketQueue.Dequeue();
|
||||||
if(nextPacket.Incoming)
|
if (nextPacket.Incoming)
|
||||||
{
|
{
|
||||||
//is a incoming packet
|
//is a incoming packet
|
||||||
ProcessInPacket(nextPacket.Packet);
|
ProcessInPacket(nextPacket.Packet);
|
||||||
|
@ -531,17 +563,18 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitNewClient() {
|
private void InitNewClient()
|
||||||
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
|
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
|
||||||
OpenSim_Main.local_world.AddViewerAgent(this);
|
OpenSim_Main.local_world.AddViewerAgent(this);
|
||||||
world.Entity tempent=OpenSim_Main.local_world.Entities[this.AgentID];
|
world.Entity tempent = OpenSim_Main.local_world.Entities[this.AgentID];
|
||||||
this.ClientAvatar=(world.Avatar)tempent;
|
this.ClientAvatar = (world.Avatar)tempent;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AuthUser()
|
private void AuthUser()
|
||||||
{
|
{
|
||||||
AuthenticateResponse sessionInfo = OpenSim_Main.gridServers.GridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
|
AuthenticateResponse sessionInfo = OpenSim_Main.gridServers.GridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
|
||||||
if(!sessionInfo.Authorised)
|
if (!sessionInfo.Authorised)
|
||||||
{
|
{
|
||||||
//session/circuit not authorised
|
//session/circuit not authorised
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString());
|
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString());
|
||||||
|
@ -551,25 +584,29 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString());
|
ServerConsole.MainConsole.Instance.WriteLine("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString());
|
||||||
//session is authorised
|
//session is authorised
|
||||||
this.AgentID=cirpack.CircuitCode.ID;
|
this.AgentID = cirpack.CircuitCode.ID;
|
||||||
this.SessionID=cirpack.CircuitCode.SessionID;
|
this.SessionID = cirpack.CircuitCode.SessionID;
|
||||||
this.CircuitCode=cirpack.CircuitCode.Code;
|
this.CircuitCode = cirpack.CircuitCode.Code;
|
||||||
InitNewClient();
|
InitNewClient();
|
||||||
this.ClientAvatar.firstname = sessionInfo.LoginInfo.First;
|
this.ClientAvatar.firstname = sessionInfo.LoginInfo.First;
|
||||||
this.ClientAvatar.lastname = sessionInfo.LoginInfo.Last;
|
this.ClientAvatar.lastname = sessionInfo.LoginInfo.Last;
|
||||||
if(sessionInfo.LoginInfo.InventoryFolder != null)
|
|
||||||
|
// Create Inventory, currently only works for sandbox mode
|
||||||
|
if (OpenSim_Main.sim.sandbox)
|
||||||
|
{
|
||||||
|
if (sessionInfo.LoginInfo.InventoryFolder != null)
|
||||||
{
|
{
|
||||||
this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder);
|
this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder);
|
||||||
if(sessionInfo.LoginInfo.BaseFolder != null)
|
if (sessionInfo.LoginInfo.BaseFolder != null)
|
||||||
{
|
{
|
||||||
OpenSim_Main.sim.inventoryManager.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder);
|
OpenSim_Main.sim.inventoryManager.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder);
|
||||||
this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder;
|
this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder;
|
||||||
AssetBase[] inventorySet = OpenSim_Main.sim.assetCache.CreateNewInventorySet(this.AgentID);
|
AssetBase[] inventorySet = OpenSim_Main.sim.assetCache.CreateNewInventorySet(this.AgentID);
|
||||||
if(inventorySet != null)
|
if (inventorySet != null)
|
||||||
{
|
{
|
||||||
for( int i = 0; i < inventorySet.Length; i++)
|
for (int i = 0; i < inventorySet.Length; i++)
|
||||||
{
|
{
|
||||||
if(inventorySet[i] != null)
|
if (inventorySet[i] != null)
|
||||||
{
|
{
|
||||||
Console.WriteLine(Helpers.FieldToString(inventorySet[i].Data));
|
Console.WriteLine(Helpers.FieldToString(inventorySet[i].Data));
|
||||||
OpenSim_Main.sim.inventoryManager.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]);
|
OpenSim_Main.sim.inventoryManager.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]);
|
||||||
|
@ -578,6 +615,8 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ClientLoop();
|
ClientLoop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ namespace OpenSim
|
||||||
ConsType = constype;
|
ConsType = constype;
|
||||||
switch(constype) {
|
switch(constype) {
|
||||||
case ConsoleType.Local:
|
case ConsoleType.Local:
|
||||||
|
|
||||||
Console.WriteLine("ServerConsole.cs - creating new local console");
|
Console.WriteLine("ServerConsole.cs - creating new local console");
|
||||||
Console.WriteLine("Logs will be saved to current directory in opensim-console.log");
|
Console.WriteLine("Logs will be saved to current directory in opensim-console.log");
|
||||||
Log=File.AppendText("opensim-console.log");
|
Log=File.AppendText("opensim-console.log");
|
||||||
|
@ -83,14 +84,22 @@ namespace OpenSim
|
||||||
Log.Close();
|
Log.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// You know what ReadLine() and WriteLine() do, right? And Read() and Write()? Right, you do actually know C#, right? Are you actually a programmer? Do you know english? Do you find my sense of humour in comments irritating? Good, glad you're still here
|
public override void Write(string format, params object[] args)
|
||||||
public override void WriteLine(string Line) {
|
{
|
||||||
Log.WriteLine(Line);
|
Log.Write(format, args);
|
||||||
Console.WriteLine(Line);
|
Console.Write(format, args);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ReadLine() {
|
public override void WriteLine(string format, params object[] args)
|
||||||
|
{
|
||||||
|
Log.WriteLine(format, args);
|
||||||
|
Console.WriteLine(format, args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ReadLine()
|
||||||
|
{
|
||||||
string TempStr=Console.ReadLine();
|
string TempStr=Console.ReadLine();
|
||||||
Log.WriteLine(TempStr);
|
Log.WriteLine(TempStr);
|
||||||
return TempStr;
|
return TempStr;
|
||||||
|
@ -102,12 +111,6 @@ namespace OpenSim
|
||||||
return TempInt;
|
return TempInt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Write(string Line) {
|
|
||||||
Console.Write(Line);
|
|
||||||
Log.Write(Line);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Displays a command prompt and waits for the user to enter a string, then returns that string
|
// Displays a command prompt and waits for the user to enter a string, then returns that string
|
||||||
public override string CmdPrompt(string prompt) {
|
public override string CmdPrompt(string prompt) {
|
||||||
this.Write(prompt);
|
this.Write(prompt);
|
||||||
|
@ -172,7 +175,7 @@ namespace OpenSim
|
||||||
break;
|
break;
|
||||||
case "users":
|
case "users":
|
||||||
OpenSim.world.Avatar TempAv;
|
OpenSim.world.Avatar TempAv;
|
||||||
this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}","Firstname", "Lastname","Agent ID", "Session ID", "Circuit", "IP"));
|
this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}","Firstname", "Lastname","Agent ID", "Session ID", "Circuit", "IP"));
|
||||||
foreach (libsecondlife.LLUUID UUID in OpenSim_Main.local_world.Entities.Keys) {
|
foreach (libsecondlife.LLUUID UUID in OpenSim_Main.local_world.Entities.Keys) {
|
||||||
if(OpenSim_Main.local_world.Entities[UUID].ToString()== "OpenSim.world.Avatar")
|
if(OpenSim_Main.local_world.Entities[UUID].ToString()== "OpenSim.world.Avatar")
|
||||||
{
|
{
|
||||||
|
@ -196,6 +199,12 @@ namespace OpenSim
|
||||||
string[] cmdparams=(string[])tempstrarray;
|
string[] cmdparams=(string[])tempstrarray;
|
||||||
RunCmd(cmd,cmdparams);
|
RunCmd(cmd,cmdparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override void SetStatus(string status)
|
||||||
|
{
|
||||||
|
Console.Write( status + "\r" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace RemoteGridServers
|
||||||
|
|
||||||
public IGridServer GetGridServer()
|
public IGridServer GetGridServer()
|
||||||
{
|
{
|
||||||
return(new RemoteGridServer());
|
return (new RemoteGridServer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,43 +62,55 @@ namespace RemoteGridServers
|
||||||
|
|
||||||
public IAssetServer GetAssetServer()
|
public IAssetServer GetAssetServer()
|
||||||
{
|
{
|
||||||
return(new RemoteAssetServer());
|
return (new RemoteAssetServer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class RemoteGridServer :IGridServer
|
public class RemoteGridServer : RemoteGridBase
|
||||||
{
|
{
|
||||||
private string GridServerUrl;
|
private string GridServerUrl;
|
||||||
private string GridSendKey;
|
private string GridSendKey;
|
||||||
|
private Dictionary<uint, agentcircuitdata> AgentCircuits = new Dictionary<uint, agentcircuitdata>();
|
||||||
|
|
||||||
|
public override Dictionary<uint, agentcircuitdata> agentcircuits
|
||||||
|
{
|
||||||
|
get { return AgentCircuits; }
|
||||||
|
set { AgentCircuits = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public RemoteGridServer()
|
public RemoteGridServer()
|
||||||
{
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Remote Grid Server class created");
|
ServerConsole.MainConsole.Instance.WriteLine("Remote Grid Server class created");
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RequestConnection()
|
public override bool RequestConnection()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
|
|
||||||
{
|
|
||||||
AuthenticateResponse user = new AuthenticateResponse();
|
|
||||||
|
|
||||||
WebRequest CheckSession = WebRequest.Create(GridServerUrl + "/usersessions/" + GridSendKey + "/" + agentID.ToString() + "/" + circuitCode.ToString() + "/exists");
|
public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
|
||||||
WebResponse GridResponse = CheckSession.GetResponse();
|
{
|
||||||
StreamReader sr = new StreamReader(GridResponse.GetResponseStream());
|
agentcircuitdata validcircuit = null;
|
||||||
String grTest = sr.ReadLine();
|
if (this.AgentCircuits.ContainsKey(circuitcode))
|
||||||
sr.Close();
|
{
|
||||||
GridResponse.Close();
|
validcircuit = this.AgentCircuits[circuitcode];
|
||||||
if(String.IsNullOrEmpty(grTest) || grTest.Equals("1"))
|
}
|
||||||
|
AuthenticateResponse user = new AuthenticateResponse();
|
||||||
|
if (validcircuit == null)
|
||||||
|
{
|
||||||
|
//don't have this circuit code in our list
|
||||||
|
user.Authorised = false;
|
||||||
|
return (user);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
|
||||||
{
|
{
|
||||||
// YAY! Valid login
|
// YAY! Valid login
|
||||||
user.Authorised = true;
|
user.Authorised = true;
|
||||||
user.LoginInfo = new Login();
|
user.LoginInfo = new Login();
|
||||||
user.LoginInfo.Agent = agentID;
|
user.LoginInfo.Agent = agentID;
|
||||||
user.LoginInfo.Session = sessionID;
|
user.LoginInfo.Session = sessionID;
|
||||||
user.LoginInfo.First = "";
|
user.LoginInfo.First = validcircuit.firstname;
|
||||||
user.LoginInfo.Last = "";
|
user.LoginInfo.Last = validcircuit.lastname;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -106,50 +118,54 @@ namespace RemoteGridServers
|
||||||
user.Authorised = false;
|
user.Authorised = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(user);
|
return (user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
|
public override bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
|
||||||
{
|
{
|
||||||
WebRequest DeleteSession = WebRequest.Create(GridServerUrl + "/usersessions/" + GridSendKey + "/" + agentID.ToString() + "/" + circuitCode.ToString() + "/delete");
|
WebRequest DeleteSession = WebRequest.Create(GridServerUrl + "/usersessions/" + sessionID.ToString());
|
||||||
WebResponse GridResponse = DeleteSession.GetResponse();
|
DeleteSession.Method = "DELETE";
|
||||||
StreamReader sr = new StreamReader(GridResponse.GetResponseStream());
|
DeleteSession.ContentType = "text/plaintext";
|
||||||
String grTest = sr.ReadLine();
|
DeleteSession.ContentLength = 0;
|
||||||
sr.Close();
|
|
||||||
GridResponse.Close();
|
StreamWriter stOut = new StreamWriter(DeleteSession.GetRequestStream(), System.Text.Encoding.ASCII);
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("DEBUG: " + grTest);
|
stOut.Write("");
|
||||||
return(true);
|
stOut.Close();
|
||||||
|
|
||||||
|
StreamReader stIn = new StreamReader(DeleteSession.GetResponse().GetResponseStream());
|
||||||
|
string GridResponse = stIn.ReadToEnd();
|
||||||
|
stIn.Close();
|
||||||
|
return (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUIDBlock RequestUUIDBlock()
|
public override UUIDBlock RequestUUIDBlock()
|
||||||
{
|
{
|
||||||
UUIDBlock uuidBlock = new UUIDBlock();
|
UUIDBlock uuidBlock = new UUIDBlock();
|
||||||
return(uuidBlock);
|
return (uuidBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestNeighbours()
|
public override void RequestNeighbours()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetServerInfo(string ServerUrl, string ServerKey)
|
public override void SetServerInfo(string ServerUrl, string ServerKey)
|
||||||
{
|
{
|
||||||
this.GridServerUrl = ServerUrl;
|
this.GridServerUrl = ServerUrl;
|
||||||
this.GridSendKey = ServerKey;
|
this.GridSendKey = ServerKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
public override string GetName()
|
||||||
{
|
{
|
||||||
|
return "Remote";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddNewSession(Login session)
|
public override void Close()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class RemoteAssetServer : IAssetServer
|
public class RemoteAssetServer : IAssetServer
|
||||||
{
|
{
|
||||||
private IAssetReceiver _receiver;
|
private IAssetReceiver _receiver;
|
||||||
|
@ -196,13 +212,9 @@ namespace RemoteGridServers
|
||||||
this.AssetSendKey = ServerKey;
|
this.AssetSendKey = ServerKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
private void RunRequests()
|
private void RunRequests()
|
||||||
{
|
{
|
||||||
while(true)
|
while (true)
|
||||||
{
|
{
|
||||||
//we need to add support for the asset server not knowing about a requested asset
|
//we need to add support for the asset server not knowing about a requested asset
|
||||||
ARequest req = this._assetRequests.Dequeue();
|
ARequest req = this._assetRequests.Dequeue();
|
||||||
|
@ -218,18 +230,24 @@ namespace RemoteGridServers
|
||||||
AssetBase asset = new AssetBase();
|
AssetBase asset = new AssetBase();
|
||||||
asset.FullID = assetID;
|
asset.FullID = assetID;
|
||||||
asset.Data = idata;
|
asset.Data = idata;
|
||||||
_receiver.AssetReceived(asset, req.IsTexture );
|
_receiver.AssetReceived(asset, req.IsTexture);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BlockingQueue< T > {
|
public void Close()
|
||||||
private Queue< T > _queue = new Queue< T >();
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BlockingQueue<T>
|
||||||
|
{
|
||||||
|
private Queue<T> _queue = new Queue<T>();
|
||||||
private object _queueSync = new object();
|
private object _queueSync = new object();
|
||||||
|
|
||||||
public void Enqueue(T value)
|
public void Enqueue(T value)
|
||||||
{
|
{
|
||||||
lock(_queueSync)
|
lock (_queueSync)
|
||||||
{
|
{
|
||||||
_queue.Enqueue(value);
|
_queue.Enqueue(value);
|
||||||
Monitor.Pulse(_queueSync);
|
Monitor.Pulse(_queueSync);
|
||||||
|
@ -238,9 +256,9 @@ namespace RemoteGridServers
|
||||||
|
|
||||||
public T Dequeue()
|
public T Dequeue()
|
||||||
{
|
{
|
||||||
lock(_queueSync)
|
lock (_queueSync)
|
||||||
{
|
{
|
||||||
if( _queue.Count < 1)
|
if (_queue.Count < 1)
|
||||||
Monitor.Wait(_queueSync);
|
Monitor.Wait(_queueSync);
|
||||||
|
|
||||||
return _queue.Dequeue();
|
return _queue.Dequeue();
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<FileAlignment>4096</FileAlignment>
|
<FileAlignment>4096</FileAlignment>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<OutputPath>..\bin\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
|
@ -53,6 +56,7 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Assets\InventoryManager.cs" />
|
||||||
<Compile Include="Config.cs" />
|
<Compile Include="Config.cs" />
|
||||||
<Compile Include="Main.cs" />
|
<Compile Include="Main.cs" />
|
||||||
<Compile Include="OpenSimClient.cs" />
|
<Compile Include="OpenSimClient.cs" />
|
||||||
|
@ -71,19 +75,30 @@
|
||||||
<Compile Include="OpenSimConsole.cs" />
|
<Compile Include="OpenSimConsole.cs" />
|
||||||
<Compile Include="HeightMapGenHills.cs" />
|
<Compile Include="HeightMapGenHills.cs" />
|
||||||
<Compile Include="VersionInfo.cs" />
|
<Compile Include="VersionInfo.cs" />
|
||||||
<Compile Include="Assets\InventoryManager.cs" />
|
<Compile Include="CAPS\SimHttp.cs">
|
||||||
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="GridServers" />
|
|
||||||
<Folder Include="Assets" />
|
|
||||||
<ProjectReference Include="GridInterfaces\GridInterfaces.csproj">
|
<ProjectReference Include="GridInterfaces\GridInterfaces.csproj">
|
||||||
<Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
|
<Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
|
||||||
<Name>GridInterfaces</Name>
|
<Name>GridInterfaces</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="LocalServers\LocalGridServers\LocalGridServers.csproj">
|
||||||
|
<Project>{D7F0395B-FADC-4936-80A0-D95AACE92F62}</Project>
|
||||||
|
<Name>LocalGridServers</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="LocalStorage\Db4LocalStorage\Db4LocalStorage.csproj">
|
||||||
|
<Project>{74784F23-B0FD-484C-82C1-96C0215733DC}</Project>
|
||||||
|
<Name>Db4LocalStorage</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="physics\PhysicsManager.csproj">
|
<ProjectReference Include="physics\PhysicsManager.csproj">
|
||||||
<Project>{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}</Project>
|
<Project>{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}</Project>
|
||||||
<Name>PhysicsManager</Name>
|
<Name>PhysicsManager</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="RemoteServers\RemoteGridServers\RemoteGridServers.csproj">
|
||||||
|
<Project>{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}</Project>
|
||||||
|
<Name>RemoteGridServers</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="ServerConsole\ServerConsole\ServerConsole.csproj">
|
<ProjectReference Include="ServerConsole\ServerConsole\ServerConsole.csproj">
|
||||||
<Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
|
<Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
|
||||||
<Name>ServerConsole</Name>
|
<Name>ServerConsole</Name>
|
||||||
|
|
|
@ -0,0 +1,87 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the <organization> nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace ServerConsole
|
||||||
|
{
|
||||||
|
public class MainConsole {
|
||||||
|
|
||||||
|
private static ConsoleBase instance;
|
||||||
|
|
||||||
|
public static ConsoleBase Instance
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
instance = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract class ConsoleBase
|
||||||
|
{
|
||||||
|
|
||||||
|
public enum ConsoleType {
|
||||||
|
Local, // Use stdio
|
||||||
|
TCP, // Use TCP/telnet
|
||||||
|
SimChat // Use in-world chat (for gods)
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void Close();
|
||||||
|
|
||||||
|
public abstract void Write(string format, params object[] args);
|
||||||
|
|
||||||
|
public abstract void WriteLine(string format, params object[] args);
|
||||||
|
|
||||||
|
public abstract string ReadLine();
|
||||||
|
|
||||||
|
public abstract int Read() ;
|
||||||
|
|
||||||
|
// Displays a command prompt and waits for the user to enter a string, then returns that string
|
||||||
|
public abstract string CmdPrompt(string prompt) ;
|
||||||
|
|
||||||
|
// Displays a command prompt and returns a default value if the user simply presses enter
|
||||||
|
public abstract string CmdPrompt(string prompt, string defaultresponse);
|
||||||
|
|
||||||
|
// Displays a command prompt and returns a default value, user may only enter 1 of 2 options
|
||||||
|
public abstract string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB) ;
|
||||||
|
|
||||||
|
// Runs a command with a number of parameters
|
||||||
|
public abstract Object RunCmd(string Cmd, string[] cmdparams) ;
|
||||||
|
|
||||||
|
// Shows data about something
|
||||||
|
public abstract void ShowCommands(string ShowWhat) ;
|
||||||
|
|
||||||
|
// Displays a prompt to the user and then runs the command they entered
|
||||||
|
public abstract void MainConsolePrompt() ;
|
||||||
|
|
||||||
|
public abstract void SetStatus( string status );
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<RootNamespace>ServerConsole</RootNamespace>
|
||||||
|
<AssemblyName>ServerConsole</AssemblyName>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</ProjectGuid>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<Optimize>False</Optimize>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugSymbols>True</DebugSymbols>
|
||||||
|
<DebugType>Full</DebugType>
|
||||||
|
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<Optimize>True</Optimize>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<DebugSymbols>False</DebugSymbols>
|
||||||
|
<DebugType>None</DebugType>
|
||||||
|
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="ServerConsole.cs" />
|
||||||
|
<Compile Include="AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
|
</Project>
|
|
@ -0,0 +1,101 @@
|
||||||
|
/*
|
||||||
|
Copyright (c) OpenSim project, http://osgrid.org/
|
||||||
|
|
||||||
|
* Copyright (c) <year>, <copyright holder>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the <organization> nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading;
|
||||||
|
using libsecondlife;
|
||||||
|
using libsecondlife.Packets;
|
||||||
|
|
||||||
|
namespace OpenSim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
public class Util
|
||||||
|
{
|
||||||
|
public static ulong UIntsToLong(uint X, uint Y)
|
||||||
|
{
|
||||||
|
return Helpers.UIntsToLong(X, Y);
|
||||||
|
}
|
||||||
|
public Util()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueItem
|
||||||
|
{
|
||||||
|
public QueItem()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Packet Packet;
|
||||||
|
public bool Incoming;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this is in IGridServer.cs, so there should be no reason for it to be here as well
|
||||||
|
public class agentcircuitdata
|
||||||
|
{
|
||||||
|
public agentcircuitdata() { }
|
||||||
|
public LLUUID AgentID;
|
||||||
|
public LLUUID SessionID;
|
||||||
|
public LLUUID SecureSessionID;
|
||||||
|
public string firstname;
|
||||||
|
public string lastname;
|
||||||
|
public uint circuitcode;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class BlockingQueue<T>
|
||||||
|
{
|
||||||
|
private Queue<T> _queue = new Queue<T>();
|
||||||
|
private object _queueSync = new object();
|
||||||
|
|
||||||
|
public void Enqueue(T value)
|
||||||
|
{
|
||||||
|
lock (_queueSync)
|
||||||
|
{
|
||||||
|
_queue.Enqueue(value);
|
||||||
|
Monitor.Pulse(_queueSync);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Dequeue()
|
||||||
|
{
|
||||||
|
lock (_queueSync)
|
||||||
|
{
|
||||||
|
if (_queue.Count < 1)
|
||||||
|
Monitor.Wait(_queueSync);
|
||||||
|
|
||||||
|
return _queue.Dequeue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
Copyright (c) OpenSim project, http://osgrid.org/
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the <organization> nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace OpenSim
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// </summary>
|
||||||
|
public class VersionInfo
|
||||||
|
{
|
||||||
|
public static string Version = "0.1, Build 1173843165, Revision 193:206M";
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||||
|
# Visual C# Express 2005
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Second-server", "Second-server.csproj", "{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GridInterfaces", "GridInterfaces\GridInterfaces.csproj", "{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhysicsManager", "physics\PhysicsManager.csproj", "{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerConsole", "ServerConsole\ServerConsole\ServerConsole.csproj", "{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalGridServers", "LocalServers\LocalGridServers\LocalGridServers.csproj", "{D7F0395B-FADC-4936-80A0-D95AACE92F62}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoteGridServers", "RemoteServers\RemoteGridServers\RemoteGridServers.csproj", "{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimConfig", "Config\SimConfig\SimConfig.csproj", "{B063760D-DB8D-4F64-B6FE-335FAD1E650A}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Db4LocalStorage", "LocalStorage\Db4LocalStorage\Db4LocalStorage.csproj", "{74784F23-B0FD-484C-82C1-96C0215733DC}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicPhysicsplugin", "physics\plugins\BasicPhysicsplugin.csproj", "{52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealPhysXplugin", "physics\RealPhysX\RealPhysXplugin\RealPhysXplugin.csproj", "{56C1D214-F389-4228-921A-0A3A0712C159}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{74784F23-B0FD-484C-82C1-96C0215733DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{74784F23-B0FD-484C-82C1-96C0215733DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{74784F23-B0FD-484C-82C1-96C0215733DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{74784F23-B0FD-484C-82C1-96C0215733DC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{56C1D214-F389-4228-921A-0A3A0712C159}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{56C1D214-F389-4228-921A-0A3A0712C159}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{56C1D214-F389-4228-921A-0A3A0712C159}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{56C1D214-F389-4228-921A-0A3A0712C159}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
|
@ -0,0 +1,161 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the <organization> nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace PhysicsSystem
|
||||||
|
{
|
||||||
|
public abstract class PhysicsActor
|
||||||
|
{
|
||||||
|
public static PhysicsActor Null
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new NullPhysicsActor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract PhysicsVector Position
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract PhysicsVector Velocity
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract PhysicsVector Acceleration
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract Axiom.MathLib.Quaternion Orientation
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract bool Flying
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract bool Kinematic
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void AddForce(PhysicsVector force);
|
||||||
|
|
||||||
|
public abstract void SetMomentum(PhysicsVector momentum);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NullPhysicsActor : PhysicsActor
|
||||||
|
{
|
||||||
|
public override PhysicsVector Position
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return PhysicsVector.Zero;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override PhysicsVector Velocity
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return PhysicsVector.Zero;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Axiom.MathLib.Quaternion Orientation
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Axiom.MathLib.Quaternion.Identity;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override PhysicsVector Acceleration
|
||||||
|
{
|
||||||
|
get { return PhysicsVector.Zero; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Flying
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Kinematic
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AddForce(PhysicsVector force)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetMomentum(PhysicsVector momentum)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -47,6 +47,11 @@ namespace PhysicsSystem
|
||||||
|
|
||||||
public PhysicsScene GetPhysicsScene(string engineName)
|
public PhysicsScene GetPhysicsScene(string engineName)
|
||||||
{
|
{
|
||||||
|
if (String.IsNullOrEmpty(engineName))
|
||||||
|
{
|
||||||
|
return new NullPhysicsScene();
|
||||||
|
}
|
||||||
|
|
||||||
if(_plugins.ContainsKey(engineName))
|
if(_plugins.ContainsKey(engineName))
|
||||||
{
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("creating "+engineName);
|
ServerConsole.MainConsole.Instance.WriteLine("creating "+engineName);
|
||||||
|
@ -54,8 +59,9 @@ namespace PhysicsSystem
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("couldn't find physicsEngine: "+ engineName);
|
string error = String.Format("couldn't find physicsEngine: {0}", engineName);
|
||||||
return null;
|
ServerConsole.MainConsole.Instance.WriteLine(error);
|
||||||
|
throw new ArgumentException(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +105,7 @@ namespace PhysicsSystem
|
||||||
pluginAssembly = null;
|
pluginAssembly = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IPhysicsPlugin
|
public interface IPhysicsPlugin
|
||||||
{
|
{
|
||||||
bool Init();
|
bool Init();
|
||||||
|
@ -106,83 +113,4 @@ namespace PhysicsSystem
|
||||||
string GetName();
|
string GetName();
|
||||||
void Dispose();
|
void Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class PhysicsScene
|
|
||||||
{
|
|
||||||
public abstract PhysicsActor AddAvatar(PhysicsVector position);
|
|
||||||
|
|
||||||
public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size);
|
|
||||||
|
|
||||||
public abstract void Simulate(float timeStep);
|
|
||||||
|
|
||||||
public abstract void GetResults();
|
|
||||||
|
|
||||||
public abstract void SetTerrain(float[] heightMap);
|
|
||||||
|
|
||||||
public abstract bool IsThreaded
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract class PhysicsActor
|
|
||||||
{
|
|
||||||
public abstract PhysicsVector Position
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract PhysicsVector Velocity
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract PhysicsVector Acceleration
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract Axiom.MathLib.Quaternion Orientation
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract bool Flying
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract bool Kinematic
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void AddForce(PhysicsVector force);
|
|
||||||
|
|
||||||
public abstract void SetMomentum(PhysicsVector momentum);
|
|
||||||
}
|
|
||||||
|
|
||||||
public class PhysicsVector
|
|
||||||
{
|
|
||||||
public float X;
|
|
||||||
public float Y;
|
|
||||||
public float Z;
|
|
||||||
|
|
||||||
public PhysicsVector()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public PhysicsVector(float x, float y, float z)
|
|
||||||
{
|
|
||||||
X = x;
|
|
||||||
Y = y;
|
|
||||||
Z = z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Axiom.MathLib">
|
<Reference Include="Axiom.MathLib">
|
||||||
<HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
|
<HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
|
||||||
|
@ -32,8 +33,11 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="PhysicsActor.cs" />
|
||||||
<Compile Include="PhysicsManager.cs" />
|
<Compile Include="PhysicsManager.cs" />
|
||||||
<Compile Include="AssemblyInfo.cs" />
|
<Compile Include="AssemblyInfo.cs" />
|
||||||
|
<Compile Include="PhysicsScene.cs" />
|
||||||
|
<Compile Include="PhysicsVector.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\ServerConsole\ServerConsole\ServerConsole.csproj">
|
<ProjectReference Include="..\ServerConsole\ServerConsole\ServerConsole.csproj">
|
||||||
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the <organization> nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace PhysicsSystem
|
||||||
|
{
|
||||||
|
public abstract class PhysicsScene
|
||||||
|
{
|
||||||
|
public static PhysicsScene Null
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new NullPhysicsScene();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract PhysicsActor AddAvatar(PhysicsVector position);
|
||||||
|
|
||||||
|
public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size);
|
||||||
|
|
||||||
|
public abstract void Simulate(float timeStep);
|
||||||
|
|
||||||
|
public abstract void GetResults();
|
||||||
|
|
||||||
|
public abstract void SetTerrain(float[] heightMap);
|
||||||
|
|
||||||
|
public abstract bool IsThreaded
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NullPhysicsScene : PhysicsScene
|
||||||
|
{
|
||||||
|
private static int m_workIndicator;
|
||||||
|
|
||||||
|
public override PhysicsActor AddAvatar(PhysicsVector position)
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : AddAvatar({0})", position);
|
||||||
|
return PhysicsActor.Null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : AddPrim({0},{1})", position, size);
|
||||||
|
return PhysicsActor.Null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Simulate(float timeStep)
|
||||||
|
{
|
||||||
|
m_workIndicator = (m_workIndicator + 1) % 10;
|
||||||
|
|
||||||
|
ServerConsole.MainConsole.Instance.SetStatus(m_workIndicator.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void GetResults()
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : GetResults()");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetTerrain(float[] heightMap)
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : SetTerrain({0} items)", heightMap.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool IsThreaded
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the <organization> nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace PhysicsSystem
|
||||||
|
{
|
||||||
|
public class PhysicsVector
|
||||||
|
{
|
||||||
|
public float X;
|
||||||
|
public float Y;
|
||||||
|
public float Z;
|
||||||
|
|
||||||
|
public PhysicsVector()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public PhysicsVector(float x, float y, float z)
|
||||||
|
{
|
||||||
|
X = x;
|
||||||
|
Y = y;
|
||||||
|
Z = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly PhysicsVector Zero = new PhysicsVector(0f, 0f, 0f);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProductVersion>8.0.50727</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{52BCCE7B-69EA-4AC3-9DBC-D571B96C2EA1}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>BasicPhysicsplugin</RootNamespace>
|
||||||
|
<AssemblyName>BasicPhysicsplugin</AssemblyName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>..\..\..\bin\Physics\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>..\..\..\bin\Physics\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Axiom.MathLib, Version=0.7.0.25497, Culture=neutral">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\bin\Axiom.MathLib.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="PhysXplugin.cs" />
|
||||||
|
<Compile Include="AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\PhysicsManager.csproj">
|
||||||
|
<Project>{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}</Project>
|
||||||
|
<Name>PhysicsManager</Name>
|
||||||
|
<Private>False</Private>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
Loading…
Reference in New Issue