diff options
author | MW | 2007-02-03 19:51:52 +0000 |
---|---|---|
committer | MW | 2007-02-03 19:51:52 +0000 |
commit | 3a157273da7de6caa098ac4af406e37be02a1171 (patch) | |
tree | b30b6a30a7e84ebe2dcff80e9d0207b8495f1173 /Agent_Manager.cs | |
parent | (no commit message) (diff) | |
download | opensim-SC-3a157273da7de6caa098ac4af406e37be02a1171.zip opensim-SC-3a157273da7de6caa098ac4af406e37be02a1171.tar.gz opensim-SC-3a157273da7de6caa098ac4af406e37be02a1171.tar.bz2 opensim-SC-3a157273da7de6caa098ac4af406e37be02a1171.tar.xz |
Added Basic Inventory support
Diffstat (limited to 'Agent_Manager.cs')
-rw-r--r-- | Agent_Manager.cs | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/Agent_Manager.cs b/Agent_Manager.cs index 9aa8d7f..2f5ceba 100644 --- a/Agent_Manager.cs +++ b/Agent_Manager.cs | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | Copyright (c) 2007 Michael Wright | 2 | Copyright (c) OpenSim project, http://sim.opensecondlife.org/ |
3 | * | 3 | * |
4 | * Redistribution and use in source and binary forms, with or without | 4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions are met: | 5 | * modification, are permitted provided that the following conditions are met: |
@@ -44,6 +44,7 @@ namespace OpenSim | |||
44 | private uint local_numer=0; | 44 | private uint local_numer=0; |
45 | private Server server; | 45 | private Server server; |
46 | public PrimManager Prim_Manager; | 46 | public PrimManager Prim_Manager; |
47 | public AssetManagement Asset_Manager; | ||
47 | 48 | ||
48 | private libsecondlife.Packets.RegionHandshakePacket RegionPacket; | 49 | private libsecondlife.Packets.RegionHandshakePacket RegionPacket; |
49 | private System.Text.Encoding enc = System.Text.Encoding.ASCII; | 50 | private System.Text.Encoding enc = System.Text.Encoding.ASCII; |
@@ -101,7 +102,7 @@ namespace OpenSim | |||
101 | /// <param name="first"></param> | 102 | /// <param name="first"></param> |
102 | /// <param name="last"></param> | 103 | /// <param name="last"></param> |
103 | /// <returns></returns> | 104 | /// <returns></returns> |
104 | public bool NewAgent(User_Agent_info User_info, string first, string last) | 105 | public bool NewAgent(User_Agent_info User_info, string first, string last ,LLUUID BaseFolder,LLUUID InventoryFolder) |
105 | { | 106 | { |
106 | AvatarData agent=new AvatarData(); | 107 | AvatarData agent=new AvatarData(); |
107 | agent.FullID=User_info.AgentID; | 108 | agent.FullID=User_info.AgentID; |
@@ -109,7 +110,13 @@ namespace OpenSim | |||
109 | agent.NetInfo.first_name=first; | 110 | agent.NetInfo.first_name=first; |
110 | agent.NetInfo.last_name=last; | 111 | agent.NetInfo.last_name=last; |
111 | agent.Position=new LLVector3(100,100,22); | 112 | agent.Position=new LLVector3(100,100,22); |
113 | agent.BaseFolder=BaseFolder; | ||
114 | agent.InventoryFolder=InventoryFolder; | ||
112 | this.AgentList.Add(agent.FullID,agent); | 115 | this.AgentList.Add(agent.FullID,agent); |
116 | |||
117 | //Create new Wearable Assets and place in Inventory | ||
118 | this.Asset_Manager.CreateNewInventorySet(ref agent,User_info); | ||
119 | |||
113 | return(true); | 120 | return(true); |
114 | } | 121 | } |
115 | 122 | ||
@@ -343,29 +350,27 @@ namespace OpenSim | |||
343 | /// <param name="user"></param> | 350 | /// <param name="user"></param> |
344 | public void SendIntialAvatarAppearance(User_Agent_info user) | 351 | public void SendIntialAvatarAppearance(User_Agent_info user) |
345 | { | 352 | { |
346 | 353 | AvatarData Agent=this.AgentList[user.AgentID]; | |
347 | AgentWearablesUpdatePacket aw=new AgentWearablesUpdatePacket(); | 354 | AgentWearablesUpdatePacket aw=new AgentWearablesUpdatePacket(); |
348 | aw.AgentData.AgentID=user.AgentID; | 355 | aw.AgentData.AgentID=user.AgentID; |
349 | aw.AgentData.SerialNum=0;//(uint)appc; | 356 | aw.AgentData.SerialNum=0; |
350 | //appc++; | 357 | aw.AgentData.SessionID=user.SessionID; |
351 | aw.AgentData.SessionID=user.SessionID;//new LLUUID("00000000-0000-0000-0000-000000000000");//user.SessionID; | ||
352 | 358 | ||
353 | aw.WearableData= new AgentWearablesUpdatePacket.WearableDataBlock[13]; | 359 | aw.WearableData= new AgentWearablesUpdatePacket.WearableDataBlock[13]; |
354 | AgentWearablesUpdatePacket.WearableDataBlock awb=null; | 360 | AgentWearablesUpdatePacket.WearableDataBlock awb=null; |
355 | awb=new AgentWearablesUpdatePacket.WearableDataBlock(); | 361 | awb=new AgentWearablesUpdatePacket.WearableDataBlock(); |
356 | awb.WearableType=(byte)0; | 362 | awb.WearableType=(byte)0; |
357 | awb.AssetID=new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | 363 | awb.AssetID=Agent.Wearables[0].AssetID;//new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); |
358 | awb.ItemID=new LLUUID("b7878441893b094917f791174bc8401c"); | 364 | awb.ItemID=Agent.Wearables[0].ItemID;//new LLUUID("b7878441893b094917f791174bc8401c"); |
359 | aw.WearableData[0]=awb; | 365 | aw.WearableData[0]=awb; |
360 | 366 | ||
361 | /*awb=new AgentWearablesUpdatePacket.WearableDataBlock(); | 367 | awb=new AgentWearablesUpdatePacket.WearableDataBlock(); |
362 | awb.WearableType=(byte)1; | 368 | awb.WearableType=(byte)1; |
363 | awb.AssetID=new LLUUID("e0ee49b5a4184df8d3c9a65361fe7f49"); | 369 | awb.AssetID=Agent.Wearables[1].AssetID;//new LLUUID("e0ee49b5a4184df8d3c9a65361fe7f49"); |
364 | awb.ItemID=new LLUUID("193f0876fc11d143797454352f9c9c26"); | 370 | awb.ItemID=Agent.Wearables[1].ItemID;//new LLUUID("193f0876fc11d143797454352f9c9c26"); |
365 | //awb.ItemID=new LLUUID("00000000-0000-0000-0000-000000000000"); | 371 | aw.WearableData[1]=awb; |
366 | aw.WearableData[1]=awb;*/ | ||
367 | 372 | ||
368 | for(int i=1; i<13; i++) | 373 | for(int i=2; i<13; i++) |
369 | { | 374 | { |
370 | awb=new AgentWearablesUpdatePacket.WearableDataBlock(); | 375 | awb=new AgentWearablesUpdatePacket.WearableDataBlock(); |
371 | awb.WearableType=(byte)i; | 376 | awb.WearableType=(byte)i; |
@@ -412,6 +417,7 @@ namespace OpenSim | |||
412 | server.SendPacket(avp,true,user); | 417 | server.SendPacket(avp,true,user); |
413 | 418 | ||
414 | } | 419 | } |
420 | |||
415 | /// <summary> | 421 | /// <summary> |
416 | /// | 422 | /// |
417 | /// </summary> | 423 | /// </summary> |
@@ -638,9 +644,27 @@ namespace OpenSim | |||
638 | public bool Walk=false; | 644 | public bool Walk=false; |
639 | public bool Started=false; | 645 | public bool Started=false; |
640 | //public TextureEntry TextureEntry; | 646 | //public TextureEntry TextureEntry; |
647 | public AvatarWearable[] Wearables; | ||
648 | public LLUUID InventoryFolder; | ||
649 | public LLUUID BaseFolder; | ||
641 | 650 | ||
642 | public AvatarData() | 651 | public AvatarData() |
643 | { | 652 | { |
653 | Wearables=new AvatarWearable[2]; //should be 13 | ||
654 | for(int i=0; i<2; i++) | ||
655 | { | ||
656 | Wearables[i]=new AvatarWearable(); | ||
657 | } | ||
658 | } | ||
659 | } | ||
660 | |||
661 | public class AvatarWearable | ||
662 | { | ||
663 | public LLUUID AssetID; | ||
664 | public LLUUID ItemID; | ||
665 | |||
666 | public AvatarWearable() | ||
667 | { | ||
644 | 668 | ||
645 | } | 669 | } |
646 | } | 670 | } |