diff options
author | lbsa71 | 2007-08-15 21:24:25 +0000 |
---|---|---|
committer | lbsa71 | 2007-08-15 21:24:25 +0000 |
commit | 94af93874226bf4441a35bfd4cf498e9ed83ccf5 (patch) | |
tree | 4fd6498ca8384f375bfc1365e74469af13954ae0 /OpenSim/Region/Examples | |
parent | compile error removed :) (diff) | |
download | opensim-SC-94af93874226bf4441a35bfd4cf498e9ed83ccf5.zip opensim-SC-94af93874226bf4441a35bfd4cf498e9ed83ccf5.tar.gz opensim-SC-94af93874226bf4441a35bfd4cf498e9ed83ccf5.tar.bz2 opensim-SC-94af93874226bf4441a35bfd4cf498e9ed83ccf5.tar.xz |
The 'Party Party Groupie Groupie Life is a game' commit:
* Added prototypical MoneyBalance support
* Finalized konceptual touch wiring
* Turned SimpleApp into a tedious harvesting game.
Diffstat (limited to 'OpenSim/Region/Examples')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/ComplexObject.cs | 23 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyWorld.cs | 47 |
3 files changed, 54 insertions, 21 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs b/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs index b1da33a..5821b9f 100644 --- a/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs | |||
@@ -5,6 +5,7 @@ using OpenSim.Region.Environment.Scenes; | |||
5 | using Axiom.Math; | 5 | using Axiom.Math; |
6 | using libsecondlife; | 6 | using libsecondlife; |
7 | using OpenSim.Framework.Types; | 7 | using OpenSim.Framework.Types; |
8 | using OpenSim.Framework.Interfaces; | ||
8 | 9 | ||
9 | namespace SimpleApp | 10 | namespace SimpleApp |
10 | { | 11 | { |
@@ -35,6 +36,8 @@ namespace SimpleApp | |||
35 | base.UpdateMovement(); | 36 | base.UpdateMovement(); |
36 | } | 37 | } |
37 | 38 | ||
39 | |||
40 | |||
38 | public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos ) | 41 | public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos ) |
39 | : base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default ) | 42 | : base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default ) |
40 | { | 43 | { |
@@ -51,5 +54,25 @@ namespace SimpleApp | |||
51 | 54 | ||
52 | UpdateParentIDs(); | 55 | UpdateParentIDs(); |
53 | } | 56 | } |
57 | |||
58 | public override void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient) | ||
59 | { | ||
60 | m_parts.Remove(part.UUID); | ||
61 | remoteClient.SendKillObject(m_regionHandle, part.LocalID); | ||
62 | remoteClient.AddMoney(1); | ||
63 | remoteClient.SendChatMessage("Poof!", 1, Pos, "Party Party", LLUUID.Zero); | ||
64 | } | ||
65 | |||
66 | public override void OnGrabGroup( LLVector3 offsetPos, IClientAPI remoteClient) | ||
67 | { | ||
68 | if( m_parts.Count == 1 ) | ||
69 | { | ||
70 | m_parts.Remove(m_rootPart.UUID); | ||
71 | m_scene.RemoveEntity(this); | ||
72 | remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalID); | ||
73 | remoteClient.AddMoney(50); | ||
74 | remoteClient.SendChatMessage("KABLAM!!!", 1, Pos, "Groupie Groupie", LLUUID.Zero); | ||
75 | } | ||
76 | } | ||
54 | } | 77 | } |
55 | } | 78 | } |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index c0132f5..8bd7496 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -202,5 +202,10 @@ namespace SimpleApp | |||
202 | 202 | ||
203 | count++; | 203 | count++; |
204 | } | 204 | } |
205 | |||
206 | public bool AddMoney(int debit) | ||
207 | { | ||
208 | return false; | ||
209 | } | ||
205 | } | 210 | } |
206 | } | 211 | } |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs index 92dd61b..6cf8974 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs | |||
@@ -41,38 +41,43 @@ namespace SimpleApp | |||
41 | this.CreateTerrainTexture(); | 41 | this.CreateTerrainTexture(); |
42 | } | 42 | } |
43 | 43 | ||
44 | public override void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | ||
45 | { | ||
46 | foreach (EntityBase ent in Entities.Values) | ||
47 | { | ||
48 | if (ent is SceneObjectGroup) | ||
49 | { | ||
50 | SceneObjectGroup obj = ent as SceneObjectGroup; | ||
51 | |||
52 | if( obj.HasChildPrim( localID ) ) | ||
53 | { | ||
54 | obj.ObjectGrabHandler(localID, offsetPos, remoteClient); | ||
55 | return; | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | |||
60 | base.ProcessObjectGrab(localID, offsetPos, remoteClient); | ||
61 | } | ||
62 | |||
44 | #region IWorld Members | 63 | #region IWorld Members |
45 | 64 | ||
46 | override public void AddNewClient(IClientAPI client, bool child) | 65 | override public void AddNewClient(IClientAPI client, bool child) |
47 | { | 66 | { |
67 | SubscribeToClientEvents(client); | ||
68 | |||
69 | ScenePresence avatar = CreateAndAddScenePresence(client); | ||
70 | avatar.Pos = new LLVector3(128, 128, 26); | ||
71 | |||
48 | LLVector3 pos = new LLVector3(128, 128, 128); | 72 | LLVector3 pos = new LLVector3(128, 128, 128); |
49 | 73 | ||
50 | client.OnRegionHandShakeReply += SendLayerData; | ||
51 | /*client.OnChatFromViewer += | ||
52 | delegate(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) | ||
53 | { | ||
54 | // Echo it (so you know what you typed) | ||
55 | client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); | ||
56 | client.SendChatMessage("Ready.", 1, pos, "System", LLUUID.Zero ); | ||
57 | }; | ||
58 | */ | ||
59 | client.OnChatFromViewer += this.SimChat; | ||
60 | client.OnAddPrim += AddNewPrim; | ||
61 | client.OnUpdatePrimGroupPosition += this.UpdatePrimPosition; | ||
62 | client.OnRequestMapBlocks += this.RequestMapBlocks; | ||
63 | client.OnTeleportLocationRequest += this.RequestTeleportLocation; | ||
64 | client.OnGrabUpdate += this.MoveObject; | ||
65 | client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; | ||
66 | |||
67 | client.OnCompleteMovementToRegion += delegate() | 74 | client.OnCompleteMovementToRegion += delegate() |
68 | { | 75 | { |
69 | client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero ); | 76 | client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero ); |
70 | }; | 77 | }; |
71 | 78 | ||
72 | client.SendRegionHandshake(m_regInfo); | ||
73 | 79 | ||
74 | ScenePresence avatar = CreateAndAddScenePresence(client); | 80 | client.SendRegionHandshake(m_regInfo); |
75 | avatar.Pos = new LLVector3(128, 128, 26); | ||
76 | } | 81 | } |
77 | 82 | ||
78 | #endregion | 83 | #endregion |