Saving stage

parent 1227ed85
...@@ -78,17 +78,10 @@ static PyObject* va_connect(PyObject* pSelf, PyObject** ppArgs, Py_ssize_t nArgs ...@@ -78,17 +78,10 @@ static PyObject* va_connect(PyObject* pSelf, PyObject** ppArgs, Py_ssize_t nArgs
static PyObject* va_disconnect(PyObject* pSelf, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames) static PyObject* va_disconnect(PyObject* pSelf, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{ {
if (g_pVANetClient) if( !g_pVANetClient )
{ return PyBool_FromLong( 0 );
if (g_pVANetClient->IsConnected())
{
g_pVANetClient->Disconnect();
return PyBool_FromLong(1);
}
}
PyErr_WarnEx(NULL, "Was not connected, doing nothing. Use is_connected to avoid this message.", 1); return PyBool_FromLong( g_pVANetClient->Disconnect() );
return PyBool_FromLong(1);
}; };
static PyObject* va_is_connected(PyObject* pSelf, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames) static PyObject* va_is_connected(PyObject* pSelf, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
...@@ -102,10 +95,9 @@ static PyObject* va_is_connected(PyObject* pSelf, PyObject** ppArgs, Py_ssize_t ...@@ -102,10 +95,9 @@ static PyObject* va_is_connected(PyObject* pSelf, PyObject** ppArgs, Py_ssize_t
static PyObject* va_reset(PyObject*, PyObject*) static PyObject* va_reset(PyObject*, PyObject*)
{ {
VAPY_REQUIRE_CONN_TRY; VAPY_REQUIRE_CONN_TRY;
g_pVANetClient->GetCoreInstance()->Reset(); g_pVANetClient->GetCoreInstance()->Reset();
return PyBool_FromLong(1); Py_INCREF( Py_None );
return Py_None;
VAPY_CATCH_RETURN; VAPY_CATCH_RETURN;
}; };
...@@ -191,7 +183,8 @@ static PyObject* va_lock_scene( PyObject* pSelf, PyObject** ppArgs, Py_ssize_t n ...@@ -191,7 +183,8 @@ static PyObject* va_lock_scene( PyObject* pSelf, PyObject** ppArgs, Py_ssize_t n
{ {
VAPY_REQUIRE_CONN_TRY VAPY_REQUIRE_CONN_TRY
g_pVANetClient->GetCoreInstance()->LockScene(); g_pVANetClient->GetCoreInstance()->LockScene();
return PyLong_FromLong( 1 ); Py_INCREF( Py_None );
return Py_None;
VAPY_CATCH_RETURN; VAPY_CATCH_RETURN;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment