30 using OpenSim.Framework;
41 public delegate
void TerrainUploadComplete(
string name, byte[] filedata,
IClientAPI remoteClient);
48 private sbyte type = 0;
51 private TerrainUploadComplete handlerTerrainUploadDone;
55 m_asset =
new AssetBase(UUID.Zero, pClientFilename, type, pRemoteClient.
AgentId.ToString());
56 m_asset.Data =
new byte[0];
57 m_asset.Description =
"empty";
59 m_asset.Temporary =
true;
64 get {
return mXferID; }
69 mXferID = Util.GetNextXferID();
70 pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name));
81 if (mXferID != xferID)
86 if (m_asset.Data.Length > 1)
88 byte[] destinationArray =
new byte[m_asset.Data.Length + data.Length];
89 Array.Copy(m_asset.Data, 0, destinationArray, 0, m_asset.Data.Length);
90 Array.Copy(data, 0, destinationArray, m_asset.Data.Length, data.Length);
91 m_asset.Data = destinationArray;
95 byte[] buffer2 =
new byte[data.Length - 4];
96 Array.Copy(data, 4, buffer2, 0, data.Length - 4);
97 m_asset.Data = buffer2;
100 remoteClient.SendConfirmXfer(xferID, packetID);
102 if ((packetID & 0x80000000) != 0)
104 SendCompleteMessage(remoteClient);
111 handlerTerrainUploadDone = TerrainUploadDone;
112 if (handlerTerrainUploadDone != null)
114 handlerTerrainUploadDone(m_asset.Name, m_asset.Data, remoteClient);
void SendCompleteMessage(IClientAPI remoteClient)
TerrainUploadComplete TerrainUploadDone
void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data)
Process transfer data received from the client.
Asset class. All Assets are reference by this class or a class derived from this class ...
void RequestStartXfer(IClientAPI pRemoteClient)
EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename)