diff options
Diffstat (limited to 'src/chat/user.cpp')
| -rwxr-xr-x | src/chat/user.cpp | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/src/chat/user.cpp b/src/chat/user.cpp index 4f1646b..bac8b7e 100755 --- a/src/chat/user.cpp +++ b/src/chat/user.cpp @@ -73,23 +73,27 @@ user::initialize() void user::clean() { + destroy_session(); + set_fake( false ); + set_invisible( false ); + set_away( false, "" ); +} + +void +user::destroy_session() +{ + if ( !get_has_sess() ) + return; - // If this user has a session - if ( get_has_sess() ) - { #ifdef DATABASE - // Store all changed data into the mysql table if this user is registered: - if ( b_is_reg ) - wrap::DATA->update_user_data( get_name(), "savechangednick", map_changed_data ); + // Store all changed data into the mysql table if this user is registered: + if ( b_is_reg ) + wrap::DATA->update_user_data( get_name(), "savechangednick", map_changed_data ); #endif - wrap::SMAN->destroy_session( get_tmpid() ); - // wrap::system_message( SESSION + tool::int2string( wrap::SMAN->get_session_count() ) ); - } - - set_fake( false ); - set_invisible( false ); - set_away( false, "" ); + set_has_sess(false); + wrap::SMAN->destroy_session(get_tmpid()); + set_tmpid(""); } string @@ -411,7 +415,7 @@ user::command( string &s_command ) string s_command2 = s_command.substr(0, pos2-1); s_mod.append( s_command2 ).append( ".so" ); - dynmod *mod = wrap::MODL->get_module( s_mod ); + dynmod *mod = wrap::MODL->get_module( s_mod, get_name() ); if ( mod == NULL || wrap::CHAT->get_command_disabled( s_command2 ) || @@ -577,4 +581,15 @@ void user::reconf() {} +void +user::dumpit() +{ + dumpable::add("[user]"); + dumpable::add("Name: " + get_name() + + "; Room: " + get_room()->get_name() + + "; Status: " + tool::int2string(get_status())); + dumpable::add("TempID: " + get_tmpid()); +} + + #endif |
