2021-09-02 15:51:23 +00:00
|
|
|
/*
|
|
|
|
Copyright 2021 flyinghead
|
|
|
|
|
|
|
|
This file is part of Flycast.
|
|
|
|
|
|
|
|
Flycast is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Flycast is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Flycast. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2022-02-01 16:37:54 +00:00
|
|
|
#pragma once
|
2021-09-02 15:51:23 +00:00
|
|
|
#include <future>
|
2024-01-02 13:38:16 +00:00
|
|
|
#include <string>
|
2021-09-02 15:51:23 +00:00
|
|
|
|
2021-09-11 16:50:11 +00:00
|
|
|
struct MapleInputState;
|
|
|
|
|
2021-09-02 15:51:23 +00:00
|
|
|
namespace ggpo
|
|
|
|
{
|
|
|
|
|
|
|
|
std::future<bool> startNetwork();
|
|
|
|
void startSession(int localPort, int localPlayerNum);
|
|
|
|
void stopSession();
|
2021-09-11 16:50:11 +00:00
|
|
|
void getInput(MapleInputState inputState[4]);
|
2021-09-09 16:17:05 +00:00
|
|
|
bool nextFrame();
|
2021-09-02 15:51:23 +00:00
|
|
|
bool active();
|
2021-09-03 09:11:46 +00:00
|
|
|
void displayStats();
|
2021-09-09 16:17:05 +00:00
|
|
|
void endOfFrame();
|
2021-10-18 14:40:17 +00:00
|
|
|
void sendChatMessage(int playerNum, const std::string& msg);
|
|
|
|
void receiveChatMessages(void (*callback)(int playerNum, const std::string& msg));
|
2022-02-01 16:37:54 +00:00
|
|
|
|
|
|
|
static inline bool rollbacking() {
|
|
|
|
extern bool inRollback;
|
|
|
|
|
|
|
|
return inRollback;
|
|
|
|
}
|
|
|
|
|
2021-09-02 15:51:23 +00:00
|
|
|
}
|