diff options
author | gareth | 2007-02-28 22:21:33 +0000 |
---|---|---|
committer | gareth | 2007-02-28 22:21:33 +0000 |
commit | 8f3c679c734882fad1e1f8c2dfec1b58f1943f58 (patch) | |
tree | 715c2213676c5df9e559324b9053d4de2cf431a2 /src | |
parent | Adding monodevelop project (diff) | |
download | opensim-SC_OLD-8f3c679c734882fad1e1f8c2dfec1b58f1943f58.zip opensim-SC_OLD-8f3c679c734882fad1e1f8c2dfec1b58f1943f58.tar.gz opensim-SC_OLD-8f3c679c734882fad1e1f8c2dfec1b58f1943f58.tar.bz2 opensim-SC_OLD-8f3c679c734882fad1e1f8c2dfec1b58f1943f58.tar.xz |
Half-working asset system, but avatar objectupdate stuff needs to be done by a non-Gareth
Diffstat (limited to '')
-rw-r--r-- | src/OpenSimClient.cs | 33 | ||||
-rw-r--r-- | src/world/Avatar.cs | 25 |
2 files changed, 58 insertions, 0 deletions
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 | |||
98 | Transfer.TransferInfo.Params = reqPacket.TransferInfo.Params; | 98 | Transfer.TransferInfo.Params = reqPacket.TransferInfo.Params; |
99 | Transfer.TransferInfo.Size = (int)AssetResponse.ContentLength; | 99 | Transfer.TransferInfo.Size = (int)AssetResponse.ContentLength; |
100 | Transfer.TransferInfo.TransferID = reqPacket.TransferInfo.TransferID; | 100 | Transfer.TransferInfo.TransferID = reqPacket.TransferInfo.TransferID; |
101 | |||
102 | OutPacket(Transfer); | ||
103 | |||
104 | TransferPacketPacket TransferPacket = new TransferPacketPacket(); | ||
105 | TransferPacket.TransferData.Packet = 0; | ||
106 | TransferPacket.TransferData.ChannelType = 2; | ||
107 | TransferPacket.TransferData.TransferID=reqPacket.TransferInfo.TransferID; | ||
108 | |||
109 | if(AssetResponse.ContentLength>1000) { | ||
110 | byte[] chunk = new byte[1000]; | ||
111 | Array.Copy(idata,chunk,1000); | ||
112 | TransferPacket.TransferData.Data = chunk; | ||
113 | TransferPacket.TransferData.Status = 0; | ||
114 | OutPacket(TransferPacket); | ||
115 | |||
116 | TransferPacket = new TransferPacketPacket(); | ||
117 | TransferPacket.TransferData.Packet = 1; | ||
118 | TransferPacket.TransferData.ChannelType = 2; | ||
119 | TransferPacket.TransferData.TransferID = reqPacket.TransferInfo.TransferID; | ||
120 | byte[] chunk1 = new byte[(idata.Length-1000)]; | ||
121 | Array.Copy(idata, 1000, chunk1, 0, chunk1.Length); | ||
122 | TransferPacket.TransferData.Data = chunk1; | ||
123 | TransferPacket.TransferData.Status = 1; | ||
124 | OutPacket(TransferPacket); | ||
125 | } else { | ||
126 | TransferPacket.TransferData.Status = 1; | ||
127 | TransferPacket.TransferData.Data = idata; | ||
128 | OutPacket(TransferPacket); | ||
129 | } | ||
101 | } | 130 | } |
102 | 131 | ||
103 | public void ProcessInPacket(Packet Pack) { | 132 | public void ProcessInPacket(Packet Pack) { |
@@ -109,7 +138,11 @@ namespace OpenSim | |||
109 | case PacketType.RegionHandshakeReply: | 138 | case PacketType.RegionHandshakeReply: |
110 | OpenSim_Main.local_world.SendLayerData(this); | 139 | OpenSim_Main.local_world.SendLayerData(this); |
111 | break; | 140 | break; |
141 | case PacketType.AgentWearablesRequest: | ||
142 | ClientAvatar.SendInitialAppearance(); | ||
143 | break; | ||
112 | case PacketType.TransferRequest: | 144 | case PacketType.TransferRequest: |
145 | Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request"); | ||
113 | // We put transfer requests into a big queue and then spawn a thread for each new one | 146 | // We put transfer requests into a big queue and then spawn a thread for each new one |
114 | TransferRequestPacket transfer = (TransferRequestPacket)Pack; | 147 | TransferRequestPacket transfer = (TransferRequestPacket)Pack; |
115 | AssetRequests.Enqueue(transfer); | 148 | 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 | |||
32 | ControllingClient.OutPacket(mov); | 32 | ControllingClient.OutPacket(mov); |
33 | } | 33 | } |
34 | 34 | ||
35 | public void SendInitialPosition() { | ||
36 | } | ||
37 | |||
38 | public void SendInitialAppearance() { | ||
39 | AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket(); | ||
40 | aw.AgentData.AgentID = this.ControllingClient.AgentID; | ||
41 | aw.AgentData.SerialNum = 0; | ||
42 | aw.AgentData.SessionID = ControllingClient.SessionID; | ||
43 | |||
44 | aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13]; | ||
45 | AgentWearablesUpdatePacket.WearableDataBlock awb = new AgentWearablesUpdatePacket.WearableDataBlock(); | ||
46 | awb.WearableType = (byte)0; | ||
47 | awb.AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | ||
48 | awb.ItemID = LLUUID.Random(); | ||
49 | aw.WearableData[0] = awb; | ||
50 | |||
51 | for(int i=1; i<13; i++) { | ||
52 | awb = new AgentWearablesUpdatePacket.WearableDataBlock(); | ||
53 | awb.WearableType = (byte)i; | ||
54 | awb.AssetID = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
55 | awb.ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
56 | aw.WearableData[i] = awb; | ||
57 | } | ||
58 | } | ||
59 | |||
35 | public void SendRegionHandshake(World RegionInfo) { | 60 | public void SendRegionHandshake(World RegionInfo) { |
36 | Console.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); | 61 | Console.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); |
37 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; | 62 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; |