From 803b1812d08fe8c3b3eea9371f8d9b0bead93c6d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 10 Jan 2019 21:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4python=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cpp/scriptengine.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cpp/scriptengine.cc b/cpp/scriptengine.cc index 2826191..dad06f9 100644 --- a/cpp/scriptengine.cc +++ b/cpp/scriptengine.cc @@ -8,6 +8,7 @@ namespace f8 { void ScriptEngine::Init() { + #if 0 engine_ = new a8::PyEngine(); if (getenv("is_dev_env")) { engine_->work_path = "/var/data/conf_test/game1008/res/pyscripts/"; @@ -18,13 +19,16 @@ namespace f8 if (!engine_->IsInitialized()) { abort(); } + #endif } void ScriptEngine::UnInit() { + #if 0 engine_->UnInit(); delete engine_; engine_ = nullptr; + #endif } void ScriptEngine::Update() @@ -33,6 +37,9 @@ namespace f8 bool ScriptEngine::LoadModule(const std::string& module_name) { + #if 1 + return false; + #else bool ret = engine_->LoadModule(module_name.c_str()); if (!ret) { a8::UdpLog::Instance()->Warning("load python module %s error %s\n", @@ -43,10 +50,14 @@ namespace f8 assert(false); } return ret; + #endif } bool ScriptEngine::LoadString(const std::string& str) { + #if 1 + return true; + #else bool ret = engine_->ExecString(str.c_str()); if (!ret) { a8::UdpLog::Instance()->Warning("load python string %s error %s", @@ -57,11 +68,15 @@ namespace f8 assert(false); } return ret; + #endif } std::tuple ScriptEngine::CallGlobalFunc(const char* func_name, std::initializer_list args) { +#if 1 + return std::tuple(); +#else auto ret = engine_->CallGlobalFunc(func_name, args); if (!std::get<0>(ret)) { a8::UdpLog::Instance()->Warning("call global function %s error %s", @@ -71,12 +86,16 @@ namespace f8 }); } return ret; +#endif } std::tuple ScriptEngine::CallModuleFunc(const char* module_name, const char* func_name, std::initializer_list args) { + #if 1 + return std::tuple(); + #else auto ret = engine_->CallModuleFunc(module_name, func_name, args); if (!std::get<0>(ret)) { a8::UdpLog::Instance()->Warning("call module function [%s] %s error %s", @@ -87,5 +106,6 @@ namespace f8 }); } return ret; + #endif } }