mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
improved code for automatic joining of persistent games; disconnecting + reconnecting works as it should with ISL
This commit is contained in:
parent
5db0fcd6ae
commit
af8e357487
13 changed files with 215 additions and 135 deletions
17
common/server_player_reference.h
Normal file
17
common/server_player_reference.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef SERVER_PLAYER_REFERENCE_H
|
||||
#define SERVER_PLAYER_REFERENCE_H
|
||||
|
||||
class PlayerReference {
|
||||
private:
|
||||
int roomId;
|
||||
int gameId;
|
||||
int playerId;
|
||||
public:
|
||||
PlayerReference(int _roomId, int _gameId, int _playerId) : roomId(_roomId), gameId(_gameId), playerId(_playerId) { }
|
||||
int getRoomId() const { return roomId; }
|
||||
int getGameId() const { return gameId; }
|
||||
int getPlayerId() const { return playerId; }
|
||||
bool operator==(const PlayerReference &other) { return ((roomId == other.roomId) && (gameId == other.gameId) && (playerId == other.playerId)); }
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue