From 8f3c679c734882fad1e1f8c2dfec1b58f1943f58 Mon Sep 17 00:00:00 2001 From: gareth Date: Wed, 28 Feb 2007 22:21:33 +0000 Subject: Half-working asset system, but avatar objectupdate stuff needs to be done by a non-Gareth --- src/OpenSimClient.cs | 33 +++++++++++++++++++++++++++++++++ src/world/Avatar.cs | 25 +++++++++++++++++++++++++ 2 files changed, 58 insertions(+) (limited to 'src') diff --git a/src/OpenSimClient.cs b/src/OpenSimClient.cs index f9349db..af4ce0e 100644 --- a/src/OpenSimClient.cs +++ b/src/OpenSimClient.cs @@ -98,6 +98,35 @@ namespace OpenSim Transfer.TransferInfo.Params = reqPacket.TransferInfo.Params; Transfer.TransferInfo.Size = (int)AssetResponse.ContentLength; Transfer.TransferInfo.TransferID = reqPacket.TransferInfo.TransferID; + + OutPacket(Transfer); + + TransferPacketPacket TransferPacket = new TransferPacketPacket(); + TransferPacket.TransferData.Packet = 0; + TransferPacket.TransferData.ChannelType = 2; + TransferPacket.TransferData.TransferID=reqPacket.TransferInfo.TransferID; + + if(AssetResponse.ContentLength>1000) { + byte[] chunk = new byte[1000]; + Array.Copy(idata,chunk,1000); + TransferPacket.TransferData.Data = chunk; + TransferPacket.TransferData.Status = 0; + OutPacket(TransferPacket); + + TransferPacket = new TransferPacketPacket(); + TransferPacket.TransferData.Packet = 1; + TransferPacket.TransferData.ChannelType = 2; + TransferPacket.TransferData.TransferID = reqPacket.TransferInfo.TransferID; + byte[] chunk1 = new byte[(idata.Length-1000)]; + Array.Copy(idata, 1000, chunk1, 0, chunk1.Length); + TransferPacket.TransferData.Data = chunk1; + TransferPacket.TransferData.Status = 1; + OutPacket(TransferPacket); + } else { + TransferPacket.TransferData.Status = 1; + TransferPacket.TransferData.Data = idata; + OutPacket(TransferPacket); + } } public void ProcessInPacket(Packet Pack) { @@ -109,7 +138,11 @@ namespace OpenSim case PacketType.RegionHandshakeReply: OpenSim_Main.local_world.SendLayerData(this); break; + case PacketType.AgentWearablesRequest: + ClientAvatar.SendInitialAppearance(); + break; case PacketType.TransferRequest: + Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request"); // We put transfer requests into a big queue and then spawn a thread for each new one TransferRequestPacket transfer = (TransferRequestPacket)Pack; AssetRequests.Enqueue(transfer); diff --git a/src/world/Avatar.cs b/src/world/Avatar.cs index dfb739e..775b601 100644 --- a/src/world/Avatar.cs +++ b/src/world/Avatar.cs @@ -32,6 +32,31 @@ namespace OpenSim.world ControllingClient.OutPacket(mov); } + public void SendInitialPosition() { + } + + public void SendInitialAppearance() { + AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket(); + aw.AgentData.AgentID = this.ControllingClient.AgentID; + aw.AgentData.SerialNum = 0; + aw.AgentData.SessionID = ControllingClient.SessionID; + + aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13]; + AgentWearablesUpdatePacket.WearableDataBlock awb = new AgentWearablesUpdatePacket.WearableDataBlock(); + awb.WearableType = (byte)0; + awb.AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); + awb.ItemID = LLUUID.Random(); + aw.WearableData[0] = awb; + + for(int i=1; i<13; i++) { + awb = new AgentWearablesUpdatePacket.WearableDataBlock(); + awb.WearableType = (byte)i; + awb.AssetID = new LLUUID("00000000-0000-0000-0000-000000000000"); + awb.ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); + aw.WearableData[i] = awb; + } + } + public void SendRegionHandshake(World RegionInfo) { Console.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); System.Text.Encoding _enc = System.Text.Encoding.ASCII; -- cgit v1.1