Esempio n. 1
0
void Player::pack(OutputFrame::Ptr frame) const {
    frame->setType(ft03_Player);
    frame->packInt(id);
    frame->packString(name);
    frame->packString("Human");
    frame->packInt64(getModTime());
}
Esempio n. 2
0
void Order::describeOrder(OutputFrame::Ptr f) const
{
  f->setType(ft02_OrderDesc);
  f->packInt(type);
  f->packString(name);
  f->packString(description);
  f->packInt(parameters.size());
  std::for_each( parameters.begin(), parameters.end(), boost::bind( &OrderParameter::packOrderDescFrame, _1, f ) );
  f->packInt64(descmodtime);
}
Esempio n. 3
0
void Category::pack(OutputFrame::Ptr frame) const{
  frame->setType(ft03_Category);
  frame->packInt(id);
  frame->packInt64(getModTime()); //timestamp
  frame->packString(name);
  frame->packString(desc);
}
Esempio n. 4
0
bool AsyncTimeRemaining::createFrame(OutputFrame::Ptr f) {
  f->setType(ft02_Time_Remaining);
  f->packInt(rtime);
  if(f->getVersion() >= fv0_4){
    f->packInt(why); //reason
    f->packInt(Game::getGame()->getTurnNumber());
    f->packString(Game::getGame()->getTurnName());
  }
  return true;
}
Esempio n. 5
0
void Message::pack(OutputFrame::Ptr frame) const {
  if (frame->getVersion() == fv0_2) {
    frame->packInt(1);
    frame->packInt(0);
  } else {
    frame->packInt(0);
  }
  frame->packString(name);
  frame->packString(desc);
  if (frame->getVersion() > fv0_2) {
    frame->packInt(turn_number);
    frame->packInt(references.size());
    for (References::iterator itcurr = references.begin(); itcurr != references.end(); ++itcurr) {
      frame->packInt((*itcurr).first);
      frame->packInt((*itcurr).second);
    }
  }
}
Esempio n. 6
0
void PropertyValue::packFrame(OutputFrame::Ptr frame) const{
  frame->packInt(propid);
  frame->packString(display);
}