mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
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.
This commit is contained in:
@@ -5,6 +5,7 @@ using OpenSim.Region.Environment.Scenes;
|
||||
using Axiom.Math;
|
||||
using libsecondlife;
|
||||
using OpenSim.Framework.Types;
|
||||
using OpenSim.Framework.Interfaces;
|
||||
|
||||
namespace SimpleApp
|
||||
{
|
||||
@@ -35,6 +36,8 @@ namespace SimpleApp
|
||||
base.UpdateMovement();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos )
|
||||
: base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default )
|
||||
{
|
||||
@@ -51,5 +54,25 @@ namespace SimpleApp
|
||||
|
||||
UpdateParentIDs();
|
||||
}
|
||||
|
||||
public override void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient)
|
||||
{
|
||||
m_parts.Remove(part.UUID);
|
||||
remoteClient.SendKillObject(m_regionHandle, part.LocalID);
|
||||
remoteClient.AddMoney(1);
|
||||
remoteClient.SendChatMessage("Poof!", 1, Pos, "Party Party", LLUUID.Zero);
|
||||
}
|
||||
|
||||
public override void OnGrabGroup( LLVector3 offsetPos, IClientAPI remoteClient)
|
||||
{
|
||||
if( m_parts.Count == 1 )
|
||||
{
|
||||
m_parts.Remove(m_rootPart.UUID);
|
||||
m_scene.RemoveEntity(this);
|
||||
remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalID);
|
||||
remoteClient.AddMoney(50);
|
||||
remoteClient.SendChatMessage("KABLAM!!!", 1, Pos, "Groupie Groupie", LLUUID.Zero);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,5 +202,10 @@ namespace SimpleApp
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
public bool AddMoney(int debit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,38 +41,43 @@ namespace SimpleApp
|
||||
this.CreateTerrainTexture();
|
||||
}
|
||||
|
||||
public override void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
|
||||
{
|
||||
foreach (EntityBase ent in Entities.Values)
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
SceneObjectGroup obj = ent as SceneObjectGroup;
|
||||
|
||||
if( obj.HasChildPrim( localID ) )
|
||||
{
|
||||
obj.ObjectGrabHandler(localID, offsetPos, remoteClient);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.ProcessObjectGrab(localID, offsetPos, remoteClient);
|
||||
}
|
||||
|
||||
#region IWorld Members
|
||||
|
||||
override public void AddNewClient(IClientAPI client, bool child)
|
||||
{
|
||||
SubscribeToClientEvents(client);
|
||||
|
||||
ScenePresence avatar = CreateAndAddScenePresence(client);
|
||||
avatar.Pos = new LLVector3(128, 128, 26);
|
||||
|
||||
LLVector3 pos = new LLVector3(128, 128, 128);
|
||||
|
||||
client.OnRegionHandShakeReply += SendLayerData;
|
||||
/*client.OnChatFromViewer +=
|
||||
delegate(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
|
||||
{
|
||||
// Echo it (so you know what you typed)
|
||||
client.SendChatMessage(message, type, fromPos, fromName, fromAgentID);
|
||||
client.SendChatMessage("Ready.", 1, pos, "System", LLUUID.Zero );
|
||||
};
|
||||
*/
|
||||
client.OnChatFromViewer += this.SimChat;
|
||||
client.OnAddPrim += AddNewPrim;
|
||||
client.OnUpdatePrimGroupPosition += this.UpdatePrimPosition;
|
||||
client.OnRequestMapBlocks += this.RequestMapBlocks;
|
||||
client.OnTeleportLocationRequest += this.RequestTeleportLocation;
|
||||
client.OnGrabUpdate += this.MoveObject;
|
||||
client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest;
|
||||
|
||||
|
||||
client.OnCompleteMovementToRegion += delegate()
|
||||
{
|
||||
client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero );
|
||||
};
|
||||
|
||||
client.SendRegionHandshake(m_regInfo);
|
||||
|
||||
ScenePresence avatar = CreateAndAddScenePresence(client);
|
||||
avatar.Pos = new LLVector3(128, 128, 26);
|
||||
client.SendRegionHandshake(m_regInfo);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user