Skip to content
Permalink
Browse files

End the C client discrimination.

  • Loading branch information...
UnknownShadow200 committed Dec 17, 2018
1 parent c085c80 commit 4454aa37a5be11e96d5a9c422bf05d853c2f0b6c
Showing with 13 additions and 4 deletions.
  1. +11 −1 fCraft/Network/Player.Networking.cs
  2. +2 −3 fCraft/System/Utils/Paths.cs
@@ -563,6 +563,13 @@ public sealed partial class Player {
if( stream != null ) stream.Close();
if( client != null ) client.Close();
}

static bool IsModernClient( string client ) {
// old java client
if( client.CaselessEquals("ClassiCube Client" ) ) return false;

return client.CaselessContains( "ClassiCube" ) || client.CaselessContains( "ClassicalSharp" );
}

bool LoginSequence()
{
@@ -786,7 +793,10 @@ bool LoginSequence()
return false;
}

if (string.IsNullOrEmpty(ClientName) || !ClientName.CaselessContains("classicalsharp")) {
if (string.IsNullOrEmpty(ClientName)) {
Message("&bIt is recommended that you switch to Enhanced mode!");
Message("&bClick &aOptions &b-> &aMode &b-> &aEnhanced &bin the launcher.");
} else if (!IsModernClient(ClientName)) {
Message("&bIt is recommended that you use the ClassicalSharp client!");
Message("&9http://123dmwm.tk/cs &bredirects to the official download.");
}
@@ -405,9 +405,8 @@ public static class Paths {
} else {
string parentDir = GetDirectoryNameOrRoot( fileInfo.FullName );
string[] files = Directory.GetFiles( parentDir, "*", SearchOption.TopDirectoryOnly );
StringComparison comparison = ( caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase );
return files.Select( fullFileName => Path.GetFileName( fullFileName ) )
.Any( fileName => fileName.Equals( fileInfo.Name, comparison ) );
StringComparison comparison = caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase;
return files.Any( path => Path.GetFileName( path ).Equals( fileInfo.Name, comparison ) );
}
}

0 comments on commit 4454aa3

Please sign in to comment.
You can’t perform that action at this time.