ggpo lib: compile warnings, remove legacy chat

This commit is contained in:
Flyinghead 2021-11-05 18:10:56 +01:00
parent 986baccf83
commit 42f92b8dc1
4 changed files with 22 additions and 36 deletions

View File

@ -18,7 +18,6 @@ struct GGPOSession {
virtual GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size) = 0; virtual GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size) = 0;
virtual GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags) = 0; virtual GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags) = 0;
virtual GGPOErrorCode IncrementFrame(void) { return GGPO_OK; } virtual GGPOErrorCode IncrementFrame(void) { return GGPO_OK; }
virtual GGPOErrorCode Chat(char *text) { return GGPO_OK; }
virtual GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle) { return GGPO_OK; } virtual GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle) { return GGPO_OK; }
virtual GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle) { return GGPO_OK; } virtual GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle) { return GGPO_OK; }
virtual GGPOErrorCode Logv(const char *fmt, va_list list) { ::Logv(fmt, list); return GGPO_OK; } virtual GGPOErrorCode Logv(const char *fmt, va_list list) { ::Logv(fmt, list); return GGPO_OK; }

View File

@ -23,20 +23,20 @@ public:
public: public:
virtual GGPOErrorCode DoPoll(int timeout); GGPOErrorCode DoPoll(int timeout) override;
virtual GGPOErrorCode AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle); GGPOErrorCode AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle) override;
virtual GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size); GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size) override;
virtual GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags); GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags) override;
virtual GGPOErrorCode IncrementFrame(void); GGPOErrorCode IncrementFrame(void) override;
virtual GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle); GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle) override;
virtual GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle); GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle) override;
virtual GGPOErrorCode SetFrameDelay(GGPOPlayerHandle player, int delay); GGPOErrorCode SetFrameDelay(GGPOPlayerHandle player, int delay) override;
virtual GGPOErrorCode SetDisconnectTimeout(int timeout); GGPOErrorCode SetDisconnectTimeout(int timeout) override;
virtual GGPOErrorCode SetDisconnectNotifyStart(int timeout); GGPOErrorCode SetDisconnectNotifyStart(int timeout) override;
GGPOErrorCode SendMessage(const void *msg, int len, bool spectators) override; GGPOErrorCode SendMessage(const void *msg, int len, bool spectators) override;
public: public:
virtual void OnMsg(sockaddr_in &from, UdpMsg *msg, int len); void OnMsg(sockaddr_in &from, UdpMsg *msg, int len) override;
protected: protected:
GGPOErrorCode PlayerHandleToQueue(GGPOPlayerHandle player, int *queue); GGPOErrorCode PlayerHandleToQueue(GGPOPlayerHandle player, int *queue);

View File

@ -25,19 +25,19 @@ public:
public: public:
virtual GGPOErrorCode DoPoll(int timeout); GGPOErrorCode DoPoll(int timeout) override;
virtual GGPOErrorCode AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle) { return GGPO_ERRORCODE_UNSUPPORTED; } GGPOErrorCode AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle) override { return GGPO_ERRORCODE_UNSUPPORTED; }
virtual GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size) { return GGPO_OK; } GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size) override { return GGPO_OK; }
virtual GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags); GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags) override;
virtual GGPOErrorCode IncrementFrame(void); GGPOErrorCode IncrementFrame(void) override;
virtual GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle) { return GGPO_ERRORCODE_UNSUPPORTED; } GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle) override { return GGPO_ERRORCODE_UNSUPPORTED; }
virtual GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle) { return GGPO_ERRORCODE_UNSUPPORTED; } GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle) override { return GGPO_ERRORCODE_UNSUPPORTED; }
virtual GGPOErrorCode SetFrameDelay(GGPOPlayerHandle player, int delay) { return GGPO_ERRORCODE_UNSUPPORTED; } GGPOErrorCode SetFrameDelay(GGPOPlayerHandle player, int delay) override { return GGPO_ERRORCODE_UNSUPPORTED; }
virtual GGPOErrorCode SetDisconnectTimeout(int timeout) { return GGPO_ERRORCODE_UNSUPPORTED; } GGPOErrorCode SetDisconnectTimeout(int timeout) override { return GGPO_ERRORCODE_UNSUPPORTED; }
virtual GGPOErrorCode SetDisconnectNotifyStart(int timeout) { return GGPO_ERRORCODE_UNSUPPORTED; } GGPOErrorCode SetDisconnectNotifyStart(int timeout) override { return GGPO_ERRORCODE_UNSUPPORTED; }
public: public:
virtual void OnMsg(sockaddr_in &from, UdpMsg *msg, int len); void OnMsg(sockaddr_in &from, UdpMsg *msg, int len) override;
protected: protected:
void PollUdpProtocolEvents(void); void PollUdpProtocolEvents(void);

View File

@ -184,19 +184,6 @@ ggpo_advance_frame(GGPOSession *ggpo)
} }
} }
GGPOErrorCode
ggpo_client_chat(GGPOSession *ggpo, char *text)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->Chat(text);
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_client_chat: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode GGPOErrorCode
ggpo_get_network_stats(GGPOSession *ggpo, ggpo_get_network_stats(GGPOSession *ggpo,
GGPOPlayerHandle player, GGPOPlayerHandle player,