aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Examples/SimpleApp/Program.cs
diff options
context:
space:
mode:
authorlbsa712007-06-09 21:45:58 +0000
committerlbsa712007-06-09 21:45:58 +0000
commit4224b695acc2e1ad0199dc0ad7f560494182ed54 (patch)
tree8fae1cf25a058bc4e378ef2b6ce264d7f9f0b910 /OpenSim/Examples/SimpleApp/Program.cs
parent*Fixed casting mishap in last commit - client now starts up without crashing (diff)
downloadopensim-SC_OLD-4224b695acc2e1ad0199dc0ad7f560494182ed54.zip
opensim-SC_OLD-4224b695acc2e1ad0199dc0ad7f560494182ed54.tar.gz
opensim-SC_OLD-4224b695acc2e1ad0199dc0ad7f560494182ed54.tar.bz2
opensim-SC_OLD-4224b695acc2e1ad0199dc0ad7f560494182ed54.tar.xz
* LogFile now defaults to "{apptype}.log"
* cleaned away suo and user files. * added handy string chat variety to the API * Moved LockPhysicsEngine on World to SyncRoot on IWorld * Introduced NextLocalId instead of World fuggliness. * Transformed GetRegionInfo to Property on IWorld for great justice * Extracted default wearables (good to have) * Deleted unused BaseServer * Used IWorld instead of World wherever possible * The client constructor's not getting unused port any longer. * Extracted ClientView factoring so PacketServer can be tweaked. * Added SendLayerData to World * Made WorldBase abstract and cleaned it up a bit * added OpenGrid.Framework.Communications.dll.build and OpenSim.World.dll.build to svn * Added code for two examples (but not in prebuild yet)
Diffstat (limited to 'OpenSim/Examples/SimpleApp/Program.cs')
-rw-r--r--OpenSim/Examples/SimpleApp/Program.cs110
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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim;
5using OpenSim.Servers;
6using OpenSim.GridInterfaces.Local;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Types;
9using OpenSim.UserServer;
10using OpenSim.Framework.Console;
11using OpenSim.world;
12using OpenSim.Physics.Manager;
13using OpenSim.Assets;
14using libsecondlife;
15
16namespace 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}