Пример #1
0
	int CWorldOther::RunApi(int nFd,  string & method_str, string& params_str,  CDbOper& db)
	{

		if ("charge" == method_str) //先判断是否是充值
		{
			LogDebug("RunApi", "charge url = %s", params_str.c_str());
			BaseCall("ChargeMgr", "onChargeReq", nFd, method_str, params_str);
			return 0;
		}
		
		tg_API_LIB::iterator itor = g_api_lib.find(method_str);
		if (itor != g_api_lib.end())
		{
			map<string, string> dictParams;
			SplitStringToMap(params_str, '&', '=', dictParams);

			Method_Params mp;
			mp.method = method_str;
			mp.params = dictParams;

			api_func func = itor->second;
			func(nFd, mp, (void*)&db);						
		}
		else
		{
			BaseCall("Collector", "API", nFd, method_str, params_str);//c++层没有 就放到lua去处理
		}

		return 0;
	}
Пример #2
0
ADT_API bool IsRecursive(void* pData)
{
	char s[sizeof(void*)+sizeof(uint32)];
	*(void**)s = pData;
	BaseCall(AFC_RECURSIVE_LOCK, s);
	return (*(uint32*)(s+sizeof(void*))) != 0;
}
Пример #3
0
ADT_API void SystemUnLock()
{
	BaseCall(AFC_SYSTEM_UNLOCK, NULL);
}
Пример #4
0
ADT_API void UnRecursive(void* pData)
{
	BaseCall(AFC_RECURSIVE_UNLOCK, pData);
}