Error with PlusEmulator

tyutu

Member
Oct 25, 2016
110
8
Hi, I also faced problems like this in my Plus, but it was soccer.cs I was able to turn off the emulator, I ended up changing and everything was solved. In case, there is no way to help you if you do not show the error log, it is impossible.

Take a print with the error log that is there on the emulator screen.
 

assface163

New Member
Jun 14, 2018
8
0
Hi, I also faced problems like this in my Plus, but it was soccer.cs I was able to turn off the emulator, I ended up changing and everything was solved. In case, there is no way to help you if you do not show the error log, it is impossible.

Take a print with the error log that is there on the emulator screen.
Thank you for the reply here is the error.
 

tyutu

Member
Oct 25, 2016
110
8
Open your emulator in visual studio and swap program.cs for this:

Code:
using System;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using Plus.Core;
using log4net.Config;

namespace Plus
{
    public static class Program
    {
        private const int MF_BYCOMMAND = 0x00000000;
        public const int SC_CLOSE = 0xF060;

        [DllImport("Kernel32")]
        private static extern bool SetConsoleCtrlHandler(EventHandler handler, bool add);

        [DllImport("user32.dll")]
        public static extern int DeleteMenu(IntPtr hMenu, int nPosition, int wFlags);

        [DllImport("user32.dll")]
        private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);

        [DllImport("kernel32.dll", ExactSpelling = true)]
        private static extern IntPtr GetConsoleWindow();

        [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlAppDomain)]

        public static void Main(string[] Args)
        {
            DeleteMenu(GetSystemMenu(GetConsoleWindow(), false), SC_CLOSE, MF_BYCOMMAND);

            XmlConfigurator.Configure();

            Console.ForegroundColor = ConsoleColor.White;
            Console.CursorVisible = false;
            AppDomain currentDomain = AppDomain.CurrentDomain;
            currentDomain.UnhandledException += MyHandler;

            PlusEnvironment.Initialize();

            while (true)
            {
                if (Console.ReadKey(true).Key == ConsoleKey.Enter)
                {
                    Console.Write("plus> ");
                    string Input = Console.ReadLine();

                    if (Input.Length > 0)
                    {
                        string s = Input.Split(' ')[0];

                        ConsoleCommands.InvokeCommand(s);
                    }
                }
            }
        }

        private static void MyHandler(object sender, UnhandledExceptionEventArgs args)
        {
            var e = (Exception) args.ExceptionObject;
            //Logger.LogCriticalException("SYSTEM CRITICAL EXCEPTION: " + e);
            PlusEnvironment.PerformShutDown();
        }

        private enum CtrlType
        {
            CTRL_C_EVENT = 0,
            CTRL_BREAK_EVENT = 1,
            CTRL_CLOSE_EVENT = 2,
            CTRL_LOGOFF_EVENT = 5,
            CTRL_SHUTDOWN_EVENT = 6
        }

        private delegate bool EventHandler(CtrlType sig);
    }
}
 

Users who are viewing this thread

Top