Fission FSN
Loading...
Searching...
No Matches
fsCInputSession.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsCInputSession.h
4*
5* Purpose: Collate input messages from fsIInputManager so
6* they can be stored / played back
7*
8*********************************************************************/
9
10#ifndef fsCInputSessionhdr
11#define fsCInputSessionhdr
12
13#include <memory>
14
15#include <fsCore/fsIFile.h>
17
19{
20public:
21
35
36 void update(fsS32 pTimeDeltaMS);
37
38 fsBool recordingGet() const;
39
41 fsBool messageReady() const;
43
44 void messageAdd(const fsCUniqueId& pMessageType, const fsIInputManager::sClonableMessageParameters& pParam);
45
48
49protected:
50
51private:
52
53 void rndSeedSave(fsStr& pStr) const;
54 void rndSeedLoad();
55
56 fsStr userStateFileNameGet(fsS32 pId) const;
57 fsBool resourceExists(const fsStr& pSource) const;
58 void resourceDelete(const fsStr& pSource) const;
59 void resourceCopy(const fsStr& pSource, const fsStr& pDestination) const;
60
61 void nextBatchOfMessagesRead();
62
63 void loadStrDecodeRecordedMessage(fsStr& pStr);
64 void loadStrDecodeRndSeed(fsStr& pStr);
65
66
67 void statePreserve(const fsStr& pStateFolder);
68 void stateRestore(const fsStr& pStateFolder);
69
70 void messagesLoad(fsS32 pOffset, fsS32 pLineCount, void (fsCInputSession::*pDecodceFnc)(fsStr& pStr));
71
72 void messagesSave();
73 fsStr sessionNameGenerate() const;
74
75 const static fsStr mGlobalStateFile;
76
77 const fsS32 mEventBufferSize;
78 fsS32 mRunningTime;
79 std::vector<sRecordedMessage> mMessages;
80 fsStr mSessionName;
81
82 fsStr mFilename;
83
84 fsS32 mCurrentSaveId;
85
86 const static fsStr mMessageLogFileName;
87 const static fsStr mMessageLogFileNameExt;
88 const static fsStr mReplayFolder;
89
90};
91
92#endif
void messageAdd(const fsCUniqueId &pMessageType, const fsIInputManager::sClonableMessageParameters &pParam)
Definition fsCInputSession.cpp:105
void update(fsS32 pTimeDeltaMS)
Definition fsCInputSession.cpp:68
fsBool frameUpdateMessageReady()
Definition fsCInputSession.cpp:96
fsBool messageReady() const
Definition fsCInputSession.cpp:89
sRecordedMessage messagePop()
Definition fsCInputSession.cpp:78
~fsCInputSession()
Definition fsCInputSession.cpp:334
fsBool recordingGet() const
Definition fsCInputSession.cpp:73
fsCInputSession()
Definition fsCInputSession.cpp:303
Definition fsCUniqueId.h:21
Definition fsStr.h:23
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20
long long fsS64
Definition fsBaseTypes.h:23
Definition fsCInputSession.h:23
fsIInputManager::sClonableMessageParameters * mParams
Definition fsCInputSession.h:33
void saveStr(fsStr &pSaveStr) const
Definition fsCInputSession.cpp:60
sRecordedMessage & operator=(const sRecordedMessage &pCopy)
Definition fsCInputSession.cpp:35
fsCUniqueId mId
Definition fsCInputSession.h:32
~sRecordedMessage()
Definition fsCInputSession.cpp:47
sRecordedMessage(fsS64 pTime, fsCUniqueId pId, const fsIInputManager::sClonableMessageParameters &pParams)
Definition fsCInputSession.cpp:20
fsS64 mTime
Definition fsCInputSession.h:31
Definition fsIInputManager.h:69