Esempio n. 1
0
File: xetp.cpp Progetto: toppk/xevil
void XETP::send_delete_object(OutStreamP out,const Id &id) {
  u_int len = 
    Identifier::get_write_length();  // Id
  
  if (out->get_protocol() == GenericStream::UDP) {
    ((UDPOutStreamP)out)->prepare_packet(XETP::add_header(len));
  }
  
  send_header(out,DELETE_OBJECT,len);
  id.write(out);
  
  if (out->get_protocol() == GenericStream::UDP) {
    ((UDPOutStreamP)out)->done_packet();
  }
}
Esempio n. 2
0
File: xetp.cpp Progetto: toppk/xevil
void XETP::_send_object(OutStreamP out,PhysicalP p,Turn turn,
                        TickType tt,u_int len) {
  // len does not include the XETP header.

  const PhysicalContext *cx = p->get_context();
  // Only send objects that can be read back in.
  assert(cx->create_from_stream);
  Id id = p->get_id();

  send_header(out,OBJECT,len);
  assert(p->get_class_id() <= USHRT_MAX);
  out->write_short((u_short)p->get_class_id());
  id.write(out);
  out->write_int((int)turn);
  assert(tt <= UCHAR_MAX);
  out->write_char((char)tt);
  p->write(out);
}