0.1-prestable
MW 2007-04-10 10:45:46 +00:00
parent 34d91c31cf
commit 03f5ff9dc2
2 changed files with 30 additions and 25 deletions

View File

@ -85,7 +85,7 @@ namespace OpenSim
protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); //local handlers for this instance protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); //local handlers for this instance
public IUserServer UserServer public IUserServer UserServer
{ {
set set
@ -224,7 +224,7 @@ namespace OpenSim
else else
{ {
System.Text.Encoding _enc = System.Text.Encoding.ASCII; System.Text.Encoding _enc = System.Text.Encoding.ASCII;
switch (Pack.Type) switch (Pack.Type)
{ {
case PacketType.CompleteAgentMovement: case PacketType.CompleteAgentMovement:
@ -272,7 +272,7 @@ namespace OpenSim
if (ent.localid == parentprimid) if (ent.localid == parentprimid)
{ {
parentprim = (OpenSim.world.Primitive)ent; parentprim = (OpenSim.world.Primitive)ent;
} }
} }
for (int i = 1; i < link.ObjectData.Length; i++) for (int i = 1; i < link.ObjectData.Length; i++)
@ -365,7 +365,7 @@ namespace OpenSim
} }
else else
{ {
// Console.Write(Pack.ToString()); // Console.Write(Pack.ToString());
this.CreateInventoryItem(createItem); this.CreateInventoryItem(createItem);
} }
break; break;
@ -388,7 +388,7 @@ namespace OpenSim
AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID)); AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID));
if (asset != null) if (asset != null)
{ {
// Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache"); // Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache");
m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset);
} }
else else
@ -444,7 +444,7 @@ namespace OpenSim
} }
break; break;
case PacketType.UpdateTaskInventory: case PacketType.UpdateTaskInventory:
// Console.WriteLine(Pack.ToString()); // Console.WriteLine(Pack.ToString());
UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack; UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID); AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
if (myinventory != null) if (myinventory != null)
@ -476,16 +476,16 @@ namespace OpenSim
} }
break; break;
case PacketType.AgentAnimation: case PacketType.AgentAnimation:
AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack;
for (int i = 0; i < AgentAni.AnimationList.Length; i++) for (int i = 0; i < AgentAni.AnimationList.Length; i++)
{ {
if (AgentAni.AnimationList[i].StartAnim) if (AgentAni.AnimationList[i].StartAnim)
{ {
ClientAvatar.current_anim = AgentAni.AnimationList[i].AnimID; ClientAvatar.current_anim = AgentAni.AnimationList[i].AnimID;
ClientAvatar.anim_seq = 1; ClientAvatar.anim_seq = 1;
ClientAvatar.SendAnimPack(); ClientAvatar.SendAnimPack();
} }
} }
break; break;
case PacketType.ObjectSelect: case PacketType.ObjectSelect:
ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack;
@ -828,7 +828,7 @@ namespace OpenSim
}*/ }*/
m_world.RemoveViewerAgent(this); m_world.RemoveViewerAgent(this);
//need to do other cleaning up here too //need to do other cleaning up here too
m_clientThreads.Remove(this.CircuitCode); m_clientThreads.Remove(this.CircuitCode);
m_application.RemoveClientCircuit(this.CircuitCode); m_application.RemoveClientCircuit(this.CircuitCode);
this.ClientThread.Abort(); this.ClientThread.Abort();
return true; return true;
@ -836,7 +836,7 @@ namespace OpenSim
protected bool AgentTextureCached(SimClient simclient, Packet packet) protected bool AgentTextureCached(SimClient simclient, Packet packet)
{ {
// Console.WriteLine(packet.ToString()); // Console.WriteLine(packet.ToString());
AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet; AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet;
AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket(); AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket();
cachedresp.AgentData.AgentID = this.AgentID; cachedresp.AgentData.AgentID = this.AgentID;

View File

@ -109,8 +109,11 @@ namespace OpenSim.world
client.OutPacket(objupdate); client.OutPacket(objupdate);
if (client.AgentID != ControllingClient.AgentID) if (client.AgentID != ControllingClient.AgentID)
{ {
client.ClientAvatar.SendAppearanceToOtherAgent(this.ControllingClient); //the below line is already in Simclient.cs at line number 245 , directly below the call to this method
SendAppearanceToOtherAgent(client); //if there is a problem/bug with that , then lets fix it there rather than duplicating it here
//client.ClientAvatar.SendAppearanceToOtherAgent(this.ControllingClient);
SendAppearanceToOtherAgent(client);
} }
} }
} }
@ -142,10 +145,12 @@ namespace OpenSim.world
avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218];
avp.ObjectData.TextureEntry = this.avatarAppearanceTexture.ToBytes(); avp.ObjectData.TextureEntry = this.avatarAppearanceTexture.ToBytes();
AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket(); //a wearable update packets should only be sent about the viewers/agents own avatar not for other avatars
//but it seems that the following code only created the packets and never actually sent them anyway
/*AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket();
aw.AgentData.AgentID = this.ControllingClient.AgentID; aw.AgentData.AgentID = this.ControllingClient.AgentID;
aw.AgentData.SessionID = userInfo.SessionID; aw.AgentData.SessionID = userInfo.SessionID;
aw.AgentData.SerialNum = (uint)(new Random()).Next(); aw.AgentData.SerialNum = 0; //removed the use of a random number as a random number could be less than the last number, should have a counter variable for this
aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13]; aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13];
AgentWearablesUpdatePacket.WearableDataBlock awb; AgentWearablesUpdatePacket.WearableDataBlock awb;
@ -156,8 +161,8 @@ namespace OpenSim.world
awb.AssetID = this.Wearables[i].AssetID; awb.AssetID = this.Wearables[i].AssetID;
awb.ItemID = this.Wearables[i].ItemID; awb.ItemID = this.Wearables[i].ItemID;
aw.WearableData[i] = awb; aw.WearableData[i] = awb;
} }*/
AvatarAppearancePacket.VisualParamBlock avblock = null; AvatarAppearancePacket.VisualParamBlock avblock = null;
for (int i = 0; i < 218; i++) for (int i = 0; i < 218; i++)
{ {