2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-13 18:17:49 -04:00

Renormalize line endings on entire repository to <LF> (for files in repository).

.gitattributes will alter text endings depending on platform with "text=auto"
This commit is contained in:
rarified
2021-02-27 12:03:48 -07:00
parent 4331076744
commit d7a68f326c
3385 changed files with 1111796 additions and 1111796 deletions

View File

@ -1,85 +1,85 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyBlueSpiralGame.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base BlueSpiral game client class
//
pyBlueSpiralGame::pyBlueSpiralGame(): pyGameCli() {}
pyBlueSpiralGame::pyBlueSpiralGame(pfGameCli* client): pyGameCli(client)
{
if (client && (client->GetGameTypeId() != kGameTypeId_BlueSpiral))
gameClient = nil; // wrong type, just clear it out
}
bool pyBlueSpiralGame::IsBlueSpiralGame(std::wstring guid)
{
Uuid gameUuid(guid.c_str());
return gameUuid == kGameTypeId_BlueSpiral;
}
void pyBlueSpiralGame::JoinCommonBlueSpiralGame(pyKey& callbackKey, unsigned gameID)
{
BlueSpiral_CreateParam init;
pfGameMgr::GetInstance()->JoinCommonGame(callbackKey.getKey(), kGameTypeId_BlueSpiral, gameID, sizeof(init), &init);
}
void pyBlueSpiralGame::StartGame()
{
if (gameClient)
{
pfGmBlueSpiral* blueSpiral = pfGmBlueSpiral::ConvertNoRef(gameClient);
blueSpiral->StartGame();
}
}
void pyBlueSpiralGame::HitCloth(int clothNum)
{
if (gameClient)
{
pfGmBlueSpiral* blueSpiral = pfGmBlueSpiral::ConvertNoRef(gameClient);
blueSpiral->HitCloth(clothNum);
}
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyBlueSpiralGame.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base BlueSpiral game client class
//
pyBlueSpiralGame::pyBlueSpiralGame(): pyGameCli() {}
pyBlueSpiralGame::pyBlueSpiralGame(pfGameCli* client): pyGameCli(client)
{
if (client && (client->GetGameTypeId() != kGameTypeId_BlueSpiral))
gameClient = nil; // wrong type, just clear it out
}
bool pyBlueSpiralGame::IsBlueSpiralGame(std::wstring guid)
{
Uuid gameUuid(guid.c_str());
return gameUuid == kGameTypeId_BlueSpiral;
}
void pyBlueSpiralGame::JoinCommonBlueSpiralGame(pyKey& callbackKey, unsigned gameID)
{
BlueSpiral_CreateParam init;
pfGameMgr::GetInstance()->JoinCommonGame(callbackKey.getKey(), kGameTypeId_BlueSpiral, gameID, sizeof(init), &init);
}
void pyBlueSpiralGame::StartGame()
{
if (gameClient)
{
pfGmBlueSpiral* blueSpiral = pfGmBlueSpiral::ConvertNoRef(gameClient);
blueSpiral->StartGame();
}
}
void pyBlueSpiralGame::HitCloth(int clothNum)
{
if (gameClient)
{
pfGmBlueSpiral* blueSpiral = pfGmBlueSpiral::ConvertNoRef(gameClient);
blueSpiral->HitCloth(clothNum);
}
}

View File

@ -1,82 +1,82 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef pyBlueSpiralGame_h
#define pyBlueSpiralGame_h
/////////////////////////////////////////////////////////////////////////////
//
// NAME: pyBlueSpiralGame
//
// PURPOSE: Class wrapper for the BlueSpiral game client
//
#include "../pfGameMgr/pfGameMgr.h"
#include <python.h>
#include "../../pyGlueHelpers.h"
#include "../pyGameCli.h"
#include "../../pyKey.h"
class pyBlueSpiralGame : public pyGameCli
{
protected:
pyBlueSpiralGame();
pyBlueSpiralGame(pfGameCli* client);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralGame);
static PyObject* New(pfGameCli* client);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralGame object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralGame); // converts a PyObject to a pyBlueSpiralGame (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaMethods(std::vector<PyMethodDef>& methods);
static bool IsBlueSpiralGame(std::wstring guid);
static void JoinCommonBlueSpiralGame(pyKey& callbackKey, unsigned gameID);
void StartGame();
void HitCloth(int clothNum);
};
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef pyBlueSpiralGame_h
#define pyBlueSpiralGame_h
/////////////////////////////////////////////////////////////////////////////
//
// NAME: pyBlueSpiralGame
//
// PURPOSE: Class wrapper for the BlueSpiral game client
//
#include "../pfGameMgr/pfGameMgr.h"
#include <python.h>
#include "../../pyGlueHelpers.h"
#include "../pyGameCli.h"
#include "../../pyKey.h"
class pyBlueSpiralGame : public pyGameCli
{
protected:
pyBlueSpiralGame();
pyBlueSpiralGame(pfGameCli* client);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralGame);
static PyObject* New(pfGameCli* client);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralGame object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralGame); // converts a PyObject to a pyBlueSpiralGame (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaMethods(std::vector<PyMethodDef>& methods);
static bool IsBlueSpiralGame(std::wstring guid);
static void JoinCommonBlueSpiralGame(pyKey& callbackKey, unsigned gameID);
void StartGame();
void HitCloth(int clothNum);
};
#endif // pyBlueSpiralGame_h

View File

