Net: port the select-phase packets

Character create/delete/rename and empire selection now reach the
server, and LOGIN_SUCCESS3, PLAYER_CREATE_SUCCESS/FAILURE,
PLAYER_DELETE_SUCCESS/WRONG_SOCIAL_ID, POINT_CHANGE and CHANGE_NAME are
parsed and forwarded to the select/create windows like Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-13 13:27:52 +09:00
co-authored by Claude Opus 5.5
parent 40cac5cf52
commit 31c74cec28
10 changed files with 205 additions and 15 deletions
+12 -2
View File
@@ -11,8 +11,13 @@ tea=(root/'upstream/ava2-client/EterBase/tea.cpp').read_text(errors='replace')
def declaration(source, start, end):
text=source[source.index(start):]
text=text[:text.index(end)+len(end)]
text=re.sub(r'\blong\s+long\b','std::int64_t',text)
return re.sub(r'\blong\b','std::int32_t',text)
def struct(source, tag, name):
match=re.search(r'typedef struct '+tag+r'\s*\{',source)
return declaration(source[match.start():],'typedef struct','} '+name+';')
# Both baseline macro headers enable sash, conqueror and five-character accounts.
for path,names in [
('upstream/ava2-client/UserInterface/Locale_inc.h',['ENABLE_SASH_SYSTEM','ENABLE_CONQUEROR_LEVEL','ENABLE_PLAYER_PER_ACCOUNT5']),
@@ -25,13 +30,18 @@ header='''#pragma once
#include <cstdint>
namespace ava2_oracle {
using BYTE=std::uint8_t; using WORD=std::uint16_t; using DWORD=std::uint32_t; using LONG=std::int32_t;
constexpr int CHARACTER_NAME_MAX_LEN=24, GUILD_NAME_MAX_LEN=12, PLAYER_PER_ACCOUNT4=5, PLAYER_PER_ACCOUNT=5;
constexpr int CHARACTER_NAME_MAX_LEN=24, GUILD_NAME_MAX_LEN=12, PLAYER_PER_ACCOUNT3=3, PLAYER_PER_ACCOUNT4=5, PLAYER_PER_ACCOUNT=5, PRIVATE_CODE_LENGTH=8;
#define ENABLE_SASH_SYSTEM
#define __SASH_SYSTEM__
#define ENABLE_CONQUEROR_LEVEL
#pragma pack(push,1)
namespace client {
'''+declaration(client,'typedef struct SSimplePlayerInformation','} TSimplePlayerInformation;')+'\n'+declaration(client,'typedef struct packet_login_success4','} TPacketGCLoginSuccess4;')+'\n}\nnamespace server {\n'+declaration(server,'typedef struct SSimplePlayer','} TSimplePlayer;')+'\n'+declaration(packet,'typedef struct packet_login_success','} TPacketGCLoginSuccess;')+'''\n}
'''+declaration(client,'typedef struct SSimplePlayerInformation','} TSimplePlayerInformation;')+'\n'+declaration(client,'typedef struct packet_login_success4','} TPacketGCLoginSuccess4;')+'\n'+'\n'.join(struct(client,tag,name) for tag,name in [
# SelectPhase packets (PythonNetworkStreamPhaseSelect.cpp)
('packet_login_success3','TPacketGCLoginSuccess3'),('command_player_create_success','TPacketGCPlayerCreateSuccess'),
('packet_point_change','TPacketGCPointChange'),('SPacketGCChangeName','TPacketGCChangeName'),
('command_player_create','TPacketCGCreateCharacter'),('command_player_delete','TPacketCGDestroyCharacter'),
('SPacketCGChangeName','TPacketCGChangeName')])+'\n}\nnamespace server {\n'+declaration(server,'typedef struct SSimplePlayer','} TSimplePlayer;')+'\n'+declaration(packet,'typedef struct packet_login_success','} TPacketGCLoginSuccess;')+'''\n}
#pragma pack(pop)
namespace original_cipher {
'''