More refactoring by pulling code out of client and server files
This commit is contained in:
parent
43d688a728
commit
5c8666d4fb
4 changed files with 86 additions and 61 deletions
|
@ -26,12 +26,18 @@ struct ClientInfo
|
|||
player_t player;
|
||||
};
|
||||
|
||||
int WaitForOrdersFromClient(const ClientInfo info, std::mutex &mut, CTTRTSGame &game);
|
||||
void WaitForOrdersFromClient(const ClientInfo info, std::mutex &mut, CTTRTSGame &game);
|
||||
|
||||
void GetOrdersFromClients(std::vector<ClientInfo> &myClients, CTTRTSGame &game, std::mutex &gameMutex);
|
||||
|
||||
void SendGameInfoToClients(std::vector<ClientInfo> &myClients, const CTTRTSGame &game, std::mutex &gameMutex);
|
||||
|
||||
void TryBindSocket(int sockfd, sockaddr_in &serv_addr);
|
||||
|
||||
void PerformServerHandshakeWithClient(const ClientInfo &client, const CTTRTSGame &game);
|
||||
|
||||
void PerformClientHandshake(int sockfd, unsigned int &player, std::string &gameNameString);
|
||||
|
||||
inline void fatal_error(const char *msg)
|
||||
{
|
||||
std::cerr<<msg<<std::endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue