Merge pull request #3 from mm201/master

Just catching up with the main repository
This commit is contained in:
HilbertIdeals5 2023-07-31 14:35:22 -04:00 committed by GitHub
commit 01e1a7bb1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 318 additions and 171 deletions

View File

@ -13,7 +13,7 @@
<connectionStrings>
<add name="pkmnFoundationsConnectionString"
connectionString="Server=gts;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
connectionString="Server=localhost;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>

View File

@ -2,7 +2,7 @@
<configuration>
<connectionStrings>
<add name="pkmnFoundationsConnectionString"
connectionString="Server=gts;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
connectionString="Server=localhost;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<startup>

View File

@ -6,7 +6,7 @@
</configSections>
<connectionStrings>
<add name="pkmnFoundationsConnectionString"
connectionString="Server=gts;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
connectionString="Server=localhost;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<startup>

View File

@ -2,11 +2,11 @@
<configuration>
<connectionStrings>
<add name="pkmnFoundationsConnectionString"
connectionString="Server=gts;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
connectionString="Server=localhost;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<appSettings>
<add key="pkmnFoundationsBoxUpload4Dir" value="C:\Users\Greg\SkyDrive\Battle Videos G4" />
<add key="pkmnFoundationsBoxUpload4Dir" value=".\Scraped battle videos Gen4" />
</appSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup><system.data>
<DbProviderFactories>

View File

@ -2,11 +2,11 @@
<configuration>
<connectionStrings>
<add name="pkmnFoundationsConnectionString"
connectionString="Server=gts;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
connectionString="Server=localhost;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<appSettings>
<add key="pkmnFoundationsBoxUpload5Dir" value="C:\Users\Greg\SkyDrive\Battle Videos G5" />
<add key="pkmnFoundationsBoxUpload5Dir" value=".\Scraped battle videos Gen5" />
</appSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup><system.data>
<DbProviderFactories>

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

View File

@ -4,7 +4,7 @@
<connectionStrings xdt:Transform="Replace">
<add name="pkmnFoundationsConnectionString"
connectionString="Server=gts;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
connectionString="Server=localhost;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>

View File

@ -8,7 +8,7 @@
<configuration>
<connectionStrings>
<add name="pkmnFoundationsConnectionString"
connectionString="Server=gts;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
connectionString="Server=localhost;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>

View File

