本文整理汇总了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 );
}
}
示例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 );
}
}
示例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 );
}
}
示例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();
}
}
示例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 );
}
}