Skip to content

Commit

Permalink
[DMG] Finish GBMA internal server list loading
Browse files Browse the repository at this point in the history
  • Loading branch information
shonumi committed Aug 28, 2018
1 parent db1945a commit 48c87ee
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
6 changes: 5 additions & 1 deletion src/data/gbma/server_list.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@

/01/CGB-B9AJ/index.html
gbma/index.html

gbe_head.bmp
gbma/gbe_plus_mobile_header.bmp
24 changes: 12 additions & 12 deletions src/dmg/gbma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,21 +856,19 @@ void DMG_SIO::mobile_adapter_process_http()
{
std::string filename = "";

//See if this is the homepage for Mobile Trainer
if(mobile_adapter.http_data.find("/01/CGB-B9AJ/index.html") != std::string::npos)
//Search internal server list
for(u32 x = 0; x < mobile_adapter.srv_list_in.size(); x++)
{
not_found = false;
filename = config::data_path + "gbma/index.html";
}
if(mobile_adapter.http_data.find(mobile_adapter.srv_list_in[x]) != std::string::npos)
{
not_found = false;
filename = config::data_path + mobile_adapter.srv_list_out[x];

//See if this is the homepage header image
else if(mobile_adapter.http_data.find("gbe_head.bmp") != std::string::npos)
{
not_found = false;
img = true;
filename = config::data_path + "gbma/gbe_plus_mobile_header.bmp";
//Check for GBE+ images
if(mobile_adapter.srv_list_out[x] == "gbma/gbe_plus_mobile_header.bmp") { img = true; }
}
}

if(!not_found)
{
//Open up GBE+ header image
Expand Down Expand Up @@ -1141,6 +1139,8 @@ bool DMG_SIO::mobile_adapter_load_server_list()

if(mobile_adapter.srv_list_in.size() > mobile_adapter.srv_list_out.size()) { mobile_adapter.srv_list_in.pop_back(); }

std::cout<<"SIO::Loaded GB Mobile Adapter internal server list\n";

file.close();
return true;
}
4 changes: 3 additions & 1 deletion src/dmg/sio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DMG_SIO::DMG_SIO()

reset();

//Load Mobile Adapter data
//Load Mobile Adapter data + internal server list
if(sio_stat.sio_type == GB_MOBILE_ADAPTER)
{
std::string mobile_conf_file = config::data_path + "gbma_conf.bin";
Expand Down Expand Up @@ -56,6 +56,8 @@ DMG_SIO::DMG_SIO()
mobile_conf.close();

std::cout<<"SIO::Loaded GB Mobile Adapter configuration data.\n";

mobile_adapter_load_server_list();
}
}

Expand Down

0 comments on commit 48c87ee

Please sign in to comment.