|
@@ -175,6 +175,11 @@ int ENetPacketPeer::get_channels() const {
|
|
|
return peer->channelCount;
|
|
|
}
|
|
|
|
|
|
+int ENetPacketPeer::get_packet_flags() const {
|
|
|
+ ERR_FAIL_COND_V(packet_queue.is_empty(), 0);
|
|
|
+ return packet_queue.front()->get()->flags;
|
|
|
+}
|
|
|
+
|
|
|
void ENetPacketPeer::_on_disconnect() {
|
|
|
if (peer) {
|
|
|
peer->data = nullptr;
|
|
@@ -206,6 +211,7 @@ void ENetPacketPeer::_bind_methods() {
|
|
|
ClassDB::bind_method(D_METHOD("send", "channel", "packet", "flags"), &ENetPacketPeer::_send);
|
|
|
ClassDB::bind_method(D_METHOD("throttle_configure", "interval", "acceleration", "deceleration"), &ENetPacketPeer::throttle_configure);
|
|
|
ClassDB::bind_method(D_METHOD("set_timeout", "timeout", "timeout_min", "timeout_max"), &ENetPacketPeer::set_timeout);
|
|
|
+ ClassDB::bind_method(D_METHOD("get_packet_flags"), &ENetPacketPeer::get_packet_flags);
|
|
|
ClassDB::bind_method(D_METHOD("get_remote_address"), &ENetPacketPeer::get_remote_address);
|
|
|
ClassDB::bind_method(D_METHOD("get_remote_port"), &ENetPacketPeer::get_remote_port);
|
|
|
ClassDB::bind_method(D_METHOD("get_statistic", "statistic"), &ENetPacketPeer::get_statistic);
|