You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1.0 KiB

/**
* @file nthread.h
*
* Interface of functions for managing game ticks.
*/
#pragma once
#include "player.h"
namespace devilution {
extern BYTE sgbNetUpdateRate;
extern size_t gdwMsgLenTbl[MAX_PLRS];
extern uint32_t gdwTurnsInTransit;
extern uintptr_t glpMsgTbl[MAX_PLRS];
extern uint32_t gdwLargestMsgSize;
extern uint32_t gdwNormalMsgSize;
extern float gfProgressToNextGameTick; // the progress as a fraction (0.0f to 1.0f) in time to the next game tick
extern int last_tick;
void nthread_terminate_game(const char *pszFcn);
uint32_t nthread_send_and_recv_turn(uint32_t curTurn, int turnDelta);
bool nthread_recv_turns(bool *pfSendAsync = nullptr);
void nthread_set_turn_upper_bit();
void nthread_start(bool setTurnUpperBit);
void nthread_cleanup();
void nthread_ignore_mutex(bool bStart);
bool nthread_has_500ms_passed();
/**
* @brief Calculates the progress in time to the next game tick
* @return Progress as a fraction (0.0f to 1.0f)
*/
void nthread_UpdateProgressToNextGameTick();
} // namespace devilution