diff options
author | lbsa71 | 2007-06-09 21:45:58 +0000 |
---|---|---|
committer | lbsa71 | 2007-06-09 21:45:58 +0000 |
commit | 4224b695acc2e1ad0199dc0ad7f560494182ed54 (patch) | |
tree | 8fae1cf25a058bc4e378ef2b6ce264d7f9f0b910 /OpenSim/Examples/SimpleApp2/MyClientView.cs | |
parent | *Fixed casting mishap in last commit - client now starts up without crashing (diff) | |
download | opensim-SC-4224b695acc2e1ad0199dc0ad7f560494182ed54.zip opensim-SC-4224b695acc2e1ad0199dc0ad7f560494182ed54.tar.gz opensim-SC-4224b695acc2e1ad0199dc0ad7f560494182ed54.tar.bz2 opensim-SC-4224b695acc2e1ad0199dc0ad7f560494182ed54.tar.xz |
* LogFile now defaults to "{apptype}.log"
* cleaned away suo and user files.
* added handy string chat variety to the API
* Moved LockPhysicsEngine on World to SyncRoot on IWorld
* Introduced NextLocalId instead of World fuggliness.
* Transformed GetRegionInfo to Property on IWorld for great justice
* Extracted default wearables (good to have)
* Deleted unused BaseServer
* Used IWorld instead of World wherever possible
* The client constructor's not getting unused port any longer.
* Extracted ClientView factoring so PacketServer can be tweaked.
* Added SendLayerData to World
* Made WorldBase abstract and cleaned it up a bit
* added OpenGrid.Framework.Communications.dll.build and OpenSim.World.dll.build to svn
* Added code for two examples (but not in prebuild yet)
Diffstat (limited to 'OpenSim/Examples/SimpleApp2/MyClientView.cs')
-rw-r--r-- | OpenSim/Examples/SimpleApp2/MyClientView.cs | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/OpenSim/Examples/SimpleApp2/MyClientView.cs b/OpenSim/Examples/SimpleApp2/MyClientView.cs new file mode 100644 index 0000000..dd8869c --- /dev/null +++ b/OpenSim/Examples/SimpleApp2/MyClientView.cs | |||
@@ -0,0 +1,69 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim; | ||
5 | using libsecondlife; | ||
6 | using OpenSim.Framework.Interfaces; | ||
7 | using System.Net; | ||
8 | using libsecondlife.Packets; | ||
9 | using OpenSim.Assets; | ||
10 | using OpenSim.Framework.Types; | ||
11 | using OpenSim.Framework; | ||
12 | |||
13 | namespace SimpleApp2 | ||
14 | { | ||
15 | public class MyClientView : ClientView | ||
16 | { | ||
17 | private float[] m_map; | ||
18 | private Dictionary<uint, IClientAPI> m_clientAPIs; | ||
19 | |||
20 | public MyClientView(float[] map, Dictionary<uint, IClientAPI> clientAPIs, EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions) | ||
21 | : base(remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions) | ||
22 | { | ||
23 | m_map = map; | ||
24 | m_clientAPIs = clientAPIs; | ||
25 | |||
26 | OnRegionHandShakeReply += RegionHandShakeReplyHandler; | ||
27 | OnChatFromViewer += ChatHandler; | ||
28 | OnRequestWearables += RequestWearablesHandler; | ||
29 | OnCompleteMovementToRegion += CompleteMovementToRegionHandler; | ||
30 | } | ||
31 | |||
32 | private void ChatHandler(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) | ||
33 | { | ||
34 | // Echo it (so you know what you typed) | ||
35 | SendChatMessage(message, type, fromPos, fromName, fromAgentID); | ||
36 | SendChatMessage("Ready.", 1, fromPos, "System", LLUUID.Zero); | ||
37 | } | ||
38 | |||
39 | private void CompleteMovementToRegionHandler() | ||
40 | { | ||
41 | LLVector3 pos = new LLVector3(128, 128, 128); | ||
42 | |||
43 | MoveAgentIntoRegion(m_world.RegionInfo); | ||
44 | |||
45 | SendAvatarData( m_world.RegionInfo, FirstName, | ||
46 | LastName, AgentId, 0, | ||
47 | pos); | ||
48 | |||
49 | SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero); | ||
50 | |||
51 | |||
52 | |||
53 | // OpenSim.world.Primitive prim = new OpenSim.world.Primitive( m_clientAPIs, m_world.RegionInfo.RegionHandle, m_world, AgentId ); | ||
54 | |||
55 | // SendNewPrim( prim ); | ||
56 | |||
57 | } | ||
58 | |||
59 | private void RegionHandShakeReplyHandler(IClientAPI client) | ||
60 | { | ||
61 | client.SendLayerData(m_map); | ||
62 | } | ||
63 | |||
64 | private void RequestWearablesHandler(IClientAPI client) | ||
65 | { | ||
66 | SendWearables(AvatarWearable.DefaultWearables); | ||
67 | } | ||
68 | } | ||
69 | } | ||