rewritten: sessions management
(Session, SessionContainer, SessionManager) now a Session object don't copy all fields in its copy constructor (only id) the rest fields are set after the object is inserted in SessionContainer added: after successfully login a session id is changed added: plugin.Call() methods with a first argument a pointer to a Session object git-svn-id: svn://ttmath.org/publicrep/winix/trunk@823 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -67,8 +67,17 @@ struct PluginInfo
|
||||
Synchro * synchro;
|
||||
SessionManager * session_manager;
|
||||
|
||||
// pointer to the plugin session (can be null if not set by the plugin)
|
||||
// you should use WINIX_SESSION_CREATED and WINIX_SESSION_REMOVE
|
||||
// a session
|
||||
// some messages are sent in a session's context e.g. logging a user
|
||||
// this pointer in not always the same as cur->session, it is preferred
|
||||
// to use this pointer instead of cur->session
|
||||
// (cur->session can point at a temporary object)
|
||||
// this pointer can be null
|
||||
Session * session;
|
||||
|
||||
// pointer to the plugin session (can be null if not set by the plugin or if session is null)
|
||||
// this is taken from session->plugin_data.Get()
|
||||
// you should use WINIX_SESSION_CREATED and WINIX_PLUGIN_SESSION_DATA_REMOVE
|
||||
// to create your plugin's session data
|
||||
PluginDataBase * plugin_data_base; // !! zmienic nazwe na plugin_session_base ? a moze session_base; a moze plugin_session?
|
||||
|
||||
@@ -86,8 +95,9 @@ struct PluginInfo
|
||||
l1 = 0;
|
||||
l2 = 0;
|
||||
|
||||
plugin_id = -1;
|
||||
plugin_data_base = 0;
|
||||
plugin_id = -1;
|
||||
session = 0;
|
||||
plugin_data_base = 0;
|
||||
|
||||
res = false;
|
||||
}
|
||||
@@ -166,8 +176,17 @@ public:
|
||||
void Call(int message, void * p1_, long l1_);
|
||||
void Call(int message, void * p1_, long l1_, long l2_);
|
||||
void Call(int message, void * p1_, void * p2_, long l1_);
|
||||
void Call(int message, void * p1_, void * p2_, long l1_, long l2_);
|
||||
void Call(Session * ses, int message, void * p1_, void * p2_, long l1_, long l2_);
|
||||
|
||||
void Call(Session * ses, int message);
|
||||
void Call(Session * ses, int message, void * p1_);
|
||||
void Call(Session * ses, int message, void * p1_, void * p2_);
|
||||
void Call(Session * ses, int message, long l1_);
|
||||
void Call(Session * ses, int message, long l1_, long l2_);
|
||||
void Call(Session * ses, int message, void * p1_, long l1_);
|
||||
void Call(Session * ses, int message, void * p1_, long l1_, long l2_);
|
||||
void Call(Session * ses, int message, void * p1_, void * p2_, long l1_);
|
||||
|
||||
// how many plugins there are
|
||||
size_t Size();
|
||||
|
||||
@@ -211,7 +230,7 @@ private:
|
||||
std::string afilename;
|
||||
|
||||
void * LoadInitFun(const char * filename, Fun1 & fun_init);
|
||||
void Call(int message, Slots::iterator & slot, PluginInfo & info);
|
||||
void Call(Session * ses, int message, Slots::iterator & slot, PluginInfo & info);
|
||||
|
||||
bool SetPointers(PluginInfo & info);
|
||||
};
|
||||
|
Reference in New Issue
Block a user