no message
This commit is contained in:
parent
66ae5b8e0f
commit
553038694d
@ -51,9 +51,9 @@ int _C_Loger::Debug(string dat,string function,int line){
|
||||
return 0;
|
||||
}
|
||||
|
||||
void _C_Loger::operator<<(const string& wb){
|
||||
void _C_Loger::operator<<(const string& wb) {
|
||||
// 还没有过天
|
||||
if(getTimeDate() == this->mCurrentDate){
|
||||
if(getTimeDate() == this->mCurrentDate) {
|
||||
string tmp = getTime();
|
||||
tmp += ":";
|
||||
tmp += wb;
|
||||
@ -80,17 +80,15 @@ void _C_Loger::operator<<(const string& wb){
|
||||
bool file_existed(string path) {
|
||||
fstream _file;
|
||||
_file.open(path.c_str(),ios::in);
|
||||
if(!_file)
|
||||
{
|
||||
if(!_file) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
_file.close();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
_C_Loger::_C_Loger(FILE *p){
|
||||
_C_Loger::_C_Loger(FILE *p) {
|
||||
this->mFile = p;
|
||||
this->mCurrentDate = getTime();
|
||||
}
|
||||
|
@ -5,8 +5,7 @@ void LuaDelegate::Stop()
|
||||
|
||||
}
|
||||
|
||||
int LuaDelegate::DoString(std::string scr)
|
||||
{
|
||||
int LuaDelegate::DoString(std::string scr) {
|
||||
if (mVM != nullptr){
|
||||
int ret = luaL_dostring(mVM,scr.c_str());
|
||||
if (ret > 0){
|
||||
@ -18,20 +17,19 @@ int LuaDelegate::DoString(std::string scr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LuaDelegate::UpdateScript(std::string scr)
|
||||
{
|
||||
int LuaDelegate::UpdateScript(std::string scr) {
|
||||
if(nullptr != mVM){
|
||||
lua_close(mVM);
|
||||
}
|
||||
free(mVM);
|
||||
mVM = luaL_newstate(); //打开lua
|
||||
if(nullptr != mVM){
|
||||
if(nullptr != mVM) {
|
||||
printf("shit is nullptr");
|
||||
}
|
||||
for (auto x : mFunc) {
|
||||
lua_register(mVM, x.first.c_str(), x.second);
|
||||
}
|
||||
if (mVM != nullptr){
|
||||
if (mVM != nullptr) {
|
||||
int ret = luaL_dostring(mVM,scr.c_str());
|
||||
if (ret > 0){
|
||||
printf("lua error");
|
||||
@ -42,12 +40,11 @@ int LuaDelegate::UpdateScript(std::string scr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void LuaDelegate::PrintError(lua_State *L)
|
||||
{
|
||||
void LuaDelegate::PrintError(lua_State *L) {
|
||||
std::cout<<"\nFATAL ERROR:%s\n\n"<< lua_tostring(L, -1);
|
||||
}
|
||||
|
||||
void LuaDelegate::OnSerialData(std::string data){
|
||||
void LuaDelegate::OnSerialData(std::string data) {
|
||||
int i = lua_getglobal(mVM,"OnDataReady");
|
||||
if(i == 0)
|
||||
return;
|
||||
@ -56,7 +53,6 @@ void LuaDelegate::OnSerialData(std::string data){
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LuaDelegate::DumpStack()
|
||||
{
|
||||
static int count = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user