diff options
Diffstat (limited to 'OpenSim/Examples/SimpleApp/Program.cs')
-rw-r--r-- | OpenSim/Examples/SimpleApp/Program.cs | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/OpenSim/Examples/SimpleApp/Program.cs b/OpenSim/Examples/SimpleApp/Program.cs new file mode 100644 index 0000000..e44bdba --- /dev/null +++ b/OpenSim/Examples/SimpleApp/Program.cs | |||
@@ -0,0 +1,110 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim; | ||
5 | using OpenSim.Servers; | ||
6 | using OpenSim.GridInterfaces.Local; | ||
7 | using OpenSim.Framework.Interfaces; | ||
8 | using OpenSim.Framework.Types; | ||
9 | using OpenSim.UserServer; | ||
10 | using OpenSim.Framework.Console; | ||
11 | using OpenSim.world; | ||
12 | using OpenSim.Physics.Manager; | ||
13 | using OpenSim.Assets; | ||
14 | using libsecondlife; | ||
15 | |||
16 | namespace SimpleApp | ||
17 | { | ||
18 | class Program : IAssetReceiver, conscmd_callback | ||
19 | { | ||
20 | private ConsoleBase m_console; | ||
21 | |||
22 | private void Run() | ||
23 | { | ||
24 | m_console = new ConsoleBase(null, "SimpleApp", this, false); | ||
25 | MainConsole.Instance = m_console; | ||
26 | |||
27 | CheckSumServer checksumServer = new CheckSumServer(12036); | ||
28 | checksumServer.ServerListener(); | ||
29 | |||
30 | string simAddr = "127.0.0.1"; | ||
31 | int simPort = 9000; | ||
32 | |||
33 | LoginServer loginServer = new LoginServer( simAddr, simPort, 0, 0, false ); | ||
34 | loginServer.Startup(); | ||
35 | |||
36 | AuthenticateSessionsLocal localSessions = new AuthenticateSessionsLocal(); | ||
37 | loginServer.SetSessionHandler(localSessions.AddNewSessionHandler ); | ||
38 | |||
39 | InventoryCache inventoryCache = new InventoryCache(); | ||
40 | |||
41 | LocalAssetServer assetServer = new LocalAssetServer(); | ||
42 | assetServer.SetServerInfo("http://127.0.0.1:8003/", ""); | ||
43 | assetServer.SetReceiver(this); | ||
44 | |||
45 | AssetCache assetCache = new AssetCache(assetServer); | ||
46 | |||
47 | UDPServer udpServer = new UDPServer(simPort, assetCache, inventoryCache, m_console, localSessions ); | ||
48 | PacketServer packetServer = new PacketServer( udpServer, (uint) simPort ); | ||
49 | udpServer.ServerListener(); | ||
50 | |||
51 | ClientView.TerrainManager = new TerrainManager(new SecondLife()); | ||
52 | |||
53 | RegionInfo regionInfo = new RegionInfo(); | ||
54 | |||
55 | udpServer.LocalWorld = new MyWorld( regionInfo ); | ||
56 | |||
57 | // World world = new World(udpServer.PacketServer.ClientAPIs, regionInfo); | ||
58 | // PhysicsScene physicsScene = new NullPhysicsScene(); | ||
59 | // world.PhysicsScene = physicsScene; | ||
60 | // udpServer.LocalWorld = world; | ||
61 | |||
62 | BaseHttpServer httpServer = new BaseHttpServer( simPort ); | ||
63 | httpServer.AddXmlRPCHandler( "login_to_simulator", loginServer.XmlRpcLoginMethod ); | ||
64 | httpServer.Start(); | ||
65 | |||
66 | m_console.WriteLine( LogPriority.NORMAL, "Press enter to quit."); | ||
67 | m_console.ReadLine(); | ||
68 | } | ||
69 | |||
70 | private void AddNewSessionHandler(Login loginData) | ||
71 | { | ||
72 | m_console.WriteLine( LogPriority.NORMAL, "Recieved Login from [{0}] [{1}]", loginData.First, loginData.Last ); | ||
73 | } | ||
74 | |||
75 | #region IAssetReceiver Members | ||
76 | |||
77 | public void AssetReceived( AssetBase asset, bool IsTexture) | ||
78 | { | ||
79 | throw new Exception("The method or operation is not implemented."); | ||
80 | } | ||
81 | |||
82 | public void AssetNotFound( AssetBase asset) | ||
83 | { | ||
84 | throw new Exception("The method or operation is not implemented."); | ||
85 | } | ||
86 | |||
87 | #endregion | ||
88 | |||
89 | #region conscmd_callback Members | ||
90 | |||
91 | public void RunCmd(string cmd, string[] cmdparams) | ||
92 | { | ||
93 | throw new Exception("The method or operation is not implemented."); | ||
94 | } | ||
95 | |||
96 | public void Show(string ShowWhat) | ||
97 | { | ||
98 | throw new Exception("The method or operation is not implemented."); | ||
99 | } | ||
100 | |||
101 | #endregion | ||
102 | |||
103 | static void Main(string[] args) | ||
104 | { | ||
105 | Program app = new Program(); | ||
106 | |||
107 | app.Run(); | ||
108 | } | ||
109 | } | ||
110 | } | ||