cmangos / issues

This repository is used as a centralized point for all issues regarding CMaNGOS.
179 stars 48 forks source link

🐛 [Bug Report] CHARACTER_LOGIN_FAILED does not display an error box on the client + wrong oppcodes on reasons #3285

Open Novivy opened 1 year ago

Novivy commented 1 year ago

Bug Details

1) When sending a SMSG_CHARACTER_LOGIN_FAILED during the loading after clicking enter world (WorldSession::HandlePlayerLoginOpcode), the loading correctly stop and bring you back to the characters list but it does not display an error box with the error message given with SMSG_CHARACTER_LOGIN_FAILED.

2) It also appears that the errors messages oopcodes are wrong for 1.12 client.

Current ones (that are wrong)

enum CharLoginFailReasons
{
    CHAR_LOGIN_NO_WORLD                                    = 0x01,
    CHAR_LOGIN_DUPLICATE_CHARACTER                         = 0x02,
    CHAR_LOGIN_NO_INSTANCES                                = 0x03,
    CHAR_LOGIN_DISABLED                                    = 0x04,
    CHAR_LOGIN_NO_CHARACTER                                = 0x05,
    CHAR_LOGIN_LOCKED_FOR_TRANSFER                         = 0x06,
    CHAR_LOGIN_LOCKED_BY_BILLING                           = 0x07,
    CHAR_LOGIN_FAILED                                      = 0x08,
}

The correct ones (I was able to test it and verify theses on the character creation screen since the error box appear there when you attempt to create a character)

CHAR_LOGIN_IN_PROGRESS  0x3C
CHAR_LOGIN_SUCCESS  0x3D
CHAR_LOGIN_NO_WORLD 0x3E    
CHAR_LOGIN_DUPLICATE_CHARACTER  0x3F    
CHAR_LOGIN_NO_INSTANCES 0x40    
CHAR_LOGIN_FAILED   0x41    
CHAR_LOGIN_DISABLED 0x42    
CHAR_LOGIN_NO_CHARACTER 0x43    
CHAR_LOGIN_LOCKED_FOR_TRANSFER  0x44

I will make a pull request for the second point if we can sort out the first one

Steps to Reproduce

Point 1) Checking that the error box does not appear on character selection screen after trying to login

Put

WorldPacket datax(SMSG_CHARACTER_LOGIN_FAILED, 1);  
datax << (uint8)0x42;
SendPacket(datax, true);
return;

at the very beginning of void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recv_data)

Then try to login on a character

Point 2) Checking correct oppcodes

Put

WorldPacket datax(SMSG_CHAR_CREATE, 1);  
datax << (uint8)0x42;
SendPacket(datax, true);
return;

at the very beginning of void WorldSession::HandleCharCreateOpcode(WorldPacket& recv_data)

Then go into the character creation screen and try to create a character, this will throw the excepted error

image

Expected behavior

1) The error box should appear on the client after sending SMSG_CHARACTER_LOGIN_FAILED with CHAR_LOGIN_DISABLED while entering the world 2) oppcodes for CharLoginFailReasons should be updated

Suggested Workaround

1) No idea.. this is why I am here :) 2) oppcodes for CharLoginFailReasons should be updated with the ones I provided

Crash Log

No response

Core SHA1 Commit Hash

ef797221800493d26e4f5b17d34389953c591d7b

Database SHA1 Commit Hash

14648a47039f968ec0b09ab395c52fc1135cd9fb

Operating System

Windows 10

Client Version

1.12.1 (Classic)

killerwife commented 1 year ago
  1. Here you can see a nice switch case of valid packetfills for SMSG_CHARACTER_LOGIN_FAILED

image

The whole enum is actually all connected. Here you can see that 1-6 convert them to the numbering scheme in the other ones (like SMSG_CHAR_CREATE)

Why it doesnt show the error after the loading screen, I do not know currently. Likely wrong order of packets in some way.

killerwife commented 1 year ago

If you put your line of code for 1. at the end of WorldSession::HandleCharEnum and disable anticheat, you will actually be able to see the error messages in their full glory, but char list wont show. So it isnt a question of packet order. Something else is off and currently do not know.

Novivy commented 1 year ago
  1. Here you can see a nice switch case of valid packetfills for SMSG_CHARACTER_LOGIN_FAILED

image

The whole enum is actually all connected. Here you can see that 1-6 convert them to the numbering scheme in the other ones (like SMSG_CHAR_CREATE)

Why it doesnt show the error after the loading screen, I do not know currently. Likely wrong order of packets in some way.

Indeed my bad!

If you put your line of code for 1. at the end of WorldSession::HandleCharEnum and disable anticheat, you will actually be able to see the error messages in their full glory, but char list wont show. So it isnt a question of packet order. Something else is off and currently do not know.

Yeah, damn, maybe the client should send CMSG CHAR ENUM after getting SMSG_CHARACTER_LOGIN_FAILED so he can retrieve the list again after it. Maybe it's a bug and we were never able to display error on the character list? I can't remember back then but I think we had already got errors like World server is down when trying to login on a character so that's not it

killerwife commented 1 year ago

Currently I do not know I'm afraid. In tbc we have correct protocol, but I do not exactly have vanilla sniffs. One thing is to track down packet payloads, a whole another is showing errors.

celguar commented 1 year ago

If I make my game show world server is down it wont show me list if chars after that. and if it does error disappears I think

Novivy commented 1 year ago

If I make my game show world server is down it wont show me list if chars after that. and if it does error disappears I think

Yeah so if we display an error the character list won't show and if we want to show the character list, the error won't show. I guess that's how it worked back then.. although displaying an empty character list would freak out people