X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/3e32eb8e48a56bca543faa522909d3d83538c55d..9701b7ab4dc4cd709ad4dcaa750fc0021f15e231:/include/stg/stg_message.h?ds=sidebyside diff --git a/include/stg/stg_message.h b/include/stg/stg_message.h new file mode 100644 index 00000000..16fe566f --- /dev/null +++ b/include/stg/stg_message.h @@ -0,0 +1,56 @@ +#ifndef STG_MESSAGES_H +#define STG_MESSAGES_H + +/* + * Author : Boris Mikhailenko + */ + + /* + $Revision: 1.3 $ + $Date: 2010/03/04 11:49:52 $ + */ + +#include +#include + +#include "os_int.h" + +//----------------------------------------------------------------------------- +struct STG_MSG_HDR +{ +STG_MSG_HDR() + : id(0), + ver(0), + type(0), + lastSendTime(0), + creationTime(0), + showTime(0), + repeat(0), + repeatPeriod(0) +{}; + +uint64_t id; +unsigned ver; +unsigned type; +unsigned lastSendTime; +unsigned creationTime; +unsigned showTime; +int repeat; +unsigned repeatPeriod; +}; +//----------------------------------------------------------------------------- +struct STG_MSG +{ +STG_MSG() {}; + +time_t GetNextSendTime() const +{ +return header.lastSendTime + header.repeat * 60; +}; + +STG_MSG_HDR header; +std::string text; +}; +//----------------------------------------------------------------------------- + +#endif