@ -1,158 +1,158 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyBlueSpiralGame.h"
#include <python.h>
#include "../../pyEnum.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base BlueSpiral game client class
//
PYTHON_CLASS_DEFINITION(ptBlueSpiralGame, pyBlueSpiralGame);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralGame, pyBlueSpiralGame)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralGame)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralGame)
PYTHON_GLOBAL_METHOD_DEFINITION(PtIsBlueSpiralGame, args, "Params: typeID\nReturns true if the specifed typeID (guid as a string) is a BlueSpiral game")
{
PyObject* textObj;
if (!PyArg_ParseTuple(args, "O", &textObj))
{
PyErr_SetString(PyExc_TypeError, "PtIsBlueSpiralGame expects a unicode string");
PYTHON_RETURN_ERROR;
}
if (PyUnicode_Check(textObj))
{
int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0';
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");
PYTHON_RETURN_ERROR;
}
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtJoinCommonBlueSpiralGame, args, "Params: callbackKey, gameID\nJoins a common BlueSpiral game with the specified ID. If one doesn't exist, it creates it")
{
PyObject* callbackObj = NULL;
int gameID = 0;
if (!PyArg_ParseTuple(args, "Oi", &callbackObj, &gameID))
{
PyErr_SetString(PyExc_TypeError, "PtJoinCommonBlueSpiralGame expects a ptKey and an integer");
PYTHON_RETURN_ERROR;
}
if (!pyKey::Check(callbackObj))
{
PyErr_SetString(PyExc_TypeError, "PtJoinCommonBlueSpiralGame expects a ptKey and an integer");
PYTHON_RETURN_ERROR;
}
pyKey* key = pyKey::ConvertFrom(callbackObj);
pyBlueSpiralGame::JoinCommonBlueSpiralGame(*key, gameID);
PYTHON_RETURN_NONE;
}
PYTHON_BASIC_METHOD_DEFINITION(ptBlueSpiralGame, startGame, StartGame)
PYTHON_METHOD_DEFINITION(ptBlueSpiralGame, hitCloth, args)
{
int clothNum = 0;
if (!PyArg_ParseTuple(args, "i", &clothNum))
{
PyErr_SetString(PyExc_TypeError, "hitCloth expects one integer");
PYTHON_RETURN_ERROR;
}
self->fThis->HitCloth(clothNum);
PYTHON_RETURN_NONE;
}
PYTHON_START_METHODS_TABLE(ptBlueSpiralGame)
PYTHON_BASIC_METHOD(ptBlueSpiralGame, startGame, "Starts a new game"),
PYTHON_METHOD(ptBlueSpiralGame, hitCloth, "Params: clothNum\nTells the server you hit the specified cloth"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralGame, pyGameCli, "Game client for the BlueSpiral game");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralGame::New(pfGameCli* client)
{
ptBlueSpiralGame *newObj = (ptBlueSpiralGame*)ptBlueSpiralGame_type.tp_new(&ptBlueSpiralGame_type, NULL, NULL);
if (client && (client->GetGameTypeId() == kGameTypeId_BlueSpiral))
newObj->fThis->gameClient = client;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralGame, pyBlueSpiralGame)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralGame, pyBlueSpiralGame)
// Module and method definitions
void pyBlueSpiralGame::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralGame);
PYTHON_CLASS_IMPORT_END(m);
}
void pyBlueSpiralGame::AddPlasmaMethods(std::vector<PyMethodDef>& methods)
{
PYTHON_GLOBAL_METHOD(methods, PtIsBlueSpiralGame);
PYTHON_GLOBAL_METHOD(methods, PtJoinCommonBlueSpiralGame);
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyBlueSpiralGame.h"
#include <python.h>
#include "../../pyEnum.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base BlueSpiral game client class
//
PYTHON_CLASS_DEFINITION(ptBlueSpiralGame, pyBlueSpiralGame);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralGame, pyBlueSpiralGame)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralGame)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralGame)
PYTHON_GLOBAL_METHOD_DEFINITION(PtIsBlueSpiralGame, args, "Params: typeID\nReturns true if the specifed typeID (guid as a string) is a BlueSpiral game")
{
PyObject* textObj;
if (!PyArg_ParseTuple(args, "O", &textObj))
{
PyErr_SetString(PyExc_TypeError, "PtIsBlueSpiralGame expects a unicode string");
PYTHON_RETURN_ERROR;
}
if (PyUnicode_Check(textObj))
{
int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0';
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");
PYTHON_RETURN_ERROR;
}
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtJoinCommonBlueSpiralGame, args, "Params: callbackKey, gameID\nJoins a common BlueSpiral game with the specified ID. If one doesn't exist, it creates it")
{
PyObject* callbackObj = NULL;
int gameID = 0;
if (!PyArg_ParseTuple(args, "Oi", &callbackObj, &gameID))
{
PyErr_SetString(PyExc_TypeError, "PtJoinCommonBlueSpiralGame expects a ptKey and an integer");
PYTHON_RETURN_ERROR;
}
if (!pyKey::Check(callbackObj))
{
PyErr_SetString(PyExc_TypeError, "PtJoinCommonBlueSpiralGame expects a ptKey and an integer");
PYTHON_RETURN_ERROR;
}
pyKey* key = pyKey::ConvertFrom(callbackObj);
pyBlueSpiralGame::JoinCommonBlueSpiralGame(*key, gameID);
PYTHON_RETURN_NONE;
}
PYTHON_BASIC_METHOD_DEFINITION(ptBlueSpiralGame, startGame, StartGame)
PYTHON_METHOD_DEFINITION(ptBlueSpiralGame, hitCloth, args)
{
int clothNum = 0;
if (!PyArg_ParseTuple(args, "i", &clothNum))
{
PyErr_SetString(PyExc_TypeError, "hitCloth expects one integer");
PYTHON_RETURN_ERROR;
}
self->fThis->HitCloth(clothNum);
PYTHON_RETURN_NONE;
}
PYTHON_START_METHODS_TABLE(ptBlueSpiralGame)
PYTHON_BASIC_METHOD(ptBlueSpiralGame, startGame, "Starts a new game"),
PYTHON_METHOD(ptBlueSpiralGame, hitCloth, "Params: clothNum\nTells the server you hit the specified cloth"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralGame, pyGameCli, "Game client for the BlueSpiral game");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralGame::New(pfGameCli* client)
{
ptBlueSpiralGame *newObj = (ptBlueSpiralGame*)ptBlueSpiralGame_type.tp_new(&ptBlueSpiralGame_type, NULL, NULL);
if (client && (client->GetGameTypeId() == kGameTypeId_BlueSpiral))
newObj->fThis->gameClient = client;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralGame, pyBlueSpiralGame)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralGame, pyBlueSpiralGame)
// Module and method definitions
void pyBlueSpiralGame::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralGame);
PYTHON_CLASS_IMPORT_END(m);
}
void pyBlueSpiralGame::AddPlasmaMethods(std::vector<PyMethodDef>& methods)
{
PYTHON_GLOBAL_METHOD(methods, PtIsBlueSpiralGame);
PYTHON_GLOBAL_METHOD(methods, PtJoinCommonBlueSpiralGame);
}

