summaryrefslogtreecommitdiff
path: root/src/user.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/user.cpp')
-rwxr-xr-xsrc/user.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/user.cpp b/src/user.cpp
index 7fd5858..1250254 100755
--- a/src/user.cpp
+++ b/src/user.cpp
@@ -5,6 +5,7 @@
#include "user.h"
#include "s_conf.h"
+#include "s_modl.h"
#include "s_tool.h"
using namespace std;
@@ -113,6 +114,34 @@ user::set_sock( int i_sock )
}
void
+user::command( string &s_command )
+{
+
+ auto unsigned int pos = s_command.find( "/" );
+ while( pos != string::npos )
+ {
+ s_command.replace( pos, 1, "" );
+ pos = s_command.find( "/" );
+ }
+
+ string s_mod( "cmnd/yc_" );
+ s_mod.append( s_command ).append( ".so" );
+
+ dynmod *mod = s_modl::get
+ ().get_module( s_mod );
+
+ if ( mod == NULL )
+ {
+ msg_post( new string( s_lang::get
+ ().get_val( "ERRORCMD" ) ) );
+ return;
+ }
+
+ // execute the module.
+ ( *(mod->the_func) ) ( (void*) this );
+}
+
+void
user::renew_stamp( )
{
pthread_mutex_lock ( &mut_l_time );