PlusEMU Debug LOGGER

Buu

New Member
Jun 22, 2021
3
2

How does one disable this?
Hello, I took a look at the emulator for you.
The TryExecutePacket() method of the PacketManager class checks whether a debugger is attached.
If this is the case, Log.Debug() is called.
Source:

Q: What is a debugger?
A: A tool that attaches to a running application and allows programmers to inspect their code.

I'm assuming that you have the source code of the project and run it in Visual Studio, can that be?
If so, I wouldn't change anything here, although I certainly have some suggestions for improvement.
You most likely already have a compiled version of the project. Open the folder in which the project is located, you should have the following folders: bin\Debug\<framework-version>.
There should now be an executable file that you can use instead.

You can also do this in Visual Studio, of course, but you seem to want to use the server for a production environment, for which Visual Studio is overkill for and the IDE is just used for an unintended purpose at this point, apart from that it can also have a negative impact on performance.
If you insist anyway, you only have to use the release configuration to start the application instead of the debug configuration.

You must be registered for see images attach

You must be registered for see images attach
 

Shxrty

Shorty#1960
Mar 31, 2018
629
163
The emulator is not in debug mode; its opened by going to bin/debug/plusemulator.exe <- yet it still does the logger. and log.debug() isnt called for.
 

Buu

New Member
Jun 22, 2021
3
2
The emulator is not in debug mode; its opened by going to bin/debug/plusemulator.exe <- yet it still does the logger. and log.debug() isnt called for.
If you still see it, Log.Debug() is definitely called somewhere.
That surprises me, because even if the project was compiled with the debug configuration but no debugger attached, Debugger.IsAttached will return false and Log.Debug() cannot be called accordingly.
You could still try to build the project with the release configuration (see my previous post), it might work after all, which still would be pretty strange. But hey, if it works 🤷‍♂️.

If it does not work, I refer to PacketManager.cs:L132 from again.
C#:
public void TryExecutePacket(GameClient session, ClientPacket packet)
        {
            if (session == null)
                return;

            if (!_incomingPackets.TryGetValue(packet.Id, out IPacketEvent pak))
            {
                if (System.Diagnostics.Debugger.IsAttached)
                    Log.Debug("Unhandled Packet: " + packet);
                return;
            }

            if (System.Diagnostics.Debugger.IsAttached)
            {
                if (_packetNames.ContainsKey(packet.Id))
                    Log.Debug("Handled Packet: [" + packet.Id + "] " + _packetNames[packet.Id]);
                else
                    Log.Debug("Handled Packet: [" + packet.Id + "] UnnamedPacketEvent");
            }

            if (!_ignoreTasks)
                ExecutePacketAsync(session, packet, pak);
            else
                pak.Parse(session, packet);
        }

Are there any differences between your and this TryExecutePacket() method?
If so, I would ask you to post the class or upload the project solution somewhere. If everything is identical, I would have to look over it myself. The last time I actively dealt with Habbo was in 2011. Therefore, I am unfortunately not aware of today's emulators 😅.
 

Buu

New Member
Jun 22, 2021
3
2
It's identical, feel free to add me on Discord, so we can fix your little problem and share the solution here.
Buu#9891

Edit: The thread starter added me on Discord but didn't respond to my messages, I suppose he was able to fix his problem with one of the above solutions.
 
Last edited:

Users who are viewing this thread

Top