I'll give you some code from a text game.
void Server::PlayerInput(const std::string& text, Database::ObjectPointer player){ assert(State::empty() && "[PLAYERINPUT] State stack was not empty"); assert(!text.empty() && "[PLAYERINPUT] Text was empty"); assert(player && "[PLAYERINPUT] Bad player objectpointer"); State st; State::sender() = player; std::list<std::string> words; SU::Tokenize(text,words); if (words.empty()) { player->send("Don't do that.\n"); return; } std::string cmd = boost::algorithm::to_upper_copy(words.front()); words.pop_front(); std::string script; std::string func; jisp::type_list pi; if (!search_command_set(cmd,words,cmds,player,player,script,func,pi)) { if (!player->location || !search_command_set(cmd,words, player->location->commands, player, player->location, script,func,pi)) { player->send("I don't recognize that command.\n"); return; } } ScriptInterface::ContextWrapper ctx; int func_id = ScriptInterface::FetchFunction(script, std::string("void ")+func+"(type_list)"); if (func_id < 0) { player->send("[Command definition error]\n"); return; } ctx->Prepare(func_id); ctx->SetArgObject(0,&pi); ctx->Execute(); return;}
Oh, wait, that wasn't helpful at all.