#include <pbem-server-interaction.h>
Inheritance diagram for ASC_PBEM:

Public Member Functions | |
| ASC_PBEM (ASCString serverBase) | |
| default constructor: | |
| ~ASC_PBEM () | |
| bool | isUsable () |
| important: check this first after instantiation this class will be false after any | |
| bool | login (ASCString user, ASCString passwd) |
| |
| bool | createAccount (ASCString user, ASCString passwd, ASCString email) |
| |
| bool | activateAccount (ASCString user, ASCString code) |
| |
| bool | uploadFile (ASCString fileName, const char *data, const int size, const int gameID) |
| |
| std::vector< TUserData > | getUserList (bool activeOnly=true) |
| |
| bool | createGame (ASCString fileName, const char *data, const int size, ASCString gameName, ASCString fileNamePattern, char *roles, int *players, int projectID=-1, int turn=1, int currentSlot=1) |
| |
| std::vector< TGameInfo > | getCurrentGamesInfo (bool myTurnOnly) |
| |
| TFileData * | downloadGame (TGameInfo game) |
| |
| bool | logout () |
| |
| bool | isLoggedIn () |
| ASCString | getHeader () |
| ASCString | getBody () |
| int | getStatusCode () |
| std::vector< ASCString > | listPlayers () |
Static Public Attributes | |
| static const char | ROLE_SUPERVISOR = 's' |
| static const char | ROLE_PLAYER = 'p' |
| static const char | ROLE_HIDDEN = 'h' |
Definition at line 104 of file pbem-server-interaction.h.
| ASC_PBEM::ASC_PBEM | ( | ASCString | serverBase | ) |
default constructor:
| serverBase,: | default url syntax, example: http://localhost:8080/ascServer/ note: currently, the trailing slash is _required_ ??? todo: fix that ;) |
Definition at line 150 of file pbem-server-interaction.cpp.
| ASC_PBEM::~ASC_PBEM | ( | ) |
Definition at line 180 of file pbem-server-interaction.cpp.
| bool ASC_PBEM::isUsable | ( | ) |
important: check this first after instantiation this class will be false after any
Definition at line 185 of file pbem-server-interaction.cpp.
Referenced by nmain().
Definition at line 381 of file pbem-server-interaction.cpp.
Referenced by PBEMServer::getSession(), and nmain().
Definition at line 398 of file pbem-server-interaction.cpp.
Definition at line 417 of file pbem-server-interaction.cpp.
| bool ASC_PBEM::uploadFile | ( | ASCString | fileName, | |
| const char * | data, | |||
| const int | size, | |||
| const int | gameID | |||
| ) |
Definition at line 432 of file pbem-server-interaction.cpp.
References ASC_PBEM_FileUploadControl::boundary, ASC_PBEM_FileUploadControl::fileName, ASC_PBEM_FileUploadControl::parameters, ASC_PBEM_FileUploadControl::sent_step, and ASC_PBEM_FileUploadControl::step.
| std::vector< TUserData > ASC_PBEM::getUserList | ( | bool | activeOnly = true |
) |
| activeOnly | if true, only return data about active (activated) players |
Definition at line 555 of file pbem-server-interaction.cpp.
References getBody(), and line().
Referenced by listPlayers().
| bool ASC_PBEM::createGame | ( | ASCString | fileName, | |
| const char * | data, | |||
| const int | size, | |||
| ASCString | gameName, | |||
| ASCString | fileNamePattern, | |||
| char * | roles, | |||
| int * | players, | |||
| int | projectID = -1, |
|||
| int | turn = 1, |
|||
| int | currentSlot = 1 | |||
| ) |
Definition at line 455 of file pbem-server-interaction.cpp.
References ASC_PBEM_FileUploadControl::boundary, ASC_PBEM_FileUploadControl::fileName, ASC_PBEM_FileUploadControl::parameters, ASC_PBEM_FileUploadControl::sent_step, and ASC_PBEM_FileUploadControl::step.
| std::vector< TGameInfo > ASC_PBEM::getCurrentGamesInfo | ( | bool | myTurnOnly | ) |
| myTurnOnly | if true, only return info about games where it's the turn of the currenty logged in player |
Definition at line 511 of file pbem-server-interaction.cpp.
References getBody(), and line().
Referenced by nmain().
Definition at line 610 of file pbem-server-interaction.cpp.
References ASC_PBEM_writeBuffer(), TGameInfo::currentSaveGameName, TFileData::fileData, TFileData::fileName, TFileData::fileSize, TGameInfo::gameID, and getBody().
| bool ASC_PBEM::logout | ( | ) |
Definition at line 367 of file pbem-server-interaction.cpp.
Referenced by nmain().
| bool ASC_PBEM::isLoggedIn | ( | ) |
Definition at line 190 of file pbem-server-interaction.cpp.
| ASCString ASC_PBEM::getHeader | ( | ) |
| ASCString ASC_PBEM::getBody | ( | ) |
Definition at line 697 of file pbem-server-interaction.cpp.
Referenced by downloadGame(), getCurrentGamesInfo(), getUserList(), and nmain().
| int ASC_PBEM::getStatusCode | ( | ) |
| std::vector< ASCString > ASC_PBEM::listPlayers | ( | ) |
Reimplemented from ServerInterface.
Definition at line 597 of file pbem-server-interaction.cpp.
References getUserList().
const char ASC_PBEM::ROLE_SUPERVISOR = 's' [static] |
Definition at line 130 of file pbem-server-interaction.h.
const char ASC_PBEM::ROLE_PLAYER = 'p' [static] |
Definition at line 131 of file pbem-server-interaction.h.
const char ASC_PBEM::ROLE_HIDDEN = 'h' [static] |
Definition at line 132 of file pbem-server-interaction.h.
1.5.1