-1

I write new launcher for mine Minecraft roleplay server in Microsoft Forms App using CmlLib.Core and when I start the game it shows me "multiplayer is disabled" how can I fix this?

Library: https://github.com/CmlLib/CmlLib.Core

How it looks

Source Code:

using CmlLib.Core;
using CmlLib.Core.Auth;
using System.Threading;

namespace Toba_Launcher
{
    public partial class Toba : Form
    {
        public Toba()
        {
            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;
        }

        private void path()
        {
            var path = new MinecraftPath();
            var launcher = new CMLauncher(path);
            launcher.FileChanged += (e) =>
            {
                console.Items.Add(string.Format("[{0}] {1} - {2}/{3}", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount));
            };
            launcher.ProgressChanged += (s, e) =>
            {
                //Console.WriteLine("{0}%", e.ProgressPercentage);
            };
        }

        private async void launch()
        {
            var path = new MinecraftPath();
            var launcher = new CMLauncher(path);
            launcher.FileChanged += (e) =>
            {
                console.Items.Add(string.Format("[{0}] {1} - {2}/{3}", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount));
            };

            var launchOption = new MLaunchOption
            {
                MaximumRamMb = 1024,
                Session = MSession.GetOfflineSession("Test123")
                //ServerIp = "mc.hypixel.net"
            };

            var process = launcher.CreateProcess("1.16.5", launchOption);
            process.Start();
            Hide();
        }

        private void Toba_Load(object sender, EventArgs e)
        {
            path();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;
            Thread thread = new Thread(() => launch());
            thread.IsBackground = true;
            thread.Start();
        }
    }
}

I read documentation but not find anything useful.

I tried this:

MSession session = new MSession("username", "accesstoken", "uuid");

But nothing changed, maybe I can't use it.

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49

1 Answers1

1

Problem solved, Minecraft version 1.16.5 and 1.16.4 has problem with authlib.

Here is the solution: https://github.com/CmlLib/CmlLib.Core/issues/85#issuecomment-1638171765

But you can just change the game version. xD

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 06 '23 at 11:15