diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-05-20 16:41:03 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-05-20 16:41:03 -0300 |
| commit | 42be37f4ad99fc8580415fed89939e305d56193e (patch) | |
| tree | 41303aace3c214f925a43fec6a857f313196e38d /src/main.hh | |
| parent | 7fe30185df21617cf44100f89db462cd4501050e (diff) | |
| download | game-42be37f4ad99fc8580415fed89939e305d56193e.tar.gz game-42be37f4ad99fc8580415fed89939e305d56193e.zip | |
implement `main.cc`, `shm.cc`, and `time.cc` + overall tweeks
Diffstat (limited to 'src/main.hh')
| -rw-r--r-- | src/main.hh | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/main.hh b/src/main.hh index 0b0993c..287b59c 100644 --- a/src/main.hh +++ b/src/main.hh @@ -75,6 +75,64 @@ STATIC_ASSERT(sizeof(int) == 4); # define ASSERT(expr) ((void)(expr)) #endif +// TODO(fusion): We should re-implement the multi-process structure used by the +// original code but only for reference. Making it compile on Windows shouldn't +// be too difficult either. Overall this design is outdated and should be reviewed. +// Nevertheless, we should focus on getting it working as intended, on the target +// platform (which is Linux 32-bits) before attempting to refine it. +STATIC_ASSERT(OS_LINUX); +#include <sys/types.h> +// + +// config.cc +extern int Beat; + +// shm.cc +void StartGame(void); +void CloseGame(void); +void EndGame(void); +bool LoginAllowed(void); +bool GameRunning(void); +bool GameStarting(void); +bool GameEnding(void); +pid_t GetGameThreadPID(void); +int GetPrintlogPosition(void); +char *GetPrintlogLine(int Line); +void IncrementObjectCounter(void); +void DecrementObjectCounter(void); +uint32 GetObjectCounter(void); +void IncrementPlayersOnline(void); +void DecrementPlayersOnline(void); +int GetPlayersOnline(void); +void IncrementNewbiesOnline(void); +void DecrementNewbiesOnline(void); +int GetNewbiesOnline(void); +void SetRoundNr(uint32 RoundNr); +uint32 GetRoundNr(void); +void SetCommand(int Command, char *Text); +int GetCommand(void); +char *GetCommandBuffer(void); +void InitSHM(bool Verbose); +void ExitSHM(void); +void InitSHMExtern(bool Verbose); +void ExitSHMExtern(void); + +// time.cc +extern uint32 RoundNr; +extern uint32 ServerMilliseconds; +void GetRealTime(int *Hour, int *Minute); +void GetTime(int *Hour, int *Minute); +void GetDate(int *Year, int *Cycle, int *Day); +void GetAmbiente(int *Brightness, int *Color); +uint32 GetRoundAtTime(int Hour, int Minute); +uint32 GetRoundForNextMinute(void); + +// util.cc +typedef void TErrorFunction(const char *Text); +typedef void TPrintFunction(int Level, const char *Text); +void SetErrorFunction(TErrorFunction *Function); +void SetPrintFunction(TPrintFunction *Function); void error(char *Text, ...) ATTR_PRINTF(1, 2); +void print(int Level, char *Text, ...) ATTR_PRINTF(1, 2); #endif //TIBIA_MAIN_HH_ |
