Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VsnetDownload Namespace Reference

Namespaces

 Adapter
 
 Client
 
 Server
 

Classes

class  RecvCmdDownload
 

Enumerations

enum  Subcommand {
  ResolveRequest, ResolveResponse, DownloadRequest, DownloadError,
  Download, DownloadFirstFragment, DownloadFragment, DownloadLastFragment,
  UnexpectedSubcommand
}
 

Functions

std::ostream & operator<< (std::ostream &ostr, Subcommand e)
 

Enumeration Type Documentation

Enumerator
ResolveRequest 
ResolveResponse 
DownloadRequest 
DownloadError 
Download 
DownloadFirstFragment 
DownloadFragment 
DownloadLastFragment 
UnexpectedSubcommand 

Definition at line 16 of file vsnet_dloadenum.h.

Function Documentation

std::ostream & VsnetDownload::operator<< ( std::ostream &  ostr,
Subcommand  e 
)

Protocol:

resolve request CMD_DOWNLOAD, object serial 0, COMPRESS|SENDRELIABLE|LOPRI char : subcommand ResolveRequest int16 : number of entries ( char, : list of filetype int16 stringlen, char* )*: and filenames

resolve response CMD_DOWNLOAD, object serial 0, COMPRESS|SENDRELIABLE|LOPRI char : subcommand ResolveResponse int16 : number of entries ( int16 stringlen, char* : name char )* : ok(1), not ok(0)

download request CMD_DOWNLOAD, object serial 0, COMPRESS|SENDRELIABLE|LOPRI char : subcommand DownloadRequest int16 : number of entries ( int16 stringlen, char* )*: list of filenames

download error CMD_DOWNLOAD, object serial 0, COMPRESS|SENDRELIABLE|LOPRI char : subcommand DownloadError ( int16 stringlen, char* ) : failed filename

download entire file in one packet CMD_DOWNLOAD, object serial 0, COMPRESS|SENDRELIABLE|LOPRI char : subcommand Download ( int16 stringlen, char* ) : filename int16 : payload length char* : payload

download first fragment of a file CMD_DOWNLOAD, object serial 0, COMPRESS|SENDRELIABLE|LOPRI char : subcommand DownloadFirstFragment ( int16 stringlen, char* ) : filename int32 : file length int16 : payload length char* : payload

download a middle fragment of a file CMD_DOWNLOAD, object serial 0, COMPRESS|SENDRELIABLE|LOPRI char : subcommand DownloadFragment int16 : payload length char* : payload

download last fragment of a file CMD_DOWNLOAD, object serial 0, COMPRESS|SENDRELIABLE|LOPRI char : subcommand DownloadLastFragment int16 : payload length char* : payload

Definition at line 72 of file vsnet_dloadenum.cpp.

References Download, DownloadError, DownloadFirstFragment, DownloadFragment, DownloadLastFragment, DownloadRequest, ResolveRequest, ResolveResponse, and UnexpectedSubcommand.

73 {
74  switch (e)
75  {
76  case ResolveRequest:
77  ostr<<"ResolveRequest";
78  break;
79  case ResolveResponse:
80  ostr<<"ResolveResponse";
81  break;
82  case DownloadRequest:
83  ostr<<"DownloadRequest";
84  break;
85  case DownloadError:
86  ostr<<"DownloadError";
87  break;
88  case Download:
89  ostr<<"Download";
90  break;
92  ostr<<"DownloadFirstFragment";
93  break;
94  case DownloadFragment:
95  ostr<<"DownloadFragment";
96  break;
98  ostr<<"DownloadLastFragment";
99  break;
101  ostr<<"UnexpectedSubcommand";
102  break;
103  default:
104  ostr<<"missing case";
105  break;
106  }
107  return ostr;
108 }