Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

pbem-server-interaction.cpp File Reference

#include "pbem-server-interaction.h"

Include dependency graph for pbem-server-interaction.cpp:

Go to the source code of this file.

Functions

size_t ASC_PBEM_writeInternal (void *inboundData, size_t size, size_t nmemb, void *vector)
 file: ASC_PBEM.cpp author: Jade Rogalski license: GPL warranty: none
int ASC_PBEM_writeBuffer (char *buffer, const char *source, int startPos, int bufferSize, int sourceSize)
size_t ASC_PBEM_readInternal (char *outboundBuffer, size_t size, size_t nitems, void *infoStruct)
int nmain (int argc, char *argv[])


Function Documentation

size_t ASC_PBEM_readInternal char *  outboundBuffer,
size_t  size,
size_t  nitems,
void *  infoStruct
 

Definition at line 47 of file pbem-server-interaction.cpp.

References ASC_PBEM_writeBuffer(), ASC_PBEM_FileUploadControl::boundary, ASC_PBEM_FileUploadControl::data, ASC_PBEM_FileUploadControl::fileName, ASC_PBEM_FileUploadControl::parameters, ASC_PBEM_FileUploadControl::sent_step, ASC_PBEM_FileUploadControl::size, and ASC_PBEM_FileUploadControl::step.

int ASC_PBEM_writeBuffer char *  buffer,
const char *  source,
int  startPos,
int  bufferSize,
int  sourceSize
 

Definition at line 35 of file pbem-server-interaction.cpp.

Referenced by ASC_PBEM_readInternal(), and ASC_PBEM::downloadGame().

size_t ASC_PBEM_writeInternal void *  inboundData,
size_t  size,
size_t  nmemb,
void *  vector
 

file: ASC_PBEM.cpp author: Jade Rogalski license: GPL warranty: none

interface between the game asc by Marting Bickel, and the asc pbem server by Jade Rogalski

Definition at line 20 of file pbem-server-interaction.cpp.

int nmain int  argc,
char *  argv[]
 

account erstellen

ASC_PBEM asc_pbem( "http://localhost:8080/ascServer/" ); if( asc_pbem.isUsable() && asc_pbem.createAccount( "user", "password", "a@b.c" ) ) { std::cout << "account erstellt, mail unterwegs\n"; }else { std::cout << "account erstellung fehlgeschlagen\n"; }

account aktivieren

ASC_PBEM asc_pbem( "http://localhost:8080/ascServer/" ); if( asc_pbem.isUsable() && asc_pbem.activateAccount( "user", "code" ) ) { std::cout << "account aktiviert, erwarte freischaltung\n"; }else { std::cout << "account aktivierung fehlgeschlagen\n"; }

upload eines spielstandes;

char* daten = "miau"; int size = strlen( "miau" ) * sizeof( char ); ASCString fileName = "duell-A-1.ascpbm"; int gameID = 1;

ASC_PBEM asc_pbem( "http://localhost:8080/ascServer/" ); if( asc_pbem.isUsable() && asc_pbem.login( "user", "pw" ) ) { if( asc_pbem.uploadFile( fileName, daten, size, gameID ) ) std::cout << "account aktiviert, erwarte freischaltung\n"; }else { std::cout << "account aktivierung fehlgeschlagen\n"; }

download eines spielstandes

ASC_PBEM asc_pbem( "http://localhost:8080/ascServer/" ); if( asc_pbem.isUsable() ) { std::vector<TGameInfo> allGames = asc_pbem.getCurrentGamesInfo( true ); TFileData *download = asc_pbem.downloadGame( allGames[ 0 ] );

if( download == NULL ) { std::cout << "download failed" << std::endl; }else { std::cout << "download worked:" << std::endl; delete download; } }

Definition at line 710 of file pbem-server-interaction.cpp.

References TGameInfo::currentPlayerName, TGameInfo::currentSaveGameName, TGameInfo::currentSlot, TGameInfo::gameID, ASC_PBEM::getBody(), ASC_PBEM::getCurrentGamesInfo(), ASC_PBEM::getHeader(), ASC_PBEM::getStatusCode(), ASC_PBEM::isUsable(), TGameInfo::lastActive, ASC_PBEM::login(), ASC_PBEM::logout(), TGameInfo::name, TGameInfo::projectID, and TGameInfo::turn.


Generated on Tue Jun 24 01:56:38 2008 for Advanced Strategic Command by  doxygen 1.4.2