当前位置: 首页>>代码示例>>C#>>正文


C# Game.Run方法代码示例

本文整理汇总了C#中ClassicalSharp.Game.Run方法的典型用法代码示例。如果您正苦于以下问题:C# Game.Run方法的具体用法?C# Game.Run怎么用?C# Game.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ClassicalSharp.Game的用法示例。


在下文中一共展示了Game.Run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main( string[] args )
        {
            ErrorHandler.InstallHandler( "client.log" );

            Utils.LogDebug( "Starting " + AppName + ".." );
            if( !File.Exists( "default.zip" ) ) {
                Utils.LogDebug( "default.zip not found. Cannot start." );
                return;
            }
            bool nullContext = true;
            #if !USE_DX
            nullContext = false;
            #endif
            int width, height;
            SelectResolution( out width, out height );

            if( args.Length == 0 || args.Length == 1 ) {
                const string skinServer = "http://s3.amazonaws.com/MinecraftSkins/";
                string pack = args.Length >= 1 ? args[0] : "default.zip";

                using( Game game = new Game( "LocalPlayer", null, skinServer,
                                            pack, nullContext, width, height ) )
                    game.Run();
            } else if( args.Length < 4 ) {
                Utils.LogDebug( "ClassicalSharp.exe is only the raw client. You must either use the launcher or"
                     + " provide command line arguments to start the client." );
            } else {
                RunMultiplayer( args, nullContext, width, height );
            }
        }
开发者ID:Daribon,项目名称:ClassicalSharp,代码行数:30,代码来源:Program.cs

示例2: Main

        static void Main( string[] args )
        {
            AppDirectory = AppDomain.CurrentDomain.BaseDirectory;
            string logPath = Path.Combine( AppDirectory, "client.log" );
            ErrorHandler.InstallHandler( logPath );
            CleanupMainDirectory();

            Utils.LogDebug( "Starting " + AppName + ".." );
            string path = Path.Combine( Program.AppDirectory, TexturePackExtractor.Dir );
            if( !File.Exists( Path.Combine( path, "default.zip" ) ) ) {
                Utils.LogDebug( "default.zip not found. Cannot start." );
                return;
            }

            bool nullContext = true;
            #if !USE_DX
            nullContext = false;
            #endif
            int width, height;
            SelectResolution( out width, out height );

            if( args.Length == 0 || args.Length == 1 ) {
                const string skinServer = "http://static.classicube.net/skins/";
                string user = args.Length > 0 ? args[0] : "Singleplayer";
                using( Game game = new Game( user, null, skinServer, nullContext, width, height ) )
                    game.Run();
            } else if( args.Length < 4 ) {
                Utils.LogDebug( "ClassicalSharp.exe is only the raw client. You must either use the launcher or"
                     + " provide command line arguments to start the client." );
            } else {
                RunMultiplayer( args, nullContext, width, height );
            }
        }
开发者ID:Chameleonherman,项目名称:ClassicalSharp,代码行数:33,代码来源:Program.cs

示例3: Main

        public static void Main( string[] args )
        {
            if( !Debugger.IsAttached ) {
                AppDomain.CurrentDomain.UnhandledException += UnhandledException;
            }

            Utils.Log( "Starting " + Utils.AppName + ".." );
            if( !File.Exists( "default.zip" ) ) {
                Fail( "default.zip not found. Cannot start." );
                return;
            }

            if( args.Length == 0 || args.Length == 1 ) {
                Utils.Log( "Starting singleplayer mode." );
                const string skinServer = "http://s3.amazonaws.com/MinecraftSkins/";
                using( Game game = new Game( "LocalPlayer", null, skinServer, "default.zip" ) ) {
                    game.Run();
                }
            } else if( args.Length < 4 ) {
                Fail( "ClassicalSharp.exe is only the raw client. You must either use the launcher or"
                     + " provide command line arguments to start the client." );
            } else {
                RunMultiplayer( args );
            }
        }
开发者ID:Hetal728,项目名称:ClassicalSharp,代码行数:25,代码来源:Program.cs

示例4: RunMultiplayer

        static void RunMultiplayer( string[] args )
        {
            IPAddress ip = null;
            if( !IPAddress.TryParse( args[2], out ip ) ) {
                Fail( "Invalid IP \"" + args[2] + '"' );
            }

            int port = 0;
            if( !Int32.TryParse( args[3], out port ) ) {
                Fail( "Invalid port \"" + args[3] + '"' );
                return;
            } else if( port < ushort.MinValue || port > ushort.MaxValue ) {
                Fail( "Specified port " + port + " is out of valid range." );
            }

            string skinServer = args.Length >= 5 ? args[4] : "http://s3.amazonaws.com/MinecraftSkins/";
            using( Game game = new Game( args[0], args[1], skinServer, "default.zip" ) ) {
                game.IPAddress = ip;
                game.Port = port;
                game.Run();
            }
        }
开发者ID:Hetal728,项目名称:ClassicalSharp,代码行数:22,代码来源:Program.cs

示例5: Main

        static void Main( string[] args )
        {
            ErrorHandler.InstallHandler( "client.log" );

            Utils.Log( "Starting " + AppName + ".." );
            if( !File.Exists( "default.zip" ) ) {
                Fail( "default.zip not found. Cannot start." );
                return;
            }

            if( args.Length == 0 || args.Length == 1 ) {
                Utils.Log( "Starting singleplayer mode." );
                const string skinServer = "http://s3.amazonaws.com/MinecraftSkins/";
                string pack = args.Length >= 1 ? args[0] : "default.zip";
                using( Game game = new Game( "LocalPlayer", null, skinServer, pack ) ) {
                    game.Run();
                }
            } else if( args.Length < 4 ) {
                Fail( "ClassicalSharp.exe is only the raw client. You must either use the launcher or"
                     + " provide command line arguments to start the client." );
            } else {
                RunMultiplayer( args );
            }
        }
开发者ID:Cheesse,项目名称:ClassicalSharp,代码行数:24,代码来源:Program.cs


注:本文中的ClassicalSharp.Game.Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。