mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-13 18:17:49 -04:00
Replace Uuid with plUUID EVERYWHERE.
This commit is contained in:
@ -59,9 +59,9 @@ pyHeekGame::pyHeekGame(pfGameCli* client): pyGameCli(client)
|
||||
gameClient = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
bool pyHeekGame::IsHeekGame(std::wstring guid)
|
||||
bool pyHeekGame::IsHeekGame(plString& guid)
|
||||
{
|
||||
Uuid gameUuid(guid.c_str());
|
||||
plUUID gameUuid(guid);
|
||||
return gameUuid == kGameTypeId_Heek;
|
||||
}
|
||||
|
||||
@ -104,4 +104,4 @@ void pyHeekGame::SequenceFinished(int seq)
|
||||
pfGmHeek* heek = pfGmHeek::ConvertNoRef(gameClient);
|
||||
heek->SequenceFinished((EHeekSeqFinished)seq);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
static void AddPlasmaConstantsClasses(PyObject* m);
|
||||
static void AddPlasmaMethods(std::vector<PyMethodDef>& methods);
|
||||
|
||||
static bool IsHeekGame(std::wstring guid);
|
||||
static bool IsHeekGame(plString& guid);
|
||||
static void JoinCommonHeekGame(pyKey& callbackKey, unsigned gameID);
|
||||
|
||||
void PlayGame(int position, uint32_t points, std::wstring name);
|
||||
|
@ -65,31 +65,20 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsHeekGame, args, "Params: typeID\nReturns tru
|
||||
PyObject* textObj;
|
||||
if (!PyArg_ParseTuple(args, "O", &textObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsHeekGame expects a unicode string");
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsHeekGame 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 = pyHeekGame::IsHeekGame(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 = pyHeekGame::IsHeekGame(wText);
|
||||
delete [] wText;
|
||||
PYTHON_RETURN_BOOL(retVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsHeekGame expects a unicode string");
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsHeekGame expects a string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
@ -224,4 +213,4 @@ void pyHeekGame::AddPlasmaMethods(std::vector<PyMethodDef>& methods)
|
||||
{
|
||||
PYTHON_GLOBAL_METHOD(methods, PtIsHeekGame);
|
||||
PYTHON_GLOBAL_METHOD(methods, PtJoinCommonHeekGame);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user