static PyObject *wpDbResult_fetchrow(wpDbResult *self, PyObject *args) { Q_UNUSED(args); bool result = self->result->fetchrow(); if (result) return PyTrue(); else return PyFalse(); }
static PyObject *wpTooltip_add(wpTooltip *self, PyObject *args) { char *params; unsigned int id; if (!PyArg_ParseTuple(args, "Ies:tooltip.add(id, params)", &id, "utf-8", ¶ms)) { return 0; } self->list->addLine(id, QString::fromUtf8(params)); PyMem_Free(params); return PyTrue(); }
/* \method socket.hastag \description Check if the socket has a certain custom tag attached to it. \return True if the tag is present. False otherwise. \param name The name of the tag. */ static PyObject* wpSocket_hastag( wpSocket* self, PyObject* args ) { if ( !self->pSock ) return PyFalse(); if ( PyTuple_Size( args ) < 1 || !checkArgStr( 0 ) ) { PyErr_BadArgument(); return NULL; } QString key = getArgStr( 0 ); return self->pSock->tags().has( key ) ? PyTrue() : PyFalse(); }
static PyObject *wpParty_tellall(wpParty *self, PyObject *args) { P_CHAR source; char *message; if (PyArg_ParseTuple(args, "O&es:party.tellsingle(source, message)", PyConvertChar, &source, "utf-8", &message)) { P_PLAYER psource = dynamic_cast<P_PLAYER>(source); if (psource) self->party->send(psource, QString::fromUtf8(message)); PyMem_Free(message); return PyTrue(); } return 0; }
/* \method account.checkpassword \param password The given password. \description Checks if the password of the account matches. Automatically takes MD5 hashing into account. \return True if the password is correct, false otherwise. */ static PyObject* wpAccount_checkpassword( wpAccount* self, PyObject* args ) { char* password; if ( !PyArg_ParseTuple( args, "es:account.checkpassword(password)", "utf-8", &password ) ) { return 0; } bool authorized; if ( Config::instance()->hashAccountPasswords() ) { authorized = cMd5::fastDigest( password ) == self->account->password(); } else { authorized = password == self->account->password(); } PyMem_Free( password ); return authorized ? PyTrue() : PyFalse(); }
/* \method coord.validspawnspot \return A boolean value. \description This method returns true if this coordinate is a valid spawn spot for a monster, character or item. Otherwise it returns false. This method will also set the z component of the coordinate to the nearest item top a land creature can stand on. */ static PyObject* wpCoord_validspawnspot( wpCoord* self, PyObject* args ) { Q_UNUSED( args ); return Movement::instance()->canLandMonsterMoveHere( self->coord ) ? PyTrue() : PyFalse(); }
static PyObject *wpTooltip_reset(wpTooltip *self, PyObject *args) { self->list->resize(19); self->list->setShort(1, 19); return PyTrue(); }