View File

@ -1,155 +1,155 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyBlueSpiralMsg.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base BlueSpiral msg class
//
pyBlueSpiralMsg::pyBlueSpiralMsg(): pyGameCliMsg() {}
pyBlueSpiralMsg::pyBlueSpiralMsg(pfGameCliMsg* msg): pyGameCliMsg(msg)
{
if (message && (message->gameCli->GetGameTypeId() != kGameTypeId_BlueSpiral))
message = nil; // wrong type, just clear it out
}
int pyBlueSpiralMsg::GetBlueSpiralMsgType() const
{
if (message)
return message->netMsg->messageId;
return -1;
}
PyObject* pyBlueSpiralMsg::UpcastToFinalBlueSpiralMsg() const
{
if (!message)
PYTHON_RETURN_NONE;
switch (message->netMsg->messageId)
{
case kSrv2Cli_BlueSpiral_ClothOrder:
return pyBlueSpiralClothOrderMsg::New(message);
case kSrv2Cli_BlueSpiral_SuccessfulHit:
return pyBlueSpiralSuccessfulHitMsg::New(message);
case kSrv2Cli_BlueSpiral_GameWon:
return pyBlueSpiralGameWonMsg::New(message);
case kSrv2Cli_BlueSpiral_GameOver:
return pyBlueSpiralGameOverMsg::New(message);
case kSrv2Cli_BlueSpiral_GameStarted:
return pyBlueSpiralGameStartedMsg::New(message);
default:
PYTHON_RETURN_NONE;
}
}
///////////////////////////////////////////////////////////////////////////////
//
// The different messages we can receive
//
pyBlueSpiralClothOrderMsg::pyBlueSpiralClothOrderMsg(): pyBlueSpiralMsg() {}
pyBlueSpiralClothOrderMsg::pyBlueSpiralClothOrderMsg(pfGameCliMsg* msg): pyBlueSpiralMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_BlueSpiral_ClothOrder))
message = nil; // wrong type, just clear it out
}
std::vector<int> pyBlueSpiralClothOrderMsg::Order()
{
std::vector<int> retVal;
if (message)
{
const Srv2Cli_BlueSpiral_ClothOrder* gmMsg = (const Srv2Cli_BlueSpiral_ClothOrder*)message->netMsg;
for (int i = 0; i < arrsize(gmMsg->order); ++i)
retVal.push_back(gmMsg->order[i]);
}
return retVal;
}
///////////////////////////////////////////////////////////////////////////////
pyBlueSpiralSuccessfulHitMsg::pyBlueSpiralSuccessfulHitMsg(): pyBlueSpiralMsg() {}
pyBlueSpiralSuccessfulHitMsg::pyBlueSpiralSuccessfulHitMsg(pfGameCliMsg* msg): pyBlueSpiralMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_BlueSpiral_SuccessfulHit))
message = nil; // wrong type, just clear it out
}
///////////////////////////////////////////////////////////////////////////////
pyBlueSpiralGameWonMsg::pyBlueSpiralGameWonMsg(): pyBlueSpiralMsg() {}
pyBlueSpiralGameWonMsg::pyBlueSpiralGameWonMsg(pfGameCliMsg* msg): pyBlueSpiralMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_BlueSpiral_GameWon))
message = nil; // wrong type, just clear it out
}
///////////////////////////////////////////////////////////////////////////////
pyBlueSpiralGameOverMsg::pyBlueSpiralGameOverMsg(): pyBlueSpiralMsg() {}
pyBlueSpiralGameOverMsg::pyBlueSpiralGameOverMsg(pfGameCliMsg* msg): pyBlueSpiralMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_BlueSpiral_GameOver))
message = nil; // wrong type, just clear it out
}
///////////////////////////////////////////////////////////////////////////////
pyBlueSpiralGameStartedMsg::pyBlueSpiralGameStartedMsg(): pyBlueSpiralMsg() {}
pyBlueSpiralGameStartedMsg::pyBlueSpiralGameStartedMsg(pfGameCliMsg* msg): pyBlueSpiralMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_BlueSpiral_GameStarted))
message = nil; // wrong type, just clear it out
}
bool pyBlueSpiralGameStartedMsg::StartSpin()
{
if (message)
{
const Srv2Cli_BlueSpiral_GameStarted* gmMsg = (const Srv2Cli_BlueSpiral_GameStarted*)message->netMsg;
return gmMsg->startSpin;
}
return false;
}
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyBlueSpiralMsg.h"
///////////////////////////////////////////////////////////////////////////////
//
// Base BlueSpiral msg class
//
pyBlueSpiralMsg::pyBlueSpiralMsg(): pyGameCliMsg() {}
pyBlueSpiralMsg::pyBlueSpiralMsg(pfGameCliMsg* msg): pyGameCliMsg(msg)
{
if (message && (message->gameCli->GetGameTypeId() != kGameTypeId_BlueSpiral))
message = nil; // wrong type, just clear it out
}
int pyBlueSpiralMsg::GetBlueSpiralMsgType() const
{
if (message)
return message->netMsg->messageId;
return -1;
}
PyObject* pyBlueSpiralMsg::UpcastToFinalBlueSpiralMsg() const
{
if (!message)
PYTHON_RETURN_NONE;
switch (message->netMsg->messageId)
{
case kSrv2Cli_BlueSpiral_ClothOrder:
return pyBlueSpiralClothOrderMsg::New(message);
case kSrv2Cli_BlueSpiral_SuccessfulHit:
return pyBlueSpiralSuccessfulHitMsg::New(message);
case kSrv2Cli_BlueSpiral_GameWon:
return pyBlueSpiralGameWonMsg::New(message);
case kSrv2Cli_BlueSpiral_GameOver:
return pyBlueSpiralGameOverMsg::New(message);
case kSrv2Cli_BlueSpiral_GameStarted:
return pyBlueSpiralGameStartedMsg::New(message);
default:
PYTHON_RETURN_NONE;
}
}
///////////////////////////////////////////////////////////////////////////////
//
// The different messages we can receive
//
pyBlueSpiralClothOrderMsg::pyBlueSpiralClothOrderMsg(): pyBlueSpiralMsg() {}
pyBlueSpiralClothOrderMsg::pyBlueSpiralClothOrderMsg(pfGameCliMsg* msg): pyBlueSpiralMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_BlueSpiral_ClothOrder))
message = nil; // wrong type, just clear it out
}
std::vector<int> pyBlueSpiralClothOrderMsg::Order()
{
std::vector<int> retVal;
if (message)
{
const Srv2Cli_BlueSpiral_ClothOrder* gmMsg = (const Srv2Cli_BlueSpiral_ClothOrder*)message->netMsg;
for (int i = 0; i < arrsize(gmMsg->order); ++i)
retVal.push_back(gmMsg->order[i]);
}
return retVal;
}
///////////////////////////////////////////////////////////////////////////////
pyBlueSpiralSuccessfulHitMsg::pyBlueSpiralSuccessfulHitMsg(): pyBlueSpiralMsg() {}
pyBlueSpiralSuccessfulHitMsg::pyBlueSpiralSuccessfulHitMsg(pfGameCliMsg* msg): pyBlueSpiralMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_BlueSpiral_SuccessfulHit))
message = nil; // wrong type, just clear it out
}
///////////////////////////////////////////////////////////////////////////////
pyBlueSpiralGameWonMsg::pyBlueSpiralGameWonMsg(): pyBlueSpiralMsg() {}
pyBlueSpiralGameWonMsg::pyBlueSpiralGameWonMsg(pfGameCliMsg* msg): pyBlueSpiralMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_BlueSpiral_GameWon))
message = nil; // wrong type, just clear it out
}
///////////////////////////////////////////////////////////////////////////////
pyBlueSpiralGameOverMsg::pyBlueSpiralGameOverMsg(): pyBlueSpiralMsg() {}
pyBlueSpiralGameOverMsg::pyBlueSpiralGameOverMsg(pfGameCliMsg* msg): pyBlueSpiralMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_BlueSpiral_GameOver))
message = nil; // wrong type, just clear it out
}
///////////////////////////////////////////////////////////////////////////////
pyBlueSpiralGameStartedMsg::pyBlueSpiralGameStartedMsg(): pyBlueSpiralMsg() {}
pyBlueSpiralGameStartedMsg::pyBlueSpiralGameStartedMsg(pfGameCliMsg* msg): pyBlueSpiralMsg(msg)
{
if (message && (message->netMsg->messageId != kSrv2Cli_BlueSpiral_GameStarted))
message = nil; // wrong type, just clear it out
}
bool pyBlueSpiralGameStartedMsg::StartSpin()
{
if (message)
{
const Srv2Cli_BlueSpiral_GameStarted* gmMsg = (const Srv2Cli_BlueSpiral_GameStarted*)message->netMsg;
return gmMsg->startSpin;
}
return false;
}

