aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Examples/SimpleApp2/MyClientView.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Examples/SimpleApp2/MyClientView.cs69
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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim;
5using libsecondlife;
6using OpenSim.Framework.Interfaces;
7using System.Net;
8using libsecondlife.Packets;
9using OpenSim.Assets;
10using OpenSim.Framework.Types;
11using OpenSim.Framework;
12
13namespace 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}