Skip to content

Commit 1f85f53

Browse files
committed
Server: Let computer players interact with Spades and Hearts matches
Adds and organizes the code in such a way that allows computer players to interact with Spades and Hearts matches (the only ones where they're supported for now) when required. Additionally, Spades matches now track whether Spades have been unlocked, which therefore allow tricks to be led with Spades. If not unlocked, that is now forbidden. TODO: Actual bid/pass/card strategy logic for Spades and Hearts.
1 parent 429cd43 commit 1f85f53

File tree

9 files changed

+840
-458
lines changed

9 files changed

+840
-458
lines changed

InternetGamesServer/Win7/Match.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ Match::DisconnectedPlayer(PlayerSocket& player)
179179
for (PlayerSocket* p : m_players)
180180
p->OnEventReceive(replaceWithAIXML);
181181

182+
OnReplacePlayer(player);
183+
182184
m_playerSeatsComputer[player.m_role] = true;
183185
}
184186
#if not MATCH_NO_DISCONNECT_ON_PLAYER_LEAVE
@@ -414,7 +416,7 @@ Match::ConstructGameInitXML(PlayerSocket* caller) const
414416
}
415417

416418
std::vector<std::string>
417-
Match::ConstructGameStartMessagesXML(const PlayerSocket&) const
419+
Match::ConstructGameStartMessagesXML(const PlayerSocket&)
418420
{
419421
return {};
420422
}

InternetGamesServer/Win7/Match.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Match : public ::Match<PlayerSocket>
6767

6868
/** Construct XML data for STag messages */
6969
std::string ConstructGameInitXML(PlayerSocket* caller) const;
70-
virtual std::vector<std::string> ConstructGameStartMessagesXML(const PlayerSocket& caller) const;
70+
virtual std::vector<std::string> ConstructGameStartMessagesXML(const PlayerSocket& caller);
7171

7272
protected:
7373
struct QueuedEvent final

0 commit comments

Comments
 (0)