diff options
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/Program.cs | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index a2fdd81..8ff2b77 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs | |||
@@ -19,24 +19,28 @@ using OpenSim.Framework.Data; | |||
19 | 19 | ||
20 | namespace SimpleApp | 20 | namespace SimpleApp |
21 | { | 21 | { |
22 | class Program : conscmd_callback | 22 | class Program : RegionApplicationBase, conscmd_callback |
23 | { | 23 | { |
24 | private LogBase m_log; | ||
25 | AuthenticateSessionsBase m_circuitManager; | 24 | AuthenticateSessionsBase m_circuitManager; |
26 | uint m_localId; | 25 | |
27 | public MyWorld world; | 26 | public MyWorld m_world; |
28 | private SceneObject m_sceneObject; | 27 | private SceneObject m_sceneObject; |
29 | public MyNpcCharacter m_character; | 28 | public MyNpcCharacter m_character; |
30 | 29 | ||
31 | private void Run() | 30 | protected override LogBase CreateLog() |
32 | { | 31 | { |
33 | m_log = new LogBase(null, "SimpleApp", this, false); | 32 | return new LogBase(null, "SimpleApp", this, false); |
34 | MainLog.Instance = m_log; | 33 | } |
35 | 34 | ||
36 | // CheckSumServer checksumServer = new CheckSumServer(12036); | 35 | protected override void Initialize() |
37 | // checksumServer.ServerListener(); | 36 | { |
37 | } | ||
38 | |||
39 | public void Run() | ||
40 | { | ||
41 | base.StartUp(); | ||
38 | 42 | ||
39 | IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000); | 43 | MainLog.Instance = m_log; |
40 | 44 | ||
41 | m_circuitManager = new AuthenticateSessionsBase(); | 45 | m_circuitManager = new AuthenticateSessionsBase(); |
42 | 46 | ||
@@ -50,30 +54,27 @@ namespace SimpleApp | |||
50 | ScenePresence.LoadTextureFile("avatar-texture.dat"); | 54 | ScenePresence.LoadTextureFile("avatar-texture.dat"); |
51 | ScenePresence.PhysicsEngineFlying = true; | 55 | ScenePresence.PhysicsEngineFlying = true; |
52 | 56 | ||
53 | PhysicsPluginManager physManager = new PhysicsPluginManager(); | 57 | IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000); |
54 | physManager.LoadPlugins(); | ||
55 | 58 | ||
56 | UDPServer udpServer = new UDPServer(internalEndPoint.Port, assetCache, inventoryCache, m_log, m_circuitManager); | 59 | UDPServer udpServer = new UDPServer(internalEndPoint.Port, assetCache, inventoryCache, m_log, m_circuitManager); |
57 | PacketServer packetServer = new PacketServer(udpServer); | 60 | PacketServer packetServer = new PacketServer(udpServer); |
58 | 61 | ||
59 | ClientView.TerrainManager = new TerrainManager(new SecondLife()); | ||
60 | BaseHttpServer httpServer = new BaseHttpServer(internalEndPoint.Port); | 62 | BaseHttpServer httpServer = new BaseHttpServer(internalEndPoint.Port); |
61 | 63 | ||
62 | NetworkServersInfo serverInfo = new NetworkServersInfo(); | 64 | CommunicationsLocal communicationsManager = new CommunicationsLocal(m_networkServersInfo, httpServer); |
63 | CommunicationsLocal communicationsManager = new CommunicationsLocal(serverInfo, httpServer); | ||
64 | 65 | ||
65 | RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "127.0.0.1"); | 66 | RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "127.0.0.1"); |
66 | 67 | ||
67 | OpenSim.Region.Environment.StorageManager storeMan = new OpenSim.Region.Environment.StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp"); | 68 | OpenSim.Region.Environment.StorageManager storeMan = new OpenSim.Region.Environment.StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp"); |
68 | 69 | ||
69 | world = new MyWorld( regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, httpServer); | 70 | m_world = new MyWorld( regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, httpServer); |
70 | world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null; | 71 | m_world.PhysScene = GetPhysicsScene( ); |
71 | 72 | ||
72 | world.LoadWorldMap(); | 73 | m_world.LoadWorldMap(); |
73 | world.PhysScene.SetTerrain(world.Terrain.getHeights1D()); | 74 | m_world.PhysScene.SetTerrain(m_world.Terrain.getHeights1D()); |
74 | world.performParcelPrimCountUpdate(); | 75 | m_world.performParcelPrimCountUpdate(); |
75 | 76 | ||
76 | udpServer.LocalWorld = world; | 77 | udpServer.LocalWorld = m_world; |
77 | 78 | ||
78 | httpServer.Start(); | 79 | httpServer.Start(); |
79 | udpServer.ServerListener(); | 80 | udpServer.ServerListener(); |
@@ -81,27 +82,32 @@ namespace SimpleApp | |||
81 | UserProfileData masterAvatar = communicationsManager.UserServer.SetupMasterUser("Test", "User", "test"); | 82 | UserProfileData masterAvatar = communicationsManager.UserServer.SetupMasterUser("Test", "User", "test"); |
82 | if (masterAvatar != null) | 83 | if (masterAvatar != null) |
83 | { | 84 | { |
84 | world.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; | 85 | m_world.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; |
85 | world.LandManager.NoLandDataFromStorage(); | 86 | m_world.LandManager.NoLandDataFromStorage(); |
86 | } | 87 | } |
87 | 88 | ||
88 | world.StartTimer(); | 89 | m_world.StartTimer(); |
89 | 90 | ||
90 | PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); | 91 | PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); |
91 | shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); | 92 | shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); |
92 | LLVector3 pos = new LLVector3(138, 129, 27); | 93 | LLVector3 pos = new LLVector3(138, 129, 27); |
93 | 94 | ||
94 | m_sceneObject = new MySceneObject(world, world.EventManager, LLUUID.Zero, world.PrimIDAllocate(), pos, shape); | 95 | m_sceneObject = new MySceneObject(m_world, m_world.EventManager, LLUUID.Zero, m_world.PrimIDAllocate(), pos, shape); |
95 | world.AddEntity(m_sceneObject); | 96 | m_world.AddEntity(m_sceneObject); |
96 | 97 | ||
97 | m_character = new MyNpcCharacter(); | 98 | m_character = new MyNpcCharacter(); |
98 | world.AddNewClient(m_character, false); | 99 | m_world.AddNewClient(m_character, false); |
99 | 100 | ||
100 | m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); | 101 | m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); |
101 | m_log.ReadLine(); | 102 | m_log.ReadLine(); |
102 | 103 | ||
103 | } | 104 | } |
104 | 105 | ||
106 | protected override PhysicsScene GetPhysicsScene( ) | ||
107 | { | ||
108 | return GetPhysicsScene("basicphysics"); | ||
109 | } | ||
110 | |||
105 | #region conscmd_callback Members | 111 | #region conscmd_callback Members |
106 | 112 | ||
107 | public void RunCmd(string cmd, string[] cmdparams) | 113 | public void RunCmd(string cmd, string[] cmdparams) |
@@ -120,7 +126,7 @@ namespace SimpleApp | |||
120 | { | 126 | { |
121 | Program app = new Program(); | 127 | Program app = new Program(); |
122 | 128 | ||
123 | app.Run(); | 129 | app.StartUp(); |
124 | } | 130 | } |
125 | } | 131 | } |
126 | } | 132 | } |