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
AccountServer Class Reference

#include <acctserver.h>

Public Member Functions

 AccountServer ()
 
 ~AccountServer ()
 
void startMsg ()
 
void start ()
 
void save ()
 
void recvMsg (SOCKETALT sock)
 
void sendAuthorized (SOCKETALT sock, Account *acct)
 
void sendUnauthorized (SOCKETALT sock, Account *acct)
 
void sendAlreadyConnected (SOCKETALT sock, Account *acct)
 
void sendServerData (SOCKETALT sock, Account *acct)
 
void writeSave (const char *buffer, unsigned int bufferlen)
 
void removeDeadSockets ()
 

Detailed Description

Class that manages player accounts

  • Receives authentication request packets
  • Returns a packet with LOGIN_ACCEPT or LOGIN_ERROR and with player name This class should also :
  • manage accounts info (ships descriptions...)
  • handle future web subscriptions

Definition at line 26 of file acctserver.h.

Constructor & Destructor Documentation

AccountServer::AccountServer ( )

Definition at line 23 of file acctserver.cpp.

References getNewTime(), POSH_GetArchString(), serial_seed, and UpdateTime().

23  :
24  _sock_set( true )
25 {
26  cout<<endl<<POSH_GetArchString()<<endl;
27  cout<<"AccountServer init"<<endl;
28  //Network = new TCPNetUI;
29  newaccounts = 0;
30  UpdateTime();
31  srand( (int) getNewTime() );
32  serial_seed = (ObjSerial) ( rand()*( 500./( ( (double) (RAND_MAX) )+1 ) ) );
33 }
AccountServer::~AccountServer ( )

Definition at line 41 of file acctserver.cpp.

42 {
43  delete Network;
44 }

Member Function Documentation

void AccountServer::recvMsg ( SOCKETALT  sock)

Definition at line 135 of file acctserver.cpp.

References VSFileSystem::AccountFile, addAcct(), VSFileSystem::VSFile::Close(), CMD_LOGIN, CMD_LOGOUT, CMD_NEWSUBSCRIBE, CMD_RESYNCACCOUNTS, CMD_SAVEACCOUNTS, Account::compareName(), COUT, f, getAcctNoReload(), getAcctTemplate(), Packet::getCommand(), Packet::getData(), Packet::getDataLength(), Packet::getSerial(), i, Account::isConnected(), j, LOGIN_DATA, LOGIN_ERROR, MAXBUFFER, VSFileSystem::Ok, VSFileSystem::VSFile::OpenCreateWrite(), VSFileSystem::VSFile::OpenReadOnly(), Account::passwd, VSFileSystem::VSFile::ReadLine(), SOCKETALT::recvbuf(), Account::retryConnectedCount(), Packet::send(), sendAlreadyConnected(), sendAuthorized(), SENDRELIABLE, sendServerData(), sendUnauthorized(), Account::setConnected(), strtoupper(), VSExit(), VSFileSystem::VSFile::WriteLine(), and writeSave().

Referenced by start().

