diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/Program.cs | 69 |
1 files changed, 23 insertions, 46 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index fe8c11a..c945d39 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs | |||
@@ -22,9 +22,7 @@ namespace SimpleApp | |||
22 | { | 22 | { |
23 | class Program : RegionApplicationBase, conscmd_callback | 23 | class Program : RegionApplicationBase, conscmd_callback |
24 | { | 24 | { |
25 | AuthenticateSessionsBase m_circuitManager; | 25 | public MyWorld m_scene; |
26 | |||
27 | public MyWorld m_world; | ||
28 | private SceneObject m_sceneObject; | 26 | private SceneObject m_sceneObject; |
29 | public MyNpcCharacter m_character; | 27 | public MyNpcCharacter m_character; |
30 | 28 | ||
@@ -36,73 +34,52 @@ namespace SimpleApp | |||
36 | protected override void Initialize() | 34 | protected override void Initialize() |
37 | { | 35 | { |
38 | m_httpServerPort = 9000; | 36 | m_httpServerPort = 9000; |
37 | |||
38 | StartLog(); | ||
39 | |||
40 | LocalAssetServer assetServer = new LocalAssetServer(); | ||
41 | assetServer.SetServerInfo("http://localhost:8003/", ""); | ||
42 | |||
43 | AssetCache m_assetCache = new AssetCache(assetServer); | ||
39 | } | 44 | } |
40 | 45 | ||
41 | public void Run() | 46 | public void Run() |
42 | { | 47 | { |
43 | base.StartUp(); | 48 | base.StartUp(); |
44 | 49 | ||
45 | m_circuitManager = new AuthenticateSessionsBase(); | 50 | CommunicationsLocal m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer); |
46 | |||
47 | InventoryCache inventoryCache = new InventoryCache(); | ||
48 | 51 | ||
49 | LocalAssetServer assetServer = new LocalAssetServer(); | ||
50 | assetServer.SetServerInfo("http://localhost:8003/", ""); | ||
51 | |||
52 | AssetCache assetCache = new AssetCache(assetServer); | ||
53 | |||
54 | ScenePresence.LoadTextureFile("avatar-texture.dat"); | ||
55 | ScenePresence.PhysicsEngineFlying = true; | 52 | ScenePresence.PhysicsEngineFlying = true; |
56 | 53 | ||
57 | IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000); | 54 | IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000); |
58 | RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost"); | 55 | RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost"); |
59 | 56 | ||
60 | UDPServer udpServer = new UDPServer(internalEndPoint.Port, assetCache, inventoryCache, m_log, m_circuitManager); | 57 | UDPServer udpServer; |
61 | PacketServer packetServer = new PacketServer(udpServer); | ||
62 | |||
63 | CommunicationsLocal communicationsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer); | ||
64 | |||
65 | StorageManager storeMan = GetStoreManager(regionInfo); | ||
66 | 58 | ||
67 | 59 | Scene scene = SetupScene(regionInfo, out udpServer); | |
68 | 60 | ||
69 | m_world = new MyWorld( regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, m_httpServer); | ||
70 | m_world.PhysScene = GetPhysicsScene( ); | ||
71 | |||
72 | m_world.LoadWorldMap(); | ||
73 | m_world.PhysScene.SetTerrain(m_world.Terrain.getHeights1D()); | ||
74 | m_world.performParcelPrimCountUpdate(); | ||
75 | |||
76 | udpServer.LocalWorld = m_world; | ||
77 | |||
78 | m_httpServer.Start(); | ||
79 | udpServer.ServerListener(); | 61 | udpServer.ServerListener(); |
80 | 62 | ||
81 | UserProfileData masterAvatar = communicationsManager.UserServer.SetupMasterUser("Test", "User", "test"); | ||
82 | if (masterAvatar != null) | ||
83 | { | ||
84 | m_world.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; | ||
85 | m_world.LandManager.NoLandDataFromStorage(); | ||
86 | } | ||
87 | |||
88 | m_world.StartTimer(); | ||
89 | |||
90 | PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); | 63 | PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); |
91 | shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); | 64 | shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); |
92 | LLVector3 pos = new LLVector3(138, 129, 27); | 65 | LLVector3 pos = new LLVector3(138, 129, 27); |
93 | 66 | ||
94 | m_sceneObject = new MySceneObject(m_world, m_world.EventManager, LLUUID.Zero, m_world.PrimIDAllocate(), pos, shape); | 67 | m_sceneObject = new MySceneObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape); |
95 | m_world.AddEntity(m_sceneObject); | 68 | scene.AddEntity(m_sceneObject); |
96 | 69 | ||
97 | m_character = new MyNpcCharacter(); | 70 | m_character = new MyNpcCharacter(); |
98 | m_world.AddNewClient(m_character, false); | 71 | scene.AddNewClient(m_character, false); |
99 | 72 | ||
100 | m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); | 73 | m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); |
101 | m_log.ReadLine(); | 74 | m_log.ReadLine(); |
102 | 75 | } | |
76 | |||
77 | protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager) | ||
78 | { | ||
79 | return new MyWorld(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer); | ||
103 | } | 80 | } |
104 | 81 | ||
105 | protected override StorageManager GetStoreManager(RegionInfo regionInfo) | 82 | protected override StorageManager CreateStorageManager(RegionInfo regionInfo) |
106 | { | 83 | { |
107 | return new StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp"); | 84 | return new StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp"); |
108 | } | 85 | } |