View File

@ -1,169 +1,169 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef pyBlueSpiralMsg_h
#define pyBlueSpiralMsg_h
/////////////////////////////////////////////////////////////////////////////
//
// NAME: pyBlueSpiralMsg
//
// PURPOSE: Class wrapper for BlueSpiral game messages
//
#include "../pfGameMgr/pfGameMgr.h"
#include <python.h>
#include "../../pyGlueHelpers.h"
#include "../pyGameCliMsg.h"
class pyBlueSpiralMsg : public pyGameCliMsg
{
protected:
pyBlueSpiralMsg();
pyBlueSpiralMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_EXPOSE_TYPE; // so we can subclass
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralMsg); // converts a PyObject to a pyBlueSpiralMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaConstantsClasses(PyObject* m);
int GetBlueSpiralMsgType() const;
PyObject* UpcastToFinalBlueSpiralMsg() const; // returns this message as the blue spiral message it is
};
///////////////////////////////////////////////////////////////////////////////
class pyBlueSpiralClothOrderMsg : public pyBlueSpiralMsg
{
protected:
pyBlueSpiralClothOrderMsg();
pyBlueSpiralClothOrderMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralClothOrderMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralClothOrderMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralClothOrderMsg); // converts a PyObject to a pyBlueSpiralClothOrderMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
std::vector<int> Order();
};
///////////////////////////////////////////////////////////////////////////////
class pyBlueSpiralSuccessfulHitMsg : public pyBlueSpiralMsg
{
protected:
pyBlueSpiralSuccessfulHitMsg();
pyBlueSpiralSuccessfulHitMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralSuccessfulHitMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralSuccessfulHitMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralSuccessfulHitMsg); // converts a PyObject to a pyBlueSpiralSuccessfulHitMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
};
///////////////////////////////////////////////////////////////////////////////
class pyBlueSpiralGameWonMsg : public pyBlueSpiralMsg
{
protected:
pyBlueSpiralGameWonMsg();
pyBlueSpiralGameWonMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralGameWonMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralGameWonMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralGameWonMsg); // converts a PyObject to a pyBlueSpiralGameWonMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
};
///////////////////////////////////////////////////////////////////////////////
class pyBlueSpiralGameOverMsg : public pyBlueSpiralMsg
{
protected:
pyBlueSpiralGameOverMsg();
pyBlueSpiralGameOverMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralGameOverMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralGameOverMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralGameOverMsg); // converts a PyObject to a pyBlueSpiralGameOverMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
};
///////////////////////////////////////////////////////////////////////////////
class pyBlueSpiralGameStartedMsg : public pyBlueSpiralMsg
{
protected:
pyBlueSpiralGameStartedMsg();
pyBlueSpiralGameStartedMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralGameStartedMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralGameStartedMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralGameStartedMsg); // converts a PyObject to a pyBlueSpiralGameStartedMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
bool StartSpin();
};
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef pyBlueSpiralMsg_h
#define pyBlueSpiralMsg_h
/////////////////////////////////////////////////////////////////////////////
//
// NAME: pyBlueSpiralMsg
//
// PURPOSE: Class wrapper for BlueSpiral game messages
//
#include "../pfGameMgr/pfGameMgr.h"
#include <python.h>
#include "../../pyGlueHelpers.h"
#include "../pyGameCliMsg.h"
class pyBlueSpiralMsg : public pyGameCliMsg
{
protected:
pyBlueSpiralMsg();
pyBlueSpiralMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_EXPOSE_TYPE; // so we can subclass
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralMsg); // converts a PyObject to a pyBlueSpiralMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaConstantsClasses(PyObject* m);
int GetBlueSpiralMsgType() const;
PyObject* UpcastToFinalBlueSpiralMsg() const; // returns this message as the blue spiral message it is
};
///////////////////////////////////////////////////////////////////////////////
class pyBlueSpiralClothOrderMsg : public pyBlueSpiralMsg
{
protected:
pyBlueSpiralClothOrderMsg();
pyBlueSpiralClothOrderMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralClothOrderMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralClothOrderMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralClothOrderMsg); // converts a PyObject to a pyBlueSpiralClothOrderMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
std::vector<int> Order();
};
///////////////////////////////////////////////////////////////////////////////
class pyBlueSpiralSuccessfulHitMsg : public pyBlueSpiralMsg
{
protected:
pyBlueSpiralSuccessfulHitMsg();
pyBlueSpiralSuccessfulHitMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralSuccessfulHitMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralSuccessfulHitMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralSuccessfulHitMsg); // converts a PyObject to a pyBlueSpiralSuccessfulHitMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
};
///////////////////////////////////////////////////////////////////////////////
class pyBlueSpiralGameWonMsg : public pyBlueSpiralMsg
{
protected:
pyBlueSpiralGameWonMsg();
pyBlueSpiralGameWonMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralGameWonMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralGameWonMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralGameWonMsg); // converts a PyObject to a pyBlueSpiralGameWonMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
};
///////////////////////////////////////////////////////////////////////////////
class pyBlueSpiralGameOverMsg : public pyBlueSpiralMsg
{
protected:
pyBlueSpiralGameOverMsg();
pyBlueSpiralGameOverMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralGameOverMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralGameOverMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralGameOverMsg); // converts a PyObject to a pyBlueSpiralGameOverMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
};
///////////////////////////////////////////////////////////////////////////////
class pyBlueSpiralGameStartedMsg : public pyBlueSpiralMsg
{
protected:
pyBlueSpiralGameStartedMsg();
pyBlueSpiralGameStartedMsg(pfGameCliMsg* msg);
public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBlueSpiralGameStartedMsg);
static PyObject* New(pfGameCliMsg* msg);
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyBlueSpiralGameStartedMsg object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyBlueSpiralGameStartedMsg); // converts a PyObject to a pyBlueSpiralGameStartedMsg (throws error if not correct type)
static void AddPlasmaClasses(PyObject* m);
bool StartSpin();
};
#endif // pyBlueSpiralMsg_h

