diff options
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/Program.cs')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/Program.cs | 252 |
1 files changed, 126 insertions, 126 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index c3edf0c..f82bdcb 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs | |||
@@ -1,126 +1,126 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Net; | 2 | using System.Net; |
3 | using libsecondlife; | 3 | using libsecondlife; |
4 | using OpenSim.Assets; | 4 | using OpenSim.Assets; |
5 | using OpenSim.Framework; | 5 | using OpenSim.Framework; |
6 | using OpenSim.Framework.Console; | 6 | using OpenSim.Framework.Console; |
7 | using OpenSim.Framework.Interfaces; | 7 | using OpenSim.Framework.Interfaces; |
8 | using OpenSim.Framework.Servers; | 8 | using OpenSim.Framework.Servers; |
9 | using OpenSim.Framework.Types; | 9 | using OpenSim.Framework.Types; |
10 | using OpenSim.Physics.Manager; | 10 | using OpenSim.Physics.Manager; |
11 | using OpenSim.Region.Caches; | 11 | using OpenSim.Region.Caches; |
12 | using OpenSim.Region.Capabilities; | 12 | using OpenSim.Region.Capabilities; |
13 | using OpenSim.Region.ClientStack; | 13 | using OpenSim.Region.ClientStack; |
14 | using OpenSim.Region.Communications.Local; | 14 | using OpenSim.Region.Communications.Local; |
15 | using OpenSim.Region.GridInterfaces.Local; | 15 | using OpenSim.Region.GridInterfaces.Local; |
16 | using System.Timers; | 16 | using System.Timers; |
17 | using OpenSim.Region.Environment.Scenes; | 17 | using OpenSim.Region.Environment.Scenes; |
18 | using OpenSim.Framework.Data; | 18 | using OpenSim.Framework.Data; |
19 | 19 | ||
20 | namespace SimpleApp | 20 | namespace SimpleApp |
21 | { | 21 | { |
22 | class Program : conscmd_callback | 22 | class Program : conscmd_callback |
23 | { | 23 | { |
24 | private LogBase m_log; | 24 | private LogBase m_log; |
25 | AuthenticateSessionsBase m_circuitManager; | 25 | AuthenticateSessionsBase m_circuitManager; |
26 | uint m_localId; | 26 | uint m_localId; |
27 | public MyWorld world; | 27 | public MyWorld world; |
28 | private SceneObject m_sceneObject; | 28 | private SceneObject m_sceneObject; |
29 | public MyNpcCharacter m_character; | 29 | public MyNpcCharacter m_character; |
30 | 30 | ||
31 | private void Run() | 31 | private void Run() |
32 | { | 32 | { |
33 | m_log = new LogBase(null, "SimpleApp", this, false); | 33 | m_log = new LogBase(null, "SimpleApp", this, false); |
34 | MainLog.Instance = m_log; | 34 | MainLog.Instance = m_log; |
35 | 35 | ||
36 | // CheckSumServer checksumServer = new CheckSumServer(12036); | 36 | // CheckSumServer checksumServer = new CheckSumServer(12036); |
37 | // checksumServer.ServerListener(); | 37 | // checksumServer.ServerListener(); |
38 | 38 | ||
39 | IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000); | 39 | IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000); |
40 | 40 | ||
41 | m_circuitManager = new AuthenticateSessionsBase(); | 41 | m_circuitManager = new AuthenticateSessionsBase(); |
42 | 42 | ||
43 | InventoryCache inventoryCache = new InventoryCache(); | 43 | InventoryCache inventoryCache = new InventoryCache(); |
44 | 44 | ||
45 | LocalAssetServer assetServer = new LocalAssetServer(); | 45 | LocalAssetServer assetServer = new LocalAssetServer(); |
46 | assetServer.SetServerInfo("http://127.0.0.1:8003/", ""); | 46 | assetServer.SetServerInfo("http://127.0.0.1:8003/", ""); |
47 | 47 | ||
48 | AssetCache assetCache = new AssetCache(assetServer); | 48 | AssetCache assetCache = new AssetCache(assetServer); |
49 | 49 | ||
50 | ScenePresence.LoadTextureFile("avatar-texture.dat"); | 50 | ScenePresence.LoadTextureFile("avatar-texture.dat"); |
51 | ScenePresence.PhysicsEngineFlying = true; | 51 | ScenePresence.PhysicsEngineFlying = true; |
52 | 52 | ||
53 | PhysicsManager physManager = new PhysicsManager(); | 53 | PhysicsManager physManager = new PhysicsManager(); |
54 | physManager.LoadPlugins(); | 54 | physManager.LoadPlugins(); |
55 | 55 | ||
56 | UDPServer udpServer = new UDPServer(internalEndPoint.Port, assetCache, inventoryCache, m_log, m_circuitManager); | 56 | UDPServer udpServer = new UDPServer(internalEndPoint.Port, assetCache, inventoryCache, m_log, m_circuitManager); |
57 | PacketServer packetServer = new PacketServer(udpServer); | 57 | PacketServer packetServer = new PacketServer(udpServer); |
58 | 58 | ||
59 | ClientView.TerrainManager = new TerrainManager(new SecondLife()); | 59 | ClientView.TerrainManager = new TerrainManager(new SecondLife()); |
60 | BaseHttpServer httpServer = new BaseHttpServer(internalEndPoint.Port); | 60 | BaseHttpServer httpServer = new BaseHttpServer(internalEndPoint.Port); |
61 | 61 | ||
62 | NetworkServersInfo serverInfo = new NetworkServersInfo(); | 62 | NetworkServersInfo serverInfo = new NetworkServersInfo(); |
63 | CommunicationsLocal communicationsManager = new CommunicationsLocal(serverInfo, httpServer); | 63 | CommunicationsLocal communicationsManager = new CommunicationsLocal(serverInfo, httpServer); |
64 | 64 | ||
65 | RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "127.0.0.1"); | 65 | RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "127.0.0.1"); |
66 | 66 | ||
67 | OpenSim.Region.Environment.StorageManager storeMan = new OpenSim.Region.Environment.StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp"); | 67 | OpenSim.Region.Environment.StorageManager storeMan = new OpenSim.Region.Environment.StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp"); |
68 | 68 | ||
69 | world = new MyWorld( regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, httpServer); | 69 | world = new MyWorld( regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, httpServer); |
70 | world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null; | 70 | world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null; |
71 | 71 | ||
72 | world.LoadWorldMap(); | 72 | world.LoadWorldMap(); |
73 | world.PhysScene.SetTerrain(world.Terrain.getHeights1D()); | 73 | world.PhysScene.SetTerrain(world.Terrain.getHeights1D()); |
74 | world.performParcelPrimCountUpdate(); | 74 | world.performParcelPrimCountUpdate(); |
75 | 75 | ||
76 | udpServer.LocalWorld = world; | 76 | udpServer.LocalWorld = world; |
77 | 77 | ||
78 | httpServer.Start(); | 78 | httpServer.Start(); |
79 | udpServer.ServerListener(); | 79 | udpServer.ServerListener(); |
80 | 80 | ||
81 | UserProfileData masterAvatar = communicationsManager.UserServer.SetupMasterUser("Test", "User", "test"); | 81 | UserProfileData masterAvatar = communicationsManager.UserServer.SetupMasterUser("Test", "User", "test"); |
82 | if (masterAvatar != null) | 82 | if (masterAvatar != null) |
83 | { | 83 | { |
84 | world.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; | 84 | world.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; |
85 | world.ParcelManager.NoParcelDataFromStorage(); | 85 | world.ParcelManager.NoParcelDataFromStorage(); |
86 | } | 86 | } |
87 | 87 | ||
88 | world.StartTimer(); | 88 | world.StartTimer(); |
89 | 89 | ||
90 | PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); | 90 | PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); |
91 | shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); | 91 | shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); |
92 | LLVector3 pos = new LLVector3(138, 129, 27); | 92 | LLVector3 pos = new LLVector3(138, 129, 27); |
93 | 93 | ||
94 | m_sceneObject = new MySceneObject(world, world.EventManager, LLUUID.Zero, world.PrimIDAllocate(), pos, shape); | 94 | m_sceneObject = new MySceneObject(world, world.EventManager, LLUUID.Zero, world.PrimIDAllocate(), pos, shape); |
95 | world.AddEntity(m_sceneObject); | 95 | world.AddEntity(m_sceneObject); |
96 | 96 | ||
97 | m_character = new MyNpcCharacter(); | 97 | m_character = new MyNpcCharacter(); |
98 | world.AddNewClient(m_character, false); | 98 | world.AddNewClient(m_character, false); |
99 | 99 | ||
100 | m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); | 100 | m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); |
101 | m_log.ReadLine(); | 101 | m_log.ReadLine(); |
102 | 102 | ||
103 | } | 103 | } |
104 | 104 | ||
105 | #region conscmd_callback Members | 105 | #region conscmd_callback Members |
106 | 106 | ||
107 | public void RunCmd(string cmd, string[] cmdparams) | 107 | public void RunCmd(string cmd, string[] cmdparams) |
108 | { | 108 | { |
109 | throw new Exception("The method or operation is not implemented."); | 109 | throw new Exception("The method or operation is not implemented."); |
110 | } | 110 | } |
111 | 111 | ||
112 | public void Show(string ShowWhat) | 112 | public void Show(string ShowWhat) |
113 | { | 113 | { |
114 | throw new Exception("The method or operation is not implemented."); | 114 | throw new Exception("The method or operation is not implemented."); |
115 | } | 115 | } |
116 | 116 | ||
117 | #endregion | 117 | #endregion |
118 | 118 | ||
119 | static void Main(string[] args) | 119 | static void Main(string[] args) |
120 | { | 120 | { |
121 | Program app = new Program(); | 121 | Program app = new Program(); |
122 | 122 | ||
123 | app.Run(); | 123 | app.Run(); |
124 | } | 124 | } |
125 | } | 125 | } |
126 | } | 126 | } |