Five character slots: header 32 carries PLAYER_PER_ACCOUNT5
LOGIN_SUCCESS4 (32) now always reads the five-slot packet, replacing the racy size-sniffing check; slot index bounds use PLAYER_PER_ACCOUNT5; version mt20261029. Also skip short rows in <map>_point.txt, which read past the token vector and crashed a warp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
da26f52df5
commit
1757643b07
@@ -2033,15 +2033,15 @@ int main(int argc, char** argv)
|
||||
{
|
||||
// 1. Python 导出验证
|
||||
CHECK(py("import app, net\n"
|
||||
"assert app.ENABLE_PLAYER_PER_ACCOUNT5 == 0, 'unsupported fifth slot advertised'\n"
|
||||
"assert app.ENABLE_PLAYER_PER_ACCOUNT5 == 1, 'fifth slot not advertised'\n"
|
||||
"import introselect\n"
|
||||
"assert introselect.SelectCharacterWindow.SLOT_COUNT == 4, 'current server supports four slots'\n"
|
||||
"assert len(introselect.SelectCharacterWindow.SLOT_ROTATION) == 4, 'current selection requires four angles'\n"));
|
||||
"assert introselect.SelectCharacterWindow.SLOT_COUNT == 5, 'server sends five slots'\n"
|
||||
"assert len(introselect.SelectCharacterWindow.SLOT_ROTATION) == 5, 'five-slot selection needs five angles'\n"));
|
||||
|
||||
// 2. 槽位范围与边界安全检查 (0..4 合法, 5 越界)
|
||||
CPythonNetworkStream& stream = CPythonNetworkStream::Instance();
|
||||
CHECK(stream.GetAccountCharacterSlotDatau(0, CPythonNetworkStream::ACCOUNT_CHARACTER_SLOT_ID) == 1); // 登录成功包设置的第 1 角色
|
||||
CHECK(stream.GetAccountCharacterSlotDatau(4, CPythonNetworkStream::ACCOUNT_CHARACTER_SLOT_ID) == 0); // 4 槽服务器模式下第 5 槽为空
|
||||
CHECK(stream.GetAccountCharacterSlotDatau(4, CPythonNetworkStream::ACCOUNT_CHARACTER_SLOT_ID) == 0); // 第 5 槽 (slot 4) 在登录成功包中为空
|
||||
CHECK(std::string(stream.GetAccountCharacterSlotDataz(4, CPythonNetworkStream::ACCOUNT_CHARACTER_SLOT_NAME)).empty());
|
||||
CHECK(stream.GetAccountCharacterSlotDatau(5, CPythonNetworkStream::ACCOUNT_CHARACTER_SLOT_ID) == 0); // 越界槽位安全防御
|
||||
CHECK(std::string(stream.GetAccountCharacterSlotDataz(5, CPythonNetworkStream::ACCOUNT_CHARACTER_SLOT_NAME)).empty());
|
||||
|
||||
Reference in New Issue
Block a user