a few small changes
parent
731dcbad5b
commit
f43e077150
|
@ -30,7 +30,7 @@ using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Interfaces
|
namespace OpenSim.Region.Environment.Interfaces
|
||||||
{
|
{
|
||||||
public interface IAvatarFactory : IRegionModule
|
public interface IAvatarFactory
|
||||||
{
|
{
|
||||||
bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance);
|
bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance);
|
||||||
void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance);
|
void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance);
|
||||||
|
|
|
@ -62,6 +62,13 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
lock (m_syncInit)
|
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
|
// wrap this in a try block so that defaults will work if
|
||||||
// the config file doesn't specify otherwise.
|
// the config file doesn't specify otherwise.
|
||||||
try
|
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
|
// setup IRC Relay
|
||||||
if (m_irc == null) { m_irc = new IRCChatModule(config); }
|
if (m_irc == null) { m_irc = new IRCChatModule(config); }
|
||||||
if (m_irc_connector == null)
|
if (m_irc_connector == null)
|
||||||
|
|
|
@ -986,15 +986,18 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (terrain != null)
|
if (terrain != null)
|
||||||
{
|
{
|
||||||
byte[] data = terrain.WriteJpegImage("defaultstripe.png");
|
byte[] data = terrain.WriteJpegImage("defaultstripe.png");
|
||||||
m_regInfo.EstateSettings.terrainImageID = LLUUID.Random();
|
if (data != null)
|
||||||
AssetBase asset = new AssetBase();
|
{
|
||||||
asset.FullID = m_regInfo.EstateSettings.terrainImageID;
|
m_regInfo.EstateSettings.terrainImageID = LLUUID.Random();
|
||||||
asset.Data = data;
|
AssetBase asset = new AssetBase();
|
||||||
asset.Name = "terrainImage";
|
asset.FullID = m_regInfo.EstateSettings.terrainImageID;
|
||||||
asset.Description = RegionInfo.RegionName;
|
asset.Data = data;
|
||||||
asset.Type = 0;
|
asset.Name = "terrainImage";
|
||||||
asset.Temporary = temporary;
|
asset.Description = RegionInfo.RegionName;
|
||||||
AssetCache.AddAsset(asset);
|
asset.Type = 0;
|
||||||
|
asset.Temporary = temporary;
|
||||||
|
AssetCache.AddAsset(asset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
private short flyState = 0;
|
private short flyState = 0;
|
||||||
private LLQuaternion bodyDirection = LLQuaternion.Identity;
|
private LLQuaternion bodyDirection = LLQuaternion.Identity;
|
||||||
private short count = 0;
|
private short count = 0;
|
||||||
|
private short frame = 0;
|
||||||
|
|
||||||
#pragma warning disable 67
|
#pragma warning disable 67
|
||||||
|
|
||||||
|
@ -450,49 +451,54 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (OnAgentUpdate != null)
|
frame++;
|
||||||
|
if (frame > 20)
|
||||||
{
|
{
|
||||||
AgentUpdatePacket pack = new AgentUpdatePacket();
|
frame = 0;
|
||||||
pack.AgentData.ControlFlags = movementFlag;
|
if (OnAgentUpdate != null)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
ChatFromViewerArgs args = new ChatFromViewerArgs();
|
AgentUpdatePacket pack = new AgentUpdatePacket();
|
||||||
args.Message = "Kinda quiet around here, isn't it?";
|
pack.AgentData.ControlFlags = movementFlag;
|
||||||
args.Channel = 0;
|
pack.AgentData.BodyRotation = bodyDirection;
|
||||||
args.From = FirstName + " " + LastName;
|
OnAgentUpdate(this, pack);
|
||||||
args.Position = new LLVector3(128, 128, 26);
|
}
|
||||||
args.Sender = this;
|
if (flyState == 0)
|
||||||
args.Type = ChatTypeEnum.Shout;
|
{
|
||||||
|
movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY |
|
||||||
OnChatFromViewer(this, args);
|
(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)
|
public bool AddMoney(int debit)
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
|
|
||||||
AddCpuCounter(regionInfo, pos);
|
AddCpuCounter(regionInfo, pos);
|
||||||
// AddComplexObjects(regionInfo, pos);
|
// AddComplexObjects(regionInfo, pos);
|
||||||
// AddAvatars();
|
AddAvatars();
|
||||||
AddFileSystemObjects();
|
AddFileSystemObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ using OpenSim.Framework.Data.MapperFactory;
|
||||||
|
|
||||||
namespace OpenSim.Region.Modules.AvatarFactory
|
namespace OpenSim.Region.Modules.AvatarFactory
|
||||||
{
|
{
|
||||||
public class AvatarFactoryModule : IAvatarFactory
|
public class AvatarFactoryModule : IAvatarFactory, IRegionModule
|
||||||
{
|
{
|
||||||
private Scene m_scene = null;
|
private Scene m_scene = null;
|
||||||
private readonly Dictionary<LLUUID, AvatarAppearance> m_avatarsAppearance = new Dictionary<LLUUID, AvatarAppearance>();
|
private readonly Dictionary<LLUUID, AvatarAppearance> m_avatarsAppearance = new Dictionary<LLUUID, AvatarAppearance>();
|
||||||
|
@ -100,7 +100,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Thread.Sleep(5000);
|
Thread.Sleep(5000); //why is this here?
|
||||||
|
|
||||||
//this is the first thread to request this appearance
|
//this is the first thread to request this appearance
|
||||||
//so let it check the db and if not found then create a default appearance
|
//so let it check the db and if not found then create a default appearance
|
||||||
|
|
Loading…
Reference in New Issue