Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
monopoly::messaging Namespace Reference

Classes

class  Transport
 

Enumerations

enum class  TcpSessionMode { VoiceSpectators , Gameplay }
 

Functions

bool initialize ()
 
void shutdown ()
 
void resetPlayerOwners ()
 
void setPlayerOwner (rules::PlayerNumber player, std::uint32_t source)
 
std::uint32_t playerOwner (rules::PlayerNumber player)
 
bool authenticSender (const rules::GameState &state, const actions::Message &message)
 
void stopNetwork ()
 
void setNetworkStarter (std::function< bool()> starter)
 
bool startConfiguredNetwork ()
 
bool gameplayNetwork ()
 
bool gameplayReady ()
 
void noteClientResynchronized ()
 
bool consumeHostDisconnected ()
 
bool startNetwork (std::unique_ptr< Transport > transport)
 
void pumpNetwork ()
 
std::string_view networkError ()
 
bool sendAction (const actions::Message &message)
 
bool sendAction (actions::Type action, rules::PlayerNumber fromPlayer, rules::PlayerNumber toPlayer, std::int64_t numberA, std::int64_t numberB, std::int64_t numberC, std::int64_t numberD, std::wstring_view stringA)
 
void clearActionQueue ()
 
std::size_t currentQueueSize ()
 
bool receiveAction (actions::Message &message)
 
bool receiveVoiceChatOnly (actions::Message &message)
 
bool serverMode ()
 
bool networkMode ()
 
std::size_t queuedActionCount ()
 
std::expected< std::unique_ptr< Transport >, std::string > openTcpTransport (bool host, std::string_view address, std::uint16_t port, TcpSessionMode mode)
 

Variables

constexpr std::size_t MessageQueueCapacity
 

Enumeration Type Documentation

◆ TcpSessionMode

Enumerator
VoiceSpectators 
Gameplay 

Definition at line 12 of file TcpMessageTransport.hpp.

Function Documentation

◆ authenticSender()

bool monopoly::messaging::authenticSender ( const rules::GameState &  state,
const actions::Message &  message 
)

Definition at line 88 of file Messaging.cpp.

◆ clearActionQueue()

void monopoly::messaging::clearActionQueue ( )

Definition at line 315 of file Messaging.cpp.

◆ consumeHostDisconnected()

bool monopoly::messaging::consumeHostDisconnected ( )

Definition at line 149 of file Messaging.cpp.

◆ currentQueueSize()

std::size_t monopoly::messaging::currentQueueSize ( )

Definition at line 322 of file Messaging.cpp.

◆ gameplayNetwork()

bool monopoly::messaging::gameplayNetwork ( )

Definition at line 132 of file Messaging.cpp.

◆ gameplayReady()

bool monopoly::messaging::gameplayReady ( )

Definition at line 137 of file Messaging.cpp.

◆ initialize()

bool monopoly::messaging::initialize ( )

Definition at line 30 of file Messaging.cpp.

◆ networkError()

std::string_view monopoly::messaging::networkError ( )

Definition at line 229 of file Messaging.cpp.

◆ networkMode()

bool monopoly::messaging::networkMode ( )

Definition at line 442 of file Messaging.cpp.

◆ noteClientResynchronized()

void monopoly::messaging::noteClientResynchronized ( )

Definition at line 143 of file Messaging.cpp.

◆ openTcpTransport()

std::expected< std::unique_ptr< Transport >, std::string > monopoly::messaging::openTcpTransport ( bool  host,
std::string_view  address,
std::uint16_t  port,
TcpSessionMode  mode 
)

Definition at line 692 of file TcpMessageTransport.cpp.

◆ playerOwner()

std::uint32_t monopoly::messaging::playerOwner ( rules::PlayerNumber  player)

Definition at line 83 of file Messaging.cpp.

◆ pumpNetwork()

void monopoly::messaging::pumpNetwork ( )

Definition at line 172 of file Messaging.cpp.

◆ queuedActionCount()

std::size_t monopoly::messaging::queuedActionCount ( )

Definition at line 447 of file Messaging.cpp.

◆ receiveAction()

bool monopoly::messaging::receiveAction ( actions::Message &  message)

Definition at line 327 of file Messaging.cpp.

◆ receiveVoiceChatOnly()

bool monopoly::messaging::receiveVoiceChatOnly ( actions::Message &  message)

Definition at line 374 of file Messaging.cpp.

◆ resetPlayerOwners()

void monopoly::messaging::resetPlayerOwners ( )

Definition at line 69 of file Messaging.cpp.

◆ sendAction() [1/2]

bool monopoly::messaging::sendAction ( actions::Type  action,
rules::PlayerNumber  fromPlayer,
rules::PlayerNumber  toPlayer,
std::int64_t  numberA,
std::int64_t  numberB,
std::int64_t  numberC,
std::int64_t  numberD,
std::wstring_view  stringA 
)

Definition at line 277 of file Messaging.cpp.

◆ sendAction() [2/2]

bool monopoly::messaging::sendAction ( const actions::Message &  message)

Definition at line 234 of file Messaging.cpp.

◆ serverMode()

bool monopoly::messaging::serverMode ( )

Definition at line 437 of file Messaging.cpp.

◆ setNetworkStarter()

void monopoly::messaging::setNetworkStarter ( std::function< bool()>  starter)

Definition at line 120 of file Messaging.cpp.

◆ setPlayerOwner()

void monopoly::messaging::setPlayerOwner ( rules::PlayerNumber  player,
std::uint32_t  source 
)

Definition at line 76 of file Messaging.cpp.

◆ shutdown()

void monopoly::messaging::shutdown ( )

Definition at line 56 of file Messaging.cpp.

◆ startConfiguredNetwork()

bool monopoly::messaging::startConfiguredNetwork ( )

Definition at line 125 of file Messaging.cpp.

◆ startNetwork()

bool monopoly::messaging::startNetwork ( std::unique_ptr< Transport >  transport)

Definition at line 154 of file Messaging.cpp.

◆ stopNetwork()

void monopoly::messaging::stopNetwork ( )

Definition at line 106 of file Messaging.cpp.

Variable Documentation

◆ MessageQueueCapacity

constexpr std::size_t monopoly::messaging::MessageQueueCapacity
inlineconstexpr
Initial value:
=
(rules::MaxPlayers * 3) +
(3 * rules::SquareCount)

Definition at line 14 of file Messaging.hpp.