|
|
@ -196,9 +196,9 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSendRTChat, args, "Params: fromPlayer,toPlayer |
|
|
|
{ |
|
|
|
{ |
|
|
|
PyObject* fromPlayerObj = NULL; |
|
|
|
PyObject* fromPlayerObj = NULL; |
|
|
|
PyObject* toPlayerListObj = NULL; |
|
|
|
PyObject* toPlayerListObj = NULL; |
|
|
|
char* message = NULL; |
|
|
|
PyObject* message = NULL; |
|
|
|
unsigned long msgFlags; |
|
|
|
unsigned long msgFlags; |
|
|
|
if (!PyArg_ParseTuple(args, "OOsl", &fromPlayerObj, &toPlayerListObj, &message, &msgFlags)) |
|
|
|
if (!PyArg_ParseTuple(args, "OOOl", &fromPlayerObj, &toPlayerListObj, &message, &msgFlags)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
PyErr_SetString(PyExc_TypeError, "PtSendRTChat expects a ptPlayer, a list of ptPlayers, a string, and a long"); |
|
|
|
PyErr_SetString(PyExc_TypeError, "PtSendRTChat expects a ptPlayer, a list of ptPlayers, a string, and a long"); |
|
|
|
PYTHON_RETURN_ERROR; |
|
|
|
PYTHON_RETURN_ERROR; |
|
|
@ -232,7 +232,25 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSendRTChat, args, "Params: fromPlayer,toPlayer |
|
|
|
PYTHON_RETURN_ERROR; |
|
|
|
PYTHON_RETURN_ERROR; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return PyLong_FromUnsignedLong(cyMisc::SendRTChat(*fromPlayer, toPlayerList, message, msgFlags)); |
|
|
|
if (PyString_Check(message)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
char* msg = PyString_AsString(message); |
|
|
|
|
|
|
|
return PyLong_FromUnsignedLong(cyMisc::SendRTChat(*fromPlayer, toPlayerList, msg, msgFlags)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (PyUnicode_Check(message)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Py_ssize_t size = PyUnicode_GetSize(message); |
|
|
|
|
|
|
|
wchar_t* msg = TRACKED_NEW wchar_t[size]; |
|
|
|
|
|
|
|
PyUnicode_AsWideChar((PyUnicodeObject*)message, msg, size); |
|
|
|
|
|
|
|
UInt32 retval = cyMisc::SendRTChat(*fromPlayer, toPlayerList, msg, msgFlags); |
|
|
|
|
|
|
|
DEL(msg); |
|
|
|
|
|
|
|
return PyLong_FromUnsignedLong(retval); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
PyErr_SetString(PyExc_TypeError, "PtSendRTChat expects a ptPlayer, a list of ptPlayers, a string, and a long"); |
|
|
|
|
|
|
|
PYTHON_RETURN_ERROR; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PYTHON_GLOBAL_METHOD_DEFINITION(PtSendKIMessage, args, "Params: command,value\nSends a command message to the KI frontend.\n" |
|
|
|
PYTHON_GLOBAL_METHOD_DEFINITION(PtSendKIMessage, args, "Params: command,value\nSends a command message to the KI frontend.\n" |
|
|
|