2
3
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:
Darryl Pogue
2012-12-29 02:05:23 -08:00
parent a0641ba66b
commit bcf6e97d23
78 changed files with 427 additions and 892 deletions

View File

@ -59,9 +59,9 @@ pyBlueSpiralGame::pyBlueSpiralGame(pfGameCli* client): pyGameCli(client)
gameClient = nil; // wrong type, just clear it out
}
bool pyBlueSpiralGame::IsBlueSpiralGame(std::wstring guid)
bool pyBlueSpiralGame::IsBlueSpiralGame(plString& guid)
{
Uuid gameUuid(guid.c_str());
plUUID gameUuid(guid);
return gameUuid == kGameTypeId_BlueSpiral;
}
@ -87,4 +87,4 @@ void pyBlueSpiralGame::HitCloth(int clothNum)
pfGmBlueSpiral* blueSpiral = pfGmBlueSpiral::ConvertNoRef(gameClient);
blueSpiral->HitCloth(clothNum);
}
}
}

View File

@ -68,7 +68,7 @@ public:
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaMethods(std::vector<PyMethodDef>& methods);
static bool IsBlueSpiralGame(std::wstring guid);
static bool IsBlueSpiralGame(plString& guid);
static void JoinCommonBlueSpiralGame(pyKey& callbackKey, unsigned gameID);
void StartGame();

View File

@ -65,31 +65,20 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsBlueSpiralGame, args, "Params: typeID\nRetur
PyObject* textObj;
if (!PyArg_ParseTuple(args, "O", &textObj))
{
PyErr_SetString(PyExc_TypeError, "PtIsBlueSpiralGame expects a unicode string");
PyErr_SetString(PyExc_TypeError, "PtIsBlueSpiralGame 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 = pyBlueSpiralGame::IsBlueSpiralGame(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 = pyBlueSpiralGame::IsBlueSpiralGame(wText);
delete [] wText;
PYTHON_RETURN_BOOL(retVal);
}
else
{
PyErr_SetString(PyExc_TypeError, "PtIsBlueSpiralGame expects a unicode string");
PyErr_SetString(PyExc_TypeError, "PtIsBlueSpiralGame expects a string");
PYTHON_RETURN_ERROR;
}
}
@ -159,4 +148,4 @@ void pyBlueSpiralGame::AddPlasmaMethods(std::vector<PyMethodDef>& methods)
{
PYTHON_GLOBAL_METHOD(methods, PtIsBlueSpiralGame);
PYTHON_GLOBAL_METHOD(methods, PtJoinCommonBlueSpiralGame);
}
}