diff options
author | MW | 2008-04-01 13:09:29 +0000 |
---|---|---|
committer | MW | 2008-04-01 13:09:29 +0000 |
commit | f43e077150d39b454bd66d43a72736a75614a721 (patch) | |
tree | 983031434fff79aa0ecc41478efccb205557d2ce /OpenSim/Region | |
parent | sadly, had to modify line by Ter because it caused mono cil compiler (diff) | |
download | opensim-SC_OLD-f43e077150d39b454bd66d43a72736a75614a721.zip opensim-SC_OLD-f43e077150d39b454bd66d43a72736a75614a721.tar.gz opensim-SC_OLD-f43e077150d39b454bd66d43a72736a75614a721.tar.bz2 opensim-SC_OLD-f43e077150d39b454bd66d43a72736a75614a721.tar.xz |
a few small changes
Diffstat (limited to 'OpenSim/Region')
6 files changed, 67 insertions, 58 deletions
diff --git a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs index a42f1dc..3ebbaab 100644 --- a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs +++ b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs | |||
@@ -30,7 +30,7 @@ using OpenSim.Region.Environment.Scenes; | |||
30 | 30 | ||
31 | namespace OpenSim.Region.Environment.Interfaces | 31 | namespace OpenSim.Region.Environment.Interfaces |
32 | { | 32 | { |
33 | public interface IAvatarFactory : IRegionModule | 33 | public interface IAvatarFactory |
34 | { | 34 | { |
35 | bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance); | 35 | bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance); |
36 | void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance); | 36 | void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance); |
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index ab6b791..08c0a11 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs | |||
@@ -62,6 +62,13 @@ namespace OpenSim.Region.Environment.Modules | |||
62 | { | 62 | { |
63 | lock (m_syncInit) | 63 | lock (m_syncInit) |
64 | { | 64 | { |
65 | if (!m_scenes.Contains(scene)) | ||
66 | { | ||
67 | m_scenes.Add(scene); | ||
68 | scene.EventManager.OnNewClient += NewClient; | ||
69 | scene.RegisterModuleInterface<ISimChat>(this); | ||
70 | } | ||
71 | |||
65 | // wrap this in a try block so that defaults will work if | 72 | // wrap this in a try block so that defaults will work if |
66 | // the config file doesn't specify otherwise. | 73 | // the config file doesn't specify otherwise. |
67 | try | 74 | try |
@@ -82,13 +89,6 @@ namespace OpenSim.Region.Environment.Modules | |||
82 | { | 89 | { |
83 | } | 90 | } |
84 | 91 | ||
85 | if (!m_scenes.Contains(scene)) | ||
86 | { | ||
87 | m_scenes.Add(scene); | ||
88 | scene.EventManager.OnNewClient += NewClient; | ||
89 | scene.RegisterModuleInterface<ISimChat>(this); | ||
90 | } | ||
91 | |||
92 | // setup IRC Relay | 92 | // setup IRC Relay |
93 | if (m_irc == null) { m_irc = new IRCChatModule(config); } | 93 | if (m_irc == null) { m_irc = new IRCChatModule(config); } |
94 | if (m_irc_connector == null) | 94 | if (m_irc_connector == null) |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 2fa0459..7ee0478 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -986,15 +986,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
986 | if (terrain != null) | 986 | if (terrain != null) |
987 | { | 987 | { |
988 | byte[] data = terrain.WriteJpegImage("defaultstripe.png"); | 988 | byte[] data = terrain.WriteJpegImage("defaultstripe.png"); |
989 | m_regInfo.EstateSettings.terrainImageID = LLUUID.Random(); | 989 | if (data != null) |
990 | AssetBase asset = new AssetBase(); | 990 | { |
991 | asset.FullID = m_regInfo.EstateSettings.terrainImageID; | 991 | m_regInfo.EstateSettings.terrainImageID = LLUUID.Random(); |
992 | asset.Data = data; | 992 | AssetBase asset = new AssetBase(); |
993 | asset.Name = "terrainImage"; | 993 | asset.FullID = m_regInfo.EstateSettings.terrainImageID; |
994 | asset.Description = RegionInfo.RegionName; | 994 | asset.Data = data; |
995 | asset.Type = 0; | 995 | asset.Name = "terrainImage"; |
996 | asset.Temporary = temporary; | 996 | asset.Description = RegionInfo.RegionName; |
997 | AssetCache.AddAsset(asset); | 997 | asset.Type = 0; |
998 | asset.Temporary = temporary; | ||
999 | AssetCache.AddAsset(asset); | ||
1000 | } | ||
998 | } | 1001 | } |
999 | 1002 | ||
1000 | } | 1003 | } |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 39d05eb..8fcc3cf 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -41,6 +41,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
41 | private short flyState = 0; | 41 | private short flyState = 0; |
42 | private LLQuaternion bodyDirection = LLQuaternion.Identity; | 42 | private LLQuaternion bodyDirection = LLQuaternion.Identity; |
43 | private short count = 0; | 43 | private short count = 0; |
44 | private short frame = 0; | ||
44 | 45 | ||
45 | #pragma warning disable 67 | 46 | #pragma warning disable 67 |
46 | 47 | ||
@@ -450,49 +451,54 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
450 | 451 | ||
451 | private void Update() | 452 | private void Update() |
452 | { | 453 | { |
453 | if (OnAgentUpdate != null) | 454 | frame++; |
455 | if (frame > 20) | ||
454 | { | 456 | { |
455 | AgentUpdatePacket pack = new AgentUpdatePacket(); | 457 | frame = 0; |
456 | pack.AgentData.ControlFlags = movementFlag; | 458 | if (OnAgentUpdate != null) |
457 | pack.AgentData.BodyRotation = bodyDirection; | 459 | { |
458 | OnAgentUpdate(this, pack); | 460 | AgentUpdatePacket pack = new AgentUpdatePacket(); |
459 | } | 461 | pack.AgentData.ControlFlags = movementFlag; |
460 | if (flyState == 0) | 462 | pack.AgentData.BodyRotation = bodyDirection; |
461 | { | 463 | OnAgentUpdate(this, pack); |
462 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY | | 464 | } |
463 | (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; | 465 | if (flyState == 0) |
464 | flyState = 1; | 466 | { |
465 | } | 467 | movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY | |
466 | else if (flyState == 1) | 468 | (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; |
467 | { | 469 | flyState = 1; |
468 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY | | 470 | } |
469 | (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; | 471 | else if (flyState == 1) |
470 | flyState = 2; | 472 | { |
471 | } | 473 | movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY | |
472 | else | 474 | (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; |
473 | { | 475 | flyState = 2; |
474 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 476 | } |
475 | flyState = 0; | 477 | else |
476 | } | 478 | { |
479 | movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | ||
480 | flyState = 0; | ||
481 | } | ||
477 | 482 | ||
478 | if (count >= 200) | 483 | if (count >= 10) |
479 | { | ||
480 | if (OnChatFromViewer != null) | ||
481 | { | 484 | { |
482 | ChatFromViewerArgs args = new ChatFromViewerArgs(); | 485 | if (OnChatFromViewer != null) |
483 | args.Message = "Kinda quiet around here, isn't it?"; | 486 | { |
484 | args.Channel = 0; | 487 | ChatFromViewerArgs args = new ChatFromViewerArgs(); |
485 | args.From = FirstName + " " + LastName; | 488 | args.Message = "Kinda quiet around here, isn't it?"; |
486 | args.Position = new LLVector3(128, 128, 26); | 489 | args.Channel = 0; |
487 | args.Sender = this; | 490 | args.From = FirstName + " " + LastName; |
488 | args.Type = ChatTypeEnum.Shout; | 491 | args.Position = new LLVector3(128, 128, 26); |
489 | 492 | args.Sender = this; | |
490 | OnChatFromViewer(this, args); | 493 | args.Type = ChatTypeEnum.Shout; |
494 | |||
495 | OnChatFromViewer(this, args); | ||
496 | } | ||
497 | count = -1; | ||
491 | } | 498 | } |
492 | count = -1; | ||
493 | } | ||
494 | 499 | ||
495 | count++; | 500 | count++; |
501 | } | ||
496 | } | 502 | } |
497 | 503 | ||
498 | public bool AddMoney(int debit) | 504 | public bool AddMoney(int debit) |
diff --git a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs index 3b21d43..1e043dd 100644 --- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs +++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
56 | 56 | ||
57 | AddCpuCounter(regionInfo, pos); | 57 | AddCpuCounter(regionInfo, pos); |
58 | // AddComplexObjects(regionInfo, pos); | 58 | // AddComplexObjects(regionInfo, pos); |
59 | // AddAvatars(); | 59 | AddAvatars(); |
60 | AddFileSystemObjects(); | 60 | AddFileSystemObjects(); |
61 | } | 61 | } |
62 | 62 | ||
diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs index d0ee277..b122753 100644 --- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -39,7 +39,7 @@ using OpenSim.Framework.Data.MapperFactory; | |||
39 | 39 | ||
40 | namespace OpenSim.Region.Modules.AvatarFactory | 40 | namespace OpenSim.Region.Modules.AvatarFactory |
41 | { | 41 | { |
42 | public class AvatarFactoryModule : IAvatarFactory | 42 | public class AvatarFactoryModule : IAvatarFactory, IRegionModule |
43 | { | 43 | { |
44 | private Scene m_scene = null; | 44 | private Scene m_scene = null; |
45 | private readonly Dictionary<LLUUID, AvatarAppearance> m_avatarsAppearance = new Dictionary<LLUUID, AvatarAppearance>(); | 45 | private readonly Dictionary<LLUUID, AvatarAppearance> m_avatarsAppearance = new Dictionary<LLUUID, AvatarAppearance>(); |
@@ -100,7 +100,7 @@ namespace OpenSim.Region.Modules.AvatarFactory | |||
100 | } | 100 | } |
101 | else | 101 | else |
102 | { | 102 | { |
103 | Thread.Sleep(5000); | 103 | Thread.Sleep(5000); //why is this here? |
104 | 104 | ||
105 | //this is the first thread to request this appearance | 105 | //this is the first thread to request this appearance |
106 | //so let it check the db and if not found then create a default appearance | 106 | //so let it check the db and if not found then create a default appearance |