Example #1
0
File: xetp.cpp Project: toppk/xevil
void XETP::send_rooms_known(OutStreamP out,const Rooms &rooms,
                            int worldVersion,Boolean *map) {
  int mapSize = rooms.acrossMax * rooms.downMax;

  u_int len = sizeof(int) +             // version
    Rooms::get_write_length() +       // rooms
    sizeof(char) * mapSize;           // map
  
  if (out->get_protocol() == GenericStream::UDP) {
    ((UDPOutStreamP)out)->prepare_packet(XETP::add_header(len));
  }

  send_header(out,ROOMS_KNOWN,len);
  out->write_int(worldVersion);
  rooms.write(out);
  for (int n = 0; n < mapSize; n++) {
    out->write_char((u_char)map[n]);
  }
  
  if (out->get_protocol() == GenericStream::UDP) {
    ((UDPOutStreamP)out)->done_packet();
  }
}
Example #2
0
void ViewportInfo::write(OutStreamP out) const {
  out->write_char((char)smoothScroll);
  logicalSize.write_32(out);
  extraSize.write(out);
  out->write_int(radius);
}