add node about D5 non-repeatability on BB
This commit is contained in:
@@ -856,7 +856,8 @@ struct S_ReconnectSplit_19 {
|
|||||||
// the chat log window contents will appear in the message box, prepended to
|
// the chat log window contents will appear in the message box, prepended to
|
||||||
// the message text from the command.
|
// the message text from the command.
|
||||||
// The maximum length of the message is 0x400 bytes. This is the only
|
// The maximum length of the message is 0x400 bytes. This is the only
|
||||||
// difference between this command and the D5 command.
|
// difference between this command and the D5 command (except on BB - see the
|
||||||
|
// notes on D5 for more information).
|
||||||
|
|
||||||
// 1B (S->C): Valid but ignored (all versions)
|
// 1B (S->C): Valid but ignored (all versions)
|
||||||
// Internal name: RcvBattleData
|
// Internal name: RcvBattleData
|
||||||
@@ -2765,7 +2766,10 @@ struct SC_TradeItems_D0_D3 { // D0 when sent by client, D3 when sent by server
|
|||||||
// See D0 description for usage information.
|
// See D0 description for usage information.
|
||||||
|
|
||||||
// D5: Large message box (V3/BB)
|
// D5: Large message box (V3/BB)
|
||||||
// Same as 1A command, except the maximum length of the message is 0x1000 bytes.
|
// Same as 1A command, except the maximum length of the message is 0x1000
|
||||||
|
// bytes. On BB, this command is not valid during the data server phase
|
||||||
|
// (whereas 1A is valid there). The BB client ignores all D5 commands after the
|
||||||
|
// first one sent in each connection; this logic does not apply to 1A.
|
||||||
|
|
||||||
// D6 (C->S): Large message box closed (V3)
|
// D6 (C->S): Large message box closed (V3)
|
||||||
// No arguments
|
// No arguments
|
||||||
|
|||||||
+42
-25
@@ -870,32 +870,49 @@ static void send_header_text(std::shared_ptr<Channel> ch, uint16_t command, uint
|
|||||||
}
|
}
|
||||||
|
|
||||||
void send_message_box(shared_ptr<Client> c, const string& text) {
|
void send_message_box(shared_ptr<Client> c, const string& text) {
|
||||||
uint16_t command;
|
if (is_v4(c->version())) {
|
||||||
switch (c->version()) {
|
phosg::StringWriter w;
|
||||||
case Version::PC_PATCH:
|
try {
|
||||||
case Version::BB_PATCH:
|
w.write(tt_encode_marked_optional(add_color(text), c->language(), true));
|
||||||
command = 0x13;
|
} catch (const runtime_error& e) {
|
||||||
break;
|
phosg::log_warning_f("Failed to encode text for message box command: {}", e.what());
|
||||||
case Version::DC_NTE:
|
return;
|
||||||
case Version::DC_11_2000:
|
}
|
||||||
case Version::DC_V1:
|
w.put_u16(0);
|
||||||
case Version::DC_V2:
|
while (w.str().size() & 3) {
|
||||||
case Version::PC_NTE:
|
w.put_u8(0);
|
||||||
case Version::PC_V2:
|
}
|
||||||
command = 0x1A;
|
send_command(c, (w.size() <= 0x400) ? 0x1A : 0xD5, 0x00, w.str());
|
||||||
break;
|
|
||||||
case Version::GC_NTE:
|
} else {
|
||||||
case Version::GC_V3:
|
uint16_t command;
|
||||||
case Version::GC_EP3_NTE:
|
switch (c->version()) {
|
||||||
case Version::GC_EP3:
|
case Version::PC_PATCH:
|
||||||
case Version::XB_V3:
|
case Version::BB_PATCH:
|
||||||
case Version::BB_V4:
|
command = 0x13;
|
||||||
command = 0xD5;
|
break;
|
||||||
break;
|
case Version::DC_NTE:
|
||||||
default:
|
case Version::DC_11_2000:
|
||||||
throw logic_error("invalid game version");
|
case Version::DC_V1:
|
||||||
|
case Version::DC_V2:
|
||||||
|
case Version::PC_NTE:
|
||||||
|
case Version::PC_V2:
|
||||||
|
command = 0x1A;
|
||||||
|
break;
|
||||||
|
case Version::GC_NTE:
|
||||||
|
case Version::GC_V3:
|
||||||
|
case Version::GC_EP3_NTE:
|
||||||
|
case Version::GC_EP3:
|
||||||
|
case Version::XB_V3:
|
||||||
|
command = 0xD5;
|
||||||
|
break;
|
||||||
|
case Version::BB_V4:
|
||||||
|
throw std::logic_error("BB not handled before version switch");
|
||||||
|
default:
|
||||||
|
throw logic_error("invalid game version");
|
||||||
|
}
|
||||||
|
send_text(c->channel, command, 0x00, text, ColorMode::ADD);
|
||||||
}
|
}
|
||||||
send_text(c->channel, command, 0x00, text, ColorMode::ADD);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_ep3_timed_message_box(std::shared_ptr<Channel> ch, uint32_t frames, const string& message) {
|
void send_ep3_timed_message_box(std::shared_ptr<Channel> ch, uint32_t frames, const string& message) {
|
||||||
|
|||||||
Reference in New Issue
Block a user