mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-13 18:17:49 -04:00
Fix line endings and tabs
This commit is contained in:
@ -1,145 +1,145 @@
|
||||
/*==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/>.
|
||||
|
||||
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 "pyMarkerGame.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Base Marker game client class
|
||||
//
|
||||
|
||||
pyMarkerGame::pyMarkerGame(): pyGameCli() {}
|
||||
|
||||
pyMarkerGame::pyMarkerGame(pfGameCli* client): pyGameCli(client)
|
||||
{
|
||||
if (client && (client->GetGameTypeId() != kGameTypeId_Marker))
|
||||
gameClient = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
bool pyMarkerGame::IsMarkerGame(std::wstring guid)
|
||||
{
|
||||
Uuid gameUuid(guid.c_str());
|
||||
return gameUuid == kGameTypeId_Marker;
|
||||
}
|
||||
|
||||
void pyMarkerGame::CreateMarkerGame(pyKey& callbackKey, unsigned gameType, std::wstring gameName, unsigned long timeLimit, std::wstring templateId)
|
||||
{
|
||||
Marker_CreateParam init;
|
||||
init.gameType = gameType;
|
||||
StrCopy(init.gameName, gameName.c_str(), arrsize(init.gameName));
|
||||
init.timeLimit = timeLimit;
|
||||
StrCopy(init.templateID, templateId.c_str(), arrsize(init.templateID));
|
||||
pfGameMgr::GetInstance()->CreateGame(callbackKey.getKey(), kGameTypeId_Marker, 0, sizeof(init), &init);
|
||||
}
|
||||
|
||||
void pyMarkerGame::StartGame()
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->StartGame();
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::PauseGame()
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->PauseGame();
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::ResetGame()
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->ResetGame();
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::ChangeGameName(std::wstring newName)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->ChangeGameName(newName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::ChangeTimeLimit(unsigned long timeLimit)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->ChangeTimeLimit(timeLimit);
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::DeleteGame()
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->DeleteGame();
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::AddMarker(double x, double y, double z, std::wstring name, std::wstring age)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->AddMarker(x, y, z, name.c_str(), age.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::DeleteMarker(unsigned long markerId)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->DeleteMarker(markerId);
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::ChangeMarkerName(unsigned long markerId, std::wstring newName)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->ChangeMarkerName(markerId, newName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::CaptureMarker(unsigned long markerId)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->CaptureMarker(markerId);
|
||||
}
|
||||
/*==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/>.
|
||||
|
||||
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 "pyMarkerGame.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Base Marker game client class
|
||||
//
|
||||
|
||||
pyMarkerGame::pyMarkerGame(): pyGameCli() {}
|
||||
|
||||
pyMarkerGame::pyMarkerGame(pfGameCli* client): pyGameCli(client)
|
||||
{
|
||||
if (client && (client->GetGameTypeId() != kGameTypeId_Marker))
|
||||
gameClient = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
bool pyMarkerGame::IsMarkerGame(std::wstring guid)
|
||||
{
|
||||
Uuid gameUuid(guid.c_str());
|
||||
return gameUuid == kGameTypeId_Marker;
|
||||
}
|
||||
|
||||
void pyMarkerGame::CreateMarkerGame(pyKey& callbackKey, unsigned gameType, std::wstring gameName, unsigned long timeLimit, std::wstring templateId)
|
||||
{
|
||||
Marker_CreateParam init;
|
||||
init.gameType = gameType;
|
||||
StrCopy(init.gameName, gameName.c_str(), arrsize(init.gameName));
|
||||
init.timeLimit = timeLimit;
|
||||
StrCopy(init.templateID, templateId.c_str(), arrsize(init.templateID));
|
||||
pfGameMgr::GetInstance()->CreateGame(callbackKey.getKey(), kGameTypeId_Marker, 0, sizeof(init), &init);
|
||||
}
|
||||
|
||||
void pyMarkerGame::StartGame()
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->StartGame();
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::PauseGame()
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->PauseGame();
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::ResetGame()
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->ResetGame();
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::ChangeGameName(std::wstring newName)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->ChangeGameName(newName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::ChangeTimeLimit(unsigned long timeLimit)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->ChangeTimeLimit(timeLimit);
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::DeleteGame()
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->DeleteGame();
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::AddMarker(double x, double y, double z, std::wstring name, std::wstring age)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->AddMarker(x, y, z, name.c_str(), age.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::DeleteMarker(unsigned long markerId)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->DeleteMarker(markerId);
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::ChangeMarkerName(unsigned long markerId, std::wstring newName)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->ChangeMarkerName(markerId, newName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void pyMarkerGame::CaptureMarker(unsigned long markerId)
|
||||
{
|
||||
if (gameClient)
|
||||
{
|
||||
pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient);
|
||||
marker->CaptureMarker(markerId);
|
||||
}
|
||||
}
|
@ -1,75 +1,75 @@
|
||||
/*==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/>.
|
||||
|
||||
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 pyMarkerGame_h
|
||||
#define pyMarkerGame_h
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// NAME: pyMarkerGame
|
||||
//
|
||||
// PURPOSE: Class wrapper for the Marker game client
|
||||
//
|
||||
|
||||
#include "pfGameMgr/pfGameMgr.h"
|
||||
|
||||
#include <python.h>
|
||||
#include "../../pyGlueHelpers.h"
|
||||
#include "../pyGameCli.h"
|
||||
#include "../../pyKey.h"
|
||||
|
||||
class pyMarkerGame : public pyGameCli
|
||||
{
|
||||
protected:
|
||||
pyMarkerGame();
|
||||
pyMarkerGame(pfGameCli* client);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGame);
|
||||
static PyObject* New(pfGameCli* client);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a ptMarkerGame object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGame); // converts a PyObject to a pyMarkerGame (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
static void AddPlasmaConstantsClasses(PyObject* m);
|
||||
static void AddPlasmaMethods(std::vector<PyMethodDef>& methods);
|
||||
|
||||
static bool IsMarkerGame(std::wstring guid);
|
||||
static void CreateMarkerGame(pyKey& callbackKey, unsigned gameType, std::wstring gameName, unsigned long timeLimit, std::wstring templateId);
|
||||
|
||||
void StartGame();
|
||||
void PauseGame();
|
||||
void ResetGame();
|
||||
void ChangeGameName(std::wstring newName);
|
||||
void ChangeTimeLimit(unsigned long timeLimit);
|
||||
void DeleteGame();
|
||||
void AddMarker(double x, double y, double z, std::wstring name, std::wstring age);
|
||||
void DeleteMarker(unsigned long markerId);
|
||||
void ChangeMarkerName(unsigned long markerId, std::wstring newName);
|
||||
void CaptureMarker(unsigned long markerId);
|
||||
};
|
||||
|
||||
#endif // pyMarkerGame_h
|
||||
/*==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/>.
|
||||
|
||||
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 pyMarkerGame_h
|
||||
#define pyMarkerGame_h
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// NAME: pyMarkerGame
|
||||
//
|
||||
// PURPOSE: Class wrapper for the Marker game client
|
||||
//
|
||||
|
||||
#include "pfGameMgr/pfGameMgr.h"
|
||||
|
||||
#include <python.h>
|
||||
#include "../../pyGlueHelpers.h"
|
||||
#include "../pyGameCli.h"
|
||||
#include "../../pyKey.h"
|
||||
|
||||
class pyMarkerGame : public pyGameCli
|
||||
{
|
||||
protected:
|
||||
pyMarkerGame();
|
||||
pyMarkerGame(pfGameCli* client);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGame);
|
||||
static PyObject* New(pfGameCli* client);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a ptMarkerGame object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGame); // converts a PyObject to a pyMarkerGame (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
static void AddPlasmaConstantsClasses(PyObject* m);
|
||||
static void AddPlasmaMethods(std::vector<PyMethodDef>& methods);
|
||||
|
||||
static bool IsMarkerGame(std::wstring guid);
|
||||
static void CreateMarkerGame(pyKey& callbackKey, unsigned gameType, std::wstring gameName, unsigned long timeLimit, std::wstring templateId);
|
||||
|
||||
void StartGame();
|
||||
void PauseGame();
|
||||
void ResetGame();
|
||||
void ChangeGameName(std::wstring newName);
|
||||
void ChangeTimeLimit(unsigned long timeLimit);
|
||||
void DeleteGame();
|
||||
void AddMarker(double x, double y, double z, std::wstring name, std::wstring age);
|
||||
void DeleteMarker(unsigned long markerId);
|
||||
void ChangeMarkerName(unsigned long markerId, std::wstring newName);
|
||||
void CaptureMarker(unsigned long markerId);
|
||||
};
|
||||
|
||||
#endif // pyMarkerGame_h
|
||||
|
@ -1,381 +1,381 @@
|
||||
/*==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/>.
|
||||
|
||||
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 "pyMarkerGame.h"
|
||||
|
||||
#include <python.h>
|
||||
#include "../../pyEnum.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Base TTT game client class
|
||||
//
|
||||
|
||||
PYTHON_CLASS_DEFINITION(ptMarkerGame, pyMarkerGame);
|
||||
|
||||
PYTHON_DEFAULT_NEW_DEFINITION(ptMarkerGame, pyMarkerGame)
|
||||
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptMarkerGame)
|
||||
|
||||
PYTHON_NO_INIT_DEFINITION(ptMarkerGame)
|
||||
|
||||
PYTHON_GLOBAL_METHOD_DEFINITION(PtIsMarkerGame, args, "Params: typeID\nReturns true if the specifed typeID (guid as a string) is a Marker game")
|
||||
{
|
||||
PyObject* textObj;
|
||||
if (!PyArg_ParseTuple(args, "O", &textObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsMarkerGame 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 = pyMarkerGame::IsMarkerGame(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 = pyMarkerGame::IsMarkerGame(wText);
|
||||
delete [] wText;
|
||||
PYTHON_RETURN_BOOL(retVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsMarkerGame expects a unicode string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
PYTHON_GLOBAL_METHOD_DEFINITION_WKEY(PtCreateMarkerGame, args, keywords, "Params: callbackKey, gameType, gameName = \"\", timeLimit = 0, templateId = \"\"\n"
|
||||
"Creates a new Marker game with the specified callback key, game type (from PtMarkerGameTypes), time limit (in ms), and template id (guid string)")
|
||||
{
|
||||
char *kwlist[] = {"callbackKey", "gameType", "gameName", "timeLimit", "templateId", NULL};
|
||||
PyObject* callbackObj = NULL;
|
||||
unsigned int gameType = 0;
|
||||
PyObject* gameNameObj = NULL;
|
||||
unsigned long timeLimit = 0;
|
||||
PyObject* templateIdObj = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywords, "OI|OkO", kwlist, &callbackObj, &gameType, &gameNameObj, &timeLimit, &templateIdObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtCreateMarkerGame expects a ptKey, unsigned int, and optionally a string, an unsigned long, and another string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
if (!pyKey::Check(callbackObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtCreateMarkerGame expects a ptKey, unsigned int, and optionally a string, an unsigned long, and another string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
pyKey* key = pyKey::ConvertFrom(callbackObj);
|
||||
std::wstring name = L"";
|
||||
std::wstring templateId = L"";
|
||||
if (gameNameObj != NULL)
|
||||
{
|
||||
if (PyUnicode_Check(gameNameObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(gameNameObj);
|
||||
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)gameNameObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
name = text;
|
||||
delete [] text;
|
||||
}
|
||||
else if (PyString_Check(gameNameObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(gameNameObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
name = wText;
|
||||
delete [] wText;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtCreateMarkerGame expects a ptKey, unsigned int, and optionally a string, an unsigned long, and another string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
if (templateIdObj != NULL)
|
||||
{
|
||||
if (PyUnicode_Check(templateIdObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(templateIdObj);
|
||||
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)templateIdObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
templateId = text;
|
||||
delete [] text;
|
||||
}
|
||||
else if (PyString_Check(templateIdObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(templateIdObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
templateId = wText;
|
||||
delete [] wText;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtCreateMarkerGame expects a ptKey, unsigned int, and optionally a string, an unsigned long, and another string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
pyMarkerGame::CreateMarkerGame(*key, gameType, name, timeLimit, templateId);
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
|
||||
PYTHON_BASIC_METHOD_DEFINITION(ptMarkerGame, startGame, StartGame)
|
||||
PYTHON_BASIC_METHOD_DEFINITION(ptMarkerGame, pauseGame, PauseGame)
|
||||
PYTHON_BASIC_METHOD_DEFINITION(ptMarkerGame, resetGame, ResetGame)
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptMarkerGame, changeGameName, args)
|
||||
{
|
||||
PyObject* textObj;
|
||||
if (!PyArg_ParseTuple(args, "O", &textObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "changeGameName 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';
|
||||
self->fThis->ChangeGameName(text);
|
||||
delete [] text;
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
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);
|
||||
self->fThis->ChangeGameName(wText);
|
||||
delete [] wText;
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "changeGameName expects a unicode string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptMarkerGame, changeTimeLimit, args)
|
||||
{
|
||||
unsigned long timeLimit;
|
||||
if (!PyArg_ParseTuple(args, "k", &timeLimit))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "changeTimeLimit expects an unsigned long");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
self->fThis->ChangeTimeLimit(timeLimit);
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
|
||||
PYTHON_BASIC_METHOD_DEFINITION(ptMarkerGame, deleteGame, DeleteGame)
|
||||
|
||||
PYTHON_METHOD_DEFINITION_WKEY(ptMarkerGame, addMarker, args, keywords)
|
||||
{
|
||||
char *kwlist[] = {"x", "y", "z", "name", "age", NULL};
|
||||
double x, y, z;
|
||||
PyObject* nameObj = NULL;
|
||||
PyObject* ageObj = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywords, "ddd|OO", kwlist, &x, &y, &z, &nameObj, &ageObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "addMarker expects three doubles, and optionally two strings");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
std::wstring name = L"";
|
||||
std::wstring age = L"";
|
||||
if (nameObj != NULL)
|
||||
{
|
||||
if (PyUnicode_Check(nameObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(nameObj);
|
||||
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
name = text;
|
||||
delete [] text;
|
||||
}
|
||||
else if (PyString_Check(nameObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(nameObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
name = wText;
|
||||
delete [] wText;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "addMarker expects three doubles, and optionally two strings");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
if (ageObj != NULL)
|
||||
{
|
||||
if (PyUnicode_Check(ageObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(ageObj);
|
||||
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)ageObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
age = text;
|
||||
delete [] text;
|
||||
}
|
||||
else if (PyString_Check(ageObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(ageObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
age = wText;
|
||||
delete [] wText;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "addMarker expects three doubles, and optionally two strings");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
self->fThis->AddMarker(x, y, z, name, age);
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptMarkerGame, deleteMarker, args)
|
||||
{
|
||||
unsigned long markerId;
|
||||
if (!PyArg_ParseTuple(args, "k", &markerId))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "deleteMarker expects an unsigned long");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
self->fThis->DeleteMarker(markerId);
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptMarkerGame, changeMarkerName, args)
|
||||
{
|
||||
unsigned long markerId;
|
||||
PyObject* nameObj = NULL;
|
||||
if (!PyArg_ParseTuple(args, "kO", &markerId, &nameObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "changeMarkerName expects an unsigned long and a string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
if (PyUnicode_Check(nameObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(nameObj);
|
||||
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
self->fThis->ChangeMarkerName(markerId, text);
|
||||
delete [] text;
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
else if (PyString_Check(nameObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(nameObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
self->fThis->ChangeMarkerName(markerId, wText);
|
||||
delete [] wText;
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "changeMarkerName expects an unsigned long and a string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptMarkerGame, captureMarker, args)
|
||||
{
|
||||
unsigned long markerId;
|
||||
if (!PyArg_ParseTuple(args, "k", &markerId))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "captureMarker expects an unsigned long");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
self->fThis->CaptureMarker(markerId);
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
|
||||
PYTHON_START_METHODS_TABLE(ptMarkerGame)
|
||||
PYTHON_BASIC_METHOD(ptMarkerGame, startGame, "Starts the game. Won't work on MP games if you're not the owner/creator"),
|
||||
PYTHON_BASIC_METHOD(ptMarkerGame, pauseGame, "Pauses the game. Won't work on MP games if you're not the owner/creator"),
|
||||
PYTHON_BASIC_METHOD(ptMarkerGame, resetGame, "Resets the game. Won't work on MP games if you're not the owner/creator"),
|
||||
PYTHON_METHOD(ptMarkerGame, changeGameName, "Params: newName\nChanges the name of the game. Won't work if you're not the game owner/creator"),
|
||||
PYTHON_METHOD(ptMarkerGame, changeTimeLimit, "Params: newTimeLimit\nChanges the time limit on the game (in ms). Won't work if you're not the game owner/creator, or if it's a quest game"),
|
||||
PYTHON_BASIC_METHOD(ptMarkerGame, deleteGame, "Tells the server to delete the game. Won't work if you're not the game owner/creator"),
|
||||
PYTHON_METHOD_WKEY(ptMarkerGame, addMarker, "Params: x, y, z, name = \"\", age = \"\"\nAdds a marker to the game. Age is ignored in a non-quest game. Won't work if you're not the owner/creator"),
|
||||
PYTHON_METHOD(ptMarkerGame, deleteMarker, "Params: markerId\nDeletes the specified marker from the game. Won't work if you're not the game owner/creator"),
|
||||
PYTHON_METHOD(ptMarkerGame, changeMarkerName, "Params: markerId, newName\nChanges the name of the specified marker. Won't work if you're not the game owner/creator"),
|
||||
PYTHON_METHOD(ptMarkerGame, captureMarker, "Params: markerId\nCaptures the specified marker"),
|
||||
PYTHON_END_METHODS_TABLE;
|
||||
|
||||
// Type structure definition
|
||||
PLASMA_DEFAULT_TYPE_WBASE(ptMarkerGame, pyGameCli, "Game client for the Marker game");
|
||||
|
||||
// required functions for PyObject interoperability
|
||||
PyObject* pyMarkerGame::New(pfGameCli* client)
|
||||
{
|
||||
ptMarkerGame *newObj = (ptMarkerGame*)ptMarkerGame_type.tp_new(&ptMarkerGame_type, NULL, NULL);
|
||||
if (client && (client->GetGameTypeId() == kGameTypeId_Marker))
|
||||
newObj->fThis->gameClient = client;
|
||||
return (PyObject*)newObj;
|
||||
}
|
||||
|
||||
PYTHON_CLASS_CHECK_IMPL(ptMarkerGame, pyMarkerGame)
|
||||
PYTHON_CLASS_CONVERT_FROM_IMPL(ptMarkerGame, pyMarkerGame)
|
||||
|
||||
// Module and method definitions
|
||||
void pyMarkerGame::AddPlasmaClasses(PyObject* m)
|
||||
{
|
||||
PYTHON_CLASS_IMPORT_START(m);
|
||||
PYTHON_CLASS_IMPORT(m, ptMarkerGame);
|
||||
PYTHON_CLASS_IMPORT_END(m);
|
||||
}
|
||||
|
||||
void pyMarkerGame::AddPlasmaConstantsClasses(PyObject* m)
|
||||
{
|
||||
PYTHON_ENUM_START(PtMarkerGameTypes);
|
||||
PYTHON_ENUM_ELEMENT(PtMarkerGameTypes, kMarkerGameQuest, kMarkerGameQuest);
|
||||
PYTHON_ENUM_ELEMENT(PtMarkerGameTypes, kMarkerGameCGZ, kMarkerGameCGZ);
|
||||
PYTHON_ENUM_ELEMENT(PtMarkerGameTypes, kMarkerGameCapture, kMarkerGameCapture);
|
||||
PYTHON_ENUM_ELEMENT(PtMarkerGameTypes, kMarkerGameCaptureAndHold, kMarkerGameCaptureAndHold);
|
||||
PYTHON_ENUM_END(m, PtMarkerGameTypes);
|
||||
}
|
||||
|
||||
void pyMarkerGame::AddPlasmaMethods(std::vector<PyMethodDef>& methods)
|
||||
{
|
||||
PYTHON_GLOBAL_METHOD(methods, PtIsMarkerGame);
|
||||
PYTHON_GLOBAL_METHOD_WKEY(methods, PtCreateMarkerGame);
|
||||
/*==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/>.
|
||||
|
||||
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 "pyMarkerGame.h"
|
||||
|
||||
#include <python.h>
|
||||
#include "../../pyEnum.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Base TTT game client class
|
||||
//
|
||||
|
||||
PYTHON_CLASS_DEFINITION(ptMarkerGame, pyMarkerGame);
|
||||
|
||||
PYTHON_DEFAULT_NEW_DEFINITION(ptMarkerGame, pyMarkerGame)
|
||||
PYTHON_DEFAULT_DEALLOC_DEFINITION(ptMarkerGame)
|
||||
|
||||
PYTHON_NO_INIT_DEFINITION(ptMarkerGame)
|
||||
|
||||
PYTHON_GLOBAL_METHOD_DEFINITION(PtIsMarkerGame, args, "Params: typeID\nReturns true if the specifed typeID (guid as a string) is a Marker game")
|
||||
{
|
||||
PyObject* textObj;
|
||||
if (!PyArg_ParseTuple(args, "O", &textObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsMarkerGame 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 = pyMarkerGame::IsMarkerGame(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 = pyMarkerGame::IsMarkerGame(wText);
|
||||
delete [] wText;
|
||||
PYTHON_RETURN_BOOL(retVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtIsMarkerGame expects a unicode string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
PYTHON_GLOBAL_METHOD_DEFINITION_WKEY(PtCreateMarkerGame, args, keywords, "Params: callbackKey, gameType, gameName = \"\", timeLimit = 0, templateId = \"\"\n"
|
||||
"Creates a new Marker game with the specified callback key, game type (from PtMarkerGameTypes), time limit (in ms), and template id (guid string)")
|
||||
{
|
||||
char *kwlist[] = {"callbackKey", "gameType", "gameName", "timeLimit", "templateId", NULL};
|
||||
PyObject* callbackObj = NULL;
|
||||
unsigned int gameType = 0;
|
||||
PyObject* gameNameObj = NULL;
|
||||
unsigned long timeLimit = 0;
|
||||
PyObject* templateIdObj = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywords, "OI|OkO", kwlist, &callbackObj, &gameType, &gameNameObj, &timeLimit, &templateIdObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtCreateMarkerGame expects a ptKey, unsigned int, and optionally a string, an unsigned long, and another string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
if (!pyKey::Check(callbackObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtCreateMarkerGame expects a ptKey, unsigned int, and optionally a string, an unsigned long, and another string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
pyKey* key = pyKey::ConvertFrom(callbackObj);
|
||||
std::wstring name = L"";
|
||||
std::wstring templateId = L"";
|
||||
if (gameNameObj != NULL)
|
||||
{
|
||||
if (PyUnicode_Check(gameNameObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(gameNameObj);
|
||||
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)gameNameObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
name = text;
|
||||
delete [] text;
|
||||
}
|
||||
else if (PyString_Check(gameNameObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(gameNameObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
name = wText;
|
||||
delete [] wText;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtCreateMarkerGame expects a ptKey, unsigned int, and optionally a string, an unsigned long, and another string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
if (templateIdObj != NULL)
|
||||
{
|
||||
if (PyUnicode_Check(templateIdObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(templateIdObj);
|
||||
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)templateIdObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
templateId = text;
|
||||
delete [] text;
|
||||
}
|
||||
else if (PyString_Check(templateIdObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(templateIdObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
templateId = wText;
|
||||
delete [] wText;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "PtCreateMarkerGame expects a ptKey, unsigned int, and optionally a string, an unsigned long, and another string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
pyMarkerGame::CreateMarkerGame(*key, gameType, name, timeLimit, templateId);
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
|
||||
PYTHON_BASIC_METHOD_DEFINITION(ptMarkerGame, startGame, StartGame)
|
||||
PYTHON_BASIC_METHOD_DEFINITION(ptMarkerGame, pauseGame, PauseGame)
|
||||
PYTHON_BASIC_METHOD_DEFINITION(ptMarkerGame, resetGame, ResetGame)
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptMarkerGame, changeGameName, args)
|
||||
{
|
||||
PyObject* textObj;
|
||||
if (!PyArg_ParseTuple(args, "O", &textObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "changeGameName 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';
|
||||
self->fThis->ChangeGameName(text);
|
||||
delete [] text;
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
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);
|
||||
self->fThis->ChangeGameName(wText);
|
||||
delete [] wText;
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "changeGameName expects a unicode string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptMarkerGame, changeTimeLimit, args)
|
||||
{
|
||||
unsigned long timeLimit;
|
||||
if (!PyArg_ParseTuple(args, "k", &timeLimit))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "changeTimeLimit expects an unsigned long");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
self->fThis->ChangeTimeLimit(timeLimit);
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
|
||||
PYTHON_BASIC_METHOD_DEFINITION(ptMarkerGame, deleteGame, DeleteGame)
|
||||
|
||||
PYTHON_METHOD_DEFINITION_WKEY(ptMarkerGame, addMarker, args, keywords)
|
||||
{
|
||||
char *kwlist[] = {"x", "y", "z", "name", "age", NULL};
|
||||
double x, y, z;
|
||||
PyObject* nameObj = NULL;
|
||||
PyObject* ageObj = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywords, "ddd|OO", kwlist, &x, &y, &z, &nameObj, &ageObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "addMarker expects three doubles, and optionally two strings");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
std::wstring name = L"";
|
||||
std::wstring age = L"";
|
||||
if (nameObj != NULL)
|
||||
{
|
||||
if (PyUnicode_Check(nameObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(nameObj);
|
||||
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
name = text;
|
||||
delete [] text;
|
||||
}
|
||||
else if (PyString_Check(nameObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(nameObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
name = wText;
|
||||
delete [] wText;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "addMarker expects three doubles, and optionally two strings");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
if (ageObj != NULL)
|
||||
{
|
||||
if (PyUnicode_Check(ageObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(ageObj);
|
||||
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)ageObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
age = text;
|
||||
delete [] text;
|
||||
}
|
||||
else if (PyString_Check(ageObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(ageObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
age = wText;
|
||||
delete [] wText;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "addMarker expects three doubles, and optionally two strings");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
self->fThis->AddMarker(x, y, z, name, age);
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptMarkerGame, deleteMarker, args)
|
||||
{
|
||||
unsigned long markerId;
|
||||
if (!PyArg_ParseTuple(args, "k", &markerId))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "deleteMarker expects an unsigned long");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
self->fThis->DeleteMarker(markerId);
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptMarkerGame, changeMarkerName, args)
|
||||
{
|
||||
unsigned long markerId;
|
||||
PyObject* nameObj = NULL;
|
||||
if (!PyArg_ParseTuple(args, "kO", &markerId, &nameObj))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "changeMarkerName expects an unsigned long and a string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
if (PyUnicode_Check(nameObj))
|
||||
{
|
||||
int strLen = PyUnicode_GetSize(nameObj);
|
||||
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1];
|
||||
PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen);
|
||||
text[strLen] = L'\0';
|
||||
self->fThis->ChangeMarkerName(markerId, text);
|
||||
delete [] text;
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
else if (PyString_Check(nameObj))
|
||||
{
|
||||
// we'll allow this, just in case something goes weird
|
||||
char* text = PyString_AsString(nameObj);
|
||||
wchar_t* wText = hsStringToWString(text);
|
||||
self->fThis->ChangeMarkerName(markerId, wText);
|
||||
delete [] wText;
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "changeMarkerName expects an unsigned long and a string");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptMarkerGame, captureMarker, args)
|
||||
{
|
||||
unsigned long markerId;
|
||||
if (!PyArg_ParseTuple(args, "k", &markerId))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "captureMarker expects an unsigned long");
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
self->fThis->CaptureMarker(markerId);
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
|
||||
PYTHON_START_METHODS_TABLE(ptMarkerGame)
|
||||
PYTHON_BASIC_METHOD(ptMarkerGame, startGame, "Starts the game. Won't work on MP games if you're not the owner/creator"),
|
||||
PYTHON_BASIC_METHOD(ptMarkerGame, pauseGame, "Pauses the game. Won't work on MP games if you're not the owner/creator"),
|
||||
PYTHON_BASIC_METHOD(ptMarkerGame, resetGame, "Resets the game. Won't work on MP games if you're not the owner/creator"),
|
||||
PYTHON_METHOD(ptMarkerGame, changeGameName, "Params: newName\nChanges the name of the game. Won't work if you're not the game owner/creator"),
|
||||
PYTHON_METHOD(ptMarkerGame, changeTimeLimit, "Params: newTimeLimit\nChanges the time limit on the game (in ms). Won't work if you're not the game owner/creator, or if it's a quest game"),
|
||||
PYTHON_BASIC_METHOD(ptMarkerGame, deleteGame, "Tells the server to delete the game. Won't work if you're not the game owner/creator"),
|
||||
PYTHON_METHOD_WKEY(ptMarkerGame, addMarker, "Params: x, y, z, name = \"\", age = \"\"\nAdds a marker to the game. Age is ignored in a non-quest game. Won't work if you're not the owner/creator"),
|
||||
PYTHON_METHOD(ptMarkerGame, deleteMarker, "Params: markerId\nDeletes the specified marker from the game. Won't work if you're not the game owner/creator"),
|
||||
PYTHON_METHOD(ptMarkerGame, changeMarkerName, "Params: markerId, newName\nChanges the name of the specified marker. Won't work if you're not the game owner/creator"),
|
||||
PYTHON_METHOD(ptMarkerGame, captureMarker, "Params: markerId\nCaptures the specified marker"),
|
||||
PYTHON_END_METHODS_TABLE;
|
||||
|
||||
// Type structure definition
|
||||
PLASMA_DEFAULT_TYPE_WBASE(ptMarkerGame, pyGameCli, "Game client for the Marker game");
|
||||
|
||||
// required functions for PyObject interoperability
|
||||
PyObject* pyMarkerGame::New(pfGameCli* client)
|
||||
{
|
||||
ptMarkerGame *newObj = (ptMarkerGame*)ptMarkerGame_type.tp_new(&ptMarkerGame_type, NULL, NULL);
|
||||
if (client && (client->GetGameTypeId() == kGameTypeId_Marker))
|
||||
newObj->fThis->gameClient = client;
|
||||
return (PyObject*)newObj;
|
||||
}
|
||||
|
||||
PYTHON_CLASS_CHECK_IMPL(ptMarkerGame, pyMarkerGame)
|
||||
PYTHON_CLASS_CONVERT_FROM_IMPL(ptMarkerGame, pyMarkerGame)
|
||||
|
||||
// Module and method definitions
|
||||
void pyMarkerGame::AddPlasmaClasses(PyObject* m)
|
||||
{
|
||||
PYTHON_CLASS_IMPORT_START(m);
|
||||
PYTHON_CLASS_IMPORT(m, ptMarkerGame);
|
||||
PYTHON_CLASS_IMPORT_END(m);
|
||||
}
|
||||
|
||||
void pyMarkerGame::AddPlasmaConstantsClasses(PyObject* m)
|
||||
{
|
||||
PYTHON_ENUM_START(PtMarkerGameTypes);
|
||||
PYTHON_ENUM_ELEMENT(PtMarkerGameTypes, kMarkerGameQuest, kMarkerGameQuest);
|
||||
PYTHON_ENUM_ELEMENT(PtMarkerGameTypes, kMarkerGameCGZ, kMarkerGameCGZ);
|
||||
PYTHON_ENUM_ELEMENT(PtMarkerGameTypes, kMarkerGameCapture, kMarkerGameCapture);
|
||||
PYTHON_ENUM_ELEMENT(PtMarkerGameTypes, kMarkerGameCaptureAndHold, kMarkerGameCaptureAndHold);
|
||||
PYTHON_ENUM_END(m, PtMarkerGameTypes);
|
||||
}
|
||||
|
||||
void pyMarkerGame::AddPlasmaMethods(std::vector<PyMethodDef>& methods)
|
||||
{
|
||||
PYTHON_GLOBAL_METHOD(methods, PtIsMarkerGame);
|
||||
PYTHON_GLOBAL_METHOD_WKEY(methods, PtCreateMarkerGame);
|
||||
}
|
@ -1,408 +1,408 @@
|
||||
/*==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/>.
|
||||
|
||||
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 "pyMarkerMsg.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Base Marker msg class
|
||||
//
|
||||
|
||||
pyMarkerMsg::pyMarkerMsg(): pyGameCliMsg() {}
|
||||
|
||||
pyMarkerMsg::pyMarkerMsg(pfGameCliMsg* msg): pyGameCliMsg(msg)
|
||||
{
|
||||
if (message && (message->gameCli->GetGameTypeId() != kGameTypeId_Marker))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
int pyMarkerMsg::GetMarkerMsgType() const
|
||||
{
|
||||
if (message)
|
||||
return message->netMsg->messageId;
|
||||
return -1;
|
||||
}
|
||||
|
||||
PyObject* pyMarkerMsg::UpcastToFinalMarkerMsg() const
|
||||
{
|
||||
if (!message)
|
||||
PYTHON_RETURN_NONE;
|
||||
switch (message->netMsg->messageId)
|
||||
{
|
||||
case kSrv2Cli_Marker_TemplateCreated:
|
||||
return pyMarkerTemplateCreatedMsg::New(message);
|
||||
case kSrv2Cli_Marker_TeamAssigned:
|
||||
return pyMarkerTeamAssignedMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameType:
|
||||
return pyMarkerGameTypeMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameStarted:
|
||||
return pyMarkerGameStartedMsg::New(message);
|
||||
case kSrv2Cli_Marker_GamePaused:
|
||||
return pyMarkerGamePausedMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameReset:
|
||||
return pyMarkerGameResetMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameOver:
|
||||
return pyMarkerGameOverMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameNameChanged:
|
||||
return pyMarkerGameNameChangedMsg::New(message);
|
||||
case kSrv2Cli_Marker_TimeLimitChanged:
|
||||
return pyMarkerTimeLimitChangedMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameDeleted:
|
||||
return pyMarkerGameDeletedMsg::New(message);
|
||||
case kSrv2Cli_Marker_MarkerAdded:
|
||||
return pyMarkerMarkerAddedMsg::New(message);
|
||||
case kSrv2Cli_Marker_MarkerDeleted:
|
||||
return pyMarkerMarkerDeletedMsg::New(message);
|
||||
case kSrv2Cli_Marker_MarkerNameChanged:
|
||||
return pyMarkerMarkerNameChangedMsg::New(message);
|
||||
case kSrv2Cli_Marker_MarkerCaptured:
|
||||
return pyMarkerMarkerCapturedMsg::New(message);
|
||||
default:
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The different messages we can receive
|
||||
//
|
||||
|
||||
pyMarkerTemplateCreatedMsg::pyMarkerTemplateCreatedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerTemplateCreatedMsg::pyMarkerTemplateCreatedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_TemplateCreated))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
std::wstring pyMarkerTemplateCreatedMsg::TemplateID() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_TemplateCreated* gmMsg = (const Srv2Cli_Marker_TemplateCreated*)message->netMsg;
|
||||
return gmMsg->templateID;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerTeamAssignedMsg::pyMarkerTeamAssignedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerTeamAssignedMsg::pyMarkerTeamAssignedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_TeamAssigned))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
int pyMarkerTeamAssignedMsg::TeamNumber() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_TeamAssigned* gmMsg = (const Srv2Cli_Marker_TeamAssigned*)message->netMsg;
|
||||
return gmMsg->teamNumber;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameTypeMsg::pyMarkerGameTypeMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameTypeMsg::pyMarkerGameTypeMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameType))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
int pyMarkerGameTypeMsg::GameType() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_GameType* gmMsg = (const Srv2Cli_Marker_GameType*)message->netMsg;
|
||||
return gmMsg->gameType;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameStartedMsg::pyMarkerGameStartedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameStartedMsg::pyMarkerGameStartedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameStarted))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGamePausedMsg::pyMarkerGamePausedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGamePausedMsg::pyMarkerGamePausedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GamePaused))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
unsigned long pyMarkerGamePausedMsg::TimeLeft() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_GamePaused* gmMsg = (const Srv2Cli_Marker_GamePaused*)message->netMsg;
|
||||
return gmMsg->timeLeft;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameResetMsg::pyMarkerGameResetMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameResetMsg::pyMarkerGameResetMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameReset))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameOverMsg::pyMarkerGameOverMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameOverMsg::pyMarkerGameOverMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameOver))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameNameChangedMsg::pyMarkerGameNameChangedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameNameChangedMsg::pyMarkerGameNameChangedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameNameChanged))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
std::wstring pyMarkerGameNameChangedMsg::Name() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_GameNameChanged* gmMsg = (const Srv2Cli_Marker_GameNameChanged*)message->netMsg;
|
||||
return gmMsg->newName;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerTimeLimitChangedMsg::pyMarkerTimeLimitChangedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerTimeLimitChangedMsg::pyMarkerTimeLimitChangedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_TimeLimitChanged))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
unsigned long pyMarkerTimeLimitChangedMsg::TimeLimit() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_TimeLimitChanged* gmMsg = (const Srv2Cli_Marker_TimeLimitChanged*)message->netMsg;
|
||||
return gmMsg->newTimeLimit;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameDeletedMsg::pyMarkerGameDeletedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameDeletedMsg::pyMarkerGameDeletedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameDeleted))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
bool pyMarkerGameDeletedMsg::Failed() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_GameDeleted* gmMsg = (const Srv2Cli_Marker_GameDeleted*)message->netMsg;
|
||||
return gmMsg->failed;
|
||||
}
|
||||
return true; // assume it failed if we have a problem
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerMarkerAddedMsg::pyMarkerMarkerAddedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerMarkerAddedMsg::pyMarkerMarkerAddedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_MarkerAdded))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
double pyMarkerMarkerAddedMsg::X() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->x;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
double pyMarkerMarkerAddedMsg::Y() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->y;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
double pyMarkerMarkerAddedMsg::Z() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->z;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long pyMarkerMarkerAddedMsg::MarkerId() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->markerID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::wstring pyMarkerMarkerAddedMsg::Name() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->name;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
std::wstring pyMarkerMarkerAddedMsg::Age() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->age;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerMarkerDeletedMsg::pyMarkerMarkerDeletedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerMarkerDeletedMsg::pyMarkerMarkerDeletedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_MarkerDeleted))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
unsigned long pyMarkerMarkerDeletedMsg::MarkerId() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerDeleted* gmMsg = (const Srv2Cli_Marker_MarkerDeleted*)message->netMsg;
|
||||
return gmMsg->markerID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerMarkerNameChangedMsg::pyMarkerMarkerNameChangedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerMarkerNameChangedMsg::pyMarkerMarkerNameChangedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_MarkerNameChanged))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
unsigned long pyMarkerMarkerNameChangedMsg::MarkerId() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerNameChanged* gmMsg = (const Srv2Cli_Marker_MarkerNameChanged*)message->netMsg;
|
||||
return gmMsg->markerID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::wstring pyMarkerMarkerNameChangedMsg::Name() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerNameChanged* gmMsg = (const Srv2Cli_Marker_MarkerNameChanged*)message->netMsg;
|
||||
return gmMsg->newName;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerMarkerCapturedMsg::pyMarkerMarkerCapturedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerMarkerCapturedMsg::pyMarkerMarkerCapturedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_MarkerCaptured))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
unsigned long pyMarkerMarkerCapturedMsg::MarkerId() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerCaptured* gmMsg = (const Srv2Cli_Marker_MarkerCaptured*)message->netMsg;
|
||||
return gmMsg->markerID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int pyMarkerMarkerCapturedMsg::Team() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerCaptured* gmMsg = (const Srv2Cli_Marker_MarkerCaptured*)message->netMsg;
|
||||
return gmMsg->team;
|
||||
}
|
||||
return 0;
|
||||
/*==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/>.
|
||||
|
||||
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 "pyMarkerMsg.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Base Marker msg class
|
||||
//
|
||||
|
||||
pyMarkerMsg::pyMarkerMsg(): pyGameCliMsg() {}
|
||||
|
||||
pyMarkerMsg::pyMarkerMsg(pfGameCliMsg* msg): pyGameCliMsg(msg)
|
||||
{
|
||||
if (message && (message->gameCli->GetGameTypeId() != kGameTypeId_Marker))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
int pyMarkerMsg::GetMarkerMsgType() const
|
||||
{
|
||||
if (message)
|
||||
return message->netMsg->messageId;
|
||||
return -1;
|
||||
}
|
||||
|
||||
PyObject* pyMarkerMsg::UpcastToFinalMarkerMsg() const
|
||||
{
|
||||
if (!message)
|
||||
PYTHON_RETURN_NONE;
|
||||
switch (message->netMsg->messageId)
|
||||
{
|
||||
case kSrv2Cli_Marker_TemplateCreated:
|
||||
return pyMarkerTemplateCreatedMsg::New(message);
|
||||
case kSrv2Cli_Marker_TeamAssigned:
|
||||
return pyMarkerTeamAssignedMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameType:
|
||||
return pyMarkerGameTypeMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameStarted:
|
||||
return pyMarkerGameStartedMsg::New(message);
|
||||
case kSrv2Cli_Marker_GamePaused:
|
||||
return pyMarkerGamePausedMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameReset:
|
||||
return pyMarkerGameResetMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameOver:
|
||||
return pyMarkerGameOverMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameNameChanged:
|
||||
return pyMarkerGameNameChangedMsg::New(message);
|
||||
case kSrv2Cli_Marker_TimeLimitChanged:
|
||||
return pyMarkerTimeLimitChangedMsg::New(message);
|
||||
case kSrv2Cli_Marker_GameDeleted:
|
||||
return pyMarkerGameDeletedMsg::New(message);
|
||||
case kSrv2Cli_Marker_MarkerAdded:
|
||||
return pyMarkerMarkerAddedMsg::New(message);
|
||||
case kSrv2Cli_Marker_MarkerDeleted:
|
||||
return pyMarkerMarkerDeletedMsg::New(message);
|
||||
case kSrv2Cli_Marker_MarkerNameChanged:
|
||||
return pyMarkerMarkerNameChangedMsg::New(message);
|
||||
case kSrv2Cli_Marker_MarkerCaptured:
|
||||
return pyMarkerMarkerCapturedMsg::New(message);
|
||||
default:
|
||||
PYTHON_RETURN_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The different messages we can receive
|
||||
//
|
||||
|
||||
pyMarkerTemplateCreatedMsg::pyMarkerTemplateCreatedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerTemplateCreatedMsg::pyMarkerTemplateCreatedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_TemplateCreated))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
std::wstring pyMarkerTemplateCreatedMsg::TemplateID() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_TemplateCreated* gmMsg = (const Srv2Cli_Marker_TemplateCreated*)message->netMsg;
|
||||
return gmMsg->templateID;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerTeamAssignedMsg::pyMarkerTeamAssignedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerTeamAssignedMsg::pyMarkerTeamAssignedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_TeamAssigned))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
int pyMarkerTeamAssignedMsg::TeamNumber() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_TeamAssigned* gmMsg = (const Srv2Cli_Marker_TeamAssigned*)message->netMsg;
|
||||
return gmMsg->teamNumber;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameTypeMsg::pyMarkerGameTypeMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameTypeMsg::pyMarkerGameTypeMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameType))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
int pyMarkerGameTypeMsg::GameType() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_GameType* gmMsg = (const Srv2Cli_Marker_GameType*)message->netMsg;
|
||||
return gmMsg->gameType;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameStartedMsg::pyMarkerGameStartedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameStartedMsg::pyMarkerGameStartedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameStarted))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGamePausedMsg::pyMarkerGamePausedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGamePausedMsg::pyMarkerGamePausedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GamePaused))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
unsigned long pyMarkerGamePausedMsg::TimeLeft() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_GamePaused* gmMsg = (const Srv2Cli_Marker_GamePaused*)message->netMsg;
|
||||
return gmMsg->timeLeft;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameResetMsg::pyMarkerGameResetMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameResetMsg::pyMarkerGameResetMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameReset))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameOverMsg::pyMarkerGameOverMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameOverMsg::pyMarkerGameOverMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameOver))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameNameChangedMsg::pyMarkerGameNameChangedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameNameChangedMsg::pyMarkerGameNameChangedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameNameChanged))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
std::wstring pyMarkerGameNameChangedMsg::Name() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_GameNameChanged* gmMsg = (const Srv2Cli_Marker_GameNameChanged*)message->netMsg;
|
||||
return gmMsg->newName;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerTimeLimitChangedMsg::pyMarkerTimeLimitChangedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerTimeLimitChangedMsg::pyMarkerTimeLimitChangedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_TimeLimitChanged))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
unsigned long pyMarkerTimeLimitChangedMsg::TimeLimit() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_TimeLimitChanged* gmMsg = (const Srv2Cli_Marker_TimeLimitChanged*)message->netMsg;
|
||||
return gmMsg->newTimeLimit;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerGameDeletedMsg::pyMarkerGameDeletedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerGameDeletedMsg::pyMarkerGameDeletedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_GameDeleted))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
bool pyMarkerGameDeletedMsg::Failed() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_GameDeleted* gmMsg = (const Srv2Cli_Marker_GameDeleted*)message->netMsg;
|
||||
return gmMsg->failed;
|
||||
}
|
||||
return true; // assume it failed if we have a problem
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerMarkerAddedMsg::pyMarkerMarkerAddedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerMarkerAddedMsg::pyMarkerMarkerAddedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_MarkerAdded))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
double pyMarkerMarkerAddedMsg::X() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->x;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
double pyMarkerMarkerAddedMsg::Y() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->y;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
double pyMarkerMarkerAddedMsg::Z() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->z;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long pyMarkerMarkerAddedMsg::MarkerId() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->markerID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::wstring pyMarkerMarkerAddedMsg::Name() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->name;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
std::wstring pyMarkerMarkerAddedMsg::Age() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerAdded* gmMsg = (const Srv2Cli_Marker_MarkerAdded*)message->netMsg;
|
||||
return gmMsg->age;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerMarkerDeletedMsg::pyMarkerMarkerDeletedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerMarkerDeletedMsg::pyMarkerMarkerDeletedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_MarkerDeleted))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
unsigned long pyMarkerMarkerDeletedMsg::MarkerId() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerDeleted* gmMsg = (const Srv2Cli_Marker_MarkerDeleted*)message->netMsg;
|
||||
return gmMsg->markerID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerMarkerNameChangedMsg::pyMarkerMarkerNameChangedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerMarkerNameChangedMsg::pyMarkerMarkerNameChangedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_MarkerNameChanged))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
unsigned long pyMarkerMarkerNameChangedMsg::MarkerId() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerNameChanged* gmMsg = (const Srv2Cli_Marker_MarkerNameChanged*)message->netMsg;
|
||||
return gmMsg->markerID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::wstring pyMarkerMarkerNameChangedMsg::Name() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerNameChanged* gmMsg = (const Srv2Cli_Marker_MarkerNameChanged*)message->netMsg;
|
||||
return gmMsg->newName;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pyMarkerMarkerCapturedMsg::pyMarkerMarkerCapturedMsg(): pyMarkerMsg() {}
|
||||
|
||||
pyMarkerMarkerCapturedMsg::pyMarkerMarkerCapturedMsg(pfGameCliMsg* msg): pyMarkerMsg(msg)
|
||||
{
|
||||
if (message && (message->netMsg->messageId != kSrv2Cli_Marker_MarkerCaptured))
|
||||
message = nil; // wrong type, just clear it out
|
||||
}
|
||||
|
||||
unsigned long pyMarkerMarkerCapturedMsg::MarkerId() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerCaptured* gmMsg = (const Srv2Cli_Marker_MarkerCaptured*)message->netMsg;
|
||||
return gmMsg->markerID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int pyMarkerMarkerCapturedMsg::Team() const
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
const Srv2Cli_Marker_MarkerCaptured* gmMsg = (const Srv2Cli_Marker_MarkerCaptured*)message->netMsg;
|
||||
return gmMsg->team;
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,331 +1,331 @@
|
||||
/*==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/>.
|
||||
|
||||
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 pyMarkerMsg_h
|
||||
#define pyMarkerMsg_h
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// NAME: pyMarkerMsg
|
||||
//
|
||||
// PURPOSE: Class wrapper for Marker game messages
|
||||
//
|
||||
|
||||
#include "pfGameMgr/pfGameMgr.h"
|
||||
|
||||
#include <python.h>
|
||||
#include "../../pyGlueHelpers.h"
|
||||
#include "../pyGameCliMsg.h"
|
||||
|
||||
class pyMarkerMsg : public pyGameCliMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerMsg();
|
||||
pyMarkerMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_EXPOSE_TYPE; // so we can subclass
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerMsg); // converts a PyObject to a pyMarkerMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
static void AddPlasmaConstantsClasses(PyObject* m);
|
||||
|
||||
int GetMarkerMsgType() const;
|
||||
|
||||
PyObject* UpcastToFinalMarkerMsg() const; // returns this message as the marker message it really is
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerTemplateCreatedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerTemplateCreatedMsg();
|
||||
pyMarkerTemplateCreatedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerTemplateCreatedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerTemplateCreatedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerTemplateCreatedMsg); // converts a PyObject to a pyMarkerTemplateCreatedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
std::wstring TemplateID() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerTeamAssignedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerTeamAssignedMsg();
|
||||
pyMarkerTeamAssignedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerTeamAssignedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerTeamAssignedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerTeamAssignedMsg); // converts a PyObject to a pyMarkerTeamAssignedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
int TeamNumber() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameTypeMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameTypeMsg();
|
||||
pyMarkerGameTypeMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameTypeMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameTypeMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameTypeMsg); // converts a PyObject to a pyMarkerGameTypeMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
int GameType() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameStartedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameStartedMsg();
|
||||
pyMarkerGameStartedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameStartedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameStartedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameStartedMsg); // converts a PyObject to a pyMarkerGameStartedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGamePausedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGamePausedMsg();
|
||||
pyMarkerGamePausedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGamePausedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGamePausedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGamePausedMsg); // converts a PyObject to a pyMarkerGamePausedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
unsigned long TimeLeft() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameResetMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameResetMsg();
|
||||
pyMarkerGameResetMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameResetMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameResetMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameResetMsg); // converts a PyObject to a pyMarkerGameResetMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameOverMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameOverMsg();
|
||||
pyMarkerGameOverMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameOverMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameOverMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameOverMsg); // converts a PyObject to a pyMarkerGameOverMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameNameChangedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameNameChangedMsg();
|
||||
pyMarkerGameNameChangedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameNameChangedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameNameChangedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameNameChangedMsg); // converts a PyObject to a pyMarkerGameNameChangedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
std::wstring Name() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerTimeLimitChangedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerTimeLimitChangedMsg();
|
||||
pyMarkerTimeLimitChangedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerTimeLimitChangedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerTimeLimitChangedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerTimeLimitChangedMsg); // converts a PyObject to a pyMarkerTimeLimitChangedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
unsigned long TimeLimit() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameDeletedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameDeletedMsg();
|
||||
pyMarkerGameDeletedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameDeletedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameDeletedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameDeletedMsg); // converts a PyObject to a pyMarkerGameDeletedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
bool Failed() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerMarkerAddedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerMarkerAddedMsg();
|
||||
pyMarkerMarkerAddedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerMarkerAddedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerMarkerAddedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerMarkerAddedMsg); // converts a PyObject to a pyMarkerMarkerAddedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
double X() const;
|
||||
double Y() const;
|
||||
double Z() const;
|
||||
unsigned long MarkerId() const;
|
||||
std::wstring Name() const;
|
||||
std::wstring Age() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerMarkerDeletedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerMarkerDeletedMsg();
|
||||
pyMarkerMarkerDeletedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerMarkerDeletedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerMarkerDeletedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerMarkerDeletedMsg); // converts a PyObject to a pyMarkerMarkerDeletedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
unsigned long MarkerId() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerMarkerNameChangedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerMarkerNameChangedMsg();
|
||||
pyMarkerMarkerNameChangedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerMarkerNameChangedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerMarkerNameChangedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerMarkerNameChangedMsg); // converts a PyObject to a pyMarkerMarkerNameChangedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
unsigned long MarkerId() const;
|
||||
std::wstring Name() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerMarkerCapturedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerMarkerCapturedMsg();
|
||||
pyMarkerMarkerCapturedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerMarkerCapturedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerMarkerCapturedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerMarkerCapturedMsg); // converts a PyObject to a pyMarkerMarkerCapturedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
unsigned long MarkerId() const;
|
||||
unsigned int Team() const;
|
||||
};
|
||||
|
||||
#endif // pyMarkerMsg_h
|
||||
/*==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/>.
|
||||
|
||||
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 pyMarkerMsg_h
|
||||
#define pyMarkerMsg_h
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// NAME: pyMarkerMsg
|
||||
//
|
||||
// PURPOSE: Class wrapper for Marker game messages
|
||||
//
|
||||
|
||||
#include "pfGameMgr/pfGameMgr.h"
|
||||
|
||||
#include <python.h>
|
||||
#include "../../pyGlueHelpers.h"
|
||||
#include "../pyGameCliMsg.h"
|
||||
|
||||
class pyMarkerMsg : public pyGameCliMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerMsg();
|
||||
pyMarkerMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_EXPOSE_TYPE; // so we can subclass
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerMsg); // converts a PyObject to a pyMarkerMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
static void AddPlasmaConstantsClasses(PyObject* m);
|
||||
|
||||
int GetMarkerMsgType() const;
|
||||
|
||||
PyObject* UpcastToFinalMarkerMsg() const; // returns this message as the marker message it really is
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerTemplateCreatedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerTemplateCreatedMsg();
|
||||
pyMarkerTemplateCreatedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerTemplateCreatedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerTemplateCreatedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerTemplateCreatedMsg); // converts a PyObject to a pyMarkerTemplateCreatedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
std::wstring TemplateID() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerTeamAssignedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerTeamAssignedMsg();
|
||||
pyMarkerTeamAssignedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerTeamAssignedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerTeamAssignedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerTeamAssignedMsg); // converts a PyObject to a pyMarkerTeamAssignedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
int TeamNumber() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameTypeMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameTypeMsg();
|
||||
pyMarkerGameTypeMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameTypeMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameTypeMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameTypeMsg); // converts a PyObject to a pyMarkerGameTypeMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
int GameType() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameStartedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameStartedMsg();
|
||||
pyMarkerGameStartedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameStartedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameStartedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameStartedMsg); // converts a PyObject to a pyMarkerGameStartedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGamePausedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGamePausedMsg();
|
||||
pyMarkerGamePausedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGamePausedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGamePausedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGamePausedMsg); // converts a PyObject to a pyMarkerGamePausedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
unsigned long TimeLeft() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameResetMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameResetMsg();
|
||||
pyMarkerGameResetMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameResetMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameResetMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameResetMsg); // converts a PyObject to a pyMarkerGameResetMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameOverMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameOverMsg();
|
||||
pyMarkerGameOverMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameOverMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameOverMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameOverMsg); // converts a PyObject to a pyMarkerGameOverMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameNameChangedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameNameChangedMsg();
|
||||
pyMarkerGameNameChangedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameNameChangedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameNameChangedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameNameChangedMsg); // converts a PyObject to a pyMarkerGameNameChangedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
std::wstring Name() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerTimeLimitChangedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerTimeLimitChangedMsg();
|
||||
pyMarkerTimeLimitChangedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerTimeLimitChangedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerTimeLimitChangedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerTimeLimitChangedMsg); // converts a PyObject to a pyMarkerTimeLimitChangedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
unsigned long TimeLimit() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerGameDeletedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerGameDeletedMsg();
|
||||
pyMarkerGameDeletedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerGameDeletedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerGameDeletedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerGameDeletedMsg); // converts a PyObject to a pyMarkerGameDeletedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
bool Failed() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerMarkerAddedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerMarkerAddedMsg();
|
||||
pyMarkerMarkerAddedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerMarkerAddedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerMarkerAddedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerMarkerAddedMsg); // converts a PyObject to a pyMarkerMarkerAddedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
double X() const;
|
||||
double Y() const;
|
||||
double Z() const;
|
||||
unsigned long MarkerId() const;
|
||||
std::wstring Name() const;
|
||||
std::wstring Age() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerMarkerDeletedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerMarkerDeletedMsg();
|
||||
pyMarkerMarkerDeletedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerMarkerDeletedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerMarkerDeletedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerMarkerDeletedMsg); // converts a PyObject to a pyMarkerMarkerDeletedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
unsigned long MarkerId() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerMarkerNameChangedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerMarkerNameChangedMsg();
|
||||
pyMarkerMarkerNameChangedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerMarkerNameChangedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerMarkerNameChangedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerMarkerNameChangedMsg); // converts a PyObject to a pyMarkerMarkerNameChangedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
unsigned long MarkerId() const;
|
||||
std::wstring Name() const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class pyMarkerMarkerCapturedMsg : public pyMarkerMsg
|
||||
{
|
||||
protected:
|
||||
pyMarkerMarkerCapturedMsg();
|
||||
pyMarkerMarkerCapturedMsg(pfGameCliMsg* msg);
|
||||
|
||||
public:
|
||||
// required functions for PyObject interoperability
|
||||
PYTHON_CLASS_NEW_FRIEND(ptMarkerMarkerCapturedMsg);
|
||||
static PyObject* New(pfGameCliMsg* msg);
|
||||
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyMarkerMarkerCapturedMsg object
|
||||
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyMarkerMarkerCapturedMsg); // converts a PyObject to a pyMarkerMarkerCapturedMsg (throws error if not correct type)
|
||||
|
||||
static void AddPlasmaClasses(PyObject* m);
|
||||
|
||||
unsigned long MarkerId() const;
|
||||
unsigned int Team() const;
|
||||
};
|
||||
|
||||
#endif // pyMarkerMsg_h
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user