mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-28 21:26:07 +00:00
even with 5ae73c8e228e0eb8bc3368fbb96b15685d0f3ef4
This commit is contained in:
parent
6d3cea0093
commit
4e00af9220
7 changed files with 32 additions and 13 deletions
|
@ -542,7 +542,7 @@ void CEXISlippi::createNewFile()
|
||||||
PanicAlertT("Could not create .slp replay file [%s].\n\n"
|
PanicAlertT("Could not create .slp replay file [%s].\n\n"
|
||||||
"The replay folder's path might be invalid, or you might "
|
"The replay folder's path might be invalid, or you might "
|
||||||
"not have permission to write to it.\n\n"
|
"not have permission to write to it.\n\n"
|
||||||
"You can change the replay folder in Config > GameCube > "
|
"You can change the replay folder in Config > Slippi > "
|
||||||
"Slippi Replay Settings.",
|
"Slippi Replay Settings.",
|
||||||
filepath.c_str());
|
filepath.c_str());
|
||||||
}
|
}
|
||||||
|
@ -687,6 +687,9 @@ void CEXISlippi::prepareGameInfo(u8* payload)
|
||||||
// Write PS Frozen byte
|
// Write PS Frozen byte
|
||||||
m_read_queue.push_back(settings->isFrozenPS);
|
m_read_queue.push_back(settings->isFrozenPS);
|
||||||
|
|
||||||
|
// Write should resync setting
|
||||||
|
m_read_queue.push_back(replayCommSettings.shouldResync ? 1 : 0);
|
||||||
|
|
||||||
// Return the size of the gecko code list
|
// Return the size of the gecko code list
|
||||||
prepareGeckoList();
|
prepareGeckoList();
|
||||||
appendWordToBuffer(&m_read_queue, (u32)geckoList.size());
|
appendWordToBuffer(&m_read_queue, (u32)geckoList.size());
|
||||||
|
@ -1008,6 +1011,7 @@ void CEXISlippi::prepareGeckoList()
|
||||||
{0x80185050, true}, // Online/Menus/VSScreen/HideStageDisplay/PreventEarlyR3Overwrite.asm
|
{0x80185050, true}, // Online/Menus/VSScreen/HideStageDisplay/PreventEarlyR3Overwrite.asm
|
||||||
{0x80184b1c, true}, // Online/Menus/VSScreen/HideStageText/SkipStageNumberShow.asm
|
{0x80184b1c, true}, // Online/Menus/VSScreen/HideStageText/SkipStageNumberShow.asm
|
||||||
{0x801A45BC, true}, // Online/Slippi Online Scene/main.asm
|
{0x801A45BC, true}, // Online/Slippi Online Scene/main.asm
|
||||||
|
{0x801a45b8, true}, // Online/Slippi Online Scene/main.asm (https://bit.ly/3kxohf4)
|
||||||
{0x801BFA20, true}, // Online/Slippi Online Scene/boot.asm
|
{0x801BFA20, true}, // Online/Slippi Online Scene/boot.asm
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1397,6 +1401,15 @@ void CEXISlippi::prepareIsFileReady()
|
||||||
m_read_queue.push_back(1);
|
m_read_queue.push_back(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CEXISlippi::isDisconnected()
|
||||||
|
{
|
||||||
|
if (!slippi_netplay)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
auto status = slippi_netplay->GetSlippiConnectStatus();
|
||||||
|
return status != SlippiNetplayClient::SlippiConnectStatus::NET_CONNECT_STATUS_CONNECTED || isConnectionStalled;
|
||||||
|
}
|
||||||
|
|
||||||
static int tempTestCount = 0;
|
static int tempTestCount = 0;
|
||||||
void CEXISlippi::handleOnlineInputs(u8* payload)
|
void CEXISlippi::handleOnlineInputs(u8* payload)
|
||||||
{
|
{
|
||||||
|
@ -1404,6 +1417,12 @@ void CEXISlippi::handleOnlineInputs(u8* payload)
|
||||||
|
|
||||||
int32_t frame = payload[0] << 24 | payload[1] << 16 | payload[2] << 8 | payload[3];
|
int32_t frame = payload[0] << 24 | payload[1] << 16 | payload[2] << 8 | payload[3];
|
||||||
|
|
||||||
|
if (isDisconnected())
|
||||||
|
{
|
||||||
|
m_read_queue.push_back(3); // Indicate we disconnected
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (frame == 1)
|
if (frame == 1)
|
||||||
{
|
{
|
||||||
availableSavestates.clear();
|
availableSavestates.clear();
|
||||||
|
@ -1564,6 +1583,9 @@ void CEXISlippi::prepareOpponentInputs(u8* payload)
|
||||||
|
|
||||||
void CEXISlippi::handleCaptureSavestate(u8* payload)
|
void CEXISlippi::handleCaptureSavestate(u8* payload)
|
||||||
{
|
{
|
||||||
|
if (isDisconnected())
|
||||||
|
return;
|
||||||
|
|
||||||
s32 frame = payload[0] << 24 | payload[1] << 16 | payload[2] << 8 | payload[3];
|
s32 frame = payload[0] << 24 | payload[1] << 16 | payload[2] << 8 | payload[3];
|
||||||
|
|
||||||
u64 startTime = Common::Timer::GetTimeUs();
|
u64 startTime = Common::Timer::GetTimeUs();
|
||||||
|
@ -2006,12 +2028,9 @@ void CEXISlippi::handleLogOutRequest()
|
||||||
|
|
||||||
void CEXISlippi::handleUpdateAppRequest()
|
void CEXISlippi::handleUpdateAppRequest()
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
|
||||||
CriticalAlertT(
|
|
||||||
"Automatic updates are not available for macOS, please get the latest update from slippi.gg/netplay.");
|
|
||||||
#else
|
|
||||||
Host_LowerWindow();
|
Host_LowerWindow();
|
||||||
user->UpdateApp();
|
user->UpdateApp();
|
||||||
|
#ifdef _WIN32
|
||||||
Host_Exit();
|
Host_Exit();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,6 @@ namespace ExpansionInterface
|
||||||
void closeFile();
|
void closeFile();
|
||||||
std::string generateFileName();
|
std::string generateFileName();
|
||||||
bool checkFrameFullyFetched(s32 frameIndex);
|
bool checkFrameFullyFetched(s32 frameIndex);
|
||||||
bool shouldFFWFrame(s32 frameIndex);
|
|
||||||
|
|
||||||
// std::ofstream log;
|
// std::ofstream log;
|
||||||
|
|
||||||
|
@ -151,6 +150,7 @@ namespace ExpansionInterface
|
||||||
|
|
||||||
// online play stuff
|
// online play stuff
|
||||||
u16 getRandomStage();
|
u16 getRandomStage();
|
||||||
|
bool isDisconnected();
|
||||||
void handleOnlineInputs(u8* payload);
|
void handleOnlineInputs(u8* payload);
|
||||||
void prepareOpponentInputs(u8* payload);
|
void prepareOpponentInputs(u8* payload);
|
||||||
void handleSendInputs(u8* payload);
|
void handleSendInputs(u8* payload);
|
||||||
|
|
|
@ -182,12 +182,6 @@ unsigned int SlippiNetplayClient::OnData(sf::Packet& packet)
|
||||||
int32_t headFrame = remotePadQueue.empty() ? 0 : remotePadQueue.front()->frame;
|
int32_t headFrame = remotePadQueue.empty() ? 0 : remotePadQueue.front()->frame;
|
||||||
int inputsToCopy = frame - headFrame;
|
int inputsToCopy = frame - headFrame;
|
||||||
|
|
||||||
// Check that the packet actually contains the data it claims to
|
|
||||||
if ((5 + inputsToCopy * SLIPPI_PAD_DATA_SIZE) > (int)packet.getDataSize()) {
|
|
||||||
ERROR_LOG(SLIPPI_ONLINE, "Netplay packet too small to read pad buffer");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = inputsToCopy - 1; i >= 0; i--)
|
for (int i = inputsToCopy - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
auto pad = std::make_unique<SlippiPad>(frame - i, &packetData[5 + i * SLIPPI_PAD_DATA_SIZE]);
|
auto pad = std::make_unique<SlippiPad>(frame - i, &packetData[5 + i * SLIPPI_PAD_DATA_SIZE]);
|
||||||
|
|
|
@ -163,6 +163,7 @@ void SlippiReplayComm::loadFile()
|
||||||
commFileSettings.commandId = "";
|
commFileSettings.commandId = "";
|
||||||
commFileSettings.outputOverlayFiles = false;
|
commFileSettings.outputOverlayFiles = false;
|
||||||
commFileSettings.isRealTimeMode = false;
|
commFileSettings.isRealTimeMode = false;
|
||||||
|
commFileSettings.shouldResync = true;
|
||||||
commFileSettings.rollbackDisplayMethod = "off";
|
commFileSettings.rollbackDisplayMethod = "off";
|
||||||
|
|
||||||
if (res.is_string())
|
if (res.is_string())
|
||||||
|
@ -193,6 +194,7 @@ void SlippiReplayComm::loadFile()
|
||||||
commFileSettings.commandId = res.value("commandId", "");
|
commFileSettings.commandId = res.value("commandId", "");
|
||||||
commFileSettings.outputOverlayFiles = res.value("outputOverlayFiles", false);
|
commFileSettings.outputOverlayFiles = res.value("outputOverlayFiles", false);
|
||||||
commFileSettings.isRealTimeMode = res.value("isRealTimeMode", false);
|
commFileSettings.isRealTimeMode = res.value("isRealTimeMode", false);
|
||||||
|
commFileSettings.shouldResync = res.value("shouldResync", true);
|
||||||
commFileSettings.rollbackDisplayMethod = res.value("rollbackDisplayMethod", "off");
|
commFileSettings.rollbackDisplayMethod = res.value("rollbackDisplayMethod", "off");
|
||||||
|
|
||||||
if (commFileSettings.mode == "queue")
|
if (commFileSettings.mode == "queue")
|
||||||
|
|
|
@ -32,6 +32,7 @@ public:
|
||||||
int endFrame = INT_MAX;
|
int endFrame = INT_MAX;
|
||||||
bool outputOverlayFiles;
|
bool outputOverlayFiles;
|
||||||
bool isRealTimeMode;
|
bool isRealTimeMode;
|
||||||
|
bool shouldResync; // If true, logic will attempt to resync games
|
||||||
std::string rollbackDisplayMethod; // off, normal, visible
|
std::string rollbackDisplayMethod; // off, normal, visible
|
||||||
std::string commandId;
|
std::string commandId;
|
||||||
std::queue<WatchSettings> queue;
|
std::queue<WatchSettings> queue;
|
||||||
|
|
|
@ -147,7 +147,7 @@ void SlippiSpectateServer::popEvents()
|
||||||
|
|
||||||
if (sendEvents.count(command))
|
if (sendEvents.count(command))
|
||||||
{
|
{
|
||||||
u32 cursor = static_cast<u32>(m_event_buffer.size() + m_cursor_offset);
|
u32 cursor = (u32)(m_event_buffer.size() + m_cursor_offset);
|
||||||
game_event["payload"] = base64::Base64::Encode(m_event_concat);
|
game_event["payload"] = base64::Base64::Encode(m_event_concat);
|
||||||
game_event["type"] = "game_event";
|
game_event["type"] = "game_event";
|
||||||
game_event["cursor"] = cursor;
|
game_event["cursor"] = cursor;
|
||||||
|
|
|
@ -190,6 +190,7 @@ void SlippiUser::UpdateApp()
|
||||||
WARN_LOG(SLIPPI, "Executing app update command: %s", command.c_str());
|
WARN_LOG(SLIPPI, "Executing app update command: %s", command.c_str());
|
||||||
RunSystemCommand(command);
|
RunSystemCommand(command);
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
|
CriticalAlertT("Automatic updates are not available for macOS; please get the latest update from slippi.gg/netplay.");
|
||||||
#else
|
#else
|
||||||
const char* appimage_path = getenv("APPIMAGE");
|
const char* appimage_path = getenv("APPIMAGE");
|
||||||
const char* appmount_path = getenv("APPDIR");
|
const char* appmount_path = getenv("APPDIR");
|
||||||
|
@ -203,6 +204,8 @@ void SlippiUser::UpdateApp()
|
||||||
std::string command = mount_path + "/usr/bin/appimageupdatetool " + path;
|
std::string command = mount_path + "/usr/bin/appimageupdatetool " + path;
|
||||||
WARN_LOG(SLIPPI, "Executing app update command: %s", command.c_str());
|
WARN_LOG(SLIPPI, "Executing app update command: %s", command.c_str());
|
||||||
RunSystemCommand(command);
|
RunSystemCommand(command);
|
||||||
|
CriticalAlertT("Restart Dolphin to finish the update. If there was an issue, please head over to the Slippi "
|
||||||
|
"Discord for support.");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue