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 SyncInput(void *values, int size, int *disconnect_flags) = 0;
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 GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle) { 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:
virtual GGPOErrorCode DoPoll(int timeout);
virtual GGPOErrorCode AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle);
virtual GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size);
virtual GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags);
virtual GGPOErrorCode IncrementFrame(void);
virtual GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle);
virtual GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle);
virtual GGPOErrorCode SetFrameDelay(GGPOPlayerHandle player, int delay);
virtual GGPOErrorCode SetDisconnectTimeout(int timeout);
virtual GGPOErrorCode SetDisconnectNotifyStart(int timeout);
GGPOErrorCode DoPoll(int timeout) override;
GGPOErrorCode AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle) override;
GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size) override;
GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags) override;
GGPOErrorCode IncrementFrame(void) override;
GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle) override;
GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle) override;
GGPOErrorCode SetFrameDelay(GGPOPlayerHandle player, int delay) override;
GGPOErrorCode SetDisconnectTimeout(int timeout) override;
GGPOErrorCode SetDisconnectNotifyStart(int timeout) override;
GGPOErrorCode SendMessage(const void *msg, int len, bool spectators) override;
public:
virtual void OnMsg(sockaddr_in &from, UdpMsg *msg, int len);
void OnMsg(sockaddr_in &from, UdpMsg *msg, int len) override;
protected:
GGPOErrorCode PlayerHandleToQueue(GGPOPlayerHandle player, int *queue);

View File

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