View File

@ -1,297 +1,297 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyBlueSpiralMsg.h"
#include "../../pyEnum.h"
#include <python.h>
///////////////////////////////////////////////////////////////////////////////
//
// Base TTT msg class
//
PYTHON_CLASS_DEFINITION(ptBlueSpiralMsg, pyBlueSpiralMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralMsg, pyBlueSpiralMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptBlueSpiralMsg, getBlueSpiralMsgType)
{
return PyInt_FromLong(self->fThis->GetBlueSpiralMsgType());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptBlueSpiralMsg, upcastToFinalBlueSpiralMsg)
{
return self->fThis->UpcastToFinalBlueSpiralMsg();
}
PYTHON_START_METHODS_TABLE(ptBlueSpiralMsg)
PYTHON_METHOD_NOARGS(ptBlueSpiralMsg, getBlueSpiralMsgType, "Returns the type of the BlueSpiral message (see PtBlueSpiralMsgTypes)"),
PYTHON_METHOD_NOARGS(ptBlueSpiralMsg, upcastToFinalBlueSpiralMsg, "Returns this message as the BlueSpiral message it really is"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralMsg, pyGameCliMsg, "Base class for BlueSpiral game messages");
PYTHON_EXPOSE_TYPE_DEFINITION(ptBlueSpiralMsg, pyBlueSpiralMsg);
// required functions for PyObject interoperability
PyObject* pyBlueSpiralMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralMsg *newObj = (ptBlueSpiralMsg*)ptBlueSpiralMsg_type.tp_new(&ptBlueSpiralMsg_type, NULL, NULL);
if (msg && (msg->gameCli->GetGameTypeId() == kGameTypeId_BlueSpiral))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralMsg, pyBlueSpiralMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralMsg, pyBlueSpiralMsg)
// Module and method definitions
void pyBlueSpiralMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralMsg);
PYTHON_CLASS_IMPORT_END(m);
}
void pyBlueSpiralMsg::AddPlasmaConstantsClasses(PyObject* m)
{
PYTHON_ENUM_START(PtBlueSpiralMsgTypes);
PYTHON_ENUM_ELEMENT(PtBlueSpiralMsgTypes, kBlueSpiralClothOrder, kSrv2Cli_BlueSpiral_ClothOrder);
PYTHON_ENUM_ELEMENT(PtBlueSpiralMsgTypes, kBlueSpiralSuccessfulHit, kSrv2Cli_BlueSpiral_SuccessfulHit);
PYTHON_ENUM_ELEMENT(PtBlueSpiralMsgTypes, kBlueSpiralGameWon, kSrv2Cli_BlueSpiral_GameWon);
PYTHON_ENUM_ELEMENT(PtBlueSpiralMsgTypes, kBlueSpiralGameOver, kSrv2Cli_BlueSpiral_GameOver);
PYTHON_ENUM_ELEMENT(PtBlueSpiralMsgTypes, kBlueSpiralGameStarted, kSrv2Cli_BlueSpiral_GameStarted);
PYTHON_ENUM_END(m, PtBlueSpiralMsgTypes);
}
///////////////////////////////////////////////////////////////////////////////
//
// Game client message subclasses
//
PYTHON_CLASS_DEFINITION(ptBlueSpiralClothOrderMsg, pyBlueSpiralClothOrderMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralClothOrderMsg, pyBlueSpiralClothOrderMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralClothOrderMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralClothOrderMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptBlueSpiralClothOrderMsg, order)
{
std::vector<int> order = self->fThis->Order();
PyObject* retVal = PyList_New(order.size());
for (unsigned i = 0; i < order.size(); ++i)
PyList_SetItem(retVal, i, PyInt_FromLong(order[i]));
return retVal;
}
PYTHON_START_METHODS_TABLE(ptBlueSpiralClothOrderMsg)
PYTHON_METHOD_NOARGS(ptBlueSpiralClothOrderMsg, order, "Returns a list of numbers indicating the correct order to hit the clothes in"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralClothOrderMsg, pyBlueSpiralMsg, "BlueSpiral message received when the game is started and the cloth order is set");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralClothOrderMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralClothOrderMsg *newObj = (ptBlueSpiralClothOrderMsg*)ptBlueSpiralClothOrderMsg_type.tp_new(&ptBlueSpiralClothOrderMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_BlueSpiral_ClothOrder))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralClothOrderMsg, pyBlueSpiralClothOrderMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralClothOrderMsg, pyBlueSpiralClothOrderMsg)
// Module and method definitions
void pyBlueSpiralClothOrderMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralClothOrderMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptBlueSpiralSuccessfulHitMsg, pyBlueSpiralSuccessfulHitMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralSuccessfulHitMsg, pyBlueSpiralSuccessfulHitMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralSuccessfulHitMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralSuccessfulHitMsg)
PYTHON_START_METHODS_TABLE(ptBlueSpiralSuccessfulHitMsg)
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralSuccessfulHitMsg, pyBlueSpiralMsg, "BlueSpiral message received when a cloth is hit in the correct order");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralSuccessfulHitMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralSuccessfulHitMsg *newObj = (ptBlueSpiralSuccessfulHitMsg*)ptBlueSpiralSuccessfulHitMsg_type.tp_new(&ptBlueSpiralSuccessfulHitMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_BlueSpiral_SuccessfulHit))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralSuccessfulHitMsg, pyBlueSpiralSuccessfulHitMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralSuccessfulHitMsg, pyBlueSpiralSuccessfulHitMsg)
// Module and method definitions
void pyBlueSpiralSuccessfulHitMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralSuccessfulHitMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptBlueSpiralGameWonMsg, pyBlueSpiralGameWonMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralGameWonMsg, pyBlueSpiralGameWonMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralGameWonMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralGameWonMsg)
PYTHON_START_METHODS_TABLE(ptBlueSpiralGameWonMsg)
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralGameWonMsg, pyBlueSpiralMsg, "BlueSpiral message received when the last cloth is successfully hit");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralGameWonMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralGameWonMsg *newObj = (ptBlueSpiralGameWonMsg*)ptBlueSpiralGameWonMsg_type.tp_new(&ptBlueSpiralGameWonMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_BlueSpiral_GameWon))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralGameWonMsg, pyBlueSpiralGameWonMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralGameWonMsg, pyBlueSpiralGameWonMsg)
// Module and method definitions
void pyBlueSpiralGameWonMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralGameWonMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptBlueSpiralGameOverMsg, pyBlueSpiralGameOverMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralGameOverMsg, pyBlueSpiralGameOverMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralGameOverMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralGameOverMsg)
PYTHON_START_METHODS_TABLE(ptBlueSpiralGameOverMsg)
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralGameOverMsg, pyBlueSpiralMsg, "BlueSpiral message received when the timer runs out, someone hits the wrong cloth, or the game is restarted (before a game start msg in that last case)");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralGameOverMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralGameOverMsg *newObj = (ptBlueSpiralGameOverMsg*)ptBlueSpiralGameOverMsg_type.tp_new(&ptBlueSpiralGameOverMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_BlueSpiral_GameOver))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralGameOverMsg, pyBlueSpiralGameOverMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralGameOverMsg, pyBlueSpiralGameOverMsg)
// Module and method definitions
void pyBlueSpiralGameOverMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralGameOverMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptBlueSpiralGameStartedMsg, pyBlueSpiralGameStartedMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralGameStartedMsg, pyBlueSpiralGameStartedMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralGameStartedMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralGameStartedMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptBlueSpiralGameStartedMsg, startSpin)
{
PYTHON_RETURN_BOOL(self->fThis->StartSpin());
}
PYTHON_START_METHODS_TABLE(ptBlueSpiralGameStartedMsg)
PYTHON_METHOD_NOARGS(ptBlueSpiralGameStartedMsg, startSpin, "Returns true if you are supposed to start spinning the door thingy"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralGameStartedMsg, pyBlueSpiralMsg, "BlueSpiral message received when someone starts the game (or when you join a game that is running)");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralGameStartedMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralGameStartedMsg *newObj = (ptBlueSpiralGameStartedMsg*)ptBlueSpiralGameStartedMsg_type.tp_new(&ptBlueSpiralGameStartedMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_BlueSpiral_GameStarted))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralGameStartedMsg, pyBlueSpiralGameStartedMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralGameStartedMsg, pyBlueSpiralGameStartedMsg)
// Module and method definitions
void pyBlueSpiralGameStartedMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralGameStartedMsg);
PYTHON_CLASS_IMPORT_END(m);
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "pyBlueSpiralMsg.h"
#include "../../pyEnum.h"
#include <python.h>
///////////////////////////////////////////////////////////////////////////////
//
// Base TTT msg class
//
PYTHON_CLASS_DEFINITION(ptBlueSpiralMsg, pyBlueSpiralMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralMsg, pyBlueSpiralMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptBlueSpiralMsg, getBlueSpiralMsgType)
{
return PyInt_FromLong(self->fThis->GetBlueSpiralMsgType());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptBlueSpiralMsg, upcastToFinalBlueSpiralMsg)
{
return self->fThis->UpcastToFinalBlueSpiralMsg();
}
PYTHON_START_METHODS_TABLE(ptBlueSpiralMsg)
PYTHON_METHOD_NOARGS(ptBlueSpiralMsg, getBlueSpiralMsgType, "Returns the type of the BlueSpiral message (see PtBlueSpiralMsgTypes)"),
PYTHON_METHOD_NOARGS(ptBlueSpiralMsg, upcastToFinalBlueSpiralMsg, "Returns this message as the BlueSpiral message it really is"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralMsg, pyGameCliMsg, "Base class for BlueSpiral game messages");
PYTHON_EXPOSE_TYPE_DEFINITION(ptBlueSpiralMsg, pyBlueSpiralMsg);
// required functions for PyObject interoperability
PyObject* pyBlueSpiralMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralMsg *newObj = (ptBlueSpiralMsg*)ptBlueSpiralMsg_type.tp_new(&ptBlueSpiralMsg_type, NULL, NULL);
if (msg && (msg->gameCli->GetGameTypeId() == kGameTypeId_BlueSpiral))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralMsg, pyBlueSpiralMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralMsg, pyBlueSpiralMsg)
// Module and method definitions
void pyBlueSpiralMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralMsg);
PYTHON_CLASS_IMPORT_END(m);
}
void pyBlueSpiralMsg::AddPlasmaConstantsClasses(PyObject* m)
{
PYTHON_ENUM_START(PtBlueSpiralMsgTypes);
PYTHON_ENUM_ELEMENT(PtBlueSpiralMsgTypes, kBlueSpiralClothOrder, kSrv2Cli_BlueSpiral_ClothOrder);
PYTHON_ENUM_ELEMENT(PtBlueSpiralMsgTypes, kBlueSpiralSuccessfulHit, kSrv2Cli_BlueSpiral_SuccessfulHit);
PYTHON_ENUM_ELEMENT(PtBlueSpiralMsgTypes, kBlueSpiralGameWon, kSrv2Cli_BlueSpiral_GameWon);
PYTHON_ENUM_ELEMENT(PtBlueSpiralMsgTypes, kBlueSpiralGameOver, kSrv2Cli_BlueSpiral_GameOver);
PYTHON_ENUM_ELEMENT(PtBlueSpiralMsgTypes, kBlueSpiralGameStarted, kSrv2Cli_BlueSpiral_GameStarted);
PYTHON_ENUM_END(m, PtBlueSpiralMsgTypes);
}
///////////////////////////////////////////////////////////////////////////////
//
// Game client message subclasses
//
PYTHON_CLASS_DEFINITION(ptBlueSpiralClothOrderMsg, pyBlueSpiralClothOrderMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralClothOrderMsg, pyBlueSpiralClothOrderMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralClothOrderMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralClothOrderMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptBlueSpiralClothOrderMsg, order)
{
std::vector<int> order = self->fThis->Order();
PyObject* retVal = PyList_New(order.size());
for (unsigned i = 0; i < order.size(); ++i)
PyList_SetItem(retVal, i, PyInt_FromLong(order[i]));
return retVal;
}
PYTHON_START_METHODS_TABLE(ptBlueSpiralClothOrderMsg)
PYTHON_METHOD_NOARGS(ptBlueSpiralClothOrderMsg, order, "Returns a list of numbers indicating the correct order to hit the clothes in"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralClothOrderMsg, pyBlueSpiralMsg, "BlueSpiral message received when the game is started and the cloth order is set");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralClothOrderMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralClothOrderMsg *newObj = (ptBlueSpiralClothOrderMsg*)ptBlueSpiralClothOrderMsg_type.tp_new(&ptBlueSpiralClothOrderMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_BlueSpiral_ClothOrder))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralClothOrderMsg, pyBlueSpiralClothOrderMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralClothOrderMsg, pyBlueSpiralClothOrderMsg)
// Module and method definitions
void pyBlueSpiralClothOrderMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralClothOrderMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptBlueSpiralSuccessfulHitMsg, pyBlueSpiralSuccessfulHitMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralSuccessfulHitMsg, pyBlueSpiralSuccessfulHitMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralSuccessfulHitMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralSuccessfulHitMsg)
PYTHON_START_METHODS_TABLE(ptBlueSpiralSuccessfulHitMsg)
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralSuccessfulHitMsg, pyBlueSpiralMsg, "BlueSpiral message received when a cloth is hit in the correct order");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralSuccessfulHitMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralSuccessfulHitMsg *newObj = (ptBlueSpiralSuccessfulHitMsg*)ptBlueSpiralSuccessfulHitMsg_type.tp_new(&ptBlueSpiralSuccessfulHitMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_BlueSpiral_SuccessfulHit))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralSuccessfulHitMsg, pyBlueSpiralSuccessfulHitMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralSuccessfulHitMsg, pyBlueSpiralSuccessfulHitMsg)
// Module and method definitions
void pyBlueSpiralSuccessfulHitMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralSuccessfulHitMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptBlueSpiralGameWonMsg, pyBlueSpiralGameWonMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralGameWonMsg, pyBlueSpiralGameWonMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralGameWonMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralGameWonMsg)
PYTHON_START_METHODS_TABLE(ptBlueSpiralGameWonMsg)
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralGameWonMsg, pyBlueSpiralMsg, "BlueSpiral message received when the last cloth is successfully hit");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralGameWonMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralGameWonMsg *newObj = (ptBlueSpiralGameWonMsg*)ptBlueSpiralGameWonMsg_type.tp_new(&ptBlueSpiralGameWonMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_BlueSpiral_GameWon))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralGameWonMsg, pyBlueSpiralGameWonMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralGameWonMsg, pyBlueSpiralGameWonMsg)
// Module and method definitions
void pyBlueSpiralGameWonMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralGameWonMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptBlueSpiralGameOverMsg, pyBlueSpiralGameOverMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralGameOverMsg, pyBlueSpiralGameOverMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralGameOverMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralGameOverMsg)
PYTHON_START_METHODS_TABLE(ptBlueSpiralGameOverMsg)
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralGameOverMsg, pyBlueSpiralMsg, "BlueSpiral message received when the timer runs out, someone hits the wrong cloth, or the game is restarted (before a game start msg in that last case)");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralGameOverMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralGameOverMsg *newObj = (ptBlueSpiralGameOverMsg*)ptBlueSpiralGameOverMsg_type.tp_new(&ptBlueSpiralGameOverMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_BlueSpiral_GameOver))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralGameOverMsg, pyBlueSpiralGameOverMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralGameOverMsg, pyBlueSpiralGameOverMsg)
// Module and method definitions
void pyBlueSpiralGameOverMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralGameOverMsg);
PYTHON_CLASS_IMPORT_END(m);
}
///////////////////////////////////////////////////////////////////////////////
PYTHON_CLASS_DEFINITION(ptBlueSpiralGameStartedMsg, pyBlueSpiralGameStartedMsg);
PYTHON_DEFAULT_NEW_DEFINITION(ptBlueSpiralGameStartedMsg, pyBlueSpiralGameStartedMsg)
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptBlueSpiralGameStartedMsg)
PYTHON_NO_INIT_DEFINITION(ptBlueSpiralGameStartedMsg)
PYTHON_METHOD_DEFINITION_NOARGS(ptBlueSpiralGameStartedMsg, startSpin)
{
PYTHON_RETURN_BOOL(self->fThis->StartSpin());
}
PYTHON_START_METHODS_TABLE(ptBlueSpiralGameStartedMsg)
PYTHON_METHOD_NOARGS(ptBlueSpiralGameStartedMsg, startSpin, "Returns true if you are supposed to start spinning the door thingy"),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE_WBASE(ptBlueSpiralGameStartedMsg, pyBlueSpiralMsg, "BlueSpiral message received when someone starts the game (or when you join a game that is running)");
// required functions for PyObject interoperability
PyObject* pyBlueSpiralGameStartedMsg::New(pfGameCliMsg* msg)
{
ptBlueSpiralGameStartedMsg *newObj = (ptBlueSpiralGameStartedMsg*)ptBlueSpiralGameStartedMsg_type.tp_new(&ptBlueSpiralGameStartedMsg_type, NULL, NULL);
if (msg && (msg->netMsg->messageId == kSrv2Cli_BlueSpiral_GameStarted))
newObj->fThis->message = msg;
return (PyObject*)newObj;
}
PYTHON_CLASS_CHECK_IMPL(ptBlueSpiralGameStartedMsg, pyBlueSpiralGameStartedMsg)
PYTHON_CLASS_CONVERT_FROM_IMPL(ptBlueSpiralGameStartedMsg, pyBlueSpiralGameStartedMsg)
// Module and method definitions
void pyBlueSpiralGameStartedMsg::AddPlasmaClasses(PyObject* m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m, ptBlueSpiralGameStartedMsg);
PYTHON_CLASS_IMPORT_END(m);
}