@ -11,7 +11,7 @@ using PkmnFoundations.Wfc;
namespace PkmnFoundations.GTS
{
/// <summary>
/// Summary description for pokemondpds_web
/// Gamestats handler for Wi-Fi Plaza
/// </summary>
public class pokemondpds_web : GamestatsHandler
{
@ -71,80 +71,64 @@ namespace PkmnFoundations.GTS
// 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, // Duration the room remains open for (seconds)
0x9e, 0xc4, 0x70, 0xa7, // Unknown, Mythra thinks it may be a random seed
0x00, 0x00, 0x00, 0x00, // Arceus footprint flag. 0 for disabled, 1 for enabled.
0x03, // Room type (0x03 = grass)
0x00, // "Season" tbd
0x16, 0x00, // Number of timed events (22)
// List of 22 events.
// Each event has an int for time and an int for what to do.
// Events are sorted according to time.
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);
PlazaSchedule ps = new PlazaSchedule();
ps.Duration = 1200;
ps.Unknown1 = -1485781858;
ps.FootprintOptions = PlazaFootprintOptions.Normal;
ps.RoomType = PlazaRoomTypes.Grass;
ps.Season = PlazaSeasons.None;
ps.Schedule = new[]
{
// todo: Have different, randomized schedules but in a way that makes sense
new PlazaScheduleEntry(0, (PlazaEventTypes)1),
new PlazaScheduleEntry(0, (PlazaEventTypes)7),
new PlazaScheduleEntry(0, (PlazaEventTypes)11),
new PlazaScheduleEntry(780, (PlazaEventTypes)8),
new PlazaScheduleEntry(840, (PlazaEventTypes)2),
new PlazaScheduleEntry(840, (PlazaEventTypes)9),
new PlazaScheduleEntry(900, (PlazaEventTypes)3),
new PlazaScheduleEntry(900, (PlazaEventTypes)10),
new PlazaScheduleEntry(900, (PlazaEventTypes)12),
new PlazaScheduleEntry(960, (PlazaEventTypes)4),
new PlazaScheduleEntry(960, (PlazaEventTypes)9),
new PlazaScheduleEntry(960, (PlazaEventTypes)13),
new PlazaScheduleEntry(960, (PlazaEventTypes)15),
new PlazaScheduleEntry(1020, (PlazaEventTypes)5),
new PlazaScheduleEntry(1020, (PlazaEventTypes)14),
new PlazaScheduleEntry(1020, (PlazaEventTypes)16),
new PlazaScheduleEntry(1075, (PlazaEventTypes)18),
new PlazaScheduleEntry(1080, (PlazaEventTypes)6),
new PlazaScheduleEntry(1080, (PlazaEventTypes)13),
new PlazaScheduleEntry(1080, (PlazaEventTypes)17),
new PlazaScheduleEntry(1140, (PlazaEventTypes)11),
new PlazaScheduleEntry(1200, (PlazaEventTypes)19),
};
Random rand = new Random();
int roomChoice = rand.Next(13);
if (roomChoice < 1)
{
ps.RoomType = PlazaRoomTypes.Mew;
ps.FootprintOptions = PlazaFootprintOptions.Arceus;
}
else
{
ps.RoomType = (PlazaRoomTypes)((roomChoice - 1) / 3);
// todo: Seasons. Based on the irl season? Maybe use GenV's season? That would be a nice callout
}
response.Write(new byte[]
{
0x00, 0x00, 0x00, 0x00
}, 0, 4);
response.Write(ps.Save(), 0, ps.Size);
} break;
case "/pokemondpds/web/enc/lobby/getVIP.asp":
{
// todo: keep VIPs in database
response.Write(new byte[] { 0x00, 0x00, 0x00, 0x00 }, 0, 4);
foreach (var i in new[] { 600403373, 601315647, 601988829 })
@ -158,100 +142,107 @@ namespace PkmnFoundations.GTS
case "/pokemondpds/web/enc/lobby/getQuestionnaire.asp":
{
// This is a replayed response that asks the question,
// "Which move would you most like to use?" Cut/Surf/Strength
// It also includes results for "last week"'s survey:
// "Do you know anyone that looks like a Gym Leader?" Yes/No/Yes, a little
// Apparently it's possible not just to use built-in survey
// questions but to also pose unique new ones?
response.Write(new byte[]{
0x00, 0x00, 0x00, 0x00, 0x2a, 0x01, 0x00,
0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x2a, 0x01, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x01, 0x00,
0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00,
0x00, 0x46, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00,
0x00, 0x64, 0x01, 0x00, 0x00, 0x11, 0x01, 0x00,
0x00, 0x83, 0x00, 0x00, 0x00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x29, 0x01, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7e, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00,
0x33, 0x00, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00,
0x11, 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00
}, 0, 732);
} break;

View File

@ -112,6 +112,7 @@
<Compile Include="Structures\StatValues.cs" />
<Compile Include="Structures\StatValuesBase.cs" />
<Compile Include="Structures\TrainerMemo.cs" />
<Compile Include="Wfc\PlazaSchedule.cs" />
<Compile Include="Wfc\TrainerProfile4.cs" />
<Compile Include="Wfc\TrainerProfile5.cs" />
<Compile Include="Wfc\TrainerProfileBase.cs" />

View File

@ -18,6 +18,12 @@ namespace PkmnFoundations.Support
{
}
public BinarySerializableBase(SerializationInfo info, StreamingContext context)
{
byte[] data = (byte[])info.GetValue("data", typeof(byte[]));
Load(data, 0);
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("data", Save());

View File

@ -0,0 +1,149 @@
using PkmnFoundations.Support;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace PkmnFoundations.Wfc
{
public class PlazaSchedule : BinarySerializableBase
{
public PlazaSchedule()
{
}
public PlazaSchedule(uint duration, int unknown1, PlazaFootprintOptions footprintOptions,
PlazaRoomTypes roomType, PlazaSeasons season, PlazaScheduleEntry[] schedule)
{
Duration = duration;
Unknown1 = unknown1;
FootprintOptions = footprintOptions;
RoomType = roomType;
Season = season;
Schedule = schedule;
}
public PlazaSchedule(byte[] data)
{
Load(data);
}
public uint Duration; // Duration the room remains open for (seconds)
public int Unknown1; // Unknown, Mythra thinks it may be a random seed
public PlazaFootprintOptions FootprintOptions;
public PlazaRoomTypes RoomType;
public PlazaSeasons Season;
public PlazaScheduleEntry[] Schedule;
protected override void Load(BinaryReader reader)
{
Duration = reader.ReadUInt32();
Unknown1 = reader.ReadInt32();
FootprintOptions = (PlazaFootprintOptions)reader.ReadInt32();
RoomType = (PlazaRoomTypes)reader.ReadByte();
Season = (PlazaSeasons)reader.ReadByte();
ushort schedLength = reader.ReadUInt16();
Schedule = new PlazaScheduleEntry[schedLength];
for (int i = 0; i < schedLength; i++)
{
Schedule[i] = new PlazaScheduleEntry(reader.ReadBytes(8));
}
}
protected override void Save(BinaryWriter writer)
{
writer.Write(Duration);
writer.Write(Unknown1);
writer.Write((int)FootprintOptions);
writer.Write((byte)RoomType);
writer.Write((byte)Season);
var schedule = Schedule;
writer.Write((ushort)schedule.Length);
foreach (var entry in schedule)
{
writer.Write(entry.Save());
}
}
public override int Size
{
get
{
return 16 + (Schedule?.Length ?? 0) * 8;
}
}
}
public class PlazaScheduleEntry : BinarySerializableBase
{
public PlazaScheduleEntry()
{
}
public PlazaScheduleEntry(int time, PlazaEventTypes eventType)
{
Time = time;
EventType = eventType;
}
public PlazaScheduleEntry(byte[] data)
{
Load(data);
}
protected override void Load(BinaryReader reader)
{
Time = reader.ReadInt32();
EventType = (PlazaEventTypes)reader.ReadInt32();
}
protected override void Save(BinaryWriter writer)
{
writer.Write(Time);
writer.Write((int)EventType);
}
public override int Size
{
get
{
return 8;
}
}
public int Time;
public PlazaEventTypes EventType;
}
public enum PlazaFootprintOptions : int
{
Normal = 0,
Arceus = 1,
}
public enum PlazaRoomTypes : byte
{
Fire = 0,
Water = 1,
Electric = 2,
Grass = 3,
Mew = 4,
}
public enum PlazaSeasons : byte
{
None = 0,
Spring = 1,
Summer = 2,
Fall = 3,
Winter = 4,
}
public enum PlazaEventTypes : int
{
// todo: Catalogue all of these and identify which ones are valid when.
}
}

View File

@ -4,7 +4,7 @@
<connectionStrings xdt:Transform="Replace">
<add name="pkmnFoundationsConnectionString"
connectionString="Server=gts;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
connectionString="Server=localhost;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>

View File

@ -8,7 +8,7 @@
<configuration>
<connectionStrings>
<add name="pkmnFoundationsConnectionString"
connectionString="Server=gts;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
connectionString="Server=localhost;Database=gts;User ID=gts;Password=gts;Pooling=true;charset=utf8;Allow User Variables=True"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>