PartyManagerUD can send to all PartyManagerAIs

This commit is contained in:
Redmond Urbino 2008-09-24 23:29:41 +00:00
parent 1aac45449d
commit 32a7f97b4b
4 changed files with 59 additions and 0 deletions

View File

@ -915,6 +915,31 @@ ai_format_update(const string &field_name, DOID_TYPE do_id,
}
#endif // HAVE_PYTHON
#ifdef HAVE_PYTHON
////////////////////////////////////////////////////////////////////
// Function: DCClass::ai_format_update_msg_type
// Access: Published
// Description: Generates a datagram containing the message necessary
// to send an update, using the indicated msg type
// for the indicated distributed
// object from the AI.
////////////////////////////////////////////////////////////////////
Datagram DCClass::
ai_format_update_msg_type(const string &field_name, DOID_TYPE do_id,
CHANNEL_TYPE to_id, CHANNEL_TYPE from_id, int msg_type, PyObject *args) const {
DCField *field = get_field_by_name(field_name);
if (field == (DCField *)NULL) {
ostringstream strm;
strm << "No field named " << field_name << " in class " << get_name()
<< "\n";
nassert_raise(strm.str());
return Datagram();
}
return field->ai_format_update_msg_type(do_id, to_id, from_id, msg_type, args);
}
#endif // HAVE_PYTHON
#ifdef HAVE_PYTHON
////////////////////////////////////////////////////////////////////
// Function: DCClass::client_format_generate

View File

@ -112,6 +112,8 @@ PUBLISHED:
DOID_TYPE do_id, PyObject *args) const;
Datagram ai_format_update(const string &field_name, DOID_TYPE do_id,
CHANNEL_TYPE to_id, CHANNEL_TYPE from_id, PyObject *args) const;
Datagram ai_format_update_msg_type(const string &field_name, DOID_TYPE do_id,
CHANNEL_TYPE to_id, CHANNEL_TYPE from_id, int msg_type, PyObject *args) const;
Datagram ai_format_generate(PyObject *distobj, DOID_TYPE do_id, ZONEID_TYPE parent_id, ZONEID_TYPE zone_id,
CHANNEL_TYPE district_channel_id, CHANNEL_TYPE from_channel_id,
PyObject *optional_fields) const;

View File

@ -480,6 +480,36 @@ ai_format_update(DOID_TYPE do_id, CHANNEL_TYPE to_id, CHANNEL_TYPE from_id, PyOb
}
#endif // HAVE_PYTHON
#ifdef HAVE_PYTHON
////////////////////////////////////////////////////////////////////
// Function: DCField::ai_format_update_msg_type
// Access: Published
// Description: Generates a datagram containing the message necessary
// to send an update, with the msg type,
// for the indicated distributed
// object from the AI.
////////////////////////////////////////////////////////////////////
Datagram DCField::
ai_format_update_msg_type(DOID_TYPE do_id, CHANNEL_TYPE to_id, CHANNEL_TYPE from_id, int msg_type, PyObject *args) const {
DCPacker packer;
packer.raw_pack_uint8(1);
packer.RAW_PACK_CHANNEL(to_id);
packer.RAW_PACK_CHANNEL(from_id);
packer.raw_pack_uint16(msg_type);
packer.raw_pack_uint32(do_id);
packer.raw_pack_uint16(_number);
packer.begin_pack(this);
pack_args(packer, args);
if (!packer.end_pack()) {
return Datagram();
}
return Datagram(packer.get_data(), packer.get_length());
}
#endif // HAVE_PYTHON
////////////////////////////////////////////////////////////////////
// Function: DCField::generate_hash

View File

@ -88,6 +88,8 @@ PUBLISHED:
Datagram client_format_update(DOID_TYPE do_id, PyObject *args) const;
Datagram ai_format_update(DOID_TYPE do_id, CHANNEL_TYPE to_id, CHANNEL_TYPE from_id,
PyObject *args) const;
Datagram ai_format_update_msg_type(DOID_TYPE do_id, CHANNEL_TYPE to_id, CHANNEL_TYPE from_id,
int msg_type, PyObject *args) const;
#endif
public: