mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-22 05:09:13 +00:00
Replace Uuid with plUUID EVERYWHERE.
This commit is contained in:
@ -65,31 +65,20 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsVarSyncGame, args, "Params: typeID\nReturns
|
||||
PyObject* textObj;
|
||||
if (!PyArg_ParseTuple(args, "O", &textObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsVarSyncGame expects a unicode string");
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsVarSyncGame expects a string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
if (PyUnicode_Check(textObj))
|
||||
|
||||
if (PyString_CheckEx(textObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(textObj);
|
||||
wchar_t* text = new wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
plString text = PyString_AsStringEx(textObj);
|
||||
|
||||
bool retVal = pyVarSyncGame::IsVarSyncGame(text);
|
||||
delete [] text;
|
||||
PYTHON_RETURN_BOOL(retVal);
|
||||
}
|
||||
else if (PyString_Check(textObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(textObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
bool retVal = pyVarSyncGame::IsVarSyncGame(wText);
|
||||
delete [] wText;
|
||||
PYTHON_RETURN_BOOL(retVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsVarSyncGame expects a unicode string");
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsVarSyncGame expects a string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
@ -325,4 +314,4 @@ void pyVarSyncGame::AddPlasmaMethods(std::vector<PyMethodDef>& methods)
|
||||
{
|
||||
PYTHON_GLOBAL_METHOD(methods, PtIsVarSyncGame);
|
||||
PYTHON_GLOBAL_METHOD(methods, PtJoinCommonVarSyncGame);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user