mew room support

refs #7

this commit adds in a static response for the "mew" room, as well as
adds in a note about how the web response isn't taken if the peerchat
server returns a special key for GETCHANKEY (which the open one does).
i haven't yet figured out the correct "empty" response for peerchat,
so peerchat will always have priority meaning this endpoint is
basically a no-op.

NOTE: I can generate rooms now, and have figured out most of the fields,
but there are still some i'm missing, and some i have a general idea of
what a byte means, but don't know the range of valid values. to not
overload the maintainers, i'm not going to commit my projects have
generated structures.

in the following weeks I hope to fully sketch out all the fields, all
their values, as well as figure out the "empty" response for peerchat,
and bring those into this project that way they can be used to generate
rooms of any type, and plugged into whatever administration tool mm201
would like to build :)

if there are any rooms i can generate in the meantime, or folks would
like to work on these with me feel free to reach out. :)
This commit is contained in:
Cynthia
2023-03-05 20:12:23 -07:00
committed by mm201
parent d19a20affe
commit 1c4049a413

View File

@@ -61,36 +61,77 @@ namespace PkmnFoundations.GTS
{
// This is a replayed response from a game I had with Pipian.
// It appears to be 49 ints.
// todo: A real implementation
// todo(mythra): A real implementation
// - we can generate events manually now, but we have a few
// missing fields, so more research will need to be done before
// that implementation.
response.Write(new byte[]
{
0x00, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00,
0x9e, 0xc4, 0x70, 0xa7, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x48, 0x03, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x48, 0x03, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00,
0x0a, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x0f, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x33, 0x04, 0x00, 0x00,
0x12, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00,
0x11, 0x00, 0x00, 0x00, 0x74, 0x04, 0x00, 0x00,
0x0b, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00,
0x13, 0x00, 0x00, 0x00
}, 0, 196);
// note(mythra): this response is usually overwritten by the
// peerchat server (through GETCHANKEY `b_lib_c_lobby`).
// this is only taken if that channel key returns an
// "empty" response.
Random room_choice = new Random();
if (room_choice.Next() % 2 == 0) {
// Mew Room w/ Arceus Footprint.
response.Write(new byte[]
{
0x00, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x04, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x48, 0x03, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x48, 0x03, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00,
0x0a, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x0f, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x33, 0x04, 0x00, 0x00,
0x12, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00,
0x11, 0x00, 0x00, 0x00, 0x74, 0x04, 0x00, 0x00,
0x0b, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00,
0x13, 0x00, 0x00, 0x00
}, 0, 196);
} else {
// Grass Room without Arceus Footprint.
response.Write(new byte[]
{
0x00, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00,
0x9e, 0xc4, 0x70, 0xa7, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x48, 0x03, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x48, 0x03, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00,
0x0a, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x0f, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x33, 0x04, 0x00, 0x00,
0x12, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00,
0x11, 0x00, 0x00, 0x00, 0x74, 0x04, 0x00, 0x00,
0x0b, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00,
0x13, 0x00, 0x00, 0x00
}, 0, 196);
}
} break;