a few small changes

0.6.0-stable
MW 2008-04-01 13:09:29 +00:00
parent 731dcbad5b
commit f43e077150
6 changed files with 68 additions and 59 deletions

View File

@ -30,7 +30,7 @@ using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Interfaces
{
public interface IAvatarFactory : IRegionModule
public interface IAvatarFactory
{
bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance);
void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance);

View File

@ -62,6 +62,13 @@ namespace OpenSim.Region.Environment.Modules
{
lock (m_syncInit)
{
if (!m_scenes.Contains(scene))
{
m_scenes.Add(scene);
scene.EventManager.OnNewClient += NewClient;
scene.RegisterModuleInterface<ISimChat>(this);
}
// wrap this in a try block so that defaults will work if
// the config file doesn't specify otherwise.
try
@ -82,13 +89,6 @@ namespace OpenSim.Region.Environment.Modules
{
}
if (!m_scenes.Contains(scene))
{
m_scenes.Add(scene);
scene.EventManager.OnNewClient += NewClient;
scene.RegisterModuleInterface<ISimChat>(this);
}
// setup IRC Relay
if (m_irc == null) { m_irc = new IRCChatModule(config); }
if (m_irc_connector == null)

View File

@ -986,15 +986,18 @@ namespace OpenSim.Region.Environment.Scenes
if (terrain != null)
{
byte[] data = terrain.WriteJpegImage("defaultstripe.png");
m_regInfo.EstateSettings.terrainImageID = LLUUID.Random();
AssetBase asset = new AssetBase();
asset.FullID = m_regInfo.EstateSettings.terrainImageID;
asset.Data = data;
asset.Name = "terrainImage";
asset.Description = RegionInfo.RegionName;
asset.Type = 0;
asset.Temporary = temporary;
AssetCache.AddAsset(asset);
if (data != null)
{
m_regInfo.EstateSettings.terrainImageID = LLUUID.Random();
AssetBase asset = new AssetBase();
asset.FullID = m_regInfo.EstateSettings.terrainImageID;
asset.Data = data;
asset.Name = "terrainImage";
asset.Description = RegionInfo.RegionName;
asset.Type = 0;
asset.Temporary = temporary;
AssetCache.AddAsset(asset);
}
}
}

View File

@ -41,6 +41,7 @@ namespace OpenSim.Region.Examples.SimpleModule
private short flyState = 0;
private LLQuaternion bodyDirection = LLQuaternion.Identity;
private short count = 0;
private short frame = 0;
#pragma warning disable 67
@ -450,49 +451,54 @@ namespace OpenSim.Region.Examples.SimpleModule
private void Update()
{
if (OnAgentUpdate != null)
frame++;
if (frame > 20)
{
AgentUpdatePacket pack = new AgentUpdatePacket();
pack.AgentData.ControlFlags = movementFlag;
pack.AgentData.BodyRotation = bodyDirection;
OnAgentUpdate(this, pack);
}
if (flyState == 0)
{
movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY |
(uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG;
flyState = 1;
}
else if (flyState == 1)
{
movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY |
(uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
flyState = 2;
}
else
{
movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY;
flyState = 0;
}
if (count >= 200)
{
if (OnChatFromViewer != null)
frame = 0;
if (OnAgentUpdate != null)
{
ChatFromViewerArgs args = new ChatFromViewerArgs();
args.Message = "Kinda quiet around here, isn't it?";
args.Channel = 0;
args.From = FirstName + " " + LastName;
args.Position = new LLVector3(128, 128, 26);
args.Sender = this;
args.Type = ChatTypeEnum.Shout;
OnChatFromViewer(this, args);
AgentUpdatePacket pack = new AgentUpdatePacket();
pack.AgentData.ControlFlags = movementFlag;
pack.AgentData.BodyRotation = bodyDirection;
OnAgentUpdate(this, pack);
}
if (flyState == 0)
{
movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY |
(uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG;
flyState = 1;
}
else if (flyState == 1)
{
movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY |
(uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
flyState = 2;
}
else
{
movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
flyState = 0;
}
count = -1;
}
count++;
if (count >= 10)
{
if (OnChatFromViewer != null)
{
ChatFromViewerArgs args = new ChatFromViewerArgs();
args.Message = "Kinda quiet around here, isn't it?";
args.Channel = 0;
args.From = FirstName + " " + LastName;
args.Position = new LLVector3(128, 128, 26);
args.Sender = this;
args.Type = ChatTypeEnum.Shout;
OnChatFromViewer(this, args);
}
count = -1;
}
count++;
}
}
public bool AddMoney(int debit)

View File

@ -56,7 +56,7 @@ namespace OpenSim.Region.Examples.SimpleModule
AddCpuCounter(regionInfo, pos);
// AddComplexObjects(regionInfo, pos);
// AddAvatars();
AddAvatars();
AddFileSystemObjects();
}

View File

@ -39,7 +39,7 @@ using OpenSim.Framework.Data.MapperFactory;
namespace OpenSim.Region.Modules.AvatarFactory
{
public class AvatarFactoryModule : IAvatarFactory
public class AvatarFactoryModule : IAvatarFactory, IRegionModule
{
private Scene m_scene = null;
private readonly Dictionary<LLUUID, AvatarAppearance> m_avatarsAppearance = new Dictionary<LLUUID, AvatarAppearance>();
@ -100,7 +100,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
}
else
{
Thread.Sleep(5000);
Thread.Sleep(5000); //why is this here?
//this is the first thread to request this appearance
//so let it check the db and if not found then create a default appearance