Exemple #1
0
//-------------------------------------------------------------------------------------		
void ClientApp::finalise(void)
{
	// 结束通知脚本
	PyObject* pyResult = PyObject_CallMethod(getEntryScript().get(), 
										const_cast<char*>("onFinish"),
										const_cast<char*>(""));

	if(pyResult != NULL)
	{
		Py_DECREF(pyResult);
	}
	else
	{
		SCRIPT_ERROR_CHECK();
	}

	if(pServerChannel_ && pServerChannel_->pEndPoint())
	{
		pServerChannel_->stopSend();
		networkInterface().dispatcher().deregisterReadFileDescriptor(*pServerChannel_->pEndPoint());
		networkInterface().deregisterChannel(pServerChannel_);
	}

	pServerChannel_->pPacketSender(NULL);
	SAFE_RELEASE(pTCPPacketSender_);
	SAFE_RELEASE(pTCPPacketReceiver_);
	
	gameTimer_.cancel();
	threadPool_.finalise();
	ClientObjectBase::finalise();
	Network::finalise();

	uninstallPyModules();
	uninstallPyScript();
}
Exemple #2
0
//-------------------------------------------------------------------------------------		
void ClientApp::finalise(void)
{
	if(pServerChannel_ && pServerChannel_->endpoint())
		getNetworkInterface().deregisterChannel(pServerChannel_);

	SAFE_RELEASE(pTCPPacketReceiver_);

	gameTimer_.cancel();
	threadPool_.finalise();
	ClientObjectBase::finalise();

	uninstallPyModules();
	uninstallPyScript();
}
Exemple #3
0
//-------------------------------------------------------------------------------------
bool ClientApp::uninstallPyScript()
{
	unregisterPyObjectToScript("entities");
	return uninstallPyModules() && EntityDef::uninstallScript();
}
Exemple #4
0
bool EntityApp<E>::uninstallPyScript()
{
	return uninstallPyModules() && getScript().uninstall();
}
Exemple #5
0
//-------------------------------------------------------------------------------------
bool PythonApp::uninstallPyScript()
{
	return uninstallPyModules() && getScript().uninstall();
}
Exemple #6
0
//-------------------------------------------------------------------------------------
bool Bots::uninstallPyScript()
{
	return uninstallPyModules() && getScript().uninstall();
}
Exemple #7
0
//-------------------------------------------------------------------------------------
bool PythonApp::uninstallPyScript()
{
	script::PyMemoryStream::uninstallScript();
	return uninstallPyModules() && getScript().uninstall();
}