136 {
137  string callsign, passwd;
138  int recvcount = 0;
139  unsigned char cmd;
140  Account *elem = NULL;
141  int found = 0, connected = 0;
142 
143  //Receive data from sock
144  Packet p;
145  AddressIP ipadr;
146  if ( ( recvcount = sock.recvbuf( &p, &ipadr ) ) > 0 ) {
147  cout<<"Socket : "<<endl<<sock<<endl;
148  packet = p;
149  NetBuffer netbuf( packet.getData(), packet.getDataLength() );
150  //Check the command of the packet
151  cmd = packet.getCommand();
152  cout<<"Buffer => "<<p.getData()<<endl;
153  VI j;
154  switch (cmd)
155  {
156  case LOGIN_DATA:
157  //We receive a request from a client that wants to know to which game server he has to connect to
158  callsign = netbuf.getString();
159  passwd = netbuf.getString();
160  cout<<">>> SERVER REQUEST =( "<<callsign<<":"<<passwd<<" )= --------------------------------------"<<endl;
161  elem = getAcctTemplate( callsign );
162  if (elem)
163  if (elem->passwd != passwd)
164  elem = NULL;
165  if (!elem) {
166  COUT<<"Login/passwd not found"<<endl;
167  Account elt( callsign, passwd );
168  this->sendUnauthorized( sock, &elt );
169  } else {
170  if (elem->isConnected() && elem->retryConnectedCount() < 6) {
171  COUT<<"Login already connected !"<<endl;
172  //elem->incConnected();//right now causes fatal clientside error
173  this->sendAlreadyConnected( sock, elem );
174  } else {
175  COUT<<"Login accepted send server ip !"<<endl;
176  //Send a packet with server IP Address
177  this->sendServerData( sock, elem );
178  //elem->setConnected( true);
179  }
180  }
181  break;
182  case CMD_LOGIN:
183  {
184  char flags = netbuf.getChar();
185  callsign = netbuf.getString();
186  passwd = netbuf.getString();
187  cout<<">>> LOGIN REQUEST =( "<<callsign<<":"<<passwd<<" )= --------------------------------------"<<endl;
188  elem = getAcctTemplate( strtoupper( callsign ) );
189  if (elem)
190  if (elem->passwd != passwd)
191  elem = NULL;
192  if (!elem) {
193  Account elt( callsign, passwd );
194  this->sendUnauthorized( sock, &elt );
195  } else {
196  if (elem->isConnected() && elem->retryConnectedCount() < 6) {
197  cout<<"Client already connected"<<endl;
198  //elem->incConnected();//right now causes fatal clientside error
199  this->sendUnauthorized( sock, elem );
200  } else {
201  cout<<"Login accepted !"<<endl;
202  this->sendAuthorized( sock, elem );
203  elem->setConnected( true );
204  }
205  }
206  cout<<"<<< LOGIN REQUEST ------------------------------------------"<<endl;
207  break;
208  }
209  case CMD_LOGOUT:
210  callsign = netbuf.getString();
211  passwd = netbuf.getString();
212  cout<<">>> LOGOUT REQUEST =( "<<callsign<<":"<<passwd<<" )= --------------------------------------"<<endl;
213  //Receive logout request containing name of player
214 
215  elem = getAcctTemplate( callsign );
216  if (elem)
217  if (elem->passwd != passwd)
218  elem = NULL;
219  if ( elem && elem->isConnected() )
220  connected = 1;
221  else
222  connected = 0;
223  if (!elem) {
224  cout<<"ERROR LOGOUT -> didn't find player to disconnect = <"<<callsign<<">:<"<<passwd<<">"<<endl;
225  } else {
226  if (connected) {
227  elem->setConnected( false );
228  cout<<"-= "<<callsign<<" =- Disconnected"<<endl;
229  } else {
230  cout<<"ERROR LOGOUT -> player exists but wasn't connected ?!?!"<<endl;
231  }
232  }
233  cout<<"<<< LOGOUT REQUEST ---------------------------------------"<<endl;
234  break;
235  case CMD_NEWSUBSCRIBE:
236  {
237  cout<<">>> SUBSRIBE REQUEST =( "<<callsign<<" )= --------------------------------------"<<endl;
238 
239  //Should receive a new subscription
240  callsign = netbuf.getString();
241  passwd = netbuf.getString();
242  //Loop through accounts to see if the required callsign already exists
243  bool found = false;
244  Packet packet2;
245  if ( 1 || getAcctNoReload( callsign ) ) {
246  found = true;
247  if (packet2.send( LOGIN_ERROR, packet.getSerial(), (char*) NULL, 0, SENDRELIABLE, NULL, sock, __FILE__,
248  __LINE__ ) < 0) {
249  cout<<"ERROR sending authorization"<<endl;
250  exit( 1 );
251  }
252  }
253  if (!found) {
254  //Add the account at the end of accounts.xml
255  VSFile f;
256  VSError err = f.OpenReadOnly( "accounts.xml", AccountFile );
257  if (err > Ok) {
258  cout<<"ERROR opening accounts file";
259  if (packet2.send( (Cmd) 0, packet.getSerial(), (char*) NULL, 0, SENDRELIABLE, NULL, sock, __FILE__,
260  __LINE__ ) < 0)
261  cout<<"ERROR sending errormsg to subscription website"<<endl;
262  VSExit( 1 );
263  } else {
264  cout<<"Account file opened"<<endl;
265  char *fbuf = new char[MAXBUFFER+1];
266  fbuf[MAXBUFFER] = '\0';
267  vector< string >acctlines;
268  //Read a line per account and one line for the "<ACCOUNTS>" tag
269  while (f.ReadLine( fbuf, MAXBUFFER ) == Ok) {
270  acctlines.push_back( fbuf );
271  cout<<"Read line : "<<fbuf<<endl;
272  }
273  f.Close();
274  err = f.OpenCreateWrite( "accounts.xml", AccountFile );
275  if (err > Ok) {
276  cerr<<"!!! ERROR : opening account file in write mode !!!"<<endl;
277  VSExit( 1 );
278  }
279  acctlines.push_back( "\t<PLAYER name=\""+callsign+"\"\tpassword=\""+passwd+"\" />\n" );
280  acctlines.push_back( "</ACCOUNTS>\n" );
281  //cout<<"Adding to file : "<<acctstr<<endl;
282  for (size_t i = 0; i < acctlines.size(); i++)
283  if (f.WriteLine( acctlines[i].c_str() ) < 0) {
284  f.Close();
285  cout<<"!!! ERROR : writing to account file !!!"<<endl;
286  VSExit( 1 );
287  }
288  /*
289  * if( fputs( acctstr.c_str(), fp) < 0)
290  * {
291  * cout<<"ERROR writing new account to account file"<<endl;
292  * VSExit(1);
293  * }
294  */
295  f.Close();
296  addAcct( callsign, new Account( callsign, passwd ) );
297  }
298  if (packet2.send( packet.getCommand(), packet.getSerial(), (char*) NULL, 0, SENDRELIABLE, NULL, sock,
299  __FILE__, __LINE__ ) < 0) {
300  cout<<"ERROR sending authorization"<<endl;
301  exit( 1 );
302  }
303  }
304  //DeadSocks.push_back( sock);
305  cout<<"<<< SUBSRIBE REQUEST --------------------------------------"<<endl;
306  break;
307  }
308  case CMD_RESYNCACCOUNTS:
309  {
310  cout<<">>> RESYNC ACCOUNTS --------------------------------------"<<endl;
311  ObjSerial nbclients = packet.getSerial();
312  int i = 0;
313  cout<<">>>>>>>>> SYNC RECEIVED FOR "<<nbclients<<" CLIENTS <<<<<<<<<<<<"<<endl;
314  std::string nameTmp;
315  VI vi;
316  //Loop through accounts
317  //Maybe not necessary since when we get a game server disconnect we should have
318  //set all its accounts disconnected
319  //Loop through received client serials
320  for (i = 0; i < nbclients; i++) {
321  nameTmp = netbuf.getString();
322  //sertmp = ntohs( *( (ObjSerial *)(buf+sizeof( ObjSerial)*i)));
323  //Loop through accounts
324  elem = getAcctTemplate( callsign );
325  if (elem) {
326  //Reactivate the serial we received from server
327  if ( elem->compareName( nameTmp ) )
328  elem->setConnected( true );
329  }
330  }
331  cout<<"<<< RESYNC'ED ACCOUNTS --------------------------------------"<<endl;
332  break;
333  }
334  case CMD_SAVEACCOUNTS:
335  cout<<">>> SAVING ACCOUNT #"<<packet.getSerial()<<"-----------------------------"<<endl;
336  this->writeSave( packet.getData(), packet.getDataLength() );
337  cout<<"<<< ACCOUNT SAVED --------------------------------------"<<endl;
338  break;
339  default:
340  cout<<">>> UNKNOWN command =( "<<cmd<<" )= ---------------------------------";
341  }
342  //cout<<"end received"<<endl;
343  }
344  /*
345  * else if( recvcount==0)
346  * {
347  * // SOCKET should have been closed by that game server
348  * cout<<"Received 0 data on socket "<<sock<<endl;
349  * }
350  */
351  else {
352  cout<<"Received failed or socket closed"<<endl;
353  DeadSocks.push_back( sock );
354  }
355 }
void AccountServer::removeDeadSockets ( )

Definition at line 501 of file acctserver.cpp.

References COUT, getAcctAddress(), j, and Account::setConnected().

Referenced by start().

502 {
503  if ( DeadSocks.empty() ) return;
504  int nbc_disc = 0;
505  int nbs_disc = 0;
506  list< SOCKETALT >::iterator j;
507  Account *elem;
508  for (j = DeadSocks.begin(); j != DeadSocks.end(); j++) {
509  bool found = false;
510  COUT<<">>>>>>> Closing socket number "<<(*j)<<endl;
511  //Disconnect all of that server clients
512  elem = getAcctAddress( *j );
513  if (elem) {
514  //if( (*vi)->getSocket().sameAddress( (*j)))
515  elem->setConnected( false );
516  nbc_disc++;
517  found = true;
518  }
519  if (!found)
520  nbs_disc++;
521  j->disconnect( "\tclosing socket" );
522  Socks.remove( (*j) );
523  }
524  cout<<"\tDisconnected "<<nbc_disc<<" clients associated with that server socket"<<endl;
525  cout<<"\tDisconnected "<<nbs_disc<<" non-clients sockets"<<endl;
526  DeadSocks.clear();
527 }
void AccountServer::save ( )

Definition at line 490 of file acctserver.cpp.

491 {
492  //Loop through all accounts and write their status
493  /*
494  * VI vi;
495  * for( vi=Cltacct.begin(); vi!=Cltacct.end(); vi++)
496  * {
497  * }
498  */
499 }
void AccountServer::sendAlreadyConnected ( SOCKETALT  sock,
Account acct 
)

Definition at line 471 of file acctserver.cpp.

References Account::callsign, Packet::getData(), Packet::getDataLength(), Account::getSerial(), LOGIN_ALREADY, Account::passwd, Packet::send(), and SENDRELIABLE.

Referenced by recvMsg().

472 {
473  Packet packet2;
474  packet2.send( LOGIN_ALREADY, acct->getSerial(), packet.getData(),
475  packet.getDataLength(), SENDRELIABLE, NULL, sock, __FILE__, __LINE__ );
476  cout<<"\tLOGIN REQUEST FAILED for <"<<acct->callsign<<">:<"<<acct->passwd<<"> -> ALREADY LOGGED IN"<<endl;
477 }
void AccountServer::sendAuthorized ( SOCKETALT  sock,
Account acct 
)

Definition at line 357 of file acctserver.cpp.

References VSFileSystem::AccountFile, NetBuffer::addString(), Account::callsign, VSFileSystem::VSFile::Close(), COMPRESSED, f, NetBuffer::getData(), Packet::getData(), Packet::getDataLength(), NetBuffer::getDataLength(), Account::isNew(), LOGIN_ACCEPT, LOGIN_NEW, VSFileSystem::Ok, VSFileSystem::VSFile::OpenReadOnly(), Account::passwd, VSFileSystem::VSFile::ReadFull(), Packet::send(), SENDRELIABLE, Account::serverip, Account::serverport, Account::setSerial(), Account::setSocket(), VSFileSystem::VSFile::Size(), and VSExit().

Referenced by recvMsg().

358 {
359  //Get a serial for client
360  //ObjSerial serial = getUniqueSerial();
361  ObjSerial serial = 0;
362  acct->setSerial( serial );
363  cout<<"\tLOGIN REQUEST SUCCESS for <"<<acct->callsign<<">:<"<<acct->passwd<<">"<<endl;
364  //Store socket as a game server id
365  acct->setSocket( sock );
366  //Verify that client already has a ship or if it is a new account
367  if ( acct->isNew() ) {
368  //Send a command to make the client create a new character/ship
369  Packet packet2;
370  if (packet2.send( LOGIN_NEW, serial, packet.getData(), packet.getDataLength(), SENDRELIABLE, NULL, sock, __FILE__,
371  __LINE__ ) < 0) {
372  cout<<"ERROR sending authorization"<<endl;
373  exit( 1 );
374  }
375  //Should receive an answer from game server that contains ship's creation info to
376  //be saved on the account server
377  } else {
378  NetBuffer netbuf;
379 
380  //Try to open save file
381  string acctfile = acct->callsign+".save";
382  cerr<<"Trying to open : "<<acctfile<<endl;
383  VSFile f;
384  VSError err = f.OpenReadOnly( acctfile, AccountFile );
385  if (err > Ok) {
386  cerr<<"Account save file does not exists... sending default one to game server"<<endl;
387  acctfile = "default.save";
388  cerr<<"Trying to open : "<<acctfile<<endl;
389  err = f.OpenReadOnly( "default.save", AccountFile );
390  if (err > Ok) {
391  cout<<"Error, default save not found"<<endl;
392  VSExit( 1 );
393  }
394  } else {
395  cout<<"... done !"<<endl;
396  //Try to open xml file
397  }
398  string acctsave;
399  //If we loaded default save -> we must load default xml
400  if (acctfile == "default.save")
401  acctsave = "default.xml";
402  else
403  acctsave = acct->callsign+".xml";
404  cerr<<"Trying to open : "<<acctsave<<endl;
405  VSFile f2;
406  VSError err2 = f2.OpenReadOnly( acctsave, AccountFile );
407  if (err2 > Ok) {
408  cout<<"XML save file does not exists... sending default one to game server"<<endl;
409  acctsave = "default.xml";
410  cerr<<"Trying to open : "<<acctsave<<endl;
411  if (acctfile != "default.save") {
412  //We loaded an existing save but no corresponding xml file so load default
413  f.Close();
414  cerr<<"Default XML Loaded -> reload the default save !"<<endl;
415  acctfile = "default.save";
416  cerr<<"Trying to open : "<<acctfile<<endl;
417  err = f.OpenReadOnly( acctfile.c_str(), AccountFile );
418  }
419  err2 = f2.OpenReadOnly( acctsave.c_str(), AccountFile );
420  } else {
421  cout<<"... done !"<<endl;
422  }
423  string savebuf;
424  string xmlbuf;
425 
426  cout<<"Save size = "<<f.Size()<<" - XML size = "<<f2.Size()<<endl;
427  cout<<"Loaded -= "<<acct->callsign<<" =- save files ("<<( f.Size()+f2.Size() )<<")"<<endl;
428  //Read the save unit file
429  if (err <= Ok) {
430  savebuf = f.ReadFull();
431  f.Close();
432  } else {
433  cout<<"Error, default save not found"<<endl;
434  VSExit( 1 );
435  }
436  //Put the name and passwd of the player in the packet
437  netbuf.addString( acct->callsign );
438  netbuf.addString( acct->passwd );
439  netbuf.addString( acct->serverip );
440  netbuf.addString( acct->serverport );
441  //Put the size of the first save file in the buffer to send
442  netbuf.addString( savebuf );
443  //Read the XML file
444  if (err2 <= Ok) {
445  xmlbuf = f2.ReadFull();
446  f2.Close();
447  } else {
448  cout<<"Error, default xml not found"<<endl;
449  VSExit( 1 );
450  }
451  netbuf.addString( xmlbuf );
452 
453  Packet packet2;
454  if (packet2.send( LOGIN_ACCEPT, serial,
455  netbuf.getData(), netbuf.getDataLength(),
457  NULL, sock, __FILE__, __LINE__ ) < 0) {
458  cout<<"ERROR sending authorization"<<endl;
459  exit( 1 );
460  }
461  }
462 }
void AccountServer::sendServerData ( SOCKETALT  sock,
Account acct 
)

Definition at line 479 of file acctserver.cpp.

References NetBuffer::addString(), Account::callsign, NetBuffer::getData(), NetBuffer::getDataLength(), LOGIN_DATA, Account::passwd, Packet::send(), SENDRELIABLE, Account::serverip, and Account::serverport.

Referenced by recvMsg().

480 {
481  Packet packet2;
482  NetBuffer netbuf;
483  netbuf.addString( acct->serverip );
484  netbuf.addString( acct->serverport );
485  cout<<"-- sending SERVERIP="<<acct->serverip<<" - SERVERPORT="<<acct->serverport<<endl;
486  packet2.send( LOGIN_DATA, 0, netbuf.getData(), netbuf.getDataLength(), SENDRELIABLE, NULL, sock, __FILE__, __LINE__ );
487  cout<<"\tLOGIN DATA SENT for <"<<acct->callsign<<">:<"<<acct->passwd<<">"<<endl;
488 }
void AccountServer::sendUnauthorized ( SOCKETALT  sock,
Account acct 
)

Definition at line 464 of file acctserver.cpp.

References Account::callsign, Packet::getData(), Packet::getDataLength(), LOGIN_ERROR, Account::passwd, Packet::send(), and SENDRELIABLE.

Referenced by recvMsg().

465 {
466  Packet packet2;
467  packet2.send( LOGIN_ERROR, 0, packet.getData(), packet.getDataLength(), SENDRELIABLE, NULL, sock, __FILE__, __LINE__ );
468  cout<<"\tLOGIN REQUEST FAILED for <"<<acct->callsign<<">:<"<<acct->passwd<<">"<<endl;
469 }
void AccountServer::start ( void  )

Definition at line 58 of file acctserver.cpp.

References ACCT_PORT, acctdir, CONFIGFILE, COUT, NetUITCP::createServerSocket(), VSFileSystem::datadir, getNewTime(), VegaConfig::getVariable(), i, vs_options::init(), VSFileSystem::InitPaths(), InitTime(), SOCKETALT::isActive(), LoadAccounts(), recvMsg(), removeDeadSockets(), VSThread::start(), startMsg(), UpdateTime(), SOCKETALT::valid(), vs_config, VSExit(), and SocketSet::wait().

Referenced by main().

59 {
60  string strperiod;
61  keeprun = 1;
62 
63  SOCKETALT comsock;
64 
65  startMsg();
66 
67  CONFIGFILE = new char[42];
68  strcpy( CONFIGFILE, "accountserver.config" );
69  cout<<"Loading config file...";
72  //vs_config = new VegaConfig( ACCTCONFIGFILE);
73  cout<<" done."<<endl;
74  InitTime();
75  UpdateTime();
76  acctdir = VSFileSystem::datadir+vs_config->getVariable( "server", "accounts_dir", "/accounts/" );
77  strperiod = vs_config->getVariable( "server", "saveperiod", "" );
78  int period;
79  if (strperiod == "")
80  period = 7200;
81  else
82  period = atoi( strperiod.c_str() );
83  savetime = getNewTime()+period;
84 
85  cout<<"Loading accounts data... ";
86  LoadAccounts( "accounts.xml" );
87  //Gets hashtable accounts elements and put them in vector Cltacct
88 
89  //Create and bind socket
90  cout<<"Initializing network..."<<endl;
91  unsigned short tmpport;
92  if (vs_config->getVariable( "network", "accountsrvport", "" ) == "")
93  tmpport = ACCT_PORT;
94  else
95  tmpport = atoi( ( vs_config->getVariable( "network", "accountsrvport", "" ) ).c_str() );
96  Network = NetworkToClient.createServerSocket( tmpport, _sock_set );
97  if (!Network) {
98  cout<<"Error cannot start server... quitting."<<endl;
99  VSExit( 1 );
100  }
101  cout<<"done."<<endl;
102 
103  _sock_set.start();
104  while (keeprun) {
105  COUT<<"Loop"<<endl;
106  //Check for incoming connections
107 
108  _sock_set.wait();
109 
110  comsock = Network->acceptNewConn();
111  if ( comsock.valid() ) {
112  Socks.push_back( comsock );
113  COUT<<"New connection - socket allocated : "<<comsock<<endl;
114  }
115  //Loop for each active client and process request
116  list< SOCKETALT >::iterator i;
117  for (i = Socks.begin(); i != Socks.end(); i++) {
118  SOCKETALT alt( *i );
119  if ( alt.isActive() )
120  this->recvMsg( alt );
121  }
122  //Remove dead connections
123  this->removeDeadSockets();
124  //Check for automatic server status save time
125  curtime = getNewTime();
126 
127  //micro_sleep(40000);
128  }
129  delete CONFIGFILE;
130  delete vs_config;
131  vs_config = NULL;
132  Network->disconnect( "Shutting down." );
133 }
void AccountServer::startMsg ( )

Definition at line 52 of file acctserver.cpp.

Referenced by start().

53 {
54  cout<<endl<<"Vegastrike Account Server version 0.0.1"<<endl;
55  cout<<"Written by Stephane Vaxelaire"<<endl<<endl;
56 }
void AccountServer::writeSave ( const char *  buffer,
unsigned int  bufferlen 
)

Definition at line 529 of file acctserver.cpp.

References Account::callsign, getAcctSerial(), FileUtil::GetSaveFromBuffer(), Packet::getSerial(), and FileUtil::WriteSaveFiles().

Referenced by recvMsg().

530 {
531  NetBuffer netbuf( buffer, length );
532  vector< string >saves = FileUtil::GetSaveFromBuffer( netbuf );
533  string xmlstr = saves[0];
534  string savestr = saves[1];
535 
536  //Find the account associated with serial packet.getSerial();
537  VI vi;
538  Account *elem = getAcctSerial( packet.getSerial() );
539  if (!elem) {
540  //Problem, we should have found it
541  } else {
542  //Save the files
543  FileUtil::WriteSaveFiles( savestr, xmlstr, elem->callsign );
544  }
545 }

The documentation for this class was generated from the following files: