本文整理汇总了C#中IRenderer.StartMainLoop方法的典型用法代码示例。如果您正苦于以下问题:C# IRenderer.StartMainLoop方法的具体用法?C# IRenderer.StartMainLoop怎么用?C# IRenderer.StartMainLoop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRenderer
的用法示例。
在下文中一共展示了IRenderer.StartMainLoop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public int Init( IConfigSource commandlineConfig, IClientControllers controllers )
{
Type type = Type.GetType( "OSMP.ObjectReplicationClientToServer" );
LogFile.WriteLine( "type: [" + type + "] " + type.AssemblyQualifiedName );
//System.Environment.Exit( 0 );
Tao.DevIl.Il.ilInit();
Tao.DevIl.Ilu.iluInit();
config = Config.GetInstance();
string serverip = commandlineConfig.Configs["CommandLineArgs"].GetString( "serverip", config.ServerIPAddress );
int port = commandlineConfig.Configs["CommandLineArgs"].GetInt( "serverport", config.ServerPort );
network = new NetworkLevel2Controller();
network.NewConnection += new Level2NewConnectionHandler(network_NewConnection);
network.ConnectAsClient(serverip, port);
rpc = new RpcController(network);
netreplicationcontroller = new NetReplicationController(rpc);
renderer = RendererFactory.GetInstance();
renderer.Tick += new OSMP.TickHandler( MainLoop );
renderer.Init();
worldstorage = new WorldModel(netreplicationcontroller);
worldview = new WorldView( worldstorage );
playermovement = PlayerMovement.GetInstance();
InitializePlayermovement();
myavatar = new Avatar();
worldstorage.AddEntity(myavatar);
controllers.Plugin.LoadClientPlugins();
if (!commandlineConfig.Configs["CommandLineArgs"].Contains("nochat" ))
{
LoadChat();
}
if( commandlineConfig.Configs["CommandLineArgs"].Contains("url" ) )
{
string url = commandlineConfig.Configs["CommandLineArgs"].GetString("url" );
LogFile.WriteLine( "url: " + url);
if (url.StartsWith( "osmp://" ))
{
targettoload = "http://" + url.Substring( "osmp://".Length );
LogFile.WriteLine( "target: " + targettoload );
}
else
{
targettoload = url;
}
}
renderer.StartMainLoop();
return 0;
}