Improve session caching

- Change SessionCache.db to SessionCache.ini
   Allows users to view and edit session cache

 - Automatically import previous SessionCache.db
   But this file is only read, not updated

 - Automatically import Minecraft session
   If you are logged in in Minecraft, no need to login again
   This is only done if Disk session cache is enabled
   See #232 and #430 for more information

 - Disk session cache becomes default
   The feature is no longer experimental and now recommended
   as the Mojang login servers now have a severe rate limit
   Previous default was Memory session cache, not saved to disk
This commit is contained in:
ORelio 2018-05-03 23:51:56 +02:00
parent a37e340613
commit 18fd24d2d5
5 changed files with 155 additions and 32 deletions

View file

@ -8,7 +8,6 @@ using System.Net.Sockets;
using System.Net.Security;
using MinecraftClient.Protocol.Handlers.Forge;
namespace MinecraftClient.Protocol
{
/// <summary>
@ -229,10 +228,10 @@ namespace MinecraftClient.Protocol
if (Settings.DebugMessages)
ConsoleIO.WriteLineFormatted("§8Debug: Login Request: " + json_request);
int code = DoHTTPSPost("authserver.mojang.com", "/authenticate", json_request, ref result);
if (Settings.DebugMessages)
ConsoleIO.WriteLineFormatted("§8Debug: Login Response: " + result);
if (code == 200)
{
if (Settings.DebugMessages)
ConsoleIO.WriteLineFormatted("§8Debug: Login Response: " + result);
if (result.Contains("availableProfiles\":[]}"))
{
return LoginResult.NotPremium;