diff options
| author | Johannes Loher <ghost91@gmx.net> | 2011-07-22 23:17:16 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-07-30 18:23:59 +0200 |
| commit | e2664c1b00e24158c3e9cee02ab517935be2f8c9 (patch) | |
| tree | 27349a384e01e626d9a93869877c62e3926da647 /src/engine/shared/filecollection.h | |
| parent | 0f11cf014c7a53c20d4432ea26af41123f9f2436 (diff) | |
| download | zcatch-e2664c1b00e24158c3e9cee02ab517935be2f8c9.tar.gz zcatch-e2664c1b00e24158c3e9cee02ab517935be2f8c9.zip | |
Added server sided automatic demo recording
Diffstat (limited to 'src/engine/shared/filecollection.h')
| -rw-r--r-- | src/engine/shared/filecollection.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/engine/shared/filecollection.h b/src/engine/shared/filecollection.h new file mode 100644 index 00000000..c7548a8b --- /dev/null +++ b/src/engine/shared/filecollection.h @@ -0,0 +1,35 @@ +/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ +/* If you are missing that file, acquire a complete release at teeworlds.com. */ +#ifndef ENGINE_SHARED_FILECOLLECTION_H +#define ENGINE_SHARED_FILECOLLECTION_H + +class CFileCollection +{ + enum + { + MAX_ENTRIES=1000, + TIMESTAMP_LENGTH=20, // _YYYY-MM-DD_HH-MM-SS + }; + + int64 m_aTimestamps[MAX_ENTRIES]; + int m_NumTimestamps; + int m_MaxEntries; + char m_aFileDesc[128]; + int m_FileDescLength; + char m_aFileExt[32]; + int m_FileExtLength; + char m_aPath[512]; + IStorage *m_pStorage; + + bool IsFilenameValid(const char *pFilename); + int64 ExtractTimestamp(const char *pTimestring); + void BuildTimestring(int64 Timestamp, char *pTimestring); + +public: + void Init(IStorage *pStorage, const char *pPath, const char *pFileDesc, const char *pFileExt, int MaxEntries); + void AddEntry(int64 Timestamp); + + static int FilelistCallback(const char *pFilename, int IsDir, int StorageType, void *pUser); +}; + +#endif \ No newline at end of file |