Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* automatically generated by rust-bindgen 0.59.2 */
- #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
- pub mod root {
- #[allow(unused_imports)]
- use self::super::root;
- pub mod std {
- #[allow(unused_imports)]
- use self::super::super::root;
- }
- pub mod __gnu_cxx {
- #[allow(unused_imports)]
- use self::super::super::root;
- }
- pub type size_t = ::std::os::raw::c_ulong;
- pub type va_list = root::__builtin_va_list;
- pub type __int8_t = ::std::os::raw::c_schar;
- pub type __uint8_t = ::std::os::raw::c_uchar;
- pub type __int16_t = ::std::os::raw::c_short;
- pub type __uint16_t = ::std::os::raw::c_ushort;
- pub type __int32_t = ::std::os::raw::c_int;
- pub type __uint32_t = ::std::os::raw::c_uint;
- pub type __int64_t = ::std::os::raw::c_long;
- pub type __uint64_t = ::std::os::raw::c_ulong;
- pub type __off_t = ::std::os::raw::c_long;
- pub type __off64_t = ::std::os::raw::c_long;
- pub type FILE = root::_IO_FILE;
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct _IO_marker {
- _unused: [u8; 0],
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct _IO_codecvt {
- _unused: [u8; 0],
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct _IO_wide_data {
- _unused: [u8; 0],
- }
- pub type _IO_lock_t = ::std::os::raw::c_void;
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct _IO_FILE {
- pub _flags: ::std::os::raw::c_int,
- pub _IO_read_ptr: *mut ::std::os::raw::c_char,
- pub _IO_read_end: *mut ::std::os::raw::c_char,
- pub _IO_read_base: *mut ::std::os::raw::c_char,
- pub _IO_write_base: *mut ::std::os::raw::c_char,
- pub _IO_write_ptr: *mut ::std::os::raw::c_char,
- pub _IO_write_end: *mut ::std::os::raw::c_char,
- pub _IO_buf_base: *mut ::std::os::raw::c_char,
- pub _IO_buf_end: *mut ::std::os::raw::c_char,
- pub _IO_save_base: *mut ::std::os::raw::c_char,
- pub _IO_backup_base: *mut ::std::os::raw::c_char,
- pub _IO_save_end: *mut ::std::os::raw::c_char,
- pub _markers: *mut root::_IO_marker,
- pub _chain: *mut root::_IO_FILE,
- pub _fileno: ::std::os::raw::c_int,
- pub _flags2: ::std::os::raw::c_int,
- pub _old_offset: root::__off_t,
- pub _cur_column: ::std::os::raw::c_ushort,
- pub _vtable_offset: ::std::os::raw::c_schar,
- pub _shortbuf: [::std::os::raw::c_char; 1usize],
- pub _lock: *mut root::_IO_lock_t,
- pub _offset: root::__off64_t,
- pub _codecvt: *mut root::_IO_codecvt,
- pub _wide_data: *mut root::_IO_wide_data,
- pub _freeres_list: *mut root::_IO_FILE,
- pub _freeres_buf: *mut ::std::os::raw::c_void,
- pub __pad5: root::size_t,
- pub _mode: ::std::os::raw::c_int,
- pub _unused2: [::std::os::raw::c_char; 20usize],
- }
- pub mod RakNet {
- #[allow(unused_imports)]
- use self::super::super::root;
- pub type Time = u64;
- pub type TimeMS = u32;
- pub type TimeUS = u64;
- pub const StartupResult_RAKNET_STARTED: root::RakNet::StartupResult = 0;
- pub const StartupResult_RAKNET_ALREADY_STARTED: root::RakNet::StartupResult = 1;
- pub const StartupResult_INVALID_SOCKET_DESCRIPTORS: root::RakNet::StartupResult = 2;
- pub const StartupResult_INVALID_MAX_CONNECTIONS: root::RakNet::StartupResult = 3;
- pub const StartupResult_SOCKET_FAMILY_NOT_SUPPORTED: root::RakNet::StartupResult = 4;
- pub const StartupResult_SOCKET_PORT_ALREADY_IN_USE: root::RakNet::StartupResult = 5;
- pub const StartupResult_SOCKET_FAILED_TO_BIND: root::RakNet::StartupResult = 6;
- pub const StartupResult_SOCKET_FAILED_TEST_SEND: root::RakNet::StartupResult = 7;
- pub const StartupResult_PORT_CANNOT_BE_ZERO: root::RakNet::StartupResult = 8;
- pub const StartupResult_FAILED_TO_CREATE_NETWORK_THREAD: root::RakNet::StartupResult = 9;
- pub const StartupResult_COULD_NOT_GENERATE_GUID: root::RakNet::StartupResult = 10;
- pub const StartupResult_STARTUP_OTHER_FAILURE: root::RakNet::StartupResult = 11;
- pub type StartupResult = ::std::os::raw::c_uint;
- pub const ConnectionAttemptResult_CONNECTION_ATTEMPT_STARTED:
- root::RakNet::ConnectionAttemptResult = 0;
- pub const ConnectionAttemptResult_INVALID_PARAMETER: root::RakNet::ConnectionAttemptResult =
- 1;
- pub const ConnectionAttemptResult_CANNOT_RESOLVE_DOMAIN_NAME:
- root::RakNet::ConnectionAttemptResult = 2;
- pub const ConnectionAttemptResult_ALREADY_CONNECTED_TO_ENDPOINT:
- root::RakNet::ConnectionAttemptResult = 3;
- pub const ConnectionAttemptResult_CONNECTION_ATTEMPT_ALREADY_IN_PROGRESS:
- root::RakNet::ConnectionAttemptResult = 4;
- pub const ConnectionAttemptResult_SECURITY_INITIALIZATION_FAILED:
- root::RakNet::ConnectionAttemptResult = 5;
- pub type ConnectionAttemptResult = ::std::os::raw::c_uint;
- #[doc = " Connect() was called, but the process hasn't started yet"]
- pub const ConnectionState_IS_PENDING: root::RakNet::ConnectionState = 0;
- #[doc = " Processing the connection attempt"]
- pub const ConnectionState_IS_CONNECTING: root::RakNet::ConnectionState = 1;
- #[doc = " Is connected and able to communicate"]
- pub const ConnectionState_IS_CONNECTED: root::RakNet::ConnectionState = 2;
- #[doc = " Was connected, but will disconnect as soon as the remaining messages are delivered"]
- pub const ConnectionState_IS_DISCONNECTING: root::RakNet::ConnectionState = 3;
- #[doc = " A connection attempt failed and will be aborted"]
- pub const ConnectionState_IS_SILENTLY_DISCONNECTING: root::RakNet::ConnectionState = 4;
- #[doc = " No longer connected"]
- pub const ConnectionState_IS_DISCONNECTED: root::RakNet::ConnectionState = 5;
- #[doc = " Was never connected, or else was disconnected long enough ago that the entry has been discarded"]
- pub const ConnectionState_IS_NOT_CONNECTED: root::RakNet::ConnectionState = 6;
- #[doc = " Returned from RakPeerInterface::GetConnectionState()"]
- pub type ConnectionState = ::std::os::raw::c_uint;
- #[doc = " \\sa NetworkIDObject.h"]
- pub type UniqueIDType = ::std::os::raw::c_uchar;
- pub type SystemIndex = ::std::os::raw::c_ushort;
- pub type RPCIndex = ::std::os::raw::c_uchar;
- #[doc = " First byte of a network message"]
- pub type MessageID = ::std::os::raw::c_uchar;
- pub type BitSize_t = u32;
- #[doc = " The connection is insecure. You can also just pass 0 for the pointer to PublicKey in RakPeerInterface::Connect()"]
- pub const PublicKeyMode_PKM_INSECURE_CONNECTION: root::RakNet::PublicKeyMode = 0;
- #[doc = " Accept whatever public key the server gives us. This is vulnerable to man in the middle, but does not require"]
- #[doc = " distribution of the public key in advance of connecting."]
- pub const PublicKeyMode_PKM_ACCEPT_ANY_PUBLIC_KEY: root::RakNet::PublicKeyMode = 1;
- #[doc = " Use a known remote server public key. PublicKey::remoteServerPublicKey must be non-zero."]
- #[doc = " This is the recommended mode for secure connections."]
- pub const PublicKeyMode_PKM_USE_KNOWN_PUBLIC_KEY: root::RakNet::PublicKeyMode = 2;
- #[doc = " Use a known remote server public key AND provide a public key for the connecting client."]
- #[doc = " PublicKey::remoteServerPublicKey, myPublicKey and myPrivateKey must be all be non-zero."]
- #[doc = " The server must cooperate for this mode to work."]
- #[doc = " I recommend not using this mode except for server-to-server communication as it significantly increases the CPU requirements during connections for both sides."]
- #[doc = " Furthermore, when it is used, a connection password should be used as well to avoid DoS attacks."]
- pub const PublicKeyMode_PKM_USE_TWO_WAY_AUTHENTICATION: root::RakNet::PublicKeyMode = 3;
- #[doc = " Used with the PublicKey structure"]
- pub type PublicKeyMode = ::std::os::raw::c_uint;
- #[doc = " Passed to RakPeerInterface::Connect()"]
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct PublicKey {
- #[doc = " How to interpret the public key, see above"]
- pub publicKeyMode: root::RakNet::PublicKeyMode,
- #[doc = " Pointer to a public key of length cat::EasyHandshake::PUBLIC_KEY_BYTES. See the Encryption sample."]
- pub remoteServerPublicKey: *mut ::std::os::raw::c_char,
- #[doc = " (Optional) Pointer to a public key of length cat::EasyHandshake::PUBLIC_KEY_BYTES"]
- pub myPublicKey: *mut ::std::os::raw::c_char,
- #[doc = " (Optional) Pointer to a private key of length cat::EasyHandshake::PRIVATE_KEY_BYTES"]
- pub myPrivateKey: *mut ::std::os::raw::c_char,
- }
- #[doc = " Describes the local socket to use for RakPeer::Startup"]
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct SocketDescriptor {
- #[doc = " The local port to bind to. Pass 0 to have the OS autoassign a port."]
- pub port: ::std::os::raw::c_ushort,
- #[doc = " The local network card address to bind to, such as \"127.0.0.1\". Pass an empty string to use INADDR_ANY."]
- pub hostAddress: [::std::os::raw::c_char; 32usize],
- #[doc = " IP version: For IPV4, use AF_INET (default). For IPV6, use AF_INET6. To autoselect, use AF_UNSPEC."]
- #[doc = " IPV6 is the newer internet protocol. Instead of addresses such as natpunch.jenkinssoftware.com, you may have an address such as fe80::7c:31f7:fec4:27de%14."]
- #[doc = " Encoding takes 16 bytes instead of 4, so IPV6 is less efficient for bandwidth."]
- #[doc = " On the positive side, NAT Punchthrough is not needed and should not be used with IPV6 because there are enough addresses that routers do not need to create address mappings."]
- #[doc = " RakPeer::Startup() will fail if this IP version is not supported."]
- #[doc = " \\pre RAKNET_SUPPORT_IPV6 must be set to 1 in RakNetDefines.h for AF_INET6"]
- pub socketFamily: ::std::os::raw::c_short,
- pub remotePortRakNetWasStartedOn_PS3_PSP2: ::std::os::raw::c_ushort,
- pub chromeInstance: ::std::os::raw::c_int,
- pub blockingSocket: bool,
- #[doc = " XBOX only: set IPPROTO_VDP if you want to use VDP. If enabled, this socket does not support broadcast to 255.255.255.255"]
- pub extraSocketOptions: ::std::os::raw::c_uint,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16SocketDescriptorC1Ev"]
- pub fn SocketDescriptor_SocketDescriptor(this: *mut root::RakNet::SocketDescriptor);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16SocketDescriptorC1EtPKc"]
- pub fn SocketDescriptor_SocketDescriptor1(
- this: *mut root::RakNet::SocketDescriptor,
- _port: ::std::os::raw::c_ushort,
- _hostAddress: *const ::std::os::raw::c_char,
- );
- }
- impl SocketDescriptor {
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- SocketDescriptor_SocketDescriptor(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new1(
- _port: ::std::os::raw::c_ushort,
- _hostAddress: *const ::std::os::raw::c_char,
- ) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- SocketDescriptor_SocketDescriptor1(__bindgen_tmp.as_mut_ptr(), _port, _hostAddress);
- __bindgen_tmp.assume_init()
- }
- }
- #[doc = " \\brief Network address for a system"]
- #[doc = " \\details Corresponds to a network address<BR>"]
- #[doc = " This is not necessarily a unique identifier. For example, if a system has both LAN and internet connections, the system may be identified by either one, depending on who is communicating<BR>"]
- #[doc = " Therefore, you should not transmit the SystemAddress over the network and expect it to identify a system, or use it to connect to that system, except in the case where that system is not behind a NAT (such as with a dedciated server)"]
- #[doc = " Use RakNetGUID for a unique per-instance of RakPeer to identify systems"]
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub struct SystemAddress {
- pub address: root::RakNet::SystemAddress__bindgen_ty_1,
- #[doc = " This is not used internally, but holds a copy of the port held in the address union, so for debugging it's easier to check what port is being held"]
- pub debugPort: ::std::os::raw::c_ushort,
- #[doc = " \\internal Used internally for fast lookup. Optional (use -1 to do regular lookup). Don't transmit this."]
- pub systemIndex: root::RakNet::SystemIndex,
- }
- #[doc = " SystemAddress, with RAKNET_SUPPORT_IPV6 defined, holds both an sockaddr_in6 and a sockaddr_in"]
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub union SystemAddress__bindgen_ty_1 {
- pub addr4: root::sockaddr_in,
- }
- extern "C" {
- #[doc = " \\internal Return the size to write to a bitStream"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress4sizeEv"]
- pub fn SystemAddress_size() -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " Hash the system address"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress9ToIntegerERKS0_"]
- pub fn SystemAddress_ToInteger(
- sa: *const root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_ulong;
- }
- extern "C" {
- #[doc = " Return the IP version, either IPV4 or IPV6"]
- #[doc = " \\return Either 4 or 6"]
- #[link_name = "\u{1}_ZNK6RakNet13SystemAddress12GetIPVersionEv"]
- pub fn SystemAddress_GetIPVersion(
- this: *const root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_uchar;
- }
- extern "C" {
- #[doc = " \\internal Returns either IPPROTO_IP or IPPROTO_IPV6"]
- #[doc = " \\sa GetIPVersion"]
- #[link_name = "\u{1}_ZNK6RakNet13SystemAddress10GetIPPROTOEv"]
- pub fn SystemAddress_GetIPPROTO(
- this: *const root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[doc = " Call SetToLoopback(), with whatever IP version is currently held. Defaults to IPV4"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress13SetToLoopbackEv"]
- pub fn SystemAddress_SetToLoopback(this: *mut root::RakNet::SystemAddress);
- }
- extern "C" {
- #[doc = " Call SetToLoopback() with a specific IP version"]
- #[doc = " \\param[in] ipVersion Either 4 for IPV4 or 6 for IPV6"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress13SetToLoopbackEh"]
- pub fn SystemAddress_SetToLoopback1(
- this: *mut root::RakNet::SystemAddress,
- ipVersion: ::std::os::raw::c_uchar,
- );
- }
- extern "C" {
- #[doc = " \\return If was set to 127.0.0.1 or ::1"]
- #[link_name = "\u{1}_ZNK6RakNet13SystemAddress10IsLoopbackEv"]
- pub fn SystemAddress_IsLoopback(this: *const root::RakNet::SystemAddress) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet13SystemAddress8ToStringEbc"]
- pub fn SystemAddress_ToString(
- this: *const root::RakNet::SystemAddress,
- writePort: bool,
- portDelineator: ::std::os::raw::c_char,
- ) -> *const ::std::os::raw::c_char;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet13SystemAddress8ToStringEbPcc"]
- pub fn SystemAddress_ToString1(
- this: *const root::RakNet::SystemAddress,
- writePort: bool,
- dest: *mut ::std::os::raw::c_char,
- portDelineator: ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " Set the system address from a printable IP string, for example \"192.0.2.1\" or \"2001:db8:63b3:1::3490\""]
- #[doc = " You can write the port as well, using the portDelineator, for example \"192.0.2.1|1234\""]
- #[doc = " \\param[in] str A printable IP string, for example \"192.0.2.1\" or \"2001:db8:63b3:1::3490\". Pass 0 for \\a str to set to UNASSIGNED_SYSTEM_ADDRESS"]
- #[doc = " \\param[in] portDelineator if \\a str contains a port, delineate the port with this character. portDelineator should not be '.', ':', '%', '-', '/', a number, or a-f"]
- #[doc = " \\param[in] ipVersion Only used if str is a pre-defined address in the wrong format, such as 127.0.0.1 but you want ip version 6, so you can pass 6 here to do the conversion"]
- #[doc = " \\note The current port is unchanged if a port is not specified in \\a str"]
- #[doc = " \\return True on success, false on ipVersion does not match type of passed string"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress10FromStringEPKcci"]
- pub fn SystemAddress_FromString(
- this: *mut root::RakNet::SystemAddress,
- str_: *const ::std::os::raw::c_char,
- portDelineator: ::std::os::raw::c_char,
- ipVersion: ::std::os::raw::c_int,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Same as FromString(), but you explicitly set a port at the same time"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress22FromStringExplicitPortEPKcti"]
- pub fn SystemAddress_FromStringExplicitPort(
- this: *mut root::RakNet::SystemAddress,
- str_: *const ::std::os::raw::c_char,
- port: ::std::os::raw::c_ushort,
- ipVersion: ::std::os::raw::c_int,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Copy the port from another SystemAddress structure"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress8CopyPortERKS0_"]
- pub fn SystemAddress_CopyPort(
- this: *mut root::RakNet::SystemAddress,
- right: *const root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[doc = " Returns if two system addresses have the same IP (port is not checked)"]
- #[link_name = "\u{1}_ZNK6RakNet13SystemAddress19EqualsExcludingPortERKS0_"]
- pub fn SystemAddress_EqualsExcludingPort(
- this: *const root::RakNet::SystemAddress,
- right: *const root::RakNet::SystemAddress,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Returns the port in host order (this is what you normally use)"]
- #[link_name = "\u{1}_ZNK6RakNet13SystemAddress7GetPortEv"]
- pub fn SystemAddress_GetPort(
- this: *const root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_ushort;
- }
- extern "C" {
- #[doc = " \\internal Returns the port in network order"]
- #[link_name = "\u{1}_ZNK6RakNet13SystemAddress19GetPortNetworkOrderEv"]
- pub fn SystemAddress_GetPortNetworkOrder(
- this: *const root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_ushort;
- }
- extern "C" {
- #[doc = " Sets the port. The port value should be in host order (this is what you normally use)"]
- #[doc = " Renamed from SetPort because of winspool.h http://edn.embarcadero.com/article/21494"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress16SetPortHostOrderEt"]
- pub fn SystemAddress_SetPortHostOrder(
- this: *mut root::RakNet::SystemAddress,
- s: ::std::os::raw::c_ushort,
- );
- }
- extern "C" {
- #[doc = " \\internal Sets the port. The port value should already be in network order."]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress19SetPortNetworkOrderEt"]
- pub fn SystemAddress_SetPortNetworkOrder(
- this: *mut root::RakNet::SystemAddress,
- s: ::std::os::raw::c_ushort,
- );
- }
- extern "C" {
- #[doc = " Old version, for crap platforms that don't support newer socket functions"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress16SetBinaryAddressEPKcc"]
- pub fn SystemAddress_SetBinaryAddress(
- this: *mut root::RakNet::SystemAddress,
- str_: *const ::std::os::raw::c_char,
- portDelineator: ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Old version, for crap platforms that don't support newer socket functions"]
- #[link_name = "\u{1}_ZNK6RakNet13SystemAddress12ToString_OldEbPcc"]
- pub fn SystemAddress_ToString_Old(
- this: *const root::RakNet::SystemAddress,
- writePort: bool,
- dest: *mut ::std::os::raw::c_char,
- portDelineator: ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " \\internal sockaddr_in6 requires extra data beyond just the IP and port. Copy that extra data from an existing SystemAddress that already has it"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress15FixForIPVersionERKS0_"]
- pub fn SystemAddress_FixForIPVersion(
- this: *mut root::RakNet::SystemAddress,
- boundAddressToSocket: *const root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13SystemAddress12IsLANAddressEv"]
- pub fn SystemAddress_IsLANAddress(this: *mut root::RakNet::SystemAddress) -> bool;
- }
- extern "C" {
- #[doc = " Constructors"]
- #[link_name = "\u{1}_ZN6RakNet13SystemAddressC1Ev"]
- pub fn SystemAddress_SystemAddress(this: *mut root::RakNet::SystemAddress);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13SystemAddressC1EPKc"]
- pub fn SystemAddress_SystemAddress1(
- this: *mut root::RakNet::SystemAddress,
- str_: *const ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13SystemAddressC1EPKct"]
- pub fn SystemAddress_SystemAddress2(
- this: *mut root::RakNet::SystemAddress,
- str_: *const ::std::os::raw::c_char,
- port: ::std::os::raw::c_ushort,
- );
- }
- impl SystemAddress {
- #[inline]
- pub unsafe fn size() -> ::std::os::raw::c_int {
- SystemAddress_size()
- }
- #[inline]
- pub unsafe fn ToInteger(
- sa: *const root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_ulong {
- SystemAddress_ToInteger(sa)
- }
- #[inline]
- pub unsafe fn GetIPVersion(&self) -> ::std::os::raw::c_uchar {
- SystemAddress_GetIPVersion(self)
- }
- #[inline]
- pub unsafe fn GetIPPROTO(&self) -> ::std::os::raw::c_uint {
- SystemAddress_GetIPPROTO(self)
- }
- #[inline]
- pub unsafe fn SetToLoopback(&mut self) {
- SystemAddress_SetToLoopback(self)
- }
- #[inline]
- pub unsafe fn SetToLoopback1(&mut self, ipVersion: ::std::os::raw::c_uchar) {
- SystemAddress_SetToLoopback1(self, ipVersion)
- }
- #[inline]
- pub unsafe fn IsLoopback(&self) -> bool {
- SystemAddress_IsLoopback(self)
- }
- #[inline]
- pub unsafe fn ToString(
- &self,
- writePort: bool,
- portDelineator: ::std::os::raw::c_char,
- ) -> *const ::std::os::raw::c_char {
- SystemAddress_ToString(self, writePort, portDelineator)
- }
- #[inline]
- pub unsafe fn ToString1(
- &self,
- writePort: bool,
- dest: *mut ::std::os::raw::c_char,
- portDelineator: ::std::os::raw::c_char,
- ) {
- SystemAddress_ToString1(self, writePort, dest, portDelineator)
- }
- #[inline]
- pub unsafe fn FromString(
- &mut self,
- str_: *const ::std::os::raw::c_char,
- portDelineator: ::std::os::raw::c_char,
- ipVersion: ::std::os::raw::c_int,
- ) -> bool {
- SystemAddress_FromString(self, str_, portDelineator, ipVersion)
- }
- #[inline]
- pub unsafe fn FromStringExplicitPort(
- &mut self,
- str_: *const ::std::os::raw::c_char,
- port: ::std::os::raw::c_ushort,
- ipVersion: ::std::os::raw::c_int,
- ) -> bool {
- SystemAddress_FromStringExplicitPort(self, str_, port, ipVersion)
- }
- #[inline]
- pub unsafe fn CopyPort(&mut self, right: *const root::RakNet::SystemAddress) {
- SystemAddress_CopyPort(self, right)
- }
- #[inline]
- pub unsafe fn EqualsExcludingPort(
- &self,
- right: *const root::RakNet::SystemAddress,
- ) -> bool {
- SystemAddress_EqualsExcludingPort(self, right)
- }
- #[inline]
- pub unsafe fn GetPort(&self) -> ::std::os::raw::c_ushort {
- SystemAddress_GetPort(self)
- }
- #[inline]
- pub unsafe fn GetPortNetworkOrder(&self) -> ::std::os::raw::c_ushort {
- SystemAddress_GetPortNetworkOrder(self)
- }
- #[inline]
- pub unsafe fn SetPortHostOrder(&mut self, s: ::std::os::raw::c_ushort) {
- SystemAddress_SetPortHostOrder(self, s)
- }
- #[inline]
- pub unsafe fn SetPortNetworkOrder(&mut self, s: ::std::os::raw::c_ushort) {
- SystemAddress_SetPortNetworkOrder(self, s)
- }
- #[inline]
- pub unsafe fn SetBinaryAddress(
- &mut self,
- str_: *const ::std::os::raw::c_char,
- portDelineator: ::std::os::raw::c_char,
- ) -> bool {
- SystemAddress_SetBinaryAddress(self, str_, portDelineator)
- }
- #[inline]
- pub unsafe fn ToString_Old(
- &self,
- writePort: bool,
- dest: *mut ::std::os::raw::c_char,
- portDelineator: ::std::os::raw::c_char,
- ) {
- SystemAddress_ToString_Old(self, writePort, dest, portDelineator)
- }
- #[inline]
- pub unsafe fn FixForIPVersion(
- &mut self,
- boundAddressToSocket: *const root::RakNet::SystemAddress,
- ) {
- SystemAddress_FixForIPVersion(self, boundAddressToSocket)
- }
- #[inline]
- pub unsafe fn IsLANAddress(&mut self) -> bool {
- SystemAddress_IsLANAddress(self)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- SystemAddress_SystemAddress(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new1(str_: *const ::std::os::raw::c_char) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- SystemAddress_SystemAddress1(__bindgen_tmp.as_mut_ptr(), str_);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new2(
- str_: *const ::std::os::raw::c_char,
- port: ::std::os::raw::c_ushort,
- ) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- SystemAddress_SystemAddress2(__bindgen_tmp.as_mut_ptr(), str_, port);
- __bindgen_tmp.assume_init()
- }
- }
- #[doc = " Uniquely identifies an instance of RakPeer. Use RakPeer::GetGuidFromSystemAddress() and RakPeer::GetSystemAddressFromGuid() to go between SystemAddress and RakNetGUID"]
- #[doc = " Use RakPeer::GetGuidFromSystemAddress(UNASSIGNED_SYSTEM_ADDRESS) to get your own GUID"]
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RakNetGUID {
- pub g: u64,
- pub systemIndex: root::RakNet::SystemIndex,
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet10RakNetGUID8ToStringEv"]
- pub fn RakNetGUID_ToString(
- this: *const root::RakNet::RakNetGUID,
- ) -> *const ::std::os::raw::c_char;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet10RakNetGUID8ToStringEPc"]
- pub fn RakNetGUID_ToString1(
- this: *const root::RakNet::RakNetGUID,
- dest: *mut ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RakNetGUID10FromStringEPKc"]
- pub fn RakNetGUID_FromString(
- this: *mut root::RakNet::RakNetGUID,
- source: *const ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RakNetGUID8ToUint32ERKS0_"]
- pub fn RakNetGUID_ToUint32(
- g: *const root::RakNet::RakNetGUID,
- ) -> ::std::os::raw::c_ulong;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RakNetGUIDC1Ev"]
- pub fn RakNetGUID_RakNetGUID(this: *mut root::RakNet::RakNetGUID);
- }
- impl RakNetGUID {
- #[inline]
- pub unsafe fn ToString(&self) -> *const ::std::os::raw::c_char {
- RakNetGUID_ToString(self)
- }
- #[inline]
- pub unsafe fn ToString1(&self, dest: *mut ::std::os::raw::c_char) {
- RakNetGUID_ToString1(self, dest)
- }
- #[inline]
- pub unsafe fn FromString(&mut self, source: *const ::std::os::raw::c_char) -> bool {
- RakNetGUID_FromString(self, source)
- }
- #[inline]
- pub unsafe fn ToUint32(g: *const root::RakNet::RakNetGUID) -> ::std::os::raw::c_ulong {
- RakNetGUID_ToUint32(g)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakNetGUID_RakNetGUID(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- }
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub struct AddressOrGUID {
- pub rakNetGuid: root::RakNet::RakNetGUID,
- pub systemAddress: root::RakNet::SystemAddress,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13AddressOrGUID9ToIntegerERKS0_"]
- pub fn AddressOrGUID_ToInteger(
- aog: *const root::RakNet::AddressOrGUID,
- ) -> ::std::os::raw::c_ulong;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet13AddressOrGUID8ToStringEb"]
- pub fn AddressOrGUID_ToString(
- this: *const root::RakNet::AddressOrGUID,
- writePort: bool,
- ) -> *const ::std::os::raw::c_char;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet13AddressOrGUID8ToStringEbPc"]
- pub fn AddressOrGUID_ToString1(
- this: *const root::RakNet::AddressOrGUID,
- writePort: bool,
- dest: *mut ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13AddressOrGUIDC1EPNS_6PacketE"]
- pub fn AddressOrGUID_AddressOrGUID(
- this: *mut root::RakNet::AddressOrGUID,
- packet: *mut root::RakNet::Packet,
- );
- }
- impl AddressOrGUID {
- #[inline]
- pub unsafe fn ToInteger(
- aog: *const root::RakNet::AddressOrGUID,
- ) -> ::std::os::raw::c_ulong {
- AddressOrGUID_ToInteger(aog)
- }
- #[inline]
- pub unsafe fn ToString(&self, writePort: bool) -> *const ::std::os::raw::c_char {
- AddressOrGUID_ToString(self, writePort)
- }
- #[inline]
- pub unsafe fn ToString1(&self, writePort: bool, dest: *mut ::std::os::raw::c_char) {
- AddressOrGUID_ToString1(self, writePort, dest)
- }
- #[inline]
- pub unsafe fn new(packet: *mut root::RakNet::Packet) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- AddressOrGUID_AddressOrGUID(__bindgen_tmp.as_mut_ptr(), packet);
- __bindgen_tmp.assume_init()
- }
- }
- pub type NetworkID = u64;
- #[doc = " This represents a user message from another system."]
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub struct Packet {
- #[doc = " The system that send this packet."]
- pub systemAddress: root::RakNet::SystemAddress,
- #[doc = " A unique identifier for the system that sent this packet, regardless of IP address (internal / external / remote system)"]
- #[doc = " Only valid once a connection has been established (ID_CONNECTION_REQUEST_ACCEPTED, or ID_NEW_INCOMING_CONNECTION)"]
- #[doc = " Until that time, will be UNASSIGNED_RAKNET_GUID"]
- pub guid: root::RakNet::RakNetGUID,
- #[doc = " The length of the data in bytes"]
- pub length: ::std::os::raw::c_uint,
- #[doc = " The length of the data in bits"]
- pub bitSize: root::RakNet::BitSize_t,
- #[doc = " The data from the sender"]
- pub data: *mut ::std::os::raw::c_uchar,
- #[doc = " @internal"]
- #[doc = " Indicates whether to delete the data, or to simply delete the packet."]
- pub deleteData: bool,
- #[doc = " @internal"]
- #[doc = " If true, this message is meant for the user, not for the plugins, so do not process it through plugins"]
- pub wasGeneratedLocally: bool,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct uint24_t {
- pub val: u32,
- }
- #[repr(C)]
- #[derive(Debug)]
- pub struct ReferenceCounter {
- pub refCount: ::std::os::raw::c_int,
- }
- #[repr(C)]
- #[derive(Debug)]
- pub struct RakNetSmartPtr<T> {
- pub ptr: *mut T,
- pub reference: *mut root::RakNet::ReferenceCounter,
- pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
- }
- #[doc = " \\brief String class"]
- #[doc = " \\details Has the following improvements over std::string"]
- #[doc = " -Reference counting: Suitable to store in lists"]
- #[doc = " -Variadic assignment operator"]
- #[doc = " -Doesn't cause linker errors"]
- #[repr(C)]
- #[derive(Debug)]
- pub struct RakString {
- #[doc = " \\internal"]
- pub sharedString: *mut root::RakNet::RakString_SharedString,
- }
- #[doc = " \\internal"]
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RakString_SharedString {
- pub refCountMutex: *mut root::RakNet::SimpleMutex,
- pub refCount: ::std::os::raw::c_uint,
- pub bytesUsed: root::size_t,
- pub bigString: *mut ::std::os::raw::c_char,
- pub c_str: *mut ::std::os::raw::c_char,
- pub smallString: [::std::os::raw::c_char; 100usize],
- }
- extern "C" {
- #[doc = " \\internal"]
- #[link_name = "\u{1}_ZN6RakNet9RakString11emptyStringE"]
- pub static mut RakString_emptyString: root::RakNet::RakString_SharedString;
- }
- extern "C" {
- #[doc = " \\internal"]
- #[doc = " List of free objects to reduce memory reallocations"]
- #[link_name = "\u{1}_ZN6RakNet9RakString8freeListE"]
- pub static mut RakString_freeList:
- root::DataStructures::List<*mut root::RakNet::RakString_SharedString>;
- }
- extern "C" {
- #[doc = " String class find replacement"]
- #[doc = " Searches the string for the content specified in stringToFind and returns the position of the first occurrence in the string."]
- #[doc = " Search only includes characters on or after position pos, ignoring any possible occurrences in previous locations."]
- #[doc = " \\param[in] stringToFind The string to find inside of this object's string"]
- #[doc = " \\param[in] pos The position in the string to start the search"]
- #[doc = " \\return Returns the position of the first occurrence in the string."]
- #[link_name = "\u{1}_ZN6RakNet9RakString4FindEPKcm"]
- pub fn RakString_Find(
- this: *mut root::RakNet::RakString,
- stringToFind: *const ::std::os::raw::c_char,
- pos: root::size_t,
- ) -> root::size_t;
- }
- extern "C" {
- #[doc = " Change all characters to lowercase"]
- #[link_name = "\u{1}_ZN6RakNet9RakString7ToLowerEv"]
- pub fn RakString_ToLower(
- this: *mut root::RakNet::RakString,
- ) -> *const ::std::os::raw::c_char;
- }
- extern "C" {
- #[doc = " Change all characters to uppercase"]
- #[link_name = "\u{1}_ZN6RakNet9RakString7ToUpperEv"]
- pub fn RakString_ToUpper(
- this: *mut root::RakNet::RakString,
- ) -> *const ::std::os::raw::c_char;
- }
- extern "C" {
- #[doc = " Set the value of the string"]
- #[link_name = "\u{1}_ZN6RakNet9RakString3SetEPKcz"]
- pub fn RakString_Set(
- this: *mut root::RakNet::RakString,
- format: *const ::std::os::raw::c_char,
- ...
- );
- }
- extern "C" {
- #[doc = " Sets a copy of a substring of str as the new content. The substring is the portion of str"]
- #[doc = " that begins at the character position pos and takes up to n characters"]
- #[doc = " (it takes less than n if the end of str is reached before)."]
- #[doc = " \\param[in] str The string to copy in"]
- #[doc = " \\param[in] pos The position on str to start the copy"]
- #[doc = " \\param[in] n How many chars to copy"]
- #[doc = " \\return Returns the string, note that the current string is set to that value as well"]
- #[link_name = "\u{1}_ZN6RakNet9RakString6AssignEPKcmm"]
- pub fn RakString_Assign(
- this: *mut root::RakNet::RakString,
- str_: *const ::std::os::raw::c_char,
- pos: root::size_t,
- n: root::size_t,
- ) -> root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " Returns if the string is empty. Also, C_String() would return \"\""]
- #[link_name = "\u{1}_ZNK6RakNet9RakString7IsEmptyEv"]
- pub fn RakString_IsEmpty(this: *const root::RakNet::RakString) -> bool;
- }
- extern "C" {
- #[doc = " Returns the length of the string"]
- #[link_name = "\u{1}_ZNK6RakNet9RakString9GetLengthEv"]
- pub fn RakString_GetLength(this: *const root::RakNet::RakString) -> root::size_t;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet9RakString13GetLengthUTF8Ev"]
- pub fn RakString_GetLengthUTF8(this: *const root::RakNet::RakString) -> root::size_t;
- }
- extern "C" {
- #[doc = " Replace character(s) in starting at index, for count, with c"]
- #[link_name = "\u{1}_ZN6RakNet9RakString7ReplaceEjjh"]
- pub fn RakString_Replace(
- this: *mut root::RakNet::RakString,
- index: ::std::os::raw::c_uint,
- count: ::std::os::raw::c_uint,
- c: ::std::os::raw::c_uchar,
- );
- }
- extern "C" {
- #[doc = " Replace character at index with c"]
- #[link_name = "\u{1}_ZN6RakNet9RakString7SetCharEjh"]
- pub fn RakString_SetChar(
- this: *mut root::RakNet::RakString,
- index: ::std::os::raw::c_uint,
- c: ::std::os::raw::c_uchar,
- );
- }
- extern "C" {
- #[doc = " Replace character at index with string s"]
- #[link_name = "\u{1}_ZN6RakNet9RakString7SetCharEjS0_"]
- pub fn RakString_SetChar1(
- this: *mut root::RakNet::RakString,
- index: ::std::os::raw::c_uint,
- s: root::RakNet::RakString,
- );
- }
- extern "C" {
- #[doc = " Make sure string is no longer than \\a length"]
- #[link_name = "\u{1}_ZN6RakNet9RakString8TruncateEj"]
- pub fn RakString_Truncate(
- this: *mut root::RakNet::RakString,
- length: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString12TruncateUTF8Ej"]
- pub fn RakString_TruncateUTF8(
- this: *mut root::RakNet::RakString,
- length: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet9RakString6SubStrEjj"]
- pub fn RakString_SubStr(
- this: *const root::RakNet::RakString,
- index: ::std::os::raw::c_uint,
- count: ::std::os::raw::c_uint,
- ) -> root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " Erase characters out of the string at index for count"]
- #[link_name = "\u{1}_ZN6RakNet9RakString5EraseEjj"]
- pub fn RakString_Erase(
- this: *mut root::RakNet::RakString,
- index: ::std::os::raw::c_uint,
- count: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " Set the first instance of c with a NULL terminator"]
- #[link_name = "\u{1}_ZN6RakNet9RakString25TerminateAtFirstCharacterEc"]
- pub fn RakString_TerminateAtFirstCharacter(
- this: *mut root::RakNet::RakString,
- c: ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " Set the last instance of c with a NULL terminator"]
- #[link_name = "\u{1}_ZN6RakNet9RakString24TerminateAtLastCharacterEc"]
- pub fn RakString_TerminateAtLastCharacter(
- this: *mut root::RakNet::RakString,
- c: ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString24StartAfterFirstCharacterEc"]
- pub fn RakString_StartAfterFirstCharacter(
- this: *mut root::RakNet::RakString,
- c: ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString23StartAfterLastCharacterEc"]
- pub fn RakString_StartAfterLastCharacter(
- this: *mut root::RakNet::RakString,
- c: ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " Returns how many occurances there are of \\a c in the string"]
- #[link_name = "\u{1}_ZN6RakNet9RakString17GetCharacterCountEc"]
- pub fn RakString_GetCharacterCount(
- this: *mut root::RakNet::RakString,
- c: ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " Remove all instances of c"]
- #[link_name = "\u{1}_ZN6RakNet9RakString15RemoveCharacterEc"]
- pub fn RakString_RemoveCharacter(
- this: *mut root::RakNet::RakString,
- c: ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " Create a RakString with a value, without doing printf style parsing"]
- #[doc = " Equivalent to assignment operator"]
- #[link_name = "\u{1}_ZN6RakNet9RakString11NonVariadicEPKc"]
- pub fn RakString_NonVariadic(
- str_: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " Hash the string into an unsigned int"]
- #[link_name = "\u{1}_ZN6RakNet9RakString9ToIntegerEPKc"]
- pub fn RakString_ToInteger(
- str_: *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_ulong;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString9ToIntegerERKS0_"]
- pub fn RakString_ToInteger1(
- rs: *const root::RakNet::RakString,
- ) -> ::std::os::raw::c_ulong;
- }
- extern "C" {
- #[doc = " \\brief Read an integer out of a substring"]
- #[doc = " \\param[in] str The string"]
- #[doc = " \\param[in] pos The position on str where the integer starts"]
- #[doc = " \\param[in] n How many chars to copy"]
- #[link_name = "\u{1}_ZN6RakNet9RakString20ReadIntFromSubstringEPKcmm"]
- pub fn RakString_ReadIntFromSubstring(
- str_: *const ::std::os::raw::c_char,
- pos: root::size_t,
- n: root::size_t,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString11AppendBytesEPKcj"]
- pub fn RakString_AppendBytes(
- this: *mut root::RakNet::RakString,
- bytes: *const ::std::os::raw::c_char,
- count: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " Compare strings (case sensitive)"]
- #[link_name = "\u{1}_ZNK6RakNet9RakString6StrCmpERKS0_"]
- pub fn RakString_StrCmp(
- this: *const root::RakNet::RakString,
- rhs: *const root::RakNet::RakString,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " Compare strings (case sensitive), up to num characters"]
- #[link_name = "\u{1}_ZNK6RakNet9RakString7StrNCmpERKS0_m"]
- pub fn RakString_StrNCmp(
- this: *const root::RakNet::RakString,
- rhs: *const root::RakNet::RakString,
- num: root::size_t,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " Compare strings (not case sensitive)"]
- #[link_name = "\u{1}_ZNK6RakNet9RakString7StrICmpERKS0_"]
- pub fn RakString_StrICmp(
- this: *const root::RakNet::RakString,
- rhs: *const root::RakNet::RakString,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " Clear the string"]
- #[link_name = "\u{1}_ZN6RakNet9RakString5ClearEv"]
- pub fn RakString_Clear(this: *mut root::RakNet::RakString);
- }
- extern "C" {
- #[doc = " Print the string to the screen"]
- #[link_name = "\u{1}_ZN6RakNet9RakString6PrintfEv"]
- pub fn RakString_Printf(this: *mut root::RakNet::RakString);
- }
- extern "C" {
- #[doc = " Print the string to a file"]
- #[link_name = "\u{1}_ZN6RakNet9RakString7FPrintfEP8_IO_FILE"]
- pub fn RakString_FPrintf(this: *mut root::RakNet::RakString, fp: *mut root::FILE);
- }
- extern "C" {
- #[doc = " Does the given IP address match the IP address encoded into this string, accounting for wildcards?"]
- #[link_name = "\u{1}_ZN6RakNet9RakString14IPAddressMatchEPKc"]
- pub fn RakString_IPAddressMatch(
- this: *mut root::RakNet::RakString,
- IP: *const ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Does the string contain non-printable characters other than spaces?"]
- #[link_name = "\u{1}_ZNK6RakNet9RakString32ContainsNonprintableExceptSpacesEv"]
- pub fn RakString_ContainsNonprintableExceptSpaces(
- this: *const root::RakNet::RakString,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Is this a valid email address?"]
- #[link_name = "\u{1}_ZNK6RakNet9RakString14IsEmailAddressEv"]
- pub fn RakString_IsEmailAddress(this: *const root::RakNet::RakString) -> bool;
- }
- extern "C" {
- #[doc = " URL Encode the string. See http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4029/"]
- #[link_name = "\u{1}_ZN6RakNet9RakString9URLEncodeEv"]
- pub fn RakString_URLEncode(
- this: *mut root::RakNet::RakString,
- ) -> *mut root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " URL decode the string"]
- #[link_name = "\u{1}_ZN6RakNet9RakString9URLDecodeEv"]
- pub fn RakString_URLDecode(
- this: *mut root::RakNet::RakString,
- ) -> *mut root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " https://servers.api.rackspacecloud.com/v1.0 to https://, servers.api.rackspacecloud.com, /v1.0"]
- #[link_name = "\u{1}_ZN6RakNet9RakString8SplitURIERS0_S1_S1_"]
- pub fn RakString_SplitURI(
- this: *mut root::RakNet::RakString,
- header: *mut root::RakNet::RakString,
- domain: *mut root::RakNet::RakString,
- path: *mut root::RakNet::RakString,
- );
- }
- extern "C" {
- #[doc = " Scan for quote, double quote, and backslash and prepend with backslash"]
- #[link_name = "\u{1}_ZN6RakNet9RakString9SQLEscapeEv"]
- pub fn RakString_SQLEscape(
- this: *mut root::RakNet::RakString,
- ) -> *mut root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " Format as a POST command that can be sent to a webserver"]
- #[doc = " \\param[in] uri For example, masterserver2.raknet.com/testServer"]
- #[doc = " \\param[in] contentType For example, text/plain; charset=UTF-8"]
- #[doc = " \\param[in] body Body of the post"]
- #[doc = " \\return Formatted string"]
- #[link_name = "\u{1}_ZN6RakNet9RakString13FormatForPOSTEPKcS2_S2_S2_"]
- pub fn RakString_FormatForPOST(
- uri: *const ::std::os::raw::c_char,
- contentType: *const ::std::os::raw::c_char,
- body: *const ::std::os::raw::c_char,
- extraHeaders: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString12FormatForPUTEPKcS2_S2_S2_"]
- pub fn RakString_FormatForPUT(
- uri: *const ::std::os::raw::c_char,
- contentType: *const ::std::os::raw::c_char,
- body: *const ::std::os::raw::c_char,
- extraHeaders: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " Format as a GET command that can be sent to a webserver"]
- #[doc = " \\param[in] uri For example, masterserver2.raknet.com/testServer?__gameId=comprehensivePCGame"]
- #[doc = " \\return Formatted string"]
- #[link_name = "\u{1}_ZN6RakNet9RakString12FormatForGETEPKcS2_"]
- pub fn RakString_FormatForGET(
- uri: *const ::std::os::raw::c_char,
- extraHeaders: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " Format as a DELETE command that can be sent to a webserver"]
- #[doc = " \\param[in] uri For example, masterserver2.raknet.com/testServer?__gameId=comprehensivePCGame&__rowId=1"]
- #[doc = " \\return Formatted string"]
- #[link_name = "\u{1}_ZN6RakNet9RakString15FormatForDELETEEPKcS2_"]
- pub fn RakString_FormatForDELETE(
- uri: *const ::std::os::raw::c_char,
- extraHeaders: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " Fix to be a file path, ending with /"]
- #[link_name = "\u{1}_ZN6RakNet9RakString12MakeFilePathEv"]
- pub fn RakString_MakeFilePath(
- this: *mut root::RakNet::RakString,
- ) -> *mut root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " RakString uses a freeList of old no-longer used strings"]
- #[doc = " Call this function to clear this memory on shutdown"]
- #[link_name = "\u{1}_ZN6RakNet9RakString10FreeMemoryEv"]
- pub fn RakString_FreeMemory();
- }
- extern "C" {
- #[doc = " \\internal"]
- #[link_name = "\u{1}_ZN6RakNet9RakString17FreeMemoryNoMutexEv"]
- pub fn RakString_FreeMemoryNoMutex();
- }
- extern "C" {
- #[doc = " Serialize to a bitstream, uncompressed (slightly faster)"]
- #[doc = " \\param[out] bs Bitstream to serialize to"]
- #[link_name = "\u{1}_ZNK6RakNet9RakString9SerializeEPNS_9BitStreamE"]
- pub fn RakString_Serialize(
- this: *const root::RakNet::RakString,
- bs: *mut root::RakNet::BitStream,
- );
- }
- extern "C" {
- #[doc = " Static version of the Serialize function"]
- #[link_name = "\u{1}_ZN6RakNet9RakString9SerializeEPKcPNS_9BitStreamE"]
- pub fn RakString_Serialize1(
- str_: *const ::std::os::raw::c_char,
- bs: *mut root::RakNet::BitStream,
- );
- }
- extern "C" {
- #[doc = " Serialize to a bitstream, compressed (better bandwidth usage)"]
- #[doc = " \\param[out] bs Bitstream to serialize to"]
- #[doc = " \\param[in] languageId languageId to pass to the StringCompressor class"]
- #[doc = " \\param[in] writeLanguageId encode the languageId variable in the stream. If false, 0 is assumed, and DeserializeCompressed will not look for this variable in the stream (saves bandwidth)"]
- #[doc = " \\pre StringCompressor::AddReference must have been called to instantiate the class (Happens automatically from RakPeer::Startup())"]
- #[link_name = "\u{1}_ZNK6RakNet9RakString19SerializeCompressedEPNS_9BitStreamEhb"]
- pub fn RakString_SerializeCompressed(
- this: *const root::RakNet::RakString,
- bs: *mut root::RakNet::BitStream,
- languageId: u8,
- writeLanguageId: bool,
- );
- }
- extern "C" {
- #[doc = " Static version of the SerializeCompressed function"]
- #[link_name = "\u{1}_ZN6RakNet9RakString19SerializeCompressedEPKcPNS_9BitStreamEhb"]
- pub fn RakString_SerializeCompressed1(
- str_: *const ::std::os::raw::c_char,
- bs: *mut root::RakNet::BitStream,
- languageId: u8,
- writeLanguageId: bool,
- );
- }
- extern "C" {
- #[doc = " Deserialize what was written by Serialize"]
- #[doc = " \\param[in] bs Bitstream to serialize from"]
- #[doc = " \\return true if the deserialization was successful"]
- #[link_name = "\u{1}_ZN6RakNet9RakString11DeserializeEPNS_9BitStreamE"]
- pub fn RakString_Deserialize(
- this: *mut root::RakNet::RakString,
- bs: *mut root::RakNet::BitStream,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Static version of the Deserialize() function"]
- #[link_name = "\u{1}_ZN6RakNet9RakString11DeserializeEPcPNS_9BitStreamE"]
- pub fn RakString_Deserialize1(
- str_: *mut ::std::os::raw::c_char,
- bs: *mut root::RakNet::BitStream,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Deserialize compressed string, written by SerializeCompressed"]
- #[doc = " \\param[in] bs Bitstream to serialize from"]
- #[doc = " \\param[in] readLanguageId If true, looks for the variable langaugeId in the data stream. Must match what was passed to SerializeCompressed"]
- #[doc = " \\return true if the deserialization was successful"]
- #[doc = " \\pre StringCompressor::AddReference must have been called to instantiate the class (Happens automatically from RakPeer::Startup())"]
- #[link_name = "\u{1}_ZN6RakNet9RakString21DeserializeCompressedEPNS_9BitStreamEb"]
- pub fn RakString_DeserializeCompressed(
- this: *mut root::RakNet::RakString,
- bs: *mut root::RakNet::BitStream,
- readLanguageId: bool,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Static version of the DeserializeCompressed() function"]
- #[link_name = "\u{1}_ZN6RakNet9RakString21DeserializeCompressedEPcPNS_9BitStreamEb"]
- pub fn RakString_DeserializeCompressed1(
- str_: *mut ::std::os::raw::c_char,
- bs: *mut root::RakNet::BitStream,
- readLanguageId: bool,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString8ToStringEl"]
- pub fn RakString_ToString(i: i64) -> *const ::std::os::raw::c_char;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString8ToStringEm"]
- pub fn RakString_ToString1(i: u64) -> *const ::std::os::raw::c_char;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString13RakStringCompERKS0_S2_"]
- pub fn RakString_RakStringComp(
- key: *const root::RakNet::RakString,
- data: *const root::RakNet::RakString,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString9LockMutexEv"]
- pub fn RakString_LockMutex();
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString11UnlockMutexEv"]
- pub fn RakString_UnlockMutex();
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString18FormatForPUTOrPostEPKcS2_S2_S2_S2_"]
- pub fn RakString_FormatForPUTOrPost(
- type_: *const ::std::os::raw::c_char,
- uri: *const ::std::os::raw::c_char,
- contentType: *const ::std::os::raw::c_char,
- body: *const ::std::os::raw::c_char,
- extraHeaders: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString8AllocateEm"]
- pub fn RakString_Allocate(this: *mut root::RakNet::RakString, len: root::size_t);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString6AssignEPKc"]
- pub fn RakString_Assign1(
- this: *mut root::RakNet::RakString,
- str_: *const ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString6AssignEPKcP13__va_list_tag"]
- pub fn RakString_Assign2(
- this: *mut root::RakNet::RakString,
- str_: *const ::std::os::raw::c_char,
- ap: *mut root::__va_list_tag,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString5CloneEv"]
- pub fn RakString_Clone(this: *mut root::RakNet::RakString);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString4FreeEv"]
- pub fn RakString_Free(this: *mut root::RakNet::RakString);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString7ToLowerEh"]
- pub fn RakString_ToLower1(
- this: *mut root::RakNet::RakString,
- c: ::std::os::raw::c_uchar,
- ) -> ::std::os::raw::c_uchar;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString7ToUpperEh"]
- pub fn RakString_ToUpper1(
- this: *mut root::RakNet::RakString,
- c: ::std::os::raw::c_uchar,
- ) -> ::std::os::raw::c_uchar;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakString7ReallocEPNS0_12SharedStringEm"]
- pub fn RakString_Realloc(
- this: *mut root::RakNet::RakString,
- sharedString: *mut root::RakNet::RakString_SharedString,
- bytes: root::size_t,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakStringC1Ev"]
- pub fn RakString_RakString(this: *mut root::RakNet::RakString);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakStringC1Ec"]
- pub fn RakString_RakString1(
- this: *mut root::RakNet::RakString,
- input: ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakStringC1Eh"]
- pub fn RakString_RakString2(
- this: *mut root::RakNet::RakString,
- input: ::std::os::raw::c_uchar,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakStringC1EPKhz"]
- pub fn RakString_RakString3(
- this: *mut root::RakNet::RakString,
- format: *const ::std::os::raw::c_uchar,
- ...
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakStringC1EPKcz"]
- pub fn RakString_RakString4(
- this: *mut root::RakNet::RakString,
- format: *const ::std::os::raw::c_char,
- ...
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakStringC1ERKS0_"]
- pub fn RakString_RakString5(
- this: *mut root::RakNet::RakString,
- rhs: *const root::RakNet::RakString,
- );
- }
- extern "C" {
- #[doc = " \\internal"]
- #[link_name = "\u{1}_ZN6RakNet9RakStringC1EPNS0_12SharedStringE"]
- pub fn RakString_RakString6(
- this: *mut root::RakNet::RakString,
- _sharedString: *mut root::RakNet::RakString_SharedString,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakStringD1Ev"]
- pub fn RakString_RakString_destructor(this: *mut root::RakNet::RakString);
- }
- impl RakString {
- #[inline]
- pub unsafe fn Find(
- &mut self,
- stringToFind: *const ::std::os::raw::c_char,
- pos: root::size_t,
- ) -> root::size_t {
- RakString_Find(self, stringToFind, pos)
- }
- #[inline]
- pub unsafe fn ToLower(&mut self) -> *const ::std::os::raw::c_char {
- RakString_ToLower(self)
- }
- #[inline]
- pub unsafe fn ToUpper(&mut self) -> *const ::std::os::raw::c_char {
- RakString_ToUpper(self)
- }
- #[inline]
- pub unsafe fn Assign(
- &mut self,
- str_: *const ::std::os::raw::c_char,
- pos: root::size_t,
- n: root::size_t,
- ) -> root::RakNet::RakString {
- RakString_Assign(self, str_, pos, n)
- }
- #[inline]
- pub unsafe fn IsEmpty(&self) -> bool {
- RakString_IsEmpty(self)
- }
- #[inline]
- pub unsafe fn GetLength(&self) -> root::size_t {
- RakString_GetLength(self)
- }
- #[inline]
- pub unsafe fn GetLengthUTF8(&self) -> root::size_t {
- RakString_GetLengthUTF8(self)
- }
- #[inline]
- pub unsafe fn Replace(
- &mut self,
- index: ::std::os::raw::c_uint,
- count: ::std::os::raw::c_uint,
- c: ::std::os::raw::c_uchar,
- ) {
- RakString_Replace(self, index, count, c)
- }
- #[inline]
- pub unsafe fn SetChar(
- &mut self,
- index: ::std::os::raw::c_uint,
- c: ::std::os::raw::c_uchar,
- ) {
- RakString_SetChar(self, index, c)
- }
- #[inline]
- pub unsafe fn SetChar1(
- &mut self,
- index: ::std::os::raw::c_uint,
- s: root::RakNet::RakString,
- ) {
- RakString_SetChar1(self, index, s)
- }
- #[inline]
- pub unsafe fn Truncate(&mut self, length: ::std::os::raw::c_uint) {
- RakString_Truncate(self, length)
- }
- #[inline]
- pub unsafe fn TruncateUTF8(&mut self, length: ::std::os::raw::c_uint) {
- RakString_TruncateUTF8(self, length)
- }
- #[inline]
- pub unsafe fn SubStr(
- &self,
- index: ::std::os::raw::c_uint,
- count: ::std::os::raw::c_uint,
- ) -> root::RakNet::RakString {
- RakString_SubStr(self, index, count)
- }
- #[inline]
- pub unsafe fn Erase(
- &mut self,
- index: ::std::os::raw::c_uint,
- count: ::std::os::raw::c_uint,
- ) {
- RakString_Erase(self, index, count)
- }
- #[inline]
- pub unsafe fn TerminateAtFirstCharacter(&mut self, c: ::std::os::raw::c_char) {
- RakString_TerminateAtFirstCharacter(self, c)
- }
- #[inline]
- pub unsafe fn TerminateAtLastCharacter(&mut self, c: ::std::os::raw::c_char) {
- RakString_TerminateAtLastCharacter(self, c)
- }
- #[inline]
- pub unsafe fn StartAfterFirstCharacter(&mut self, c: ::std::os::raw::c_char) {
- RakString_StartAfterFirstCharacter(self, c)
- }
- #[inline]
- pub unsafe fn StartAfterLastCharacter(&mut self, c: ::std::os::raw::c_char) {
- RakString_StartAfterLastCharacter(self, c)
- }
- #[inline]
- pub unsafe fn GetCharacterCount(
- &mut self,
- c: ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int {
- RakString_GetCharacterCount(self, c)
- }
- #[inline]
- pub unsafe fn RemoveCharacter(&mut self, c: ::std::os::raw::c_char) {
- RakString_RemoveCharacter(self, c)
- }
- #[inline]
- pub unsafe fn NonVariadic(
- str_: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString {
- RakString_NonVariadic(str_)
- }
- #[inline]
- pub unsafe fn ToInteger(
- str_: *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_ulong {
- RakString_ToInteger(str_)
- }
- #[inline]
- pub unsafe fn ToInteger1(
- rs: *const root::RakNet::RakString,
- ) -> ::std::os::raw::c_ulong {
- RakString_ToInteger1(rs)
- }
- #[inline]
- pub unsafe fn ReadIntFromSubstring(
- str_: *const ::std::os::raw::c_char,
- pos: root::size_t,
- n: root::size_t,
- ) -> ::std::os::raw::c_int {
- RakString_ReadIntFromSubstring(str_, pos, n)
- }
- #[inline]
- pub unsafe fn AppendBytes(
- &mut self,
- bytes: *const ::std::os::raw::c_char,
- count: ::std::os::raw::c_uint,
- ) {
- RakString_AppendBytes(self, bytes, count)
- }
- #[inline]
- pub unsafe fn StrCmp(
- &self,
- rhs: *const root::RakNet::RakString,
- ) -> ::std::os::raw::c_int {
- RakString_StrCmp(self, rhs)
- }
- #[inline]
- pub unsafe fn StrNCmp(
- &self,
- rhs: *const root::RakNet::RakString,
- num: root::size_t,
- ) -> ::std::os::raw::c_int {
- RakString_StrNCmp(self, rhs, num)
- }
- #[inline]
- pub unsafe fn StrICmp(
- &self,
- rhs: *const root::RakNet::RakString,
- ) -> ::std::os::raw::c_int {
- RakString_StrICmp(self, rhs)
- }
- #[inline]
- pub unsafe fn Clear(&mut self) {
- RakString_Clear(self)
- }
- #[inline]
- pub unsafe fn Printf(&mut self) {
- RakString_Printf(self)
- }
- #[inline]
- pub unsafe fn FPrintf(&mut self, fp: *mut root::FILE) {
- RakString_FPrintf(self, fp)
- }
- #[inline]
- pub unsafe fn IPAddressMatch(&mut self, IP: *const ::std::os::raw::c_char) -> bool {
- RakString_IPAddressMatch(self, IP)
- }
- #[inline]
- pub unsafe fn ContainsNonprintableExceptSpaces(&self) -> bool {
- RakString_ContainsNonprintableExceptSpaces(self)
- }
- #[inline]
- pub unsafe fn IsEmailAddress(&self) -> bool {
- RakString_IsEmailAddress(self)
- }
- #[inline]
- pub unsafe fn URLEncode(&mut self) -> *mut root::RakNet::RakString {
- RakString_URLEncode(self)
- }
- #[inline]
- pub unsafe fn URLDecode(&mut self) -> *mut root::RakNet::RakString {
- RakString_URLDecode(self)
- }
- #[inline]
- pub unsafe fn SplitURI(
- &mut self,
- header: *mut root::RakNet::RakString,
- domain: *mut root::RakNet::RakString,
- path: *mut root::RakNet::RakString,
- ) {
- RakString_SplitURI(self, header, domain, path)
- }
- #[inline]
- pub unsafe fn SQLEscape(&mut self) -> *mut root::RakNet::RakString {
- RakString_SQLEscape(self)
- }
- #[inline]
- pub unsafe fn FormatForPOST(
- uri: *const ::std::os::raw::c_char,
- contentType: *const ::std::os::raw::c_char,
- body: *const ::std::os::raw::c_char,
- extraHeaders: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString {
- RakString_FormatForPOST(uri, contentType, body, extraHeaders)
- }
- #[inline]
- pub unsafe fn FormatForPUT(
- uri: *const ::std::os::raw::c_char,
- contentType: *const ::std::os::raw::c_char,
- body: *const ::std::os::raw::c_char,
- extraHeaders: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString {
- RakString_FormatForPUT(uri, contentType, body, extraHeaders)
- }
- #[inline]
- pub unsafe fn FormatForGET(
- uri: *const ::std::os::raw::c_char,
- extraHeaders: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString {
- RakString_FormatForGET(uri, extraHeaders)
- }
- #[inline]
- pub unsafe fn FormatForDELETE(
- uri: *const ::std::os::raw::c_char,
- extraHeaders: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString {
- RakString_FormatForDELETE(uri, extraHeaders)
- }
- #[inline]
- pub unsafe fn MakeFilePath(&mut self) -> *mut root::RakNet::RakString {
- RakString_MakeFilePath(self)
- }
- #[inline]
- pub unsafe fn FreeMemory() {
- RakString_FreeMemory()
- }
- #[inline]
- pub unsafe fn FreeMemoryNoMutex() {
- RakString_FreeMemoryNoMutex()
- }
- #[inline]
- pub unsafe fn Serialize(&self, bs: *mut root::RakNet::BitStream) {
- RakString_Serialize(self, bs)
- }
- #[inline]
- pub unsafe fn Serialize1(
- str_: *const ::std::os::raw::c_char,
- bs: *mut root::RakNet::BitStream,
- ) {
- RakString_Serialize1(str_, bs)
- }
- #[inline]
- pub unsafe fn SerializeCompressed(
- &self,
- bs: *mut root::RakNet::BitStream,
- languageId: u8,
- writeLanguageId: bool,
- ) {
- RakString_SerializeCompressed(self, bs, languageId, writeLanguageId)
- }
- #[inline]
- pub unsafe fn SerializeCompressed1(
- str_: *const ::std::os::raw::c_char,
- bs: *mut root::RakNet::BitStream,
- languageId: u8,
- writeLanguageId: bool,
- ) {
- RakString_SerializeCompressed1(str_, bs, languageId, writeLanguageId)
- }
- #[inline]
- pub unsafe fn Deserialize(&mut self, bs: *mut root::RakNet::BitStream) -> bool {
- RakString_Deserialize(self, bs)
- }
- #[inline]
- pub unsafe fn Deserialize1(
- str_: *mut ::std::os::raw::c_char,
- bs: *mut root::RakNet::BitStream,
- ) -> bool {
- RakString_Deserialize1(str_, bs)
- }
- #[inline]
- pub unsafe fn DeserializeCompressed(
- &mut self,
- bs: *mut root::RakNet::BitStream,
- readLanguageId: bool,
- ) -> bool {
- RakString_DeserializeCompressed(self, bs, readLanguageId)
- }
- #[inline]
- pub unsafe fn DeserializeCompressed1(
- str_: *mut ::std::os::raw::c_char,
- bs: *mut root::RakNet::BitStream,
- readLanguageId: bool,
- ) -> bool {
- RakString_DeserializeCompressed1(str_, bs, readLanguageId)
- }
- #[inline]
- pub unsafe fn ToString(i: i64) -> *const ::std::os::raw::c_char {
- RakString_ToString(i)
- }
- #[inline]
- pub unsafe fn ToString1(i: u64) -> *const ::std::os::raw::c_char {
- RakString_ToString1(i)
- }
- #[inline]
- pub unsafe fn RakStringComp(
- key: *const root::RakNet::RakString,
- data: *const root::RakNet::RakString,
- ) -> ::std::os::raw::c_int {
- RakString_RakStringComp(key, data)
- }
- #[inline]
- pub unsafe fn LockMutex() {
- RakString_LockMutex()
- }
- #[inline]
- pub unsafe fn UnlockMutex() {
- RakString_UnlockMutex()
- }
- #[inline]
- pub unsafe fn FormatForPUTOrPost(
- type_: *const ::std::os::raw::c_char,
- uri: *const ::std::os::raw::c_char,
- contentType: *const ::std::os::raw::c_char,
- body: *const ::std::os::raw::c_char,
- extraHeaders: *const ::std::os::raw::c_char,
- ) -> root::RakNet::RakString {
- RakString_FormatForPUTOrPost(type_, uri, contentType, body, extraHeaders)
- }
- #[inline]
- pub unsafe fn Allocate(&mut self, len: root::size_t) {
- RakString_Allocate(self, len)
- }
- #[inline]
- pub unsafe fn Assign1(&mut self, str_: *const ::std::os::raw::c_char) {
- RakString_Assign1(self, str_)
- }
- #[inline]
- pub unsafe fn Assign2(
- &mut self,
- str_: *const ::std::os::raw::c_char,
- ap: *mut root::__va_list_tag,
- ) {
- RakString_Assign2(self, str_, ap)
- }
- #[inline]
- pub unsafe fn Clone(&mut self) {
- RakString_Clone(self)
- }
- #[inline]
- pub unsafe fn Free(&mut self) {
- RakString_Free(self)
- }
- #[inline]
- pub unsafe fn ToLower1(
- &mut self,
- c: ::std::os::raw::c_uchar,
- ) -> ::std::os::raw::c_uchar {
- RakString_ToLower1(self, c)
- }
- #[inline]
- pub unsafe fn ToUpper1(
- &mut self,
- c: ::std::os::raw::c_uchar,
- ) -> ::std::os::raw::c_uchar {
- RakString_ToUpper1(self, c)
- }
- #[inline]
- pub unsafe fn Realloc(
- &mut self,
- sharedString: *mut root::RakNet::RakString_SharedString,
- bytes: root::size_t,
- ) {
- RakString_Realloc(self, sharedString, bytes)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakString_RakString(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new1(input: ::std::os::raw::c_char) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakString_RakString1(__bindgen_tmp.as_mut_ptr(), input);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new2(input: ::std::os::raw::c_uchar) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakString_RakString2(__bindgen_tmp.as_mut_ptr(), input);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new3(rhs: *const root::RakNet::RakString) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakString_RakString5(__bindgen_tmp.as_mut_ptr(), rhs);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new4(_sharedString: *mut root::RakNet::RakString_SharedString) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakString_RakString6(__bindgen_tmp.as_mut_ptr(), _sharedString);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- RakString_RakString_destructor(self)
- }
- }
- #[repr(C)]
- #[derive(Debug)]
- pub struct SocketLayer {
- pub _address: u8,
- }
- extern "C" {
- #[doc = " Given a socket and IP, retrieves the subnet mask, on linux the socket is unused"]
- #[doc = " \\param[in] inSock the socket"]
- #[doc = " \\param[in] inIpString The ip of the interface you wish to retrieve the subnet mask from"]
- #[doc = " \\return Returns the ip dotted subnet mask if successful, otherwise returns empty string (\"\")"]
- #[link_name = "\u{1}_ZN6RakNet11SocketLayer23GetSubNetForSocketAndIpEiNS_9RakStringE"]
- pub fn SocketLayer_GetSubNetForSocketAndIp(
- inSock: root::__UDPSOCKET__,
- inIpString: root::RakNet::RakString,
- ) -> root::RakNet::RakString;
- }
- extern "C" {
- #[doc = " Retrieve all local IP address in a string format."]
- #[doc = " \\param[in] s The socket whose port we are referring to"]
- #[doc = " \\param[in] ipList An array of ip address in dotted notation."]
- #[link_name = "\u{1}_ZN6RakNet11SocketLayer7GetMyIPEPNS_13SystemAddressE"]
- pub fn SocketLayer_GetMyIP(addresses: *mut root::RakNet::SystemAddress);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet11SocketLayer12GetLocalPortEi"]
- pub fn SocketLayer_GetLocalPort(s: root::__UDPSOCKET__) -> ::std::os::raw::c_ushort;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet11SocketLayer20GetSystemAddress_OldEiPNS_13SystemAddressE"]
- pub fn SocketLayer_GetSystemAddress_Old(
- s: root::__UDPSOCKET__,
- systemAddressOut: *mut root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet11SocketLayer16GetSystemAddressEiPNS_13SystemAddressE"]
- pub fn SocketLayer_GetSystemAddress(
- s: root::__UDPSOCKET__,
- systemAddressOut: *mut root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet11SocketLayer16SetSocketOptionsEibb"]
- pub fn SocketLayer_SetSocketOptions(
- listenSocket: root::__UDPSOCKET__,
- blockingSocket: bool,
- setBroadcast: bool,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet11SocketLayer18GetFirstBindableIPEPci"]
- pub fn SocketLayer_GetFirstBindableIP(
- firstBindable: *mut ::std::os::raw::c_char,
- ipProto: ::std::os::raw::c_int,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Default Constructor"]
- #[link_name = "\u{1}_ZN6RakNet11SocketLayerC1Ev"]
- pub fn SocketLayer_SocketLayer(this: *mut root::RakNet::SocketLayer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet11SocketLayerD1Ev"]
- pub fn SocketLayer_SocketLayer_destructor(this: *mut root::RakNet::SocketLayer);
- }
- impl SocketLayer {
- #[inline]
- pub unsafe fn GetSubNetForSocketAndIp(
- inSock: root::__UDPSOCKET__,
- inIpString: root::RakNet::RakString,
- ) -> root::RakNet::RakString {
- SocketLayer_GetSubNetForSocketAndIp(inSock, inIpString)
- }
- #[inline]
- pub unsafe fn GetMyIP(addresses: *mut root::RakNet::SystemAddress) {
- SocketLayer_GetMyIP(addresses)
- }
- #[inline]
- pub unsafe fn GetLocalPort(s: root::__UDPSOCKET__) -> ::std::os::raw::c_ushort {
- SocketLayer_GetLocalPort(s)
- }
- #[inline]
- pub unsafe fn GetSystemAddress_Old(
- s: root::__UDPSOCKET__,
- systemAddressOut: *mut root::RakNet::SystemAddress,
- ) {
- SocketLayer_GetSystemAddress_Old(s, systemAddressOut)
- }
- #[inline]
- pub unsafe fn GetSystemAddress(
- s: root::__UDPSOCKET__,
- systemAddressOut: *mut root::RakNet::SystemAddress,
- ) {
- SocketLayer_GetSystemAddress(s, systemAddressOut)
- }
- #[inline]
- pub unsafe fn SetSocketOptions(
- listenSocket: root::__UDPSOCKET__,
- blockingSocket: bool,
- setBroadcast: bool,
- ) {
- SocketLayer_SetSocketOptions(listenSocket, blockingSocket, setBroadcast)
- }
- #[inline]
- pub unsafe fn GetFirstBindableIP(
- firstBindable: *mut ::std::os::raw::c_char,
- ipProto: ::std::os::raw::c_int,
- ) -> bool {
- SocketLayer_GetFirstBindableIP(firstBindable, ipProto)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- SocketLayer_SocketLayer(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- SocketLayer_SocketLayer_destructor(self)
- }
- }
- #[doc = " \\brief String class for Unicode"]
- #[repr(C)]
- #[derive(Debug)]
- pub struct RakWString {
- pub c_str: *mut u32,
- pub c_strCharLength: root::size_t,
- }
- extern "C" {
- #[doc = " Set the value of the string"]
- #[link_name = "\u{1}_ZN6RakNet10RakWString3SetEPw"]
- pub fn RakWString_Set(this: *mut root::RakNet::RakWString, str_: *mut u32);
- }
- extern "C" {
- #[doc = " Returns if the string is empty. Also, C_String() would return \"\""]
- #[link_name = "\u{1}_ZNK6RakNet10RakWString7IsEmptyEv"]
- pub fn RakWString_IsEmpty(this: *const root::RakNet::RakWString) -> bool;
- }
- extern "C" {
- #[doc = " Returns the length of the string"]
- #[link_name = "\u{1}_ZNK6RakNet10RakWString9GetLengthEv"]
- pub fn RakWString_GetLength(this: *const root::RakNet::RakWString) -> root::size_t;
- }
- extern "C" {
- #[doc = " Has the string into an unsigned int"]
- #[link_name = "\u{1}_ZN6RakNet10RakWString9ToIntegerERKS0_"]
- pub fn RakWString_ToInteger(
- rs: *const root::RakNet::RakWString,
- ) -> ::std::os::raw::c_ulong;
- }
- extern "C" {
- #[doc = " Compare strings (case sensitive)"]
- #[link_name = "\u{1}_ZNK6RakNet10RakWString6StrCmpERKS0_"]
- pub fn RakWString_StrCmp(
- this: *const root::RakNet::RakWString,
- right: *const root::RakNet::RakWString,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " Compare strings (not case sensitive)"]
- #[link_name = "\u{1}_ZNK6RakNet10RakWString7StrICmpERKS0_"]
- pub fn RakWString_StrICmp(
- this: *const root::RakNet::RakWString,
- right: *const root::RakNet::RakWString,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " Clear the string"]
- #[link_name = "\u{1}_ZN6RakNet10RakWString5ClearEv"]
- pub fn RakWString_Clear(this: *mut root::RakNet::RakWString);
- }
- extern "C" {
- #[doc = " Print the string to the screen"]
- #[link_name = "\u{1}_ZN6RakNet10RakWString6PrintfEv"]
- pub fn RakWString_Printf(this: *mut root::RakNet::RakWString);
- }
- extern "C" {
- #[doc = " Print the string to a file"]
- #[link_name = "\u{1}_ZN6RakNet10RakWString7FPrintfEP8_IO_FILE"]
- pub fn RakWString_FPrintf(this: *mut root::RakNet::RakWString, fp: *mut root::FILE);
- }
- extern "C" {
- #[doc = " Serialize to a bitstream, uncompressed (slightly faster)"]
- #[doc = " \\param[out] bs Bitstream to serialize to"]
- #[link_name = "\u{1}_ZNK6RakNet10RakWString9SerializeEPNS_9BitStreamE"]
- pub fn RakWString_Serialize(
- this: *const root::RakNet::RakWString,
- bs: *mut root::RakNet::BitStream,
- );
- }
- extern "C" {
- #[doc = " Static version of the Serialize function"]
- #[link_name = "\u{1}_ZN6RakNet10RakWString9SerializeEPKwPNS_9BitStreamE"]
- pub fn RakWString_Serialize1(str_: *const u32, bs: *mut root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " Deserialize what was written by Serialize"]
- #[doc = " \\param[in] bs Bitstream to serialize from"]
- #[doc = " \\return true if the deserialization was successful"]
- #[link_name = "\u{1}_ZN6RakNet10RakWString11DeserializeEPNS_9BitStreamE"]
- pub fn RakWString_Deserialize(
- this: *mut root::RakNet::RakWString,
- bs: *mut root::RakNet::BitStream,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Static version of the Deserialize() function"]
- #[link_name = "\u{1}_ZN6RakNet10RakWString11DeserializeEPwPNS_9BitStreamE"]
- pub fn RakWString_Deserialize1(
- str_: *mut u32,
- bs: *mut root::RakNet::BitStream,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RakWStringC1Ev"]
- pub fn RakWString_RakWString(this: *mut root::RakNet::RakWString);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RakWStringC1ERKNS_9RakStringE"]
- pub fn RakWString_RakWString1(
- this: *mut root::RakNet::RakWString,
- right: *const root::RakNet::RakString,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RakWStringC1EPKw"]
- pub fn RakWString_RakWString2(this: *mut root::RakNet::RakWString, input: *const u32);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RakWStringC1ERKS0_"]
- pub fn RakWString_RakWString3(
- this: *mut root::RakNet::RakWString,
- right: *const root::RakNet::RakWString,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RakWStringC1EPKc"]
- pub fn RakWString_RakWString4(
- this: *mut root::RakNet::RakWString,
- input: *const ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RakWStringD1Ev"]
- pub fn RakWString_RakWString_destructor(this: *mut root::RakNet::RakWString);
- }
- impl RakWString {
- #[inline]
- pub unsafe fn Set(&mut self, str_: *mut u32) {
- RakWString_Set(self, str_)
- }
- #[inline]
- pub unsafe fn IsEmpty(&self) -> bool {
- RakWString_IsEmpty(self)
- }
- #[inline]
- pub unsafe fn GetLength(&self) -> root::size_t {
- RakWString_GetLength(self)
- }
- #[inline]
- pub unsafe fn ToInteger(
- rs: *const root::RakNet::RakWString,
- ) -> ::std::os::raw::c_ulong {
- RakWString_ToInteger(rs)
- }
- #[inline]
- pub unsafe fn StrCmp(
- &self,
- right: *const root::RakNet::RakWString,
- ) -> ::std::os::raw::c_int {
- RakWString_StrCmp(self, right)
- }
- #[inline]
- pub unsafe fn StrICmp(
- &self,
- right: *const root::RakNet::RakWString,
- ) -> ::std::os::raw::c_int {
- RakWString_StrICmp(self, right)
- }
- #[inline]
- pub unsafe fn Clear(&mut self) {
- RakWString_Clear(self)
- }
- #[inline]
- pub unsafe fn Printf(&mut self) {
- RakWString_Printf(self)
- }
- #[inline]
- pub unsafe fn FPrintf(&mut self, fp: *mut root::FILE) {
- RakWString_FPrintf(self, fp)
- }
- #[inline]
- pub unsafe fn Serialize(&self, bs: *mut root::RakNet::BitStream) {
- RakWString_Serialize(self, bs)
- }
- #[inline]
- pub unsafe fn Serialize1(str_: *const u32, bs: *mut root::RakNet::BitStream) {
- RakWString_Serialize1(str_, bs)
- }
- #[inline]
- pub unsafe fn Deserialize(&mut self, bs: *mut root::RakNet::BitStream) -> bool {
- RakWString_Deserialize(self, bs)
- }
- #[inline]
- pub unsafe fn Deserialize1(str_: *mut u32, bs: *mut root::RakNet::BitStream) -> bool {
- RakWString_Deserialize1(str_, bs)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakWString_RakWString(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new1(right: *const root::RakNet::RakString) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakWString_RakWString1(__bindgen_tmp.as_mut_ptr(), right);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new2(input: *const u32) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakWString_RakWString2(__bindgen_tmp.as_mut_ptr(), input);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new3(right: *const root::RakNet::RakWString) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakWString_RakWString3(__bindgen_tmp.as_mut_ptr(), right);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new4(input: *const ::std::os::raw::c_char) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakWString_RakWString4(__bindgen_tmp.as_mut_ptr(), input);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- RakWString_RakWString_destructor(self)
- }
- }
- #[doc = " This class allows you to write and read native types as a string of bits. BitStream is used extensively throughout RakNet and is designed to be used by users as well."]
- #[doc = " \\sa BitStreamSample.txt"]
- #[repr(C)]
- #[derive(Debug)]
- pub struct BitStream {
- pub numberOfBitsUsed: root::RakNet::BitSize_t,
- pub numberOfBitsAllocated: root::RakNet::BitSize_t,
- pub readOffset: root::RakNet::BitSize_t,
- pub data: *mut ::std::os::raw::c_uchar,
- #[doc = " true if the internal buffer is copy of the data passed to the constructor"]
- pub copyData: bool,
- #[doc = " BitStreams that use less than BITSTREAM_STACK_ALLOCATION_SIZE use the stack, rather than the heap to store data. It switches over if BITSTREAM_STACK_ALLOCATION_SIZE is exceeded"]
- pub stackData: [::std::os::raw::c_uchar; 256usize],
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream11GetInstanceEv"]
- pub fn BitStream_GetInstance() -> *mut root::RakNet::BitStream;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream15DestroyInstanceEPS0_"]
- pub fn BitStream_DestroyInstance(i: *mut root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " Resets the bitstream for reuse."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream5ResetEv"]
- pub fn BitStream_Reset(this: *mut root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " \\brief Bidirectional serialize/deserialize an array or casted stream or raw data. This does NOT do endian swapping."]
- #[doc = " \\param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data"]
- #[doc = " \\param[in] inOutByteArray a byte buffer"]
- #[doc = " \\param[in] numberOfBytes the size of \\a input in bytes"]
- #[doc = " \\return true if \\a writeToBitstream is true. true if \\a writeToBitstream is false and the read was successful. false if \\a writeToBitstream is false and the read was not successful."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream9SerializeEbPcj"]
- pub fn BitStream_Serialize(
- this: *mut root::RakNet::BitStream,
- writeToBitstream: bool,
- inOutByteArray: *mut ::std::os::raw::c_char,
- numberOfBytes: ::std::os::raw::c_uint,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Serialize a float into 2 bytes, spanning the range between \\a floatMin and \\a floatMax"]
- #[doc = " \\param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data"]
- #[doc = " \\param[in] inOutFloat The float to write"]
- #[doc = " \\param[in] floatMin Predetermined minimum value of f"]
- #[doc = " \\param[in] floatMax Predetermined maximum value of f"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream16SerializeFloat16EbRfff"]
- pub fn BitStream_SerializeFloat16(
- this: *mut root::RakNet::BitStream,
- writeToBitstream: bool,
- inOutFloat: *mut f32,
- floatMin: f32,
- floatMax: f32,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Bidirectional serialize/deserialize numberToSerialize bits to/from the input."]
- #[doc = " \\details Right aligned data means in the case of a partial byte, the bits are aligned"]
- #[doc = " from the right (bit 0) rather than the left (as in the normal"]
- #[doc = " internal representation) You would set this to true when"]
- #[doc = " writing user data, and false when copying bitstream data, such"]
- #[doc = " as writing one bitstream to another"]
- #[doc = " \\param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data"]
- #[doc = " \\param[in] inOutByteArray The data"]
- #[doc = " \\param[in] numberOfBitsToSerialize The number of bits to write"]
- #[doc = " \\param[in] rightAlignedBits if true data will be right aligned"]
- #[doc = " \\return true if \\a writeToBitstream is true. true if \\a writeToBitstream is false and the read was successful. false if \\a writeToBitstream is false and the read was not successful."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream13SerializeBitsEbPhjb"]
- pub fn BitStream_SerializeBits(
- this: *mut root::RakNet::BitStream,
- writeToBitstream: bool,
- inOutByteArray: *mut ::std::os::raw::c_uchar,
- numberOfBitsToSerialize: root::RakNet::BitSize_t,
- rightAlignedBits: bool,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Read one bitstream to another."]
- #[doc = " \\param[in] numberOfBits bits to read"]
- #[doc = " \\param bitStream the bitstream to read into from"]
- #[doc = " \\return true on success, false on failure."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream4ReadEPS0_j"]
- pub fn BitStream_Read(
- this: *mut root::RakNet::BitStream,
- bitStream: *mut root::RakNet::BitStream,
- numberOfBits: root::RakNet::BitSize_t,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream4ReadEPS0_"]
- pub fn BitStream_Read1(
- this: *mut root::RakNet::BitStream,
- bitStream: *mut root::RakNet::BitStream,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream4ReadERS0_j"]
- pub fn BitStream_Read2(
- this: *mut root::RakNet::BitStream,
- bitStream: *mut root::RakNet::BitStream,
- numberOfBits: root::RakNet::BitSize_t,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream4ReadERS0_"]
- pub fn BitStream_Read3(
- this: *mut root::RakNet::BitStream,
- bitStream: *mut root::RakNet::BitStream,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Write an array or casted stream or raw data. This does NOT do endian swapping."]
- #[doc = " \\param[in] inputByteArray a byte buffer"]
- #[doc = " \\param[in] numberOfBytes the size of \\a input in bytes"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream5WriteEPKcj"]
- pub fn BitStream_Write(
- this: *mut root::RakNet::BitStream,
- inputByteArray: *const ::std::os::raw::c_char,
- numberOfBytes: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " \\brief Write one bitstream to another."]
- #[doc = " \\param[in] numberOfBits bits to write"]
- #[doc = " \\param bitStream the bitstream to copy from"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream5WriteEPS0_j"]
- pub fn BitStream_Write1(
- this: *mut root::RakNet::BitStream,
- bitStream: *mut root::RakNet::BitStream,
- numberOfBits: root::RakNet::BitSize_t,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream5WriteEPS0_"]
- pub fn BitStream_Write2(
- this: *mut root::RakNet::BitStream,
- bitStream: *mut root::RakNet::BitStream,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream5WriteERS0_j"]
- pub fn BitStream_Write3(
- this: *mut root::RakNet::BitStream,
- bitStream: *mut root::RakNet::BitStream,
- numberOfBits: root::RakNet::BitSize_t,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream5WriteERS0_"]
- pub fn BitStream_Write4(
- this: *mut root::RakNet::BitStream,
- bitStream: *mut root::RakNet::BitStream,
- );
- }
- extern "C" {
- #[doc = " \\brief Write a float into 2 bytes, spanning the range between \\a floatMin and \\a floatMax"]
- #[doc = " \\param[in] x The float to write"]
- #[doc = " \\param[in] floatMin Predetermined minimum value of f"]
- #[doc = " \\param[in] floatMax Predetermined maximum value of f"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream12WriteFloat16Efff"]
- pub fn BitStream_WriteFloat16(
- this: *mut root::RakNet::BitStream,
- x: f32,
- floatMin: f32,
- floatMax: f32,
- );
- }
- extern "C" {
- #[doc = " \\brief Read an array or casted stream of byte."]
- #[doc = " \\details The array is raw data. There is no automatic endian conversion with this function"]
- #[doc = " \\param[in] output The result byte array. It should be larger than @em numberOfBytes."]
- #[doc = " \\param[in] numberOfBytes The number of byte to read"]
- #[doc = " \\return true on success false if there is some missing bytes."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream4ReadEPcj"]
- pub fn BitStream_Read4(
- this: *mut root::RakNet::BitStream,
- output: *mut ::std::os::raw::c_char,
- numberOfBytes: ::std::os::raw::c_uint,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Read a float into 2 bytes, spanning the range between \\a floatMin and \\a floatMax"]
- #[doc = " \\param[in] outFloat The float to read"]
- #[doc = " \\param[in] floatMin Predetermined minimum value of f"]
- #[doc = " \\param[in] floatMax Predetermined maximum value of f"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream11ReadFloat16ERfff"]
- pub fn BitStream_ReadFloat16(
- this: *mut root::RakNet::BitStream,
- outFloat: *mut f32,
- floatMin: f32,
- floatMax: f32,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Sets the read pointer back to the beginning of your data."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream16ResetReadPointerEv"]
- pub fn BitStream_ResetReadPointer(this: *mut root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " \\brief Sets the write pointer back to the beginning of your data."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream17ResetWritePointerEv"]
- pub fn BitStream_ResetWritePointer(this: *mut root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " \\brief This is good to call when you are done with the stream to make"]
- #[doc = " sure you didn't leave any data left over void"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream17AssertStreamEmptyEv"]
- pub fn BitStream_AssertStreamEmpty(this: *mut root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " \\brief RAKNET_DEBUG_PRINTF the bits in the stream. Great for debugging."]
- #[link_name = "\u{1}_ZNK6RakNet9BitStream9PrintBitsEPc"]
- pub fn BitStream_PrintBits(
- this: *const root::RakNet::BitStream,
- out: *mut ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet9BitStream9PrintBitsEv"]
- pub fn BitStream_PrintBits1(this: *const root::RakNet::BitStream);
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet9BitStream8PrintHexEPc"]
- pub fn BitStream_PrintHex(
- this: *const root::RakNet::BitStream,
- out: *mut ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet9BitStream8PrintHexEv"]
- pub fn BitStream_PrintHex1(this: *const root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " \\brief Ignore data we don't intend to read"]
- #[doc = " \\param[in] numberOfBits The number of bits to ignore"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream10IgnoreBitsEj"]
- pub fn BitStream_IgnoreBits(
- this: *mut root::RakNet::BitStream,
- numberOfBits: root::RakNet::BitSize_t,
- );
- }
- extern "C" {
- #[doc = " \\brief Ignore data we don't intend to read"]
- #[doc = " \\param[in] numberOfBits The number of bytes to ignore"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream11IgnoreBytesEj"]
- pub fn BitStream_IgnoreBytes(
- this: *mut root::RakNet::BitStream,
- numberOfBytes: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " \\brief Move the write pointer to a position on the array."]
- #[doc = " \\param[in] offset the offset from the start of the array."]
- #[doc = " \\attention"]
- #[doc = " \\details Dangerous if you don't know what you are doing!"]
- #[doc = " For efficiency reasons you can only write mid-stream if your data is byte aligned."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream14SetWriteOffsetEj"]
- pub fn BitStream_SetWriteOffset(
- this: *mut root::RakNet::BitStream,
- offset: root::RakNet::BitSize_t,
- );
- }
- extern "C" {
- #[doc = " \\brief Makes a copy of the internal data for you \\a _data will point to"]
- #[doc = " the stream. Partial bytes are left aligned."]
- #[doc = " \\param[out] _data The allocated copy of GetData()"]
- #[doc = " \\return The length in bits of the stream."]
- #[link_name = "\u{1}_ZNK6RakNet9BitStream8CopyDataEPPh"]
- pub fn BitStream_CopyData(
- this: *const root::RakNet::BitStream,
- _data: *mut *mut ::std::os::raw::c_uchar,
- ) -> root::RakNet::BitSize_t;
- }
- extern "C" {
- #[doc = " \\internal"]
- #[doc = " Set the stream to some initial data."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream7SetDataEPh"]
- pub fn BitStream_SetData(
- this: *mut root::RakNet::BitStream,
- inByteArray: *mut ::std::os::raw::c_uchar,
- );
- }
- extern "C" {
- #[doc = " \\brief Write numberToWrite bits from the input source."]
- #[doc = " \\details Right aligned data means in the case of a partial byte, the bits are aligned"]
- #[doc = " from the right (bit 0) rather than the left (as in the normal"]
- #[doc = " internal representation) You would set this to true when"]
- #[doc = " writing user data, and false when copying bitstream data, such"]
- #[doc = " as writing one bitstream to another."]
- #[doc = " \\param[in] inByteArray The data"]
- #[doc = " \\param[in] numberOfBitsToWrite The number of bits to write"]
- #[doc = " \\param[in] rightAlignedBits if true data will be right aligned"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream9WriteBitsEPKhjb"]
- pub fn BitStream_WriteBits(
- this: *mut root::RakNet::BitStream,
- inByteArray: *const ::std::os::raw::c_uchar,
- numberOfBitsToWrite: root::RakNet::BitSize_t,
- rightAlignedBits: bool,
- );
- }
- extern "C" {
- #[doc = " \\brief Align the bitstream to the byte boundary and then write the"]
- #[doc = " specified number of bits."]
- #[doc = " \\details This is faster than WriteBits but"]
- #[doc = " wastes the bits to do the alignment and requires you to call"]
- #[doc = " ReadAlignedBits at the corresponding read position."]
- #[doc = " \\param[in] inByteArray The data"]
- #[doc = " \\param[in] numberOfBytesToWrite The size of input."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream17WriteAlignedBytesEPKhj"]
- pub fn BitStream_WriteAlignedBytes(
- this: *mut root::RakNet::BitStream,
- inByteArray: *const ::std::os::raw::c_uchar,
- numberOfBytesToWrite: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream15EndianSwapBytesEii"]
- pub fn BitStream_EndianSwapBytes(
- this: *mut root::RakNet::BitStream,
- byteOffset: ::std::os::raw::c_int,
- length: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[doc = " \\brief Aligns the bitstream, writes inputLength, and writes input. Won't write beyond maxBytesToWrite"]
- #[doc = " \\param[in] inByteArray The data"]
- #[doc = " \\param[in] inputLength The size of input."]
- #[doc = " \\param[in] maxBytesToWrite Max bytes to write"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream21WriteAlignedBytesSafeEPKcjj"]
- pub fn BitStream_WriteAlignedBytesSafe(
- this: *mut root::RakNet::BitStream,
- inByteArray: *const ::std::os::raw::c_char,
- inputLength: ::std::os::raw::c_uint,
- maxBytesToWrite: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " \\brief Read bits, starting at the next aligned bits."]
- #[doc = " \\details Note that the modulus 8 starting offset of the sequence must be the same as"]
- #[doc = " was used with WriteBits. This will be a problem with packet"]
- #[doc = " coalescence unless you byte align the coalesced packets."]
- #[doc = " \\param[in] inOutByteArray The byte array larger than @em numberOfBytesToRead"]
- #[doc = " \\param[in] numberOfBytesToRead The number of byte to read from the internal state"]
- #[doc = " \\return true if there is enough byte."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream16ReadAlignedBytesEPhj"]
- pub fn BitStream_ReadAlignedBytes(
- this: *mut root::RakNet::BitStream,
- inOutByteArray: *mut ::std::os::raw::c_uchar,
- numberOfBytesToRead: ::std::os::raw::c_uint,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Reads what was written by WriteAlignedBytesSafe."]
- #[doc = " \\param[in] inOutByteArray The data"]
- #[doc = " \\param[in] maxBytesToRead Maximum number of bytes to read"]
- #[doc = " \\return true on success, false on failure."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream20ReadAlignedBytesSafeEPcRii"]
- pub fn BitStream_ReadAlignedBytesSafe(
- this: *mut root::RakNet::BitStream,
- inOutByteArray: *mut ::std::os::raw::c_char,
- inputLength: *mut ::std::os::raw::c_int,
- maxBytesToRead: ::std::os::raw::c_int,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream20ReadAlignedBytesSafeEPcRjj"]
- pub fn BitStream_ReadAlignedBytesSafe1(
- this: *mut root::RakNet::BitStream,
- inOutByteArray: *mut ::std::os::raw::c_char,
- inputLength: *mut ::std::os::raw::c_uint,
- maxBytesToRead: ::std::os::raw::c_uint,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Same as ReadAlignedBytesSafe() but allocates the memory for you using new, rather than assuming it is safe to write to"]
- #[doc = " \\param[in] outByteArray outByteArray will be deleted if it is not a pointer to 0"]
- #[doc = " \\return true on success, false on failure."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream25ReadAlignedBytesSafeAllocEPPcRij"]
- pub fn BitStream_ReadAlignedBytesSafeAlloc(
- this: *mut root::RakNet::BitStream,
- outByteArray: *mut *mut ::std::os::raw::c_char,
- inputLength: *mut ::std::os::raw::c_int,
- maxBytesToRead: ::std::os::raw::c_uint,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream25ReadAlignedBytesSafeAllocEPPcRjj"]
- pub fn BitStream_ReadAlignedBytesSafeAlloc1(
- this: *mut root::RakNet::BitStream,
- outByteArray: *mut *mut ::std::os::raw::c_char,
- inputLength: *mut ::std::os::raw::c_uint,
- maxBytesToRead: ::std::os::raw::c_uint,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Read \\a numberOfBitsToRead bits to the output source."]
- #[doc = " \\details alignBitsToRight should be set to true to convert internal"]
- #[doc = " bitstream data to userdata. It should be false if you used"]
- #[doc = " WriteBits with rightAlignedBits false"]
- #[doc = " \\param[in] inOutByteArray The resulting bits array"]
- #[doc = " \\param[in] numberOfBitsToRead The number of bits to read"]
- #[doc = " \\param[in] alignBitsToRight if true bits will be right aligned."]
- #[doc = " \\return true if there is enough bits to read"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream8ReadBitsEPhjb"]
- pub fn BitStream_ReadBits(
- this: *mut root::RakNet::BitStream,
- inOutByteArray: *mut ::std::os::raw::c_uchar,
- numberOfBitsToRead: root::RakNet::BitSize_t,
- alignBitsToRight: bool,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Write a 0"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream6Write0Ev"]
- pub fn BitStream_Write0(this: *mut root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " \\brief Write a 1"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream6Write1Ev"]
- pub fn BitStream_Write11(this: *mut root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " \\brief Reads 1 bit and returns true if that bit is 1 and false if it is 0."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream7ReadBitEv"]
- pub fn BitStream_ReadBit(this: *mut root::RakNet::BitStream) -> bool;
- }
- extern "C" {
- #[doc = " \\brief If we used the constructor version with copy data off, this"]
- #[doc = " *makes sure it is set to on and the data pointed to is copied."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream14AssertCopyDataEv"]
- pub fn BitStream_AssertCopyData(this: *mut root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " \\brief Use this if you pass a pointer copy to the constructor"]
- #[doc = " *(_copyData==false) and want to overallocate to prevent"]
- #[doc = " reallocation."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream24SetNumberOfBitsAllocatedEj"]
- pub fn BitStream_SetNumberOfBitsAllocated(
- this: *mut root::RakNet::BitStream,
- lengthInBits: root::RakNet::BitSize_t,
- );
- }
- extern "C" {
- #[doc = " \\brief Reallocates (if necessary) in preparation of writing numberOfBitsToWrite"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream20AddBitsAndReallocateEj"]
- pub fn BitStream_AddBitsAndReallocate(
- this: *mut root::RakNet::BitStream,
- numberOfBitsToWrite: root::RakNet::BitSize_t,
- );
- }
- extern "C" {
- #[doc = " \\internal"]
- #[doc = " \\return How many bits have been allocated internally"]
- #[link_name = "\u{1}_ZNK6RakNet9BitStream24GetNumberOfBitsAllocatedEv"]
- pub fn BitStream_GetNumberOfBitsAllocated(
- this: *const root::RakNet::BitStream,
- ) -> root::RakNet::BitSize_t;
- }
- extern "C" {
- #[doc = " \\brief Read strings, non reference."]
- #[link_name = "\u{1}_ZN6RakNet9BitStream4ReadEPc"]
- pub fn BitStream_Read5(
- this: *mut root::RakNet::BitStream,
- varString: *mut ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream4ReadEPh"]
- pub fn BitStream_Read6(
- this: *mut root::RakNet::BitStream,
- varString: *mut ::std::os::raw::c_uchar,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Write zeros until the bitstream is filled up to \\a bytes"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream23PadWithZeroToByteLengthEj"]
- pub fn BitStream_PadWithZeroToByteLength(
- this: *mut root::RakNet::BitStream,
- bytes: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " Get the number of leading zeros for a number"]
- #[doc = " \\param[in] x Number to test"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream21NumberOfLeadingZeroesEh"]
- pub fn BitStream_NumberOfLeadingZeroes(x: u8) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream21NumberOfLeadingZeroesEt"]
- pub fn BitStream_NumberOfLeadingZeroes1(x: u16) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream21NumberOfLeadingZeroesEj"]
- pub fn BitStream_NumberOfLeadingZeroes2(x: u32) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream21NumberOfLeadingZeroesEm"]
- pub fn BitStream_NumberOfLeadingZeroes3(x: u64) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream21NumberOfLeadingZeroesEa"]
- pub fn BitStream_NumberOfLeadingZeroes4(x: i8) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream21NumberOfLeadingZeroesEs"]
- pub fn BitStream_NumberOfLeadingZeroes5(x: i16) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream21NumberOfLeadingZeroesEi"]
- pub fn BitStream_NumberOfLeadingZeroes6(x: i32) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream21NumberOfLeadingZeroesEl"]
- pub fn BitStream_NumberOfLeadingZeroes7(x: i64) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " \\internal Unrolled inner loop, for when performance is critical"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream16WriteAlignedVar8EPKc"]
- pub fn BitStream_WriteAlignedVar8(
- this: *mut root::RakNet::BitStream,
- inByteArray: *const ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " \\internal Unrolled inner loop, for when performance is critical"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream15ReadAlignedVar8EPc"]
- pub fn BitStream_ReadAlignedVar8(
- this: *mut root::RakNet::BitStream,
- inOutByteArray: *mut ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\internal Unrolled inner loop, for when performance is critical"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream17WriteAlignedVar16EPKc"]
- pub fn BitStream_WriteAlignedVar16(
- this: *mut root::RakNet::BitStream,
- inByteArray: *const ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " \\internal Unrolled inner loop, for when performance is critical"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream16ReadAlignedVar16EPc"]
- pub fn BitStream_ReadAlignedVar16(
- this: *mut root::RakNet::BitStream,
- inOutByteArray: *mut ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\internal Unrolled inner loop, for when performance is critical"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream17WriteAlignedVar32EPKc"]
- pub fn BitStream_WriteAlignedVar32(
- this: *mut root::RakNet::BitStream,
- inByteArray: *const ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " \\internal Unrolled inner loop, for when performance is critical"]
- #[link_name = "\u{1}_ZN6RakNet9BitStream16ReadAlignedVar32EPc"]
- pub fn BitStream_ReadAlignedVar32(
- this: *mut root::RakNet::BitStream,
- inOutByteArray: *mut ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream22IsNetworkOrderInternalEv"]
- pub fn BitStream_IsNetworkOrderInternal() -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream12ReverseBytesEPhS1_j"]
- pub fn BitStream_ReverseBytes(
- inByteArray: *mut ::std::os::raw::c_uchar,
- inOutByteArray: *mut ::std::os::raw::c_uchar,
- length: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStream19ReverseBytesInPlaceEPhj"]
- pub fn BitStream_ReverseBytesInPlace(
- inOutData: *mut ::std::os::raw::c_uchar,
- length: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " Default Constructor"]
- #[link_name = "\u{1}_ZN6RakNet9BitStreamC1Ev"]
- pub fn BitStream_BitStream(this: *mut root::RakNet::BitStream);
- }
- extern "C" {
- #[doc = " \\brief Create the bitstream, with some number of bytes to immediately allocate."]
- #[doc = " \\details There is no benefit to calling this, unless you know exactly how many bytes you need and it is greater than BITSTREAM_STACK_ALLOCATION_SIZE."]
- #[doc = " In that case all it does is save you one or more realloc calls."]
- #[doc = " \\param[in] initialBytesToAllocate the number of bytes to pre-allocate."]
- #[link_name = "\u{1}_ZN6RakNet9BitStreamC1Ej"]
- pub fn BitStream_BitStream1(
- this: *mut root::RakNet::BitStream,
- initialBytesToAllocate: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " \\brief Initialize the BitStream, immediately setting the data it contains to a predefined pointer."]
- #[doc = " \\details Set \\a _copyData to true if you want to make an internal copy of the data you are passing. Set it to false to just save a pointer to the data."]
- #[doc = " You shouldn't call Write functions with \\a _copyData as false, as this will write to unallocated memory"]
- #[doc = " 99% of the time you will use this function to cast Packet::data to a bitstream for reading, in which case you should write something as follows:"]
- #[doc = " \\code"]
- #[doc = " RakNet::BitStream bs(packet->data, packet->length, false);"]
- #[doc = " \\endcode"]
- #[doc = " \\param[in] _data An array of bytes."]
- #[doc = " \\param[in] lengthInBytes Size of the \\a _data."]
- #[doc = " \\param[in] _copyData true or false to make a copy of \\a _data or not."]
- #[link_name = "\u{1}_ZN6RakNet9BitStreamC1EPhjb"]
- pub fn BitStream_BitStream2(
- this: *mut root::RakNet::BitStream,
- _data: *mut ::std::os::raw::c_uchar,
- lengthInBytes: ::std::os::raw::c_uint,
- _copyData: bool,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9BitStreamD1Ev"]
- pub fn BitStream_BitStream_destructor(this: *mut root::RakNet::BitStream);
- }
- impl BitStream {
- #[inline]
- pub unsafe fn GetInstance() -> *mut root::RakNet::BitStream {
- BitStream_GetInstance()
- }
- #[inline]
- pub unsafe fn DestroyInstance(i: *mut root::RakNet::BitStream) {
- BitStream_DestroyInstance(i)
- }
- #[inline]
- pub unsafe fn Reset(&mut self) {
- BitStream_Reset(self)
- }
- #[inline]
- pub unsafe fn Serialize(
- &mut self,
- writeToBitstream: bool,
- inOutByteArray: *mut ::std::os::raw::c_char,
- numberOfBytes: ::std::os::raw::c_uint,
- ) -> bool {
- BitStream_Serialize(self, writeToBitstream, inOutByteArray, numberOfBytes)
- }
- #[inline]
- pub unsafe fn SerializeFloat16(
- &mut self,
- writeToBitstream: bool,
- inOutFloat: *mut f32,
- floatMin: f32,
- floatMax: f32,
- ) -> bool {
- BitStream_SerializeFloat16(self, writeToBitstream, inOutFloat, floatMin, floatMax)
- }
- #[inline]
- pub unsafe fn SerializeBits(
- &mut self,
- writeToBitstream: bool,
- inOutByteArray: *mut ::std::os::raw::c_uchar,
- numberOfBitsToSerialize: root::RakNet::BitSize_t,
- rightAlignedBits: bool,
- ) -> bool {
- BitStream_SerializeBits(
- self,
- writeToBitstream,
- inOutByteArray,
- numberOfBitsToSerialize,
- rightAlignedBits,
- )
- }
- #[inline]
- pub unsafe fn Read(
- &mut self,
- bitStream: *mut root::RakNet::BitStream,
- numberOfBits: root::RakNet::BitSize_t,
- ) -> bool {
- BitStream_Read(self, bitStream, numberOfBits)
- }
- #[inline]
- pub unsafe fn Read1(&mut self, bitStream: *mut root::RakNet::BitStream) -> bool {
- BitStream_Read1(self, bitStream)
- }
- #[inline]
- pub unsafe fn Read2(
- &mut self,
- bitStream: *mut root::RakNet::BitStream,
- numberOfBits: root::RakNet::BitSize_t,
- ) -> bool {
- BitStream_Read2(self, bitStream, numberOfBits)
- }
- #[inline]
- pub unsafe fn Read3(&mut self, bitStream: *mut root::RakNet::BitStream) -> bool {
- BitStream_Read3(self, bitStream)
- }
- #[inline]
- pub unsafe fn Write(
- &mut self,
- inputByteArray: *const ::std::os::raw::c_char,
- numberOfBytes: ::std::os::raw::c_uint,
- ) {
- BitStream_Write(self, inputByteArray, numberOfBytes)
- }
- #[inline]
- pub unsafe fn Write1(
- &mut self,
- bitStream: *mut root::RakNet::BitStream,
- numberOfBits: root::RakNet::BitSize_t,
- ) {
- BitStream_Write1(self, bitStream, numberOfBits)
- }
- #[inline]
- pub unsafe fn Write2(&mut self, bitStream: *mut root::RakNet::BitStream) {
- BitStream_Write2(self, bitStream)
- }
- #[inline]
- pub unsafe fn Write3(
- &mut self,
- bitStream: *mut root::RakNet::BitStream,
- numberOfBits: root::RakNet::BitSize_t,
- ) {
- BitStream_Write3(self, bitStream, numberOfBits)
- }
- #[inline]
- pub unsafe fn Write4(&mut self, bitStream: *mut root::RakNet::BitStream) {
- BitStream_Write4(self, bitStream)
- }
- #[inline]
- pub unsafe fn WriteFloat16(&mut self, x: f32, floatMin: f32, floatMax: f32) {
- BitStream_WriteFloat16(self, x, floatMin, floatMax)
- }
- #[inline]
- pub unsafe fn Read4(
- &mut self,
- output: *mut ::std::os::raw::c_char,
- numberOfBytes: ::std::os::raw::c_uint,
- ) -> bool {
- BitStream_Read4(self, output, numberOfBytes)
- }
- #[inline]
- pub unsafe fn ReadFloat16(
- &mut self,
- outFloat: *mut f32,
- floatMin: f32,
- floatMax: f32,
- ) -> bool {
- BitStream_ReadFloat16(self, outFloat, floatMin, floatMax)
- }
- #[inline]
- pub unsafe fn ResetReadPointer(&mut self) {
- BitStream_ResetReadPointer(self)
- }
- #[inline]
- pub unsafe fn ResetWritePointer(&mut self) {
- BitStream_ResetWritePointer(self)
- }
- #[inline]
- pub unsafe fn AssertStreamEmpty(&mut self) {
- BitStream_AssertStreamEmpty(self)
- }
- #[inline]
- pub unsafe fn PrintBits(&self, out: *mut ::std::os::raw::c_char) {
- BitStream_PrintBits(self, out)
- }
- #[inline]
- pub unsafe fn PrintBits1(&self) {
- BitStream_PrintBits1(self)
- }
- #[inline]
- pub unsafe fn PrintHex(&self, out: *mut ::std::os::raw::c_char) {
- BitStream_PrintHex(self, out)
- }
- #[inline]
- pub unsafe fn PrintHex1(&self) {
- BitStream_PrintHex1(self)
- }
- #[inline]
- pub unsafe fn IgnoreBits(&mut self, numberOfBits: root::RakNet::BitSize_t) {
- BitStream_IgnoreBits(self, numberOfBits)
- }
- #[inline]
- pub unsafe fn IgnoreBytes(&mut self, numberOfBytes: ::std::os::raw::c_uint) {
- BitStream_IgnoreBytes(self, numberOfBytes)
- }
- #[inline]
- pub unsafe fn SetWriteOffset(&mut self, offset: root::RakNet::BitSize_t) {
- BitStream_SetWriteOffset(self, offset)
- }
- #[inline]
- pub unsafe fn CopyData(
- &self,
- _data: *mut *mut ::std::os::raw::c_uchar,
- ) -> root::RakNet::BitSize_t {
- BitStream_CopyData(self, _data)
- }
- #[inline]
- pub unsafe fn SetData(&mut self, inByteArray: *mut ::std::os::raw::c_uchar) {
- BitStream_SetData(self, inByteArray)
- }
- #[inline]
- pub unsafe fn WriteBits(
- &mut self,
- inByteArray: *const ::std::os::raw::c_uchar,
- numberOfBitsToWrite: root::RakNet::BitSize_t,
- rightAlignedBits: bool,
- ) {
- BitStream_WriteBits(self, inByteArray, numberOfBitsToWrite, rightAlignedBits)
- }
- #[inline]
- pub unsafe fn WriteAlignedBytes(
- &mut self,
- inByteArray: *const ::std::os::raw::c_uchar,
- numberOfBytesToWrite: ::std::os::raw::c_uint,
- ) {
- BitStream_WriteAlignedBytes(self, inByteArray, numberOfBytesToWrite)
- }
- #[inline]
- pub unsafe fn EndianSwapBytes(
- &mut self,
- byteOffset: ::std::os::raw::c_int,
- length: ::std::os::raw::c_int,
- ) {
- BitStream_EndianSwapBytes(self, byteOffset, length)
- }
- #[inline]
- pub unsafe fn WriteAlignedBytesSafe(
- &mut self,
- inByteArray: *const ::std::os::raw::c_char,
- inputLength: ::std::os::raw::c_uint,
- maxBytesToWrite: ::std::os::raw::c_uint,
- ) {
- BitStream_WriteAlignedBytesSafe(self, inByteArray, inputLength, maxBytesToWrite)
- }
- #[inline]
- pub unsafe fn ReadAlignedBytes(
- &mut self,
- inOutByteArray: *mut ::std::os::raw::c_uchar,
- numberOfBytesToRead: ::std::os::raw::c_uint,
- ) -> bool {
- BitStream_ReadAlignedBytes(self, inOutByteArray, numberOfBytesToRead)
- }
- #[inline]
- pub unsafe fn ReadAlignedBytesSafe(
- &mut self,
- inOutByteArray: *mut ::std::os::raw::c_char,
- inputLength: *mut ::std::os::raw::c_int,
- maxBytesToRead: ::std::os::raw::c_int,
- ) -> bool {
- BitStream_ReadAlignedBytesSafe(self, inOutByteArray, inputLength, maxBytesToRead)
- }
- #[inline]
- pub unsafe fn ReadAlignedBytesSafe1(
- &mut self,
- inOutByteArray: *mut ::std::os::raw::c_char,
- inputLength: *mut ::std::os::raw::c_uint,
- maxBytesToRead: ::std::os::raw::c_uint,
- ) -> bool {
- BitStream_ReadAlignedBytesSafe1(self, inOutByteArray, inputLength, maxBytesToRead)
- }
- #[inline]
- pub unsafe fn ReadAlignedBytesSafeAlloc(
- &mut self,
- outByteArray: *mut *mut ::std::os::raw::c_char,
- inputLength: *mut ::std::os::raw::c_int,
- maxBytesToRead: ::std::os::raw::c_uint,
- ) -> bool {
- BitStream_ReadAlignedBytesSafeAlloc(self, outByteArray, inputLength, maxBytesToRead)
- }
- #[inline]
- pub unsafe fn ReadAlignedBytesSafeAlloc1(
- &mut self,
- outByteArray: *mut *mut ::std::os::raw::c_char,
- inputLength: *mut ::std::os::raw::c_uint,
- maxBytesToRead: ::std::os::raw::c_uint,
- ) -> bool {
- BitStream_ReadAlignedBytesSafeAlloc1(
- self,
- outByteArray,
- inputLength,
- maxBytesToRead,
- )
- }
- #[inline]
- pub unsafe fn ReadBits(
- &mut self,
- inOutByteArray: *mut ::std::os::raw::c_uchar,
- numberOfBitsToRead: root::RakNet::BitSize_t,
- alignBitsToRight: bool,
- ) -> bool {
- BitStream_ReadBits(self, inOutByteArray, numberOfBitsToRead, alignBitsToRight)
- }
- #[inline]
- pub unsafe fn Write0(&mut self) {
- BitStream_Write0(self)
- }
- #[inline]
- pub unsafe fn Write1(&mut self) {
- BitStream_Write11(self)
- }
- #[inline]
- pub unsafe fn ReadBit(&mut self) -> bool {
- BitStream_ReadBit(self)
- }
- #[inline]
- pub unsafe fn AssertCopyData(&mut self) {
- BitStream_AssertCopyData(self)
- }
- #[inline]
- pub unsafe fn SetNumberOfBitsAllocated(
- &mut self,
- lengthInBits: root::RakNet::BitSize_t,
- ) {
- BitStream_SetNumberOfBitsAllocated(self, lengthInBits)
- }
- #[inline]
- pub unsafe fn AddBitsAndReallocate(
- &mut self,
- numberOfBitsToWrite: root::RakNet::BitSize_t,
- ) {
- BitStream_AddBitsAndReallocate(self, numberOfBitsToWrite)
- }
- #[inline]
- pub unsafe fn GetNumberOfBitsAllocated(&self) -> root::RakNet::BitSize_t {
- BitStream_GetNumberOfBitsAllocated(self)
- }
- #[inline]
- pub unsafe fn Read5(&mut self, varString: *mut ::std::os::raw::c_char) -> bool {
- BitStream_Read5(self, varString)
- }
- #[inline]
- pub unsafe fn Read6(&mut self, varString: *mut ::std::os::raw::c_uchar) -> bool {
- BitStream_Read6(self, varString)
- }
- #[inline]
- pub unsafe fn PadWithZeroToByteLength(&mut self, bytes: ::std::os::raw::c_uint) {
- BitStream_PadWithZeroToByteLength(self, bytes)
- }
- #[inline]
- pub unsafe fn NumberOfLeadingZeroes(x: u8) -> ::std::os::raw::c_int {
- BitStream_NumberOfLeadingZeroes(x)
- }
- #[inline]
- pub unsafe fn NumberOfLeadingZeroes1(x: u16) -> ::std::os::raw::c_int {
- BitStream_NumberOfLeadingZeroes1(x)
- }
- #[inline]
- pub unsafe fn NumberOfLeadingZeroes2(x: u32) -> ::std::os::raw::c_int {
- BitStream_NumberOfLeadingZeroes2(x)
- }
- #[inline]
- pub unsafe fn NumberOfLeadingZeroes3(x: u64) -> ::std::os::raw::c_int {
- BitStream_NumberOfLeadingZeroes3(x)
- }
- #[inline]
- pub unsafe fn NumberOfLeadingZeroes4(x: i8) -> ::std::os::raw::c_int {
- BitStream_NumberOfLeadingZeroes4(x)
- }
- #[inline]
- pub unsafe fn NumberOfLeadingZeroes5(x: i16) -> ::std::os::raw::c_int {
- BitStream_NumberOfLeadingZeroes5(x)
- }
- #[inline]
- pub unsafe fn NumberOfLeadingZeroes6(x: i32) -> ::std::os::raw::c_int {
- BitStream_NumberOfLeadingZeroes6(x)
- }
- #[inline]
- pub unsafe fn NumberOfLeadingZeroes7(x: i64) -> ::std::os::raw::c_int {
- BitStream_NumberOfLeadingZeroes7(x)
- }
- #[inline]
- pub unsafe fn WriteAlignedVar8(&mut self, inByteArray: *const ::std::os::raw::c_char) {
- BitStream_WriteAlignedVar8(self, inByteArray)
- }
- #[inline]
- pub unsafe fn ReadAlignedVar8(
- &mut self,
- inOutByteArray: *mut ::std::os::raw::c_char,
- ) -> bool {
- BitStream_ReadAlignedVar8(self, inOutByteArray)
- }
- #[inline]
- pub unsafe fn WriteAlignedVar16(&mut self, inByteArray: *const ::std::os::raw::c_char) {
- BitStream_WriteAlignedVar16(self, inByteArray)
- }
- #[inline]
- pub unsafe fn ReadAlignedVar16(
- &mut self,
- inOutByteArray: *mut ::std::os::raw::c_char,
- ) -> bool {
- BitStream_ReadAlignedVar16(self, inOutByteArray)
- }
- #[inline]
- pub unsafe fn WriteAlignedVar32(&mut self, inByteArray: *const ::std::os::raw::c_char) {
- BitStream_WriteAlignedVar32(self, inByteArray)
- }
- #[inline]
- pub unsafe fn ReadAlignedVar32(
- &mut self,
- inOutByteArray: *mut ::std::os::raw::c_char,
- ) -> bool {
- BitStream_ReadAlignedVar32(self, inOutByteArray)
- }
- #[inline]
- pub unsafe fn IsNetworkOrderInternal() -> bool {
- BitStream_IsNetworkOrderInternal()
- }
- #[inline]
- pub unsafe fn ReverseBytes(
- inByteArray: *mut ::std::os::raw::c_uchar,
- inOutByteArray: *mut ::std::os::raw::c_uchar,
- length: ::std::os::raw::c_uint,
- ) {
- BitStream_ReverseBytes(inByteArray, inOutByteArray, length)
- }
- #[inline]
- pub unsafe fn ReverseBytesInPlace(
- inOutData: *mut ::std::os::raw::c_uchar,
- length: ::std::os::raw::c_uint,
- ) {
- BitStream_ReverseBytesInPlace(inOutData, length)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- BitStream_BitStream(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new1(initialBytesToAllocate: ::std::os::raw::c_uint) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- BitStream_BitStream1(__bindgen_tmp.as_mut_ptr(), initialBytesToAllocate);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new2(
- _data: *mut ::std::os::raw::c_uchar,
- lengthInBytes: ::std::os::raw::c_uint,
- _copyData: bool,
- ) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- BitStream_BitStream2(__bindgen_tmp.as_mut_ptr(), _data, lengthInBytes, _copyData);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- BitStream_BitStream_destructor(self)
- }
- }
- #[repr(C)]
- #[derive(Debug)]
- pub struct CCRakNetSlidingWindow {
- pub MAXIMUM_MTU_INCLUDING_UDP_HEADER: u32,
- pub cwnd: f64,
- pub ssThresh: f64,
- #[doc = " When we get an ack, if oldestUnsentAck==0, set it to the current time"]
- #[doc = " When we send out acks, set oldestUnsentAck to 0"]
- pub oldestUnsentAck: root::CCTimeType,
- #[doc = " Every outgoing datagram is assigned a sequence number, which increments by 1 every assignment"]
- pub nextDatagramSequenceNumber: root::DatagramSequenceNumberType,
- pub nextCongestionControlBlock: root::DatagramSequenceNumberType,
- pub backoffThisBlock: bool,
- pub speedUpThisBlock: bool,
- #[doc = " Track which datagram sequence numbers have arrived."]
- #[doc = " If a sequence number is skipped, send a NAK for all skipped messages"]
- pub expectedNextSequenceNumber: root::DatagramSequenceNumberType,
- pub _isContinuousSend: bool,
- pub lastRtt: f64,
- pub estimatedRTT: f64,
- pub deviationRtt: f64,
- }
- extern "C" {
- #[doc = " Reset all variables to their initial states, for a new connection"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow4InitEmj"]
- pub fn CCRakNetSlidingWindow_Init(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- maxDatagramPayload: u32,
- );
- }
- extern "C" {
- #[doc = " Update over time"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow6UpdateEmb"]
- pub fn CCRakNetSlidingWindow_Update(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- hasDataToSendOrResend: bool,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow26GetRetransmissionBandwidthEmmjb"]
- pub fn CCRakNetSlidingWindow_GetRetransmissionBandwidth(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- timeSinceLastTick: root::CCTimeType,
- unacknowledgedBytes: u32,
- isContinuousSend: bool,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow24GetTransmissionBandwidthEmmjb"]
- pub fn CCRakNetSlidingWindow_GetTransmissionBandwidth(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- timeSinceLastTick: root::CCTimeType,
- unacknowledgedBytes: u32,
- isContinuousSend: bool,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " Acks do not have to be sent immediately. Instead, they can be buffered up such that groups of acks are sent at a time"]
- #[doc = " This reduces overall bandwidth usage"]
- #[doc = " How long they can be buffered depends on the retransmit time of the sender"]
- #[doc = " Should call once per update tick, and send if needed"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow14ShouldSendACKsEmm"]
- pub fn CCRakNetSlidingWindow_ShouldSendACKs(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- estimatedTimeToNextTick: root::CCTimeType,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Every data packet sent must contain a sequence number"]
- #[doc = " Call this function to get it. The sequence number is passed into OnGotPacketPair()"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow41GetAndIncrementNextDatagramSequenceNumberEv"]
- pub fn CCRakNetSlidingWindow_GetAndIncrementNextDatagramSequenceNumber(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- ) -> root::DatagramSequenceNumberType;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow29GetNextDatagramSequenceNumberEv"]
- pub fn CCRakNetSlidingWindow_GetNextDatagramSequenceNumber(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- ) -> root::DatagramSequenceNumberType;
- }
- extern "C" {
- #[doc = " Call this when you send packets"]
- #[doc = " Every 15th and 16th packets should be sent as a packet pair if possible"]
- #[doc = " When packets marked as a packet pair arrive, pass to OnGotPacketPair()"]
- #[doc = " When any packets arrive, (additionally) pass to OnGotPacket"]
- #[doc = " Packets should contain our system time, so we can pass rtt to OnNonDuplicateAck()"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow11OnSendBytesEmj"]
- pub fn CCRakNetSlidingWindow_OnSendBytes(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- numBytes: u32,
- );
- }
- extern "C" {
- #[doc = " Call this when you get a packet pair"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow15OnGotPacketPairENS_8uint24_tEjm"]
- pub fn CCRakNetSlidingWindow_OnGotPacketPair(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- datagramSequenceNumber: root::DatagramSequenceNumberType,
- sizeInBytes: u32,
- curTime: root::CCTimeType,
- );
- }
- extern "C" {
- #[doc = " Call this when you get a packet (including packet pairs)"]
- #[doc = " If the DatagramSequenceNumberType is out of order, skippedMessageCount will be non-zero"]
- #[doc = " In that case, send a NAK for every sequence number up to that count"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow11OnGotPacketENS_8uint24_tEbmjPj"]
- pub fn CCRakNetSlidingWindow_OnGotPacket(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- datagramSequenceNumber: root::DatagramSequenceNumberType,
- isContinuousSend: bool,
- curTime: root::CCTimeType,
- sizeInBytes: u32,
- skippedMessageCount: *mut u32,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Call when you get a NAK, with the sequence number of the lost message"]
- #[doc = " Affects the congestion control"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow8OnResendEmm"]
- pub fn CCRakNetSlidingWindow_OnResend(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- nextActionTime: root::RakNet::TimeUS,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow5OnNAKEmNS_8uint24_tE"]
- pub fn CCRakNetSlidingWindow_OnNAK(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- nakSequenceNumber: root::DatagramSequenceNumberType,
- );
- }
- extern "C" {
- #[doc = " Call this when an ACK arrives."]
- #[doc = " hasBAndAS are possibly written with the ack, see OnSendAck()"]
- #[doc = " B and AS are used in the calculations in UpdateWindowSizeAndAckOnAckPerSyn"]
- #[doc = " B and AS are updated at most once per SYN"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow5OnAckEmmbdddbNS_8uint24_tE"]
- pub fn CCRakNetSlidingWindow_OnAck(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- rtt: root::CCTimeType,
- hasBAndAS: bool,
- _B: root::BytesPerMicrosecond,
- _AS: root::BytesPerMicrosecond,
- totalUserDataBytesAcked: f64,
- isContinuousSend: bool,
- sequenceNumber: root::DatagramSequenceNumberType,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow14OnDuplicateAckEmNS_8uint24_tE"]
- pub fn CCRakNetSlidingWindow_OnDuplicateAck(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- sequenceNumber: root::DatagramSequenceNumberType,
- );
- }
- extern "C" {
- #[doc = " Call when you send an ack, to see if the ack should have the B and AS parameters transmitted"]
- #[doc = " Call before calling OnSendAck()"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow18OnSendAckGetBAndASEmPbPdS2_"]
- pub fn CCRakNetSlidingWindow_OnSendAckGetBAndAS(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- hasBAndAS: *mut bool,
- _B: *mut root::BytesPerMicrosecond,
- _AS: *mut root::BytesPerMicrosecond,
- );
- }
- extern "C" {
- #[doc = " Call when we send an ack, to write B and AS if needed"]
- #[doc = " B and AS are only written once per SYN, to prevent slow calculations"]
- #[doc = " Also updates SND, the period between sends, since data is written out"]
- #[doc = " Be sure to call OnSendAckGetBAndAS() before calling OnSendAck(), since whether you write it or not affects \\a numBytes"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow9OnSendAckEmj"]
- pub fn CCRakNetSlidingWindow_OnSendAck(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- numBytes: u32,
- );
- }
- extern "C" {
- #[doc = " Call when we send a NACK"]
- #[doc = " Also updates SND, the period between sends, since data is written out"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow10OnSendNACKEmj"]
- pub fn CCRakNetSlidingWindow_OnSendNACK(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- curTime: root::CCTimeType,
- numBytes: u32,
- );
- }
- extern "C" {
- #[doc = " Retransmission time out for the sender"]
- #[doc = " If the time difference between when a message was last transmitted, and the current time is greater than RTO then packet is eligible for retransmission, pending congestion control"]
- #[doc = " RTO = (RTT + 4 * RTTVar) + SYN"]
- #[doc = " If we have been continuously sending for the last RTO, and no ACK or NAK at all, SND*=2;"]
- #[doc = " This is per message, which is different from UDT, but RakNet supports packetloss with continuing data where UDT is only RELIABLE_ORDERED"]
- #[doc = " Minimum value is 100 milliseconds"]
- #[link_name = "\u{1}_ZNK6RakNet21CCRakNetSlidingWindow23GetRTOForRetransmissionEh"]
- pub fn CCRakNetSlidingWindow_GetRTOForRetransmission(
- this: *const root::RakNet::CCRakNetSlidingWindow,
- timesSent: ::std::os::raw::c_uchar,
- ) -> root::CCTimeType;
- }
- extern "C" {
- #[doc = " Set the maximum amount of data that can be sent in one datagram"]
- #[doc = " Default to MAXIMUM_MTU_SIZE-UDP_HEADER_SIZE"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow6SetMTUEj"]
- pub fn CCRakNetSlidingWindow_SetMTU(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- bytes: u32,
- );
- }
- extern "C" {
- #[doc = " Return what was set by SetMTU()"]
- #[link_name = "\u{1}_ZNK6RakNet21CCRakNetSlidingWindow6GetMTUEv"]
- pub fn CCRakNetSlidingWindow_GetMTU(
- this: *const root::RakNet::CCRakNetSlidingWindow,
- ) -> u32;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet21CCRakNetSlidingWindow19GetLocalReceiveRateEm"]
- pub fn CCRakNetSlidingWindow_GetLocalReceiveRate(
- this: *const root::RakNet::CCRakNetSlidingWindow,
- currentTime: root::CCTimeType,
- ) -> root::BytesPerMicrosecond;
- }
- extern "C" {
- #[doc = " Query for statistics"]
- #[link_name = "\u{1}_ZNK6RakNet21CCRakNetSlidingWindow6GetRTTEv"]
- pub fn CCRakNetSlidingWindow_GetRTT(
- this: *const root::RakNet::CCRakNetSlidingWindow,
- ) -> f64;
- }
- extern "C" {
- #[doc = " Is a > b, accounting for variable overflow?"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow11GreaterThanENS_8uint24_tES1_"]
- pub fn CCRakNetSlidingWindow_GreaterThan(
- a: root::DatagramSequenceNumberType,
- b: root::DatagramSequenceNumberType,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Is a < b, accounting for variable overflow?"]
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindow8LessThanENS_8uint24_tES1_"]
- pub fn CCRakNetSlidingWindow_LessThan(
- a: root::DatagramSequenceNumberType,
- b: root::DatagramSequenceNumberType,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet21CCRakNetSlidingWindow41GetBytesPerSecondLimitByCongestionControlEv"]
- pub fn CCRakNetSlidingWindow_GetBytesPerSecondLimitByCongestionControl(
- this: *const root::RakNet::CCRakNetSlidingWindow,
- ) -> u64;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet21CCRakNetSlidingWindow18GetSenderRTOForACKEv"]
- pub fn CCRakNetSlidingWindow_GetSenderRTOForACK(
- this: *const root::RakNet::CCRakNetSlidingWindow,
- ) -> root::CCTimeType;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet21CCRakNetSlidingWindow13IsInSlowStartEv"]
- pub fn CCRakNetSlidingWindow_IsInSlowStart(
- this: *const root::RakNet::CCRakNetSlidingWindow,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindowC1Ev"]
- pub fn CCRakNetSlidingWindow_CCRakNetSlidingWindow(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet21CCRakNetSlidingWindowD1Ev"]
- pub fn CCRakNetSlidingWindow_CCRakNetSlidingWindow_destructor(
- this: *mut root::RakNet::CCRakNetSlidingWindow,
- );
- }
- impl CCRakNetSlidingWindow {
- #[inline]
- pub unsafe fn Init(&mut self, curTime: root::CCTimeType, maxDatagramPayload: u32) {
- CCRakNetSlidingWindow_Init(self, curTime, maxDatagramPayload)
- }
- #[inline]
- pub unsafe fn Update(
- &mut self,
- curTime: root::CCTimeType,
- hasDataToSendOrResend: bool,
- ) {
- CCRakNetSlidingWindow_Update(self, curTime, hasDataToSendOrResend)
- }
- #[inline]
- pub unsafe fn GetRetransmissionBandwidth(
- &mut self,
- curTime: root::CCTimeType,
- timeSinceLastTick: root::CCTimeType,
- unacknowledgedBytes: u32,
- isContinuousSend: bool,
- ) -> ::std::os::raw::c_int {
- CCRakNetSlidingWindow_GetRetransmissionBandwidth(
- self,
- curTime,
- timeSinceLastTick,
- unacknowledgedBytes,
- isContinuousSend,
- )
- }
- #[inline]
- pub unsafe fn GetTransmissionBandwidth(
- &mut self,
- curTime: root::CCTimeType,
- timeSinceLastTick: root::CCTimeType,
- unacknowledgedBytes: u32,
- isContinuousSend: bool,
- ) -> ::std::os::raw::c_int {
- CCRakNetSlidingWindow_GetTransmissionBandwidth(
- self,
- curTime,
- timeSinceLastTick,
- unacknowledgedBytes,
- isContinuousSend,
- )
- }
- #[inline]
- pub unsafe fn ShouldSendACKs(
- &mut self,
- curTime: root::CCTimeType,
- estimatedTimeToNextTick: root::CCTimeType,
- ) -> bool {
- CCRakNetSlidingWindow_ShouldSendACKs(self, curTime, estimatedTimeToNextTick)
- }
- #[inline]
- pub unsafe fn GetAndIncrementNextDatagramSequenceNumber(
- &mut self,
- ) -> root::DatagramSequenceNumberType {
- CCRakNetSlidingWindow_GetAndIncrementNextDatagramSequenceNumber(self)
- }
- #[inline]
- pub unsafe fn GetNextDatagramSequenceNumber(
- &mut self,
- ) -> root::DatagramSequenceNumberType {
- CCRakNetSlidingWindow_GetNextDatagramSequenceNumber(self)
- }
- #[inline]
- pub unsafe fn OnSendBytes(&mut self, curTime: root::CCTimeType, numBytes: u32) {
- CCRakNetSlidingWindow_OnSendBytes(self, curTime, numBytes)
- }
- #[inline]
- pub unsafe fn OnGotPacketPair(
- &mut self,
- datagramSequenceNumber: root::DatagramSequenceNumberType,
- sizeInBytes: u32,
- curTime: root::CCTimeType,
- ) {
- CCRakNetSlidingWindow_OnGotPacketPair(
- self,
- datagramSequenceNumber,
- sizeInBytes,
- curTime,
- )
- }
- #[inline]
- pub unsafe fn OnGotPacket(
- &mut self,
- datagramSequenceNumber: root::DatagramSequenceNumberType,
- isContinuousSend: bool,
- curTime: root::CCTimeType,
- sizeInBytes: u32,
- skippedMessageCount: *mut u32,
- ) -> bool {
- CCRakNetSlidingWindow_OnGotPacket(
- self,
- datagramSequenceNumber,
- isContinuousSend,
- curTime,
- sizeInBytes,
- skippedMessageCount,
- )
- }
- #[inline]
- pub unsafe fn OnResend(
- &mut self,
- curTime: root::CCTimeType,
- nextActionTime: root::RakNet::TimeUS,
- ) {
- CCRakNetSlidingWindow_OnResend(self, curTime, nextActionTime)
- }
- #[inline]
- pub unsafe fn OnNAK(
- &mut self,
- curTime: root::CCTimeType,
- nakSequenceNumber: root::DatagramSequenceNumberType,
- ) {
- CCRakNetSlidingWindow_OnNAK(self, curTime, nakSequenceNumber)
- }
- #[inline]
- pub unsafe fn OnAck(
- &mut self,
- curTime: root::CCTimeType,
- rtt: root::CCTimeType,
- hasBAndAS: bool,
- _B: root::BytesPerMicrosecond,
- _AS: root::BytesPerMicrosecond,
- totalUserDataBytesAcked: f64,
- isContinuousSend: bool,
- sequenceNumber: root::DatagramSequenceNumberType,
- ) {
- CCRakNetSlidingWindow_OnAck(
- self,
- curTime,
- rtt,
- hasBAndAS,
- _B,
- _AS,
- totalUserDataBytesAcked,
- isContinuousSend,
- sequenceNumber,
- )
- }
- #[inline]
- pub unsafe fn OnDuplicateAck(
- &mut self,
- curTime: root::CCTimeType,
- sequenceNumber: root::DatagramSequenceNumberType,
- ) {
- CCRakNetSlidingWindow_OnDuplicateAck(self, curTime, sequenceNumber)
- }
- #[inline]
- pub unsafe fn OnSendAckGetBAndAS(
- &mut self,
- curTime: root::CCTimeType,
- hasBAndAS: *mut bool,
- _B: *mut root::BytesPerMicrosecond,
- _AS: *mut root::BytesPerMicrosecond,
- ) {
- CCRakNetSlidingWindow_OnSendAckGetBAndAS(self, curTime, hasBAndAS, _B, _AS)
- }
- #[inline]
- pub unsafe fn OnSendAck(&mut self, curTime: root::CCTimeType, numBytes: u32) {
- CCRakNetSlidingWindow_OnSendAck(self, curTime, numBytes)
- }
- #[inline]
- pub unsafe fn OnSendNACK(&mut self, curTime: root::CCTimeType, numBytes: u32) {
- CCRakNetSlidingWindow_OnSendNACK(self, curTime, numBytes)
- }
- #[inline]
- pub unsafe fn GetRTOForRetransmission(
- &self,
- timesSent: ::std::os::raw::c_uchar,
- ) -> root::CCTimeType {
- CCRakNetSlidingWindow_GetRTOForRetransmission(self, timesSent)
- }
- #[inline]
- pub unsafe fn SetMTU(&mut self, bytes: u32) {
- CCRakNetSlidingWindow_SetMTU(self, bytes)
- }
- #[inline]
- pub unsafe fn GetMTU(&self) -> u32 {
- CCRakNetSlidingWindow_GetMTU(self)
- }
- #[inline]
- pub unsafe fn GetLocalReceiveRate(
- &self,
- currentTime: root::CCTimeType,
- ) -> root::BytesPerMicrosecond {
- CCRakNetSlidingWindow_GetLocalReceiveRate(self, currentTime)
- }
- #[inline]
- pub unsafe fn GetRTT(&self) -> f64 {
- CCRakNetSlidingWindow_GetRTT(self)
- }
- #[inline]
- pub unsafe fn GreaterThan(
- a: root::DatagramSequenceNumberType,
- b: root::DatagramSequenceNumberType,
- ) -> bool {
- CCRakNetSlidingWindow_GreaterThan(a, b)
- }
- #[inline]
- pub unsafe fn LessThan(
- a: root::DatagramSequenceNumberType,
- b: root::DatagramSequenceNumberType,
- ) -> bool {
- CCRakNetSlidingWindow_LessThan(a, b)
- }
- #[inline]
- pub unsafe fn GetBytesPerSecondLimitByCongestionControl(&self) -> u64 {
- CCRakNetSlidingWindow_GetBytesPerSecondLimitByCongestionControl(self)
- }
- #[inline]
- pub unsafe fn GetSenderRTOForACK(&self) -> root::CCTimeType {
- CCRakNetSlidingWindow_GetSenderRTOForACK(self)
- }
- #[inline]
- pub unsafe fn IsInSlowStart(&self) -> bool {
- CCRakNetSlidingWindow_IsInSlowStart(self)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- CCRakNetSlidingWindow_CCRakNetSlidingWindow(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- CCRakNetSlidingWindow_CCRakNetSlidingWindow_destructor(self)
- }
- }
- pub type SplitPacketIdType = u16;
- pub type SplitPacketIndexType = u32;
- #[doc = " This is the counter used for holding packet numbers, so we can detect duplicate packets. It should be large enough that if the variables"]
- #[doc = " Internally assumed to be 4 bytes, but written as 3 bytes in ReliabilityLayer::WriteToBitStreamFromInternalPacket"]
- pub type MessageNumberType = root::RakNet::uint24_t;
- #[doc = " This is the counter used for holding ordered packet numbers, so we can detect out-of-order packets. It should be large enough that if the variables"]
- #[doc = " were to wrap, the newly wrapped values would no longer be in use. Warning: Too large of a value wastes bandwidth!"]
- pub type OrderingIndexType = root::RakNet::MessageNumberType;
- pub type RemoteSystemTimeType = root::RakNet::TimeUS;
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct InternalPacketFixedSizeTransmissionHeader {
- #[doc = " A unique numerical identifier given to this user message. Used to identify reliable messages on the network"]
- pub reliableMessageNumber: root::RakNet::MessageNumberType,
- #[doc = "The ID used as identification for ordering messages. Also included in sequenced messages"]
- pub orderingIndex: root::RakNet::OrderingIndexType,
- pub sequencingIndex: root::RakNet::OrderingIndexType,
- #[doc = "What ordering channel this packet is on, if the reliability type uses ordering channels"]
- pub orderingChannel: ::std::os::raw::c_uchar,
- #[doc = "The ID of the split packet, if we have split packets. This is the maximum number of split messages we can send simultaneously per connection."]
- pub splitPacketId: root::RakNet::SplitPacketIdType,
- #[doc = "If this is a split packet, the index into the array of subsplit packets"]
- pub splitPacketIndex: root::RakNet::SplitPacketIndexType,
- #[doc = "The size of the array of subsplit packets"]
- pub splitPacketCount: root::RakNet::SplitPacketIndexType,
- #[doc = "How many bits long the data is"]
- pub dataBitLength: root::RakNet::BitSize_t,
- #[doc = "What type of reliability algorithm to use with this packet"]
- pub reliability: root::PacketReliability,
- }
- #[doc = " Used in InternalPacket when pointing to sharedDataBlock, rather than allocating itself"]
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct InternalPacketRefCountedData {
- pub sharedDataBlock: *mut ::std::os::raw::c_uchar,
- pub refCount: ::std::os::raw::c_uint,
- }
- #[doc = " Holds a user message, and related information"]
- #[doc = " Don't use a constructor or destructor, due to the memory pool I am using"]
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct InternalPacket {
- pub _base: root::RakNet::InternalPacketFixedSizeTransmissionHeader,
- #[doc = " Identifies the order in which this number was sent. Used locally"]
- pub messageInternalOrder: root::RakNet::MessageNumberType,
- #[doc = " Has this message number been assigned yet? We don't assign until the message is actually sent."]
- #[doc = " This fixes a bug where pre-determining message numbers and then sending a message on a different channel creates a huge gap."]
- #[doc = " This causes performance problems and causes those messages to timeout."]
- pub messageNumberAssigned: bool,
- #[doc = "When this packet was created"]
- pub creationTime: root::RakNet::TimeUS,
- #[doc = "The resendNext time to take action on this packet"]
- pub nextActionTime: root::RakNet::TimeUS,
- pub retransmissionTime: root::RakNet::TimeUS,
- pub headerLength: root::RakNet::BitSize_t,
- #[doc = " Buffer is a pointer to the actual data, assuming this packet has data at all"]
- pub data: *mut ::std::os::raw::c_uchar,
- pub allocationScheme: root::RakNet::InternalPacket_AllocationScheme,
- pub refCountedData: *mut root::RakNet::InternalPacketRefCountedData,
- #[doc = " How many attempts we made at sending this message"]
- pub timesSent: ::std::os::raw::c_uchar,
- #[doc = " The priority level of this packet"]
- pub priority: root::PacketPriority,
- #[doc = " If the reliability type requires a receipt, then return this number with it"]
- pub sendReceiptSerial: u32,
- pub resendPrev: *mut root::RakNet::InternalPacket,
- pub resendNext: *mut root::RakNet::InternalPacket,
- pub unreliablePrev: *mut root::RakNet::InternalPacket,
- pub unreliableNext: *mut root::RakNet::InternalPacket,
- pub stackData: [::std::os::raw::c_uchar; 128usize],
- }
- #[doc = " Data is allocated using rakMalloc. Just free it"]
- pub const InternalPacket_AllocationScheme_NORMAL:
- root::RakNet::InternalPacket_AllocationScheme = 0;
- #[doc = " data points to a larger block of data, where the larger block is reference counted. internalPacketRefCountedData is used in this case"]
- pub const InternalPacket_AllocationScheme_REF_COUNTED:
- root::RakNet::InternalPacket_AllocationScheme = 1;
- #[doc = " If allocation scheme is STACK, data points to stackData and should not be deallocated"]
- #[doc = " This is only used when sending. Received packets are deallocated in RakPeer"]
- pub const InternalPacket_AllocationScheme_STACK:
- root::RakNet::InternalPacket_AllocationScheme = 2;
- #[doc = " How to alloc and delete the data member"]
- pub type InternalPacket_AllocationScheme = ::std::os::raw::c_uint;
- #[doc = " How many bytes per pushed via a call to RakPeerInterface::Send()"]
- pub const RNSPerSecondMetrics_USER_MESSAGE_BYTES_PUSHED: root::RakNet::RNSPerSecondMetrics =
- 0;
- #[doc = " How many user message bytes were sent via a call to RakPeerInterface::Send(). This is less than or equal to USER_MESSAGE_BYTES_PUSHED."]
- #[doc = " A message would be pushed, but not yet sent, due to congestion control"]
- pub const RNSPerSecondMetrics_USER_MESSAGE_BYTES_SENT: root::RakNet::RNSPerSecondMetrics =
- 1;
- #[doc = " How many user message bytes were resent. A message is resent if it is marked as reliable, and either the message didn't arrive or the message ack didn't arrive."]
- pub const RNSPerSecondMetrics_USER_MESSAGE_BYTES_RESENT: root::RakNet::RNSPerSecondMetrics =
- 2;
- #[doc = " How many user message bytes were received, and returned to the user successfully."]
- pub const RNSPerSecondMetrics_USER_MESSAGE_BYTES_RECEIVED_PROCESSED:
- root::RakNet::RNSPerSecondMetrics = 3;
- #[doc = " How many user message bytes were received, but ignored due to data format errors. This will usually be 0."]
- pub const RNSPerSecondMetrics_USER_MESSAGE_BYTES_RECEIVED_IGNORED:
- root::RakNet::RNSPerSecondMetrics = 4;
- #[doc = " How many actual bytes were sent, including per-message and per-datagram overhead, and reliable message acks"]
- pub const RNSPerSecondMetrics_ACTUAL_BYTES_SENT: root::RakNet::RNSPerSecondMetrics = 5;
- #[doc = " How many actual bytes were received, including overead and acks."]
- pub const RNSPerSecondMetrics_ACTUAL_BYTES_RECEIVED: root::RakNet::RNSPerSecondMetrics = 6;
- #[doc = " \\internal"]
- pub const RNSPerSecondMetrics_RNS_PER_SECOND_METRICS_COUNT:
- root::RakNet::RNSPerSecondMetrics = 7;
- pub type RNSPerSecondMetrics = ::std::os::raw::c_uint;
- #[doc = " \\brief Network Statisics Usage"]
- #[doc = ""]
- #[doc = " Store Statistics information related to network usage"]
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RakNetStatistics {
- #[doc = " For each type in RNSPerSecondMetrics, what is the value over the last 1 second?"]
- pub valueOverLastSecond: [u64; 7usize],
- #[doc = " For each type in RNSPerSecondMetrics, what is the total value over the lifetime of the connection?"]
- pub runningTotal: [u64; 7usize],
- #[doc = " When did the connection start?"]
- #[doc = " \\sa RakNet::GetTimeUS()"]
- pub connectionStartTime: root::RakNet::TimeUS,
- #[doc = " Is our current send rate throttled by congestion control?"]
- #[doc = " This value should be true if you send more data per second than your bandwidth capacity"]
- pub isLimitedByCongestionControl: bool,
- #[doc = " If \\a isLimitedByCongestionControl is true, what is the limit, in bytes per second?"]
- pub BPSLimitByCongestionControl: u64,
- #[doc = " Is our current send rate throttled by a call to RakPeer::SetPerConnectionOutgoingBandwidthLimit()?"]
- pub isLimitedByOutgoingBandwidthLimit: bool,
- #[doc = " If \\a isLimitedByOutgoingBandwidthLimit is true, what is the limit, in bytes per second?"]
- pub BPSLimitByOutgoingBandwidthLimit: u64,
- #[doc = " For each priority level, how many messages are waiting to be sent out?"]
- pub messageInSendBuffer: [::std::os::raw::c_uint; 4usize],
- #[doc = " For each priority level, how many bytes are waiting to be sent out?"]
- pub bytesInSendBuffer: [f64; 4usize],
- #[doc = " How many messages are waiting in the resend buffer? This includes messages waiting for an ack, so should normally be a small value"]
- #[doc = " If the value is rising over time, you are exceeding the bandwidth capacity. See BPSLimitByCongestionControl"]
- pub messagesInResendBuffer: ::std::os::raw::c_uint,
- #[doc = " How many bytes are waiting in the resend buffer. See also messagesInResendBuffer"]
- pub bytesInResendBuffer: u64,
- #[doc = " Over the last second, what was our packetloss? This number will range from 0.0 (for none) to 1.0 (for 100%)"]
- pub packetlossLastSecond: f32,
- #[doc = " What is the average total packetloss over the lifetime of the connection?"]
- pub packetlossTotal: f32,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct TCPInterface {
- _unused: [u8; 0],
- }
- #[doc = " The plugin used this message and it shouldn't be given to the user."]
- pub const PluginReceiveResult_RR_STOP_PROCESSING_AND_DEALLOCATE:
- root::RakNet::PluginReceiveResult = 0;
- #[doc = " This message will be processed by other plugins, and at last by the user."]
- pub const PluginReceiveResult_RR_CONTINUE_PROCESSING: root::RakNet::PluginReceiveResult = 1;
- #[doc = " The plugin is going to hold on to this message. Do not deallocate it but do not pass it to other plugins either."]
- pub const PluginReceiveResult_RR_STOP_PROCESSING: root::RakNet::PluginReceiveResult = 2;
- #[doc = " For each message that arrives on an instance of RakPeer, the plugins get an opportunity to process them first. This enumeration represents what to do with the message"]
- #[doc = " \\ingroup PLUGIN_INTERFACE_GROUP"]
- pub type PluginReceiveResult = ::std::os::raw::c_uint;
- #[doc = " Called RakPeer::CloseConnection()"]
- pub const PI2_LostConnectionReason_LCR_CLOSED_BY_USER:
- root::RakNet::PI2_LostConnectionReason = 0;
- #[doc = " Got ID_DISCONNECTION_NOTIFICATION"]
- pub const PI2_LostConnectionReason_LCR_DISCONNECTION_NOTIFICATION:
- root::RakNet::PI2_LostConnectionReason = 1;
- #[doc = " GOT ID_CONNECTION_LOST"]
- pub const PI2_LostConnectionReason_LCR_CONNECTION_LOST:
- root::RakNet::PI2_LostConnectionReason = 2;
- #[doc = " Reasons why a connection was lost"]
- #[doc = " \\ingroup PLUGIN_INTERFACE_GROUP"]
- pub type PI2_LostConnectionReason = ::std::os::raw::c_uint;
- pub const PI2_FailedConnectionAttemptReason_FCAR_CONNECTION_ATTEMPT_FAILED:
- root::RakNet::PI2_FailedConnectionAttemptReason = 0;
- pub const PI2_FailedConnectionAttemptReason_FCAR_ALREADY_CONNECTED:
- root::RakNet::PI2_FailedConnectionAttemptReason = 1;
- pub const PI2_FailedConnectionAttemptReason_FCAR_NO_FREE_INCOMING_CONNECTIONS:
- root::RakNet::PI2_FailedConnectionAttemptReason = 2;
- pub const PI2_FailedConnectionAttemptReason_FCAR_SECURITY_PUBLIC_KEY_MISMATCH:
- root::RakNet::PI2_FailedConnectionAttemptReason = 3;
- pub const PI2_FailedConnectionAttemptReason_FCAR_CONNECTION_BANNED:
- root::RakNet::PI2_FailedConnectionAttemptReason = 4;
- pub const PI2_FailedConnectionAttemptReason_FCAR_INVALID_PASSWORD:
- root::RakNet::PI2_FailedConnectionAttemptReason = 5;
- pub const PI2_FailedConnectionAttemptReason_FCAR_INCOMPATIBLE_PROTOCOL:
- root::RakNet::PI2_FailedConnectionAttemptReason = 6;
- pub const PI2_FailedConnectionAttemptReason_FCAR_IP_RECENTLY_CONNECTED:
- root::RakNet::PI2_FailedConnectionAttemptReason = 7;
- pub const PI2_FailedConnectionAttemptReason_FCAR_REMOTE_SYSTEM_REQUIRES_PUBLIC_KEY:
- root::RakNet::PI2_FailedConnectionAttemptReason = 8;
- pub const PI2_FailedConnectionAttemptReason_FCAR_OUR_SYSTEM_REQUIRES_SECURITY:
- root::RakNet::PI2_FailedConnectionAttemptReason = 9;
- pub const PI2_FailedConnectionAttemptReason_FCAR_PUBLIC_KEY_MISMATCH:
- root::RakNet::PI2_FailedConnectionAttemptReason = 10;
- #[doc = " Returns why a connection attempt failed"]
- #[doc = " \\ingroup PLUGIN_INTERFACE_GROUP"]
- pub type PI2_FailedConnectionAttemptReason = ::std::os::raw::c_uint;
- #[repr(C)]
- pub struct PluginInterface2__bindgen_vtable(::std::os::raw::c_void);
- #[doc = " RakNet's plugin system. Each plugin processes the following events:"]
- #[doc = " -Connection attempts"]
- #[doc = " -The result of connection attempts"]
- #[doc = " -Each incoming message"]
- #[doc = " -Updates over time, when RakPeer::Receive() is called"]
- #[doc = ""]
- #[doc = " \\ingroup PLUGIN_INTERFACE_GROUP"]
- #[repr(C)]
- #[derive(Debug)]
- pub struct PluginInterface2 {
- pub vtable_: *const PluginInterface2__bindgen_vtable,
- pub rakPeerInterface: *mut root::RakNet::RakPeerInterface,
- pub tcpInterface: *mut root::RakNet::TCPInterface,
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet16PluginInterface216GetMyGUIDUnifiedEv"]
- pub fn PluginInterface2_GetMyGUIDUnified(
- this: *const root::RakNet::PluginInterface2,
- ) -> root::RakNet::RakNetGUID;
- }
- extern "C" {
- #[doc = " \\internal"]
- #[link_name = "\u{1}_ZN6RakNet16PluginInterface219SetRakPeerInterfaceEPNS_16RakPeerInterfaceE"]
- pub fn PluginInterface2_SetRakPeerInterface(
- this: *mut root::RakNet::PluginInterface2,
- ptr: *mut root::RakNet::RakPeerInterface,
- );
- }
- extern "C" {
- #[doc = " \\internal"]
- #[link_name = "\u{1}_ZN6RakNet16PluginInterface215SetTCPInterfaceEPNS_12TCPInterfaceE"]
- pub fn PluginInterface2_SetTCPInterface(
- this: *mut root::RakNet::PluginInterface2,
- ptr: *mut root::RakNet::TCPInterface,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16PluginInterface211SendUnifiedEPKNS_9BitStreamE14PacketPriority17PacketReliabilitycNS_13AddressOrGUIDEb"]
- pub fn PluginInterface2_SendUnified(
- this: *mut root::RakNet::PluginInterface2,
- bitStream: *const root::RakNet::BitStream,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16PluginInterface211SendUnifiedEPKci14PacketPriority17PacketReliabilitycNS_13AddressOrGUIDEb"]
- pub fn PluginInterface2_SendUnified1(
- this: *mut root::RakNet::PluginInterface2,
- data: *const ::std::os::raw::c_char,
- length: ::std::os::raw::c_int,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16PluginInterface215SendListUnifiedEPPKcPKii14PacketPriority17PacketReliabilitycNS_13AddressOrGUIDEb"]
- pub fn PluginInterface2_SendListUnified(
- this: *mut root::RakNet::PluginInterface2,
- data: *mut *const ::std::os::raw::c_char,
- lengths: *const ::std::os::raw::c_int,
- numParameters: ::std::os::raw::c_int,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16PluginInterface221AllocatePacketUnifiedEj"]
- pub fn PluginInterface2_AllocatePacketUnified(
- this: *mut root::RakNet::PluginInterface2,
- dataSize: ::std::os::raw::c_uint,
- ) -> *mut root::RakNet::Packet;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16PluginInterface221PushBackPacketUnifiedEPNS_6PacketEb"]
- pub fn PluginInterface2_PushBackPacketUnified(
- this: *mut root::RakNet::PluginInterface2,
- packet: *mut root::RakNet::Packet,
- pushAtHead: bool,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16PluginInterface220DeallocPacketUnifiedEPNS_6PacketE"]
- pub fn PluginInterface2_DeallocPacketUnified(
- this: *mut root::RakNet::PluginInterface2,
- packet: *mut root::RakNet::Packet,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16PluginInterface2C1Ev"]
- pub fn PluginInterface2_PluginInterface2(this: *mut root::RakNet::PluginInterface2);
- }
- impl PluginInterface2 {
- #[inline]
- pub unsafe fn GetMyGUIDUnified(&self) -> root::RakNet::RakNetGUID {
- PluginInterface2_GetMyGUIDUnified(self)
- }
- #[inline]
- pub unsafe fn SetRakPeerInterface(&mut self, ptr: *mut root::RakNet::RakPeerInterface) {
- PluginInterface2_SetRakPeerInterface(self, ptr)
- }
- #[inline]
- pub unsafe fn SetTCPInterface(&mut self, ptr: *mut root::RakNet::TCPInterface) {
- PluginInterface2_SetTCPInterface(self, ptr)
- }
- #[inline]
- pub unsafe fn SendUnified(
- &mut self,
- bitStream: *const root::RakNet::BitStream,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- ) {
- PluginInterface2_SendUnified(
- self,
- bitStream,
- priority,
- reliability,
- orderingChannel,
- systemIdentifier,
- broadcast,
- )
- }
- #[inline]
- pub unsafe fn SendUnified1(
- &mut self,
- data: *const ::std::os::raw::c_char,
- length: ::std::os::raw::c_int,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- ) {
- PluginInterface2_SendUnified1(
- self,
- data,
- length,
- priority,
- reliability,
- orderingChannel,
- systemIdentifier,
- broadcast,
- )
- }
- #[inline]
- pub unsafe fn SendListUnified(
- &mut self,
- data: *mut *const ::std::os::raw::c_char,
- lengths: *const ::std::os::raw::c_int,
- numParameters: ::std::os::raw::c_int,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- ) -> bool {
- PluginInterface2_SendListUnified(
- self,
- data,
- lengths,
- numParameters,
- priority,
- reliability,
- orderingChannel,
- systemIdentifier,
- broadcast,
- )
- }
- #[inline]
- pub unsafe fn AllocatePacketUnified(
- &mut self,
- dataSize: ::std::os::raw::c_uint,
- ) -> *mut root::RakNet::Packet {
- PluginInterface2_AllocatePacketUnified(self, dataSize)
- }
- #[inline]
- pub unsafe fn PushBackPacketUnified(
- &mut self,
- packet: *mut root::RakNet::Packet,
- pushAtHead: bool,
- ) {
- PluginInterface2_PushBackPacketUnified(self, packet, pushAtHead)
- }
- #[inline]
- pub unsafe fn DeallocPacketUnified(&mut self, packet: *mut root::RakNet::Packet) {
- PluginInterface2_DeallocPacketUnified(self, packet)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- PluginInterface2_PluginInterface2(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16PluginInterface2D1Ev"]
- pub fn PluginInterface2_PluginInterface2_destructor(
- this: *mut root::RakNet::PluginInterface2,
- );
- }
- #[repr(C)]
- #[derive(Debug)]
- pub struct RakNetRandom {
- pub state: [::std::os::raw::c_uint; 625usize],
- pub next: *mut ::std::os::raw::c_uint,
- pub left: ::std::os::raw::c_int,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RakNetRandom6SeedMTEj"]
- pub fn RakNetRandom_SeedMT(
- this: *mut root::RakNet::RakNetRandom,
- seed: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RakNetRandom8ReloadMTEv"]
- pub fn RakNetRandom_ReloadMT(
- this: *mut root::RakNet::RakNetRandom,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RakNetRandom8RandomMTEv"]
- pub fn RakNetRandom_RandomMT(
- this: *mut root::RakNet::RakNetRandom,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RakNetRandom9FrandomMTEv"]
- pub fn RakNetRandom_FrandomMT(this: *mut root::RakNet::RakNetRandom) -> f32;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RakNetRandom12FillBufferMTEPvj"]
- pub fn RakNetRandom_FillBufferMT(
- this: *mut root::RakNet::RakNetRandom,
- buffer: *mut ::std::os::raw::c_void,
- bytes: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RakNetRandomC1Ev"]
- pub fn RakNetRandom_RakNetRandom(this: *mut root::RakNet::RakNetRandom);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RakNetRandomD1Ev"]
- pub fn RakNetRandom_RakNetRandom_destructor(this: *mut root::RakNet::RakNetRandom);
- }
- impl RakNetRandom {
- #[inline]
- pub unsafe fn SeedMT(&mut self, seed: ::std::os::raw::c_uint) {
- RakNetRandom_SeedMT(self, seed)
- }
- #[inline]
- pub unsafe fn ReloadMT(&mut self) -> ::std::os::raw::c_uint {
- RakNetRandom_ReloadMT(self)
- }
- #[inline]
- pub unsafe fn RandomMT(&mut self) -> ::std::os::raw::c_uint {
- RakNetRandom_RandomMT(self)
- }
- #[inline]
- pub unsafe fn FrandomMT(&mut self) -> f32 {
- RakNetRandom_FrandomMT(self)
- }
- #[inline]
- pub unsafe fn FillBufferMT(
- &mut self,
- buffer: *mut ::std::os::raw::c_void,
- bytes: ::std::os::raw::c_uint,
- ) {
- RakNetRandom_FillBufferMT(self, buffer, bytes)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakNetRandom_RakNetRandom(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- RakNetRandom_RakNetRandom_destructor(self)
- }
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct LocklessUint32_t {
- pub value: u32,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16LocklessUint32_t9IncrementEv"]
- pub fn LocklessUint32_t_Increment(this: *mut root::RakNet::LocklessUint32_t) -> u32;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16LocklessUint32_t9DecrementEv"]
- pub fn LocklessUint32_t_Decrement(this: *mut root::RakNet::LocklessUint32_t) -> u32;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16LocklessUint32_tC1Ev"]
- pub fn LocklessUint32_t_LocklessUint32_t(this: *mut root::RakNet::LocklessUint32_t);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16LocklessUint32_tC1Ej"]
- pub fn LocklessUint32_t_LocklessUint32_t1(
- this: *mut root::RakNet::LocklessUint32_t,
- initial: u32,
- );
- }
- impl LocklessUint32_t {
- #[inline]
- pub unsafe fn Increment(&mut self) -> u32 {
- LocklessUint32_t_Increment(self)
- }
- #[inline]
- pub unsafe fn Decrement(&mut self) -> u32 {
- LocklessUint32_t_Decrement(self)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- LocklessUint32_t_LocklessUint32_t(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new1(initial: u32) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- LocklessUint32_t_LocklessUint32_t1(__bindgen_tmp.as_mut_ptr(), initial);
- __bindgen_tmp.assume_init()
- }
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RakThread {
- pub _address: u8,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet9RakThread6CreateEPFPvS1_ES1_i"]
- pub fn RakThread_Create(
- start_address: ::std::option::Option<
- unsafe extern "C" fn(
- arg1: *mut ::std::os::raw::c_void,
- ) -> *mut ::std::os::raw::c_void,
- >,
- arglist: *mut ::std::os::raw::c_void,
- priority: ::std::os::raw::c_int,
- ) -> ::std::os::raw::c_int;
- }
- impl RakThread {
- #[inline]
- pub unsafe fn Create(
- start_address: ::std::option::Option<
- unsafe extern "C" fn(
- arg1: *mut ::std::os::raw::c_void,
- ) -> *mut ::std::os::raw::c_void,
- >,
- arglist: *mut ::std::os::raw::c_void,
- priority: ::std::os::raw::c_int,
- ) -> ::std::os::raw::c_int {
- RakThread_Create(start_address, arglist, priority)
- }
- }
- #[doc = " Forward declarations"]
- #[repr(C)]
- pub struct SimpleMutex {
- pub hMutex: root::pthread_mutex_t,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet11SimpleMutex4LockEv"]
- pub fn SimpleMutex_Lock(this: *mut root::RakNet::SimpleMutex);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet11SimpleMutex6UnlockEv"]
- pub fn SimpleMutex_Unlock(this: *mut root::RakNet::SimpleMutex);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet11SimpleMutexC1Ev"]
- pub fn SimpleMutex_SimpleMutex(this: *mut root::RakNet::SimpleMutex);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet11SimpleMutexD1Ev"]
- pub fn SimpleMutex_SimpleMutex_destructor(this: *mut root::RakNet::SimpleMutex);
- }
- impl SimpleMutex {
- #[inline]
- pub unsafe fn Lock(&mut self) {
- SimpleMutex_Lock(self)
- }
- #[inline]
- pub unsafe fn Unlock(&mut self) {
- SimpleMutex_Unlock(self)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- SimpleMutex_SimpleMutex(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- SimpleMutex_SimpleMutex_destructor(self)
- }
- }
- pub type RNS2Socket = ::std::os::raw::c_int;
- pub const RNS2BindResult_BR_SUCCESS: root::RakNet::RNS2BindResult = 0;
- pub const RNS2BindResult_BR_REQUIRES_RAKNET_SUPPORT_IPV6_DEFINE:
- root::RakNet::RNS2BindResult = 1;
- pub const RNS2BindResult_BR_FAILED_TO_BIND_SOCKET: root::RakNet::RNS2BindResult = 2;
- pub const RNS2BindResult_BR_FAILED_SEND_TEST: root::RakNet::RNS2BindResult = 3;
- pub type RNS2BindResult = ::std::os::raw::c_uint;
- pub type RNS2SendResult = ::std::os::raw::c_int;
- pub const RNS2Type_RNS2T_WINDOWS_STORE_8: root::RakNet::RNS2Type = 0;
- pub const RNS2Type_RNS2T_PS3: root::RakNet::RNS2Type = 1;
- pub const RNS2Type_RNS2T_PS4: root::RakNet::RNS2Type = 2;
- pub const RNS2Type_RNS2T_CHROME: root::RakNet::RNS2Type = 3;
- pub const RNS2Type_RNS2T_VITA: root::RakNet::RNS2Type = 4;
- pub const RNS2Type_RNS2T_XBOX_360: root::RakNet::RNS2Type = 5;
- pub const RNS2Type_RNS2T_XBOX_720: root::RakNet::RNS2Type = 6;
- pub const RNS2Type_RNS2T_WINDOWS: root::RakNet::RNS2Type = 7;
- pub const RNS2Type_RNS2T_LINUX: root::RakNet::RNS2Type = 8;
- pub type RNS2Type = ::std::os::raw::c_uint;
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub struct RNS2_SendParameters {
- pub data: *mut ::std::os::raw::c_char,
- pub length: ::std::os::raw::c_int,
- pub systemAddress: root::RakNet::SystemAddress,
- pub ttl: ::std::os::raw::c_int,
- }
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub struct RNS2RecvStruct {
- pub data: [::std::os::raw::c_char; 1492usize],
- pub bytesRead: ::std::os::raw::c_int,
- pub systemAddress: root::RakNet::SystemAddress,
- pub timeRead: root::RakNet::TimeUS,
- pub socket: *mut root::RakNet::RakNetSocket2,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RakNetSocket2Allocator {
- pub _address: u8,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet22RakNetSocket2Allocator9AllocRNS2Ev"]
- pub fn RakNetSocket2Allocator_AllocRNS2() -> *mut root::RakNet::RakNetSocket2;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet22RakNetSocket2Allocator11DeallocRNS2EPNS_13RakNetSocket2E"]
- pub fn RakNetSocket2Allocator_DeallocRNS2(s: *mut root::RakNet::RakNetSocket2);
- }
- impl RakNetSocket2Allocator {
- #[inline]
- pub unsafe fn AllocRNS2() -> *mut root::RakNet::RakNetSocket2 {
- RakNetSocket2Allocator_AllocRNS2()
- }
- #[inline]
- pub unsafe fn DeallocRNS2(s: *mut root::RakNet::RakNetSocket2) {
- RakNetSocket2Allocator_DeallocRNS2(s)
- }
- }
- #[repr(C)]
- pub struct RNS2EventHandler__bindgen_vtable(::std::os::raw::c_void);
- #[repr(C)]
- #[derive(Debug)]
- pub struct RNS2EventHandler {
- pub vtable_: *const RNS2EventHandler__bindgen_vtable,
- }
- #[repr(C)]
- pub struct RakNetSocket2__bindgen_vtable(::std::os::raw::c_void);
- #[repr(C)]
- pub struct RakNetSocket2 {
- pub vtable_: *const RakNetSocket2__bindgen_vtable,
- pub eventHandler: *mut root::RakNet::RNS2EventHandler,
- pub socketType: root::RakNet::RNS2Type,
- pub boundAddress: root::RakNet::SystemAddress,
- pub userConnectionSocketIndex: ::std::os::raw::c_uint,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13RakNetSocket219SetRecvEventHandlerEPNS_16RNS2EventHandlerE"]
- pub fn RakNetSocket2_SetRecvEventHandler(
- this: *mut root::RakNet::RakNetSocket2,
- _eventHandler: *mut root::RakNet::RNS2EventHandler,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet13RakNetSocket213GetSocketTypeEv"]
- pub fn RakNetSocket2_GetSocketType(
- this: *const root::RakNet::RakNetSocket2,
- ) -> root::RakNet::RNS2Type;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13RakNetSocket213SetSocketTypeENS_8RNS2TypeE"]
- pub fn RakNetSocket2_SetSocketType(
- this: *mut root::RakNet::RakNetSocket2,
- t: root::RakNet::RNS2Type,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet13RakNetSocket215IsBerkleySocketEv"]
- pub fn RakNetSocket2_IsBerkleySocket(this: *const root::RakNet::RakNetSocket2) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet13RakNetSocket215GetBoundAddressEv"]
- pub fn RakNetSocket2_GetBoundAddress(
- this: *const root::RakNet::RakNetSocket2,
- ) -> root::RakNet::SystemAddress;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet13RakNetSocket228GetUserConnectionSocketIndexEv"]
- pub fn RakNetSocket2_GetUserConnectionSocketIndex(
- this: *const root::RakNet::RakNetSocket2,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13RakNetSocket228SetUserConnectionSocketIndexEj"]
- pub fn RakNetSocket2_SetUserConnectionSocketIndex(
- this: *mut root::RakNet::RakNetSocket2,
- i: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet13RakNetSocket215GetEventHandlerEv"]
- pub fn RakNetSocket2_GetEventHandler(
- this: *const root::RakNet::RakNetSocket2,
- ) -> *mut root::RakNet::RNS2EventHandler;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13RakNetSocket27GetMyIPEPNS_13SystemAddressE"]
- pub fn RakNetSocket2_GetMyIP(addresses: *mut root::RakNet::SystemAddress);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13RakNetSocket214DomainNameToIPEPKcPc"]
- pub fn RakNetSocket2_DomainNameToIP(
- domainName: *const ::std::os::raw::c_char,
- ip: *mut ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13RakNetSocket2C2Ev"]
- pub fn RakNetSocket2_RakNetSocket2(this: *mut root::RakNet::RakNetSocket2);
- }
- impl RakNetSocket2 {
- #[inline]
- pub unsafe fn SetRecvEventHandler(
- &mut self,
- _eventHandler: *mut root::RakNet::RNS2EventHandler,
- ) {
- RakNetSocket2_SetRecvEventHandler(self, _eventHandler)
- }
- #[inline]
- pub unsafe fn GetSocketType(&self) -> root::RakNet::RNS2Type {
- RakNetSocket2_GetSocketType(self)
- }
- #[inline]
- pub unsafe fn SetSocketType(&mut self, t: root::RakNet::RNS2Type) {
- RakNetSocket2_SetSocketType(self, t)
- }
- #[inline]
- pub unsafe fn IsBerkleySocket(&self) -> bool {
- RakNetSocket2_IsBerkleySocket(self)
- }
- #[inline]
- pub unsafe fn GetBoundAddress(&self) -> root::RakNet::SystemAddress {
- RakNetSocket2_GetBoundAddress(self)
- }
- #[inline]
- pub unsafe fn GetUserConnectionSocketIndex(&self) -> ::std::os::raw::c_uint {
- RakNetSocket2_GetUserConnectionSocketIndex(self)
- }
- #[inline]
- pub unsafe fn SetUserConnectionSocketIndex(&mut self, i: ::std::os::raw::c_uint) {
- RakNetSocket2_SetUserConnectionSocketIndex(self, i)
- }
- #[inline]
- pub unsafe fn GetEventHandler(&self) -> *mut root::RakNet::RNS2EventHandler {
- RakNetSocket2_GetEventHandler(self)
- }
- #[inline]
- pub unsafe fn GetMyIP(addresses: *mut root::RakNet::SystemAddress) {
- RakNetSocket2_GetMyIP(addresses)
- }
- #[inline]
- pub unsafe fn DomainNameToIP(
- domainName: *const ::std::os::raw::c_char,
- ip: *mut ::std::os::raw::c_char,
- ) {
- RakNetSocket2_DomainNameToIP(domainName, ip)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakNetSocket2_RakNetSocket2(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13RakNetSocket2D1Ev"]
- pub fn RakNetSocket2_RakNetSocket2_destructor(this: *mut root::RakNet::RakNetSocket2);
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RNS2_BerkleyBindParameters {
- pub port: ::std::os::raw::c_ushort,
- pub hostAddress: *mut ::std::os::raw::c_char,
- pub addressFamily: ::std::os::raw::c_ushort,
- pub type_: ::std::os::raw::c_int,
- pub protocol: ::std::os::raw::c_int,
- pub nonBlockingSocket: bool,
- pub setBroadcast: ::std::os::raw::c_int,
- pub setIPHdrIncl: ::std::os::raw::c_int,
- pub doNotFragment: ::std::os::raw::c_int,
- pub pollingThreadPriority: ::std::os::raw::c_int,
- pub eventHandler: *mut root::RakNet::RNS2EventHandler,
- pub remotePortRakNetWasStartedOn_PS3_PS4_PSP2: ::std::os::raw::c_ushort,
- }
- #[repr(C)]
- pub struct IRNS2_Berkley {
- pub _base: root::RakNet::RakNetSocket2,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13IRNS2_Berkley11IsPortInUseEtPKcti"]
- pub fn IRNS2_Berkley_IsPortInUse(
- port: ::std::os::raw::c_ushort,
- hostAddress: *const ::std::os::raw::c_char,
- addressFamily: ::std::os::raw::c_ushort,
- type_: ::std::os::raw::c_int,
- ) -> bool;
- }
- impl IRNS2_Berkley {
- #[inline]
- pub unsafe fn IsPortInUse(
- port: ::std::os::raw::c_ushort,
- hostAddress: *const ::std::os::raw::c_char,
- addressFamily: ::std::os::raw::c_ushort,
- type_: ::std::os::raw::c_int,
- ) -> bool {
- IRNS2_Berkley_IsPortInUse(port, hostAddress, addressFamily, type_)
- }
- }
- #[repr(C)]
- pub struct RNS2_Berkley {
- pub _base: root::RakNet::IRNS2_Berkley,
- pub rns2Socket: root::RakNet::RNS2Socket,
- pub binding: root::RakNet::RNS2_BerkleyBindParameters,
- pub isRecvFromLoopThreadActive: root::RakNet::LocklessUint32_t,
- pub endThreads: bool,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley23CreateRecvPollingThreadEi"]
- pub fn RNS2_Berkley_CreateRecvPollingThread(
- this: *mut root::RakNet::RNS2_Berkley,
- threadPriority: ::std::os::raw::c_int,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley27SignalStopRecvPollingThreadEv"]
- pub fn RNS2_Berkley_SignalStopRecvPollingThread(this: *mut root::RakNet::RNS2_Berkley);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley28BlockOnStopRecvPollingThreadEv"]
- pub fn RNS2_Berkley_BlockOnStopRecvPollingThread(this: *mut root::RakNet::RNS2_Berkley);
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet12RNS2_Berkley11GetBindingsEv"]
- pub fn RNS2_Berkley_GetBindings(
- this: *const root::RakNet::RNS2_Berkley,
- ) -> *const root::RakNet::RNS2_BerkleyBindParameters;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet12RNS2_Berkley9GetSocketEv"]
- pub fn RNS2_Berkley_GetSocket(
- this: *const root::RakNet::RNS2_Berkley,
- ) -> root::RakNet::RNS2Socket;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley16SetDoNotFragmentEi"]
- pub fn RNS2_Berkley_SetDoNotFragment(
- this: *mut root::RakNet::RNS2_Berkley,
- opt: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley10BindSharedEPNS_26RNS2_BerkleyBindParametersEPKcj"]
- pub fn RNS2_Berkley_BindShared(
- this: *mut root::RakNet::RNS2_Berkley,
- bindParameters: *mut root::RakNet::RNS2_BerkleyBindParameters,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> root::RakNet::RNS2BindResult;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley14BindSharedIPV4EPNS_26RNS2_BerkleyBindParametersEPKcj"]
- pub fn RNS2_Berkley_BindSharedIPV4(
- this: *mut root::RakNet::RNS2_Berkley,
- bindParameters: *mut root::RakNet::RNS2_BerkleyBindParameters,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> root::RakNet::RNS2BindResult;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley18BindSharedIPV4And6EPNS_26RNS2_BerkleyBindParametersEPKcj"]
- pub fn RNS2_Berkley_BindSharedIPV4And6(
- this: *mut root::RakNet::RNS2_Berkley,
- bindParameters: *mut root::RakNet::RNS2_BerkleyBindParameters,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> root::RakNet::RNS2BindResult;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley20GetSystemAddressIPV4EiPNS_13SystemAddressE"]
- pub fn RNS2_Berkley_GetSystemAddressIPV4(
- rns2Socket: root::RakNet::RNS2Socket,
- systemAddressOut: *mut root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley24GetSystemAddressIPV4And6EiPNS_13SystemAddressE"]
- pub fn RNS2_Berkley_GetSystemAddressIPV4And6(
- rns2Socket: root::RakNet::RNS2Socket,
- systemAddressOut: *mut root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley20SetNonBlockingSocketEm"]
- pub fn RNS2_Berkley_SetNonBlockingSocket(
- this: *mut root::RakNet::RNS2_Berkley,
- nonblocking: ::std::os::raw::c_ulong,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley16SetSocketOptionsEv"]
- pub fn RNS2_Berkley_SetSocketOptions(this: *mut root::RakNet::RNS2_Berkley);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley18SetBroadcastSocketEi"]
- pub fn RNS2_Berkley_SetBroadcastSocket(
- this: *mut root::RakNet::RNS2_Berkley,
- broadcast: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley12SetIPHdrInclEi"]
- pub fn RNS2_Berkley_SetIPHdrIncl(
- this: *mut root::RakNet::RNS2_Berkley,
- ipHdrIncl: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley16RecvFromBlockingEPNS_14RNS2RecvStructE"]
- pub fn RNS2_Berkley_RecvFromBlocking(
- this: *mut root::RakNet::RNS2_Berkley,
- recvFromStruct: *mut root::RakNet::RNS2RecvStruct,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley20RecvFromBlockingIPV4EPNS_14RNS2RecvStructE"]
- pub fn RNS2_Berkley_RecvFromBlockingIPV4(
- this: *mut root::RakNet::RNS2_Berkley,
- recvFromStruct: *mut root::RakNet::RNS2RecvStruct,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley24RecvFromBlockingIPV4And6EPNS_14RNS2RecvStructE"]
- pub fn RNS2_Berkley_RecvFromBlockingIPV4And6(
- this: *mut root::RakNet::RNS2_Berkley,
- recvFromStruct: *mut root::RakNet::RNS2RecvStruct,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley15RecvFromLoopIntEv"]
- pub fn RNS2_Berkley_RecvFromLoopInt(
- this: *mut root::RakNet::RNS2_Berkley,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_Berkley12RecvFromLoopEPv"]
- pub fn RNS2_Berkley_RecvFromLoop(
- arguments: *mut ::std::os::raw::c_void,
- ) -> *mut ::std::os::raw::c_void;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_BerkleyC2Ev"]
- pub fn RNS2_Berkley_RNS2_Berkley(this: *mut root::RakNet::RNS2_Berkley);
- }
- impl RNS2_Berkley {
- #[inline]
- pub unsafe fn CreateRecvPollingThread(
- &mut self,
- threadPriority: ::std::os::raw::c_int,
- ) -> ::std::os::raw::c_int {
- RNS2_Berkley_CreateRecvPollingThread(self, threadPriority)
- }
- #[inline]
- pub unsafe fn SignalStopRecvPollingThread(&mut self) {
- RNS2_Berkley_SignalStopRecvPollingThread(self)
- }
- #[inline]
- pub unsafe fn BlockOnStopRecvPollingThread(&mut self) {
- RNS2_Berkley_BlockOnStopRecvPollingThread(self)
- }
- #[inline]
- pub unsafe fn GetBindings(&self) -> *const root::RakNet::RNS2_BerkleyBindParameters {
- RNS2_Berkley_GetBindings(self)
- }
- #[inline]
- pub unsafe fn GetSocket(&self) -> root::RakNet::RNS2Socket {
- RNS2_Berkley_GetSocket(self)
- }
- #[inline]
- pub unsafe fn SetDoNotFragment(&mut self, opt: ::std::os::raw::c_int) {
- RNS2_Berkley_SetDoNotFragment(self, opt)
- }
- #[inline]
- pub unsafe fn BindShared(
- &mut self,
- bindParameters: *mut root::RakNet::RNS2_BerkleyBindParameters,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> root::RakNet::RNS2BindResult {
- RNS2_Berkley_BindShared(self, bindParameters, file, line)
- }
- #[inline]
- pub unsafe fn BindSharedIPV4(
- &mut self,
- bindParameters: *mut root::RakNet::RNS2_BerkleyBindParameters,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> root::RakNet::RNS2BindResult {
- RNS2_Berkley_BindSharedIPV4(self, bindParameters, file, line)
- }
- #[inline]
- pub unsafe fn BindSharedIPV4And6(
- &mut self,
- bindParameters: *mut root::RakNet::RNS2_BerkleyBindParameters,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> root::RakNet::RNS2BindResult {
- RNS2_Berkley_BindSharedIPV4And6(self, bindParameters, file, line)
- }
- #[inline]
- pub unsafe fn GetSystemAddressIPV4(
- rns2Socket: root::RakNet::RNS2Socket,
- systemAddressOut: *mut root::RakNet::SystemAddress,
- ) {
- RNS2_Berkley_GetSystemAddressIPV4(rns2Socket, systemAddressOut)
- }
- #[inline]
- pub unsafe fn GetSystemAddressIPV4And6(
- rns2Socket: root::RakNet::RNS2Socket,
- systemAddressOut: *mut root::RakNet::SystemAddress,
- ) {
- RNS2_Berkley_GetSystemAddressIPV4And6(rns2Socket, systemAddressOut)
- }
- #[inline]
- pub unsafe fn SetNonBlockingSocket(&mut self, nonblocking: ::std::os::raw::c_ulong) {
- RNS2_Berkley_SetNonBlockingSocket(self, nonblocking)
- }
- #[inline]
- pub unsafe fn SetSocketOptions(&mut self) {
- RNS2_Berkley_SetSocketOptions(self)
- }
- #[inline]
- pub unsafe fn SetBroadcastSocket(&mut self, broadcast: ::std::os::raw::c_int) {
- RNS2_Berkley_SetBroadcastSocket(self, broadcast)
- }
- #[inline]
- pub unsafe fn SetIPHdrIncl(&mut self, ipHdrIncl: ::std::os::raw::c_int) {
- RNS2_Berkley_SetIPHdrIncl(self, ipHdrIncl)
- }
- #[inline]
- pub unsafe fn RecvFromBlocking(
- &mut self,
- recvFromStruct: *mut root::RakNet::RNS2RecvStruct,
- ) {
- RNS2_Berkley_RecvFromBlocking(self, recvFromStruct)
- }
- #[inline]
- pub unsafe fn RecvFromBlockingIPV4(
- &mut self,
- recvFromStruct: *mut root::RakNet::RNS2RecvStruct,
- ) {
- RNS2_Berkley_RecvFromBlockingIPV4(self, recvFromStruct)
- }
- #[inline]
- pub unsafe fn RecvFromBlockingIPV4And6(
- &mut self,
- recvFromStruct: *mut root::RakNet::RNS2RecvStruct,
- ) {
- RNS2_Berkley_RecvFromBlockingIPV4And6(self, recvFromStruct)
- }
- #[inline]
- pub unsafe fn RecvFromLoopInt(&mut self) -> ::std::os::raw::c_uint {
- RNS2_Berkley_RecvFromLoopInt(self)
- }
- #[inline]
- pub unsafe fn RecvFromLoop(
- arguments: *mut ::std::os::raw::c_void,
- ) -> *mut ::std::os::raw::c_void {
- RNS2_Berkley_RecvFromLoop(arguments)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RNS2_Berkley_RNS2_Berkley(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet12RNS2_BerkleyD1Ev"]
- pub fn RNS2_Berkley_RNS2_Berkley_destructor(this: *mut root::RakNet::RNS2_Berkley);
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RNS2_Windows_Linux_360 {
- pub _address: u8,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet22RNS2_Windows_Linux_36027Send_Windows_Linux_360NoVDPEiPNS_19RNS2_SendParametersEPKcj"]
- pub fn RNS2_Windows_Linux_360_Send_Windows_Linux_360NoVDP(
- rns2Socket: root::RakNet::RNS2Socket,
- sendParameters: *mut root::RakNet::RNS2_SendParameters,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> root::RakNet::RNS2SendResult;
- }
- impl RNS2_Windows_Linux_360 {
- #[inline]
- pub unsafe fn Send_Windows_Linux_360NoVDP(
- rns2Socket: root::RakNet::RNS2Socket,
- sendParameters: *mut root::RakNet::RNS2_SendParameters,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> root::RakNet::RNS2SendResult {
- RNS2_Windows_Linux_360_Send_Windows_Linux_360NoVDP(
- rns2Socket,
- sendParameters,
- file,
- line,
- )
- }
- }
- #[repr(C)]
- pub struct RNS2_Linux {
- pub _base: root::RakNet::RNS2_Berkley,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RNS2_Linux7GetMyIPEPNS_13SystemAddressE"]
- pub fn RNS2_Linux_GetMyIP(addresses: *mut root::RakNet::SystemAddress);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RNS2_Linux11GetMyIPIPV4EPNS_13SystemAddressE"]
- pub fn RNS2_Linux_GetMyIPIPV4(addresses: *mut root::RakNet::SystemAddress);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RNS2_Linux15GetMyIPIPV4And6EPNS_13SystemAddressE"]
- pub fn RNS2_Linux_GetMyIPIPV4And6(addresses: *mut root::RakNet::SystemAddress);
- }
- impl RNS2_Linux {
- #[inline]
- pub unsafe fn GetMyIP(addresses: *mut root::RakNet::SystemAddress) {
- RNS2_Linux_GetMyIP(addresses)
- }
- #[inline]
- pub unsafe fn GetMyIPIPV4(addresses: *mut root::RakNet::SystemAddress) {
- RNS2_Linux_GetMyIPIPV4(addresses)
- }
- #[inline]
- pub unsafe fn GetMyIPIPV4And6(addresses: *mut root::RakNet::SystemAddress) {
- RNS2_Linux_GetMyIPIPV4And6(addresses)
- }
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RNS2_Linux4BindEPNS_26RNS2_BerkleyBindParametersEPKcj"]
- pub fn RNS2_Linux_Bind(
- this: *mut ::std::os::raw::c_void,
- bindParameters: *mut root::RakNet::RNS2_BerkleyBindParameters,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> root::RakNet::RNS2BindResult;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10RNS2_Linux4SendEPNS_19RNS2_SendParametersEPKcj"]
- pub fn RNS2_Linux_Send(
- this: *mut ::std::os::raw::c_void,
- sendParameters: *mut root::RakNet::RNS2_SendParameters,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> root::RakNet::RNS2SendResult;
- }
- pub type reliabilityHeapWeightType = u64;
- #[repr(C)]
- #[derive(Debug)]
- pub struct SplitPacketChannel {
- pub lastUpdateTime: root::CCTimeType,
- pub splitPacketList: root::DataStructures::List<*mut root::RakNet::InternalPacket>,
- pub firstPacket: *mut root::RakNet::InternalPacket,
- }
- #[repr(C)]
- #[derive(Debug)]
- pub struct BPSTracker {
- pub total1: u64,
- pub lastSec1: u64,
- pub dataQueue: root::DataStructures::Queue<root::RakNet::BPSTracker_TimeAndValue2>,
- }
- #[repr(C)]
- #[derive(Debug)]
- pub struct BPSTracker_TimeAndValue2 {
- pub value1: u64,
- pub time: root::CCTimeType,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10BPSTracker13TimeAndValue2C1Ev"]
- pub fn BPSTracker_TimeAndValue2_TimeAndValue2(
- this: *mut root::RakNet::BPSTracker_TimeAndValue2,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10BPSTracker13TimeAndValue2C1Emm"]
- pub fn BPSTracker_TimeAndValue2_TimeAndValue21(
- this: *mut root::RakNet::BPSTracker_TimeAndValue2,
- t: root::CCTimeType,
- v1: u64,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10BPSTracker13TimeAndValue2D1Ev"]
- pub fn BPSTracker_TimeAndValue2_TimeAndValue2_destructor(
- this: *mut root::RakNet::BPSTracker_TimeAndValue2,
- );
- }
- impl BPSTracker_TimeAndValue2 {
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- BPSTracker_TimeAndValue2_TimeAndValue2(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn new1(t: root::CCTimeType, v1: u64) -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- BPSTracker_TimeAndValue2_TimeAndValue21(__bindgen_tmp.as_mut_ptr(), t, v1);
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- BPSTracker_TimeAndValue2_TimeAndValue2_destructor(self)
- }
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10BPSTracker5ResetEPKcj"]
- pub fn BPSTracker_Reset(
- this: *mut root::RakNet::BPSTracker,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet10BPSTracker9GetTotal1Ev"]
- pub fn BPSTracker_GetTotal1(this: *const root::RakNet::BPSTracker) -> u64;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10BPSTracker13ClearExpired1Em"]
- pub fn BPSTracker_ClearExpired1(
- this: *mut root::RakNet::BPSTracker,
- time: root::CCTimeType,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10BPSTrackerC1Ev"]
- pub fn BPSTracker_BPSTracker(this: *mut root::RakNet::BPSTracker);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet10BPSTrackerD1Ev"]
- pub fn BPSTracker_BPSTracker_destructor(this: *mut root::RakNet::BPSTracker);
- }
- impl BPSTracker {
- #[inline]
- pub unsafe fn Reset(
- &mut self,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) {
- BPSTracker_Reset(self, file, line)
- }
- #[inline]
- pub unsafe fn GetTotal1(&self) -> u64 {
- BPSTracker_GetTotal1(self)
- }
- #[inline]
- pub unsafe fn ClearExpired1(&mut self, time: root::CCTimeType) {
- BPSTracker_ClearExpired1(self, time)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- BPSTracker_BPSTracker(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- BPSTracker_BPSTracker_destructor(self)
- }
- }
- #[doc = " Datagram reliable, ordered, unordered and sequenced sends. Flow control. Message splitting, reassembly, and coalescence."]
- #[repr(C)]
- #[derive(Debug)]
- pub struct ReliabilityLayer {
- pub outputQueue: root::DataStructures::Queue<*mut root::RakNet::InternalPacket>,
- pub splitMessageProgressInterval: ::std::os::raw::c_int,
- pub unreliableTimeout: root::CCTimeType,
- pub datagramHistory:
- root::DataStructures::Queue<root::RakNet::ReliabilityLayer_DatagramHistoryNode>,
- pub datagramHistoryMessagePool:
- root::DataStructures::MemoryPool<root::RakNet::ReliabilityLayer_MessageNumberNode>,
- pub unreliableWithAckReceiptHistory: root::DataStructures::List<
- root::RakNet::ReliabilityLayer_UnreliableWithAckReceiptNode,
- >,
- pub datagramHistoryPopCount: root::DatagramSequenceNumberType,
- pub internalPacketPool: root::DataStructures::MemoryPool<root::RakNet::InternalPacket>,
- pub resendBuffer: [*mut root::RakNet::InternalPacket; 512usize],
- pub resendLinkedListHead: *mut root::RakNet::InternalPacket,
- pub unreliableLinkedListHead: *mut root::RakNet::InternalPacket,
- pub timeLastDatagramArrived: root::RakNet::TimeMS,
- pub outgoingPacketBuffer: [u64; 3usize],
- pub outgoingPacketBufferNextWeights: [root::RakNet::reliabilityHeapWeightType; 4usize],
- pub splitPacketChannelList: [u64; 2usize],
- pub sendReliableMessageNumberIndex: root::RakNet::MessageNumberType,
- pub internalOrderIndex: root::RakNet::MessageNumberType,
- pub deadConnection: bool,
- pub cheater: bool,
- pub splitPacketId: root::RakNet::SplitPacketIdType,
- pub timeoutTime: root::RakNet::TimeMS,
- pub statistics: root::RakNet::RakNetStatistics,
- pub orderedWriteIndex: [root::RakNet::OrderingIndexType; 32usize],
- pub sequencedWriteIndex: [root::RakNet::OrderingIndexType; 32usize],
- pub orderedReadIndex: [root::RakNet::OrderingIndexType; 32usize],
- pub highestSequencedReadIndex: [root::RakNet::OrderingIndexType; 32usize],
- pub orderingHeaps: [u64; 96usize],
- pub heapIndexOffsets: [root::RakNet::OrderingIndexType; 32usize],
- pub hasReceivedPacketQueue: root::DataStructures::Queue<bool>,
- pub receivedPacketsBaseIndex: root::DatagramSequenceNumberType,
- pub resetReceivedPackets: bool,
- pub lastUpdateTime: root::CCTimeType,
- pub timeBetweenPackets: root::CCTimeType,
- pub nextSendTime: root::CCTimeType,
- pub ackPingSum: root::CCTimeType,
- pub ackPingIndex: ::std::os::raw::c_uchar,
- pub remoteSystemTime: root::RakNet::RemoteSystemTimeType,
- pub nextAllowedThroughputSample: root::CCTimeType,
- pub bandwidthExceededStatistic: bool,
- pub throughputCapCountdown: ::std::os::raw::c_longlong,
- pub receivePacketCount: ::std::os::raw::c_uint,
- pub elapsedTimeSinceLastUpdate: root::CCTimeType,
- pub nextAckTimeToSend: root::CCTimeType,
- pub congestionManager: root::RakNet::CCRakNetSlidingWindow,
- pub unacknowledgedBytes: u32,
- pub packetsToSendThisUpdate:
- root::DataStructures::List<*mut root::RakNet::InternalPacket>,
- pub packetsToDeallocThisUpdate: root::DataStructures::List<bool>,
- pub packetsToSendThisUpdateDatagramBoundaries:
- root::DataStructures::List<::std::os::raw::c_uint>,
- pub datagramsToSendThisUpdateIsPair: root::DataStructures::List<bool>,
- pub datagramSizesInBytes: root::DataStructures::List<::std::os::raw::c_uint>,
- pub datagramSizeSoFar: root::RakNet::BitSize_t,
- pub allDatagramSizesSoFar: root::RakNet::BitSize_t,
- pub totalUserDataBytesAcked: f64,
- pub timeOfLastContinualSend: root::CCTimeType,
- pub timeToNextUnreliableCull: root::CCTimeType,
- pub incomingAcks: root::DataStructures::RangeList,
- pub countdownToNextPacketPair: ::std::os::raw::c_int,
- pub acknowlegements: root::DataStructures::RangeList,
- pub NAKs: root::DataStructures::RangeList,
- pub remoteSystemNeedsBAndAS: bool,
- pub refCountedDataPool:
- root::DataStructures::MemoryPool<root::RakNet::InternalPacketRefCountedData>,
- pub bpsMetrics: [root::RakNet::BPSTracker; 7usize],
- pub lastBpsClear: root::CCTimeType,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct ReliabilityLayer_MessageNumberNode {
- pub messageNumber: root::DatagramSequenceNumberType,
- pub next: *mut root::RakNet::ReliabilityLayer_MessageNumberNode,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct ReliabilityLayer_DatagramHistoryNode {
- pub head: *mut root::RakNet::ReliabilityLayer_MessageNumberNode,
- pub timeSent: root::CCTimeType,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct ReliabilityLayer_UnreliableWithAckReceiptNode {
- pub datagramNumber: root::DatagramSequenceNumberType,
- pub sendReceiptSerial: u32,
- pub nextActionTime: root::RakNet::TimeUS,
- }
- extern "C" {
- #[doc = " Resets the layer for reuse"]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer5ResetEbib"]
- pub fn ReliabilityLayer_Reset(
- this: *mut root::RakNet::ReliabilityLayer,
- resetVariables: bool,
- MTUSize: ::std::os::raw::c_int,
- _useSecurity: bool,
- );
- }
- extern "C" {
- #[doc = " Set the time, in MS, to use before considering ourselves disconnected after not being able to deliver a reliable packet"]
- #[doc = " Default time is 10,000 or 10 seconds in release and 30,000 or 30 seconds in debug."]
- #[doc = " \\param[in] time Time, in MS"]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer14SetTimeoutTimeEj"]
- pub fn ReliabilityLayer_SetTimeoutTime(
- this: *mut root::RakNet::ReliabilityLayer,
- time: root::RakNet::TimeMS,
- );
- }
- extern "C" {
- #[doc = " Returns the value passed to SetTimeoutTime. or the default if it was never called"]
- #[doc = " \\param[out] the value passed to SetTimeoutTime"]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer14GetTimeoutTimeEv"]
- pub fn ReliabilityLayer_GetTimeoutTime(
- this: *mut root::RakNet::ReliabilityLayer,
- ) -> root::RakNet::TimeMS;
- }
- extern "C" {
- #[doc = " Packets are read directly from the socket layer and skip the reliability layer because unconnected players do not use the reliability layer"]
- #[doc = " This function takes packet data after a player has been confirmed as connected."]
- #[doc = " \\param[in] buffer The socket data"]
- #[doc = " \\param[in] length The length of the socket data"]
- #[doc = " \\param[in] systemAddress The player that this data is from"]
- #[doc = " \\param[in] messageHandlerList A list of registered plugins"]
- #[doc = " \\param[in] MTUSize maximum datagram size"]
- #[doc = " \\retval true Success"]
- #[doc = " \\retval false Modified packet"]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer38HandleSocketReceiveFromConnectedPlayerEPKcjRNS_13SystemAddressERN14DataStructures4ListIPNS_16PluginInterface2EEEiPNS_13RakNetSocket2EPNS_12RakNetRandomEmRNS_9BitStreamE"]
- pub fn ReliabilityLayer_HandleSocketReceiveFromConnectedPlayer(
- this: *mut root::RakNet::ReliabilityLayer,
- buffer: *const ::std::os::raw::c_char,
- length: ::std::os::raw::c_uint,
- systemAddress: *mut root::RakNet::SystemAddress,
- messageHandlerList: *mut root::DataStructures::List<
- *mut root::RakNet::PluginInterface2,
- >,
- MTUSize: ::std::os::raw::c_int,
- s: *mut root::RakNet::RakNetSocket2,
- rnr: *mut root::RakNet::RakNetRandom,
- timeRead: root::CCTimeType,
- updateBitStream: *mut root::RakNet::BitStream,
- ) -> bool;
- }
- extern "C" {
- #[doc = " This allocates bytes and writes a user-level message to those bytes."]
- #[doc = " \\param[out] data The message"]
- #[doc = " \\return Returns number of BITS put into the buffer"]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer7ReceiveEPPh"]
- pub fn ReliabilityLayer_Receive(
- this: *mut root::RakNet::ReliabilityLayer,
- data: *mut *mut ::std::os::raw::c_uchar,
- ) -> root::RakNet::BitSize_t;
- }
- extern "C" {
- #[doc = " Puts data on the send queue"]
- #[doc = " \\param[in] data The data to send"]
- #[doc = " \\param[in] numberOfBitsToSend The length of \\a data in bits"]
- #[doc = " \\param[in] priority The priority level for the send"]
- #[doc = " \\param[in] reliability The reliability type for the send"]
- #[doc = " \\param[in] orderingChannel 0 to 31. Specifies what channel to use, for relational ordering and sequencing of packets."]
- #[doc = " \\param[in] makeDataCopy If true \\a data will be copied. Otherwise, only a pointer will be stored."]
- #[doc = " \\param[in] MTUSize maximum datagram size"]
- #[doc = " \\param[in] currentTime Current time, as per RakNet::GetTimeMS()"]
- #[doc = " \\param[in] receipt This number will be returned back with ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS and is only returned with the reliability types that contain RECEIPT in the name"]
- #[doc = " \\return True or false for success or failure."]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer4SendEPcj14PacketPriority17PacketReliabilityhbimj"]
- pub fn ReliabilityLayer_Send(
- this: *mut root::RakNet::ReliabilityLayer,
- data: *mut ::std::os::raw::c_char,
- numberOfBitsToSend: root::RakNet::BitSize_t,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_uchar,
- makeDataCopy: bool,
- MTUSize: ::std::os::raw::c_int,
- currentTime: root::CCTimeType,
- receipt: u32,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Call once per game cycle. Handles internal lists and actually does the send."]
- #[doc = " \\param[in] s the communication end point"]
- #[doc = " \\param[in] systemAddress The Unique Player Identifier who shouldhave sent some packets"]
- #[doc = " \\param[in] MTUSize maximum datagram size"]
- #[doc = " \\param[in] time current system time"]
- #[doc = " \\param[in] maxBitsPerSecond if non-zero, enforces that outgoing bandwidth does not exceed this amount"]
- #[doc = " \\param[in] messageHandlerList A list of registered plugins"]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer6UpdateEPNS_13RakNetSocket2ERNS_13SystemAddressEimjRN14DataStructures4ListIPNS_16PluginInterface2EEEPNS_12RakNetRandomERNS_9BitStreamE"]
- pub fn ReliabilityLayer_Update(
- this: *mut root::RakNet::ReliabilityLayer,
- s: *mut root::RakNet::RakNetSocket2,
- systemAddress: *mut root::RakNet::SystemAddress,
- MTUSize: ::std::os::raw::c_int,
- time: root::CCTimeType,
- bitsPerSecondLimit: ::std::os::raw::c_uint,
- messageHandlerList: *mut root::DataStructures::List<
- *mut root::RakNet::PluginInterface2,
- >,
- rnr: *mut root::RakNet::RakNetRandom,
- updateBitStream: *mut root::RakNet::BitStream,
- );
- }
- extern "C" {
- #[doc = " Were you ever unable to deliver a packet despite retries?"]
- #[doc = " \\return true means the connection has been lost. Otherwise not."]
- #[link_name = "\u{1}_ZNK6RakNet16ReliabilityLayer16IsDeadConnectionEv"]
- pub fn ReliabilityLayer_IsDeadConnection(
- this: *const root::RakNet::ReliabilityLayer,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Causes IsDeadConnection to return true"]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer14KillConnectionEv"]
- pub fn ReliabilityLayer_KillConnection(this: *mut root::RakNet::ReliabilityLayer);
- }
- extern "C" {
- #[doc = " Get Statistics"]
- #[doc = " \\return A pointer to a static struct, filled out with current statistical information."]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer13GetStatisticsEPNS_16RakNetStatisticsE"]
- pub fn ReliabilityLayer_GetStatistics(
- this: *mut root::RakNet::ReliabilityLayer,
- rns: *mut root::RakNet::RakNetStatistics,
- ) -> *mut root::RakNet::RakNetStatistics;
- }
- extern "C" {
- #[doc = "Are we waiting for any data to be sent out or be processed by the player?"]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer21IsOutgoingDataWaitingEv"]
- pub fn ReliabilityLayer_IsOutgoingDataWaiting(
- this: *mut root::RakNet::ReliabilityLayer,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer14AreAcksWaitingEv"]
- pub fn ReliabilityLayer_AreAcksWaiting(
- this: *mut root::RakNet::ReliabilityLayer,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer21ApplyNetworkSimulatorEdjj"]
- pub fn ReliabilityLayer_ApplyNetworkSimulator(
- this: *mut root::RakNet::ReliabilityLayer,
- _maxSendBPS: f64,
- _minExtraPing: root::RakNet::TimeMS,
- _extraPingVariance: root::RakNet::TimeMS,
- );
- }
- extern "C" {
- #[doc = " Returns if you previously called ApplyNetworkSimulator"]
- #[doc = " \\return If you previously called ApplyNetworkSimulator"]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer24IsNetworkSimulatorActiveEv"]
- pub fn ReliabilityLayer_IsNetworkSimulatorActive(
- this: *mut root::RakNet::ReliabilityLayer,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer31SetSplitMessageProgressIntervalEi"]
- pub fn ReliabilityLayer_SetSplitMessageProgressInterval(
- this: *mut root::RakNet::ReliabilityLayer,
- interval: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer20SetUnreliableTimeoutEj"]
- pub fn ReliabilityLayer_SetUnreliableTimeout(
- this: *mut root::RakNet::ReliabilityLayer,
- timeoutMS: root::RakNet::TimeMS,
- );
- }
- extern "C" {
- #[doc = " Has a lot of time passed since the last ack"]
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayer10AckTimeoutEm"]
- pub fn ReliabilityLayer_AckTimeout(
- this: *mut root::RakNet::ReliabilityLayer,
- curTime: root::RakNet::Time,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet16ReliabilityLayer15GetNextSendTimeEv"]
- pub fn ReliabilityLayer_GetNextSendTime(
- this: *const root::RakNet::ReliabilityLayer,
- ) -> root::CCTimeType;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet16ReliabilityLayer21GetTimeBetweenPacketsEv"]
- pub fn ReliabilityLayer_GetTimeBetweenPackets(
- this: *const root::RakNet::ReliabilityLayer,
- ) -> root::CCTimeType;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayerC1Ev"]
- pub fn ReliabilityLayer_ReliabilityLayer(this: *mut root::RakNet::ReliabilityLayer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16ReliabilityLayerD1Ev"]
- pub fn ReliabilityLayer_ReliabilityLayer_destructor(
- this: *mut root::RakNet::ReliabilityLayer,
- );
- }
- impl ReliabilityLayer {
- #[inline]
- pub unsafe fn Reset(
- &mut self,
- resetVariables: bool,
- MTUSize: ::std::os::raw::c_int,
- _useSecurity: bool,
- ) {
- ReliabilityLayer_Reset(self, resetVariables, MTUSize, _useSecurity)
- }
- #[inline]
- pub unsafe fn SetTimeoutTime(&mut self, time: root::RakNet::TimeMS) {
- ReliabilityLayer_SetTimeoutTime(self, time)
- }
- #[inline]
- pub unsafe fn GetTimeoutTime(&mut self) -> root::RakNet::TimeMS {
- ReliabilityLayer_GetTimeoutTime(self)
- }
- #[inline]
- pub unsafe fn HandleSocketReceiveFromConnectedPlayer(
- &mut self,
- buffer: *const ::std::os::raw::c_char,
- length: ::std::os::raw::c_uint,
- systemAddress: *mut root::RakNet::SystemAddress,
- messageHandlerList: *mut root::DataStructures::List<
- *mut root::RakNet::PluginInterface2,
- >,
- MTUSize: ::std::os::raw::c_int,
- s: *mut root::RakNet::RakNetSocket2,
- rnr: *mut root::RakNet::RakNetRandom,
- timeRead: root::CCTimeType,
- updateBitStream: *mut root::RakNet::BitStream,
- ) -> bool {
- ReliabilityLayer_HandleSocketReceiveFromConnectedPlayer(
- self,
- buffer,
- length,
- systemAddress,
- messageHandlerList,
- MTUSize,
- s,
- rnr,
- timeRead,
- updateBitStream,
- )
- }
- #[inline]
- pub unsafe fn Receive(
- &mut self,
- data: *mut *mut ::std::os::raw::c_uchar,
- ) -> root::RakNet::BitSize_t {
- ReliabilityLayer_Receive(self, data)
- }
- #[inline]
- pub unsafe fn Send(
- &mut self,
- data: *mut ::std::os::raw::c_char,
- numberOfBitsToSend: root::RakNet::BitSize_t,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_uchar,
- makeDataCopy: bool,
- MTUSize: ::std::os::raw::c_int,
- currentTime: root::CCTimeType,
- receipt: u32,
- ) -> bool {
- ReliabilityLayer_Send(
- self,
- data,
- numberOfBitsToSend,
- priority,
- reliability,
- orderingChannel,
- makeDataCopy,
- MTUSize,
- currentTime,
- receipt,
- )
- }
- #[inline]
- pub unsafe fn Update(
- &mut self,
- s: *mut root::RakNet::RakNetSocket2,
- systemAddress: *mut root::RakNet::SystemAddress,
- MTUSize: ::std::os::raw::c_int,
- time: root::CCTimeType,
- bitsPerSecondLimit: ::std::os::raw::c_uint,
- messageHandlerList: *mut root::DataStructures::List<
- *mut root::RakNet::PluginInterface2,
- >,
- rnr: *mut root::RakNet::RakNetRandom,
- updateBitStream: *mut root::RakNet::BitStream,
- ) {
- ReliabilityLayer_Update(
- self,
- s,
- systemAddress,
- MTUSize,
- time,
- bitsPerSecondLimit,
- messageHandlerList,
- rnr,
- updateBitStream,
- )
- }
- #[inline]
- pub unsafe fn IsDeadConnection(&self) -> bool {
- ReliabilityLayer_IsDeadConnection(self)
- }
- #[inline]
- pub unsafe fn KillConnection(&mut self) {
- ReliabilityLayer_KillConnection(self)
- }
- #[inline]
- pub unsafe fn GetStatistics(
- &mut self,
- rns: *mut root::RakNet::RakNetStatistics,
- ) -> *mut root::RakNet::RakNetStatistics {
- ReliabilityLayer_GetStatistics(self, rns)
- }
- #[inline]
- pub unsafe fn IsOutgoingDataWaiting(&mut self) -> bool {
- ReliabilityLayer_IsOutgoingDataWaiting(self)
- }
- #[inline]
- pub unsafe fn AreAcksWaiting(&mut self) -> bool {
- ReliabilityLayer_AreAcksWaiting(self)
- }
- #[inline]
- pub unsafe fn ApplyNetworkSimulator(
- &mut self,
- _maxSendBPS: f64,
- _minExtraPing: root::RakNet::TimeMS,
- _extraPingVariance: root::RakNet::TimeMS,
- ) {
- ReliabilityLayer_ApplyNetworkSimulator(
- self,
- _maxSendBPS,
- _minExtraPing,
- _extraPingVariance,
- )
- }
- #[inline]
- pub unsafe fn IsNetworkSimulatorActive(&mut self) -> bool {
- ReliabilityLayer_IsNetworkSimulatorActive(self)
- }
- #[inline]
- pub unsafe fn SetSplitMessageProgressInterval(
- &mut self,
- interval: ::std::os::raw::c_int,
- ) {
- ReliabilityLayer_SetSplitMessageProgressInterval(self, interval)
- }
- #[inline]
- pub unsafe fn SetUnreliableTimeout(&mut self, timeoutMS: root::RakNet::TimeMS) {
- ReliabilityLayer_SetUnreliableTimeout(self, timeoutMS)
- }
- #[inline]
- pub unsafe fn AckTimeout(&mut self, curTime: root::RakNet::Time) -> bool {
- ReliabilityLayer_AckTimeout(self, curTime)
- }
- #[inline]
- pub unsafe fn GetNextSendTime(&self) -> root::CCTimeType {
- ReliabilityLayer_GetNextSendTime(self)
- }
- #[inline]
- pub unsafe fn GetTimeBetweenPackets(&self) -> root::CCTimeType {
- ReliabilityLayer_GetTimeBetweenPackets(self)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- ReliabilityLayer_ReliabilityLayer(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- ReliabilityLayer_ReliabilityLayer_destructor(self)
- }
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RPCMap {
- _unused: [u8; 0],
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RakNetBandwidth {
- _unused: [u8; 0],
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RouterInterface {
- _unused: [u8; 0],
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct NetworkIDManager {
- _unused: [u8; 0],
- }
- #[repr(C)]
- pub struct RakPeerInterface__bindgen_vtable(::std::os::raw::c_void);
- #[doc = " Forward declarations"]
- #[repr(C)]
- #[derive(Debug)]
- pub struct RakPeerInterface {
- pub vtable_: *const RakPeerInterface__bindgen_vtable,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16RakPeerInterface11GetInstanceEv"]
- pub fn RakPeerInterface_GetInstance() -> *mut root::RakNet::RakPeerInterface;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet16RakPeerInterface15DestroyInstanceEPS0_"]
- pub fn RakPeerInterface_DestroyInstance(i: *mut root::RakNet::RakPeerInterface);
- }
- extern "C" {
- #[doc = " Get a random number (to generate a GUID)"]
- #[link_name = "\u{1}_ZN6RakNet16RakPeerInterface26Get64BitUniqueRandomNumberEv"]
- pub fn RakPeerInterface_Get64BitUniqueRandomNumber() -> u64;
- }
- impl RakPeerInterface {
- #[inline]
- pub unsafe fn GetInstance() -> *mut root::RakNet::RakPeerInterface {
- RakPeerInterface_GetInstance()
- }
- #[inline]
- pub unsafe fn DestroyInstance(i: *mut root::RakNet::RakPeerInterface) {
- RakPeerInterface_DestroyInstance(i)
- }
- #[inline]
- pub unsafe fn Get64BitUniqueRandomNumber() -> u64 {
- RakPeerInterface_Get64BitUniqueRandomNumber()
- }
- }
- #[repr(C)]
- pub struct SignaledEvent {
- pub isSignaledMutex: root::RakNet::SimpleMutex,
- pub isSignaled: bool,
- pub condAttr: root::pthread_condattr_t,
- pub eventList: root::pthread_cond_t,
- pub hMutex: root::pthread_mutex_t,
- pub mutexAttr: root::pthread_mutexattr_t,
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13SignaledEvent9InitEventEv"]
- pub fn SignaledEvent_InitEvent(this: *mut root::RakNet::SignaledEvent);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13SignaledEvent10CloseEventEv"]
- pub fn SignaledEvent_CloseEvent(this: *mut root::RakNet::SignaledEvent);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13SignaledEvent8SetEventEv"]
- pub fn SignaledEvent_SetEvent(this: *mut root::RakNet::SignaledEvent);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13SignaledEvent11WaitOnEventEi"]
- pub fn SignaledEvent_WaitOnEvent(
- this: *mut root::RakNet::SignaledEvent,
- timeoutMs: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13SignaledEventC1Ev"]
- pub fn SignaledEvent_SignaledEvent(this: *mut root::RakNet::SignaledEvent);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet13SignaledEventD1Ev"]
- pub fn SignaledEvent_SignaledEvent_destructor(this: *mut root::RakNet::SignaledEvent);
- }
- impl SignaledEvent {
- #[inline]
- pub unsafe fn InitEvent(&mut self) {
- SignaledEvent_InitEvent(self)
- }
- #[inline]
- pub unsafe fn CloseEvent(&mut self) {
- SignaledEvent_CloseEvent(self)
- }
- #[inline]
- pub unsafe fn SetEvent(&mut self) {
- SignaledEvent_SetEvent(self)
- }
- #[inline]
- pub unsafe fn WaitOnEvent(&mut self, timeoutMs: ::std::os::raw::c_int) {
- SignaledEvent_WaitOnEvent(self, timeoutMs)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- SignaledEvent_SignaledEvent(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- #[inline]
- pub unsafe fn destruct(&mut self) {
- SignaledEvent_SignaledEvent_destructor(self)
- }
- }
- #[doc = " Forward declarations"]
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct HuffmanEncodingTree {
- _unused: [u8; 0],
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RemoteSystemIndex {
- pub index: ::std::os::raw::c_uint,
- pub next: *mut root::RakNet::RemoteSystemIndex,
- }
- #[doc = " Forward declarations"]
- #[repr(C)]
- pub struct RakPeer {
- pub _base: root::RakNet::RakPeerInterface,
- pub _base_1: root::RakNet::RNS2EventHandler,
- #[doc = "Set this to true to terminate the Peer thread execution"]
- pub endThreads: bool,
- #[doc = "true if the peer thread is active."]
- pub isMainLoopThreadActive: bool,
- pub occasionalPing: bool,
- #[doc = " Do we occasionally ping the other systems?*/"]
- #[doc = "Store the maximum number of peers allowed to connect"]
- pub maximumNumberOfPeers: ::std::os::raw::c_uint,
- #[doc = "Store the maximum incoming connection allowed"]
- pub maximumIncomingConnections: ::std::os::raw::c_uint,
- pub offlinePingResponse: root::RakNet::BitStream,
- pub incomingPassword: [::std::os::raw::c_char; 256usize],
- pub incomingPasswordLength: ::std::os::raw::c_uchar,
- #[doc = " This is an array of pointers to RemoteSystemStruct"]
- #[doc = " This allows us to preallocate the list when starting, so we don't have to allocate or delete at runtime."]
- #[doc = " Another benefit is that is lets us add and remove active players simply by setting systemAddress"]
- #[doc = " and moving elements in the list by copying pointers variables without affecting running threads, even if they are in the reliability layer"]
- pub remoteSystemList: *mut root::RakNet::RakPeer_RemoteSystemStruct,
- #[doc = " activeSystemList holds a list of pointers and is preallocated to be the same size as remoteSystemList. It is updated only by the network thread, but read by both threads"]
- #[doc = " When the isActive member of RemoteSystemStruct is set to true or false, that system is added to this list of pointers"]
- #[doc = " Threadsafe because RemoteSystemStruct is preallocated, and the list is only added to, not removed from"]
- pub activeSystemList: *mut *mut root::RakNet::RakPeer_RemoteSystemStruct,
- pub activeSystemListSize: ::std::os::raw::c_uint,
- pub remoteSystemLookup: *mut *mut root::RakNet::RemoteSystemIndex,
- pub remoteSystemIndexPool:
- root::DataStructures::MemoryPool<root::RakNet::RemoteSystemIndex>,
- pub rakPeerMutexes: [root::RakNet::SimpleMutex; 2usize],
- #[doc = "RunUpdateCycle is not thread safe but we don't need to mutex calls. Just skip calls if it is running already"]
- pub updateCycleIsRunning: bool,
- #[doc = "Data that both the client and the server needs"]
- pub bytesSentPerSecond: ::std::os::raw::c_uint,
- #[doc = "Data that both the client and the server needs"]
- pub bytesReceivedPerSecond: ::std::os::raw::c_uint,
- pub validationInteger: ::std::os::raw::c_uint,
- pub incomingQueueMutex: root::RakNet::SimpleMutex,
- pub banListMutex: root::RakNet::SimpleMutex,
- pub banList: root::DataStructures::List<*mut root::RakNet::RakPeer_BanStruct>,
- pub pluginListTS: root::DataStructures::List<*mut root::RakNet::PluginInterface2>,
- pub pluginListNTS: root::DataStructures::List<*mut root::RakNet::PluginInterface2>,
- pub requestedConnectionQueue:
- root::DataStructures::Queue<*mut root::RakNet::RakPeer_RequestedConnectionStruct>,
- pub requestedConnectionQueueMutex: root::RakNet::SimpleMutex,
- pub bufferedCommands: root::DataStructures::ThreadsafeAllocatingQueue<
- root::RakNet::RakPeer_BufferedCommandStruct,
- >,
- pub bufferedPacketsFreePool:
- root::DataStructures::Queue<*mut root::RakNet::RNS2RecvStruct>,
- pub bufferedPacketsFreePoolMutex: root::RakNet::SimpleMutex,
- pub bufferedPacketsQueue:
- root::DataStructures::Queue<*mut root::RakNet::RNS2RecvStruct>,
- pub bufferedPacketsQueueMutex: root::RakNet::SimpleMutex,
- pub socketQueryOutput: root::DataStructures::ThreadsafeAllocatingQueue<
- root::RakNet::RakPeer_SocketQueryOutput,
- >,
- pub securityExceptionMutex: root::RakNet::SimpleMutex,
- pub defaultMTUSize: ::std::os::raw::c_int,
- pub trackFrequencyTable: bool,
- pub socketList: root::DataStructures::List<*mut root::RakNet::RakNetSocket2>,
- pub replyFromTargetBS: *mut root::RakNet::BitStream,
- pub replyFromTargetPlayer: root::RakNet::SystemAddress,
- pub replyFromTargetBroadcast: bool,
- pub defaultTimeoutTime: root::RakNet::TimeMS,
- pub myGuid: root::RakNet::RakNetGUID,
- pub maxOutgoingBPS: ::std::os::raw::c_uint,
- #[doc = " True to allow connection accepted packets from anyone. False to only allow these packets from servers we requested a connection to."]
- pub allowConnectionResponseIPMigration: bool,
- pub firstExternalID: root::RakNet::SystemAddress,
- pub splitMessageProgressInterval: ::std::os::raw::c_int,
- pub unreliableTimeout: root::RakNet::TimeMS,
- pub incomingDatagramEventHandler: ::std::option::Option<
- unsafe extern "C" fn(arg1: *mut root::RakNet::RNS2RecvStruct) -> bool,
- >,
- pub securityExceptionList: root::DataStructures::List<root::RakNet::RakString>,
- pub ipList: [root::RakNet::SystemAddress; 10usize],
- pub allowInternalRouting: bool,
- pub userUpdateThreadPtr: ::std::option::Option<
- unsafe extern "C" fn(
- arg1: *mut root::RakNet::RakPeerInterface,
- arg2: *mut ::std::os::raw::c_void,
- ),
- >,
- pub userUpdateThreadData: *mut ::std::os::raw::c_void,
- pub quitAndDataEvents: root::RakNet::SignaledEvent,
- pub limitConnectionFrequencyFromTheSameIP: bool,
- pub packetAllocationPoolMutex: root::RakNet::SimpleMutex,
- pub packetAllocationPool: root::DataStructures::MemoryPool<root::RakNet::Packet>,
- pub packetReturnMutex: root::RakNet::SimpleMutex,
- pub packetReturnQueue: root::DataStructures::Queue<*mut root::RakNet::Packet>,
- #[doc = " This is used to return a number to the user when they call Send identifying the message"]
- #[doc = " This number will be returned back with ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS and is only returned"]
- #[doc = " with the reliability types that contain RECEIPT in the name"]
- pub sendReceiptSerialMutex: root::RakNet::SimpleMutex,
- pub sendReceiptSerial: u32,
- }
- #[doc = " \\internal"]
- #[doc = " \\brief Holds the clock differences between systems, along with the ping"]
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RakPeer_PingAndClockDifferential {
- pub pingTime: ::std::os::raw::c_ushort,
- pub clockDifferential: root::RakNet::Time,
- }
- #[doc = " \\internal"]
- #[doc = " \\brief All the information representing a connected system"]
- #[repr(C)]
- pub struct RakPeer_RemoteSystemStruct {
- pub isActive: bool,
- pub systemAddress: root::RakNet::SystemAddress,
- #[doc = " Their external IP on the internet"]
- pub myExternalSystemAddress: root::RakNet::SystemAddress,
- #[doc = " Your external IP on the internet, from their perspective"]
- pub theirInternalSystemAddress: [root::RakNet::SystemAddress; 10usize],
- #[doc = " Their internal IP, behind the LAN"]
- pub reliabilityLayer: root::RakNet::ReliabilityLayer,
- #[doc = " The reliability layer associated with this player"]
- pub weInitiatedTheConnection: bool,
- #[doc = " True if we started this connection via Connect. False if someone else connected to us."]
- pub pingAndClockDifferential: [root::RakNet::RakPeer_PingAndClockDifferential; 5usize],
- #[doc = " last x ping times and calculated clock differentials with it"]
- pub pingAndClockDifferentialWriteIndex: root::RakNet::Time,
- #[doc = " The index we are writing into the pingAndClockDifferential circular buffer"]
- pub lowestPing: ::std::os::raw::c_ushort,
- #[doc = "The lowest ping value encountered"]
- pub nextPingTime: root::RakNet::Time,
- #[doc = " When to next ping this player"]
- pub lastReliableSend: root::RakNet::Time,
- #[doc = " When did the last reliable send occur. Reliable sends must occur at least once every timeoutTime/2 units to notice disconnects"]
- pub connectionTime: root::RakNet::Time,
- pub guid: root::RakNet::RakNetGUID,
- pub MTUSize: ::std::os::raw::c_int,
- pub rakNetSocket: *mut root::RakNet::RakNetSocket2,
- pub remoteSystemIndex: root::RakNet::SystemIndex,
- pub connectMode: root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode,
- }
- pub const RakPeer_RemoteSystemStruct_ConnectMode_NO_ACTION:
- root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode = 0;
- pub const RakPeer_RemoteSystemStruct_ConnectMode_DISCONNECT_ASAP:
- root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode = 1;
- pub const RakPeer_RemoteSystemStruct_ConnectMode_DISCONNECT_ASAP_SILENTLY:
- root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode = 2;
- pub const RakPeer_RemoteSystemStruct_ConnectMode_DISCONNECT_ON_NO_ACK:
- root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode = 3;
- pub const RakPeer_RemoteSystemStruct_ConnectMode_REQUESTED_CONNECTION:
- root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode = 4;
- pub const RakPeer_RemoteSystemStruct_ConnectMode_HANDLING_CONNECTION_REQUEST:
- root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode = 5;
- pub const RakPeer_RemoteSystemStruct_ConnectMode_UNVERIFIED_SENDER:
- root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode = 6;
- pub const RakPeer_RemoteSystemStruct_ConnectMode_CONNECTED:
- root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode = 7;
- pub type RakPeer_RemoteSystemStruct_ConnectMode = ::std::os::raw::c_uint;
- pub const RakPeer_requestedConnectionList_Mutex: ::std::os::raw::c_uint = 0;
- pub const RakPeer_offlinePingResponse_Mutex: ::std::os::raw::c_uint = 1;
- pub const RakPeer_NUMBER_OF_RAKPEER_MUTEXES: ::std::os::raw::c_uint = 2;
- pub type RakPeer__bindgen_ty_1 = ::std::os::raw::c_uint;
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct RakPeer_BanStruct {
- pub IP: *mut ::std::os::raw::c_char,
- pub timeout: root::RakNet::TimeMS,
- }
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub struct RakPeer_RequestedConnectionStruct {
- pub systemAddress: root::RakNet::SystemAddress,
- pub nextRequestTime: root::RakNet::Time,
- pub requestsMade: ::std::os::raw::c_uchar,
- pub data: *mut ::std::os::raw::c_char,
- pub dataLength: ::std::os::raw::c_ushort,
- pub outgoingPassword: [::std::os::raw::c_char; 256usize],
- pub outgoingPasswordLength: ::std::os::raw::c_uchar,
- pub socketIndex: ::std::os::raw::c_uint,
- pub extraData: ::std::os::raw::c_uint,
- pub sendConnectionAttemptCount: ::std::os::raw::c_uint,
- pub timeBetweenSendConnectionAttemptsMS: ::std::os::raw::c_uint,
- pub timeoutTime: root::RakNet::TimeMS,
- pub publicKeyMode: root::RakNet::PublicKeyMode,
- pub socket: *mut root::RakNet::RakNetSocket2,
- pub actionToTake: root::RakNet::RakPeer_RequestedConnectionStruct__bindgen_ty_1,
- }
- pub const RakPeer_RequestedConnectionStruct_CONNECT: ::std::os::raw::c_uint = 1;
- pub type RakPeer_RequestedConnectionStruct__bindgen_ty_1 = ::std::os::raw::c_uint;
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub struct RakPeer_BufferedCommandStruct {
- pub numberOfBitsToSend: root::RakNet::BitSize_t,
- pub priority: root::PacketPriority,
- pub reliability: root::PacketReliability,
- pub orderingChannel: ::std::os::raw::c_char,
- pub systemIdentifier: root::RakNet::AddressOrGUID,
- pub broadcast: bool,
- pub connectionMode: root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode,
- pub networkID: root::RakNet::NetworkID,
- pub blockingCommand: bool,
- pub data: *mut ::std::os::raw::c_char,
- pub haveRakNetCloseSocket: bool,
- pub connectionSocketIndex: ::std::os::raw::c_uint,
- pub remotePortRakNetWasStartedOn_PS3: ::std::os::raw::c_ushort,
- pub extraSocketOptions: ::std::os::raw::c_uint,
- pub socket: *mut root::RakNet::RakNetSocket2,
- pub port: ::std::os::raw::c_ushort,
- pub receipt: u32,
- pub command: root::RakNet::RakPeer_BufferedCommandStruct__bindgen_ty_1,
- }
- pub const RakPeer_BufferedCommandStruct_BCS_SEND: ::std::os::raw::c_uint = 0;
- pub const RakPeer_BufferedCommandStruct_BCS_CLOSE_CONNECTION: ::std::os::raw::c_uint = 1;
- pub const RakPeer_BufferedCommandStruct_BCS_GET_SOCKET: ::std::os::raw::c_uint = 2;
- pub const RakPeer_BufferedCommandStruct_BCS_CHANGE_SYSTEM_ADDRESS: ::std::os::raw::c_uint =
- 3;
- pub const RakPeer_BufferedCommandStruct_BCS_DO_NOTHING: ::std::os::raw::c_uint = 4;
- pub type RakPeer_BufferedCommandStruct__bindgen_ty_1 = ::std::os::raw::c_uint;
- #[repr(C)]
- #[derive(Debug)]
- pub struct RakPeer_SocketQueryOutput {
- pub sockets: root::DataStructures::List<*mut root::RakNet::RakNetSocket2>,
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer25GetIndexFromSystemAddressENS_13SystemAddressEb"]
- pub fn RakPeer_GetIndexFromSystemAddress1(
- this: *const root::RakNet::RakPeer,
- systemAddress: root::RakNet::SystemAddress,
- calledFromNetworkThread: bool,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer16GetIndexFromGuidENS_10RakNetGUIDE"]
- pub fn RakPeer_GetIndexFromGuid(
- this: *mut root::RakNet::RakPeer,
- guid: root::RakNet::RakNetGUID,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer21SendConnectionRequestEPKctS2_iPNS_9PublicKeyEjjjjjPNS_13RakNetSocket2E"]
- pub fn RakPeer_SendConnectionRequest(
- this: *mut root::RakNet::RakPeer,
- host: *const ::std::os::raw::c_char,
- remotePort: ::std::os::raw::c_ushort,
- passwordData: *const ::std::os::raw::c_char,
- passwordDataLength: ::std::os::raw::c_int,
- publicKey: *mut root::RakNet::PublicKey,
- connectionSocketIndex: ::std::os::raw::c_uint,
- extraData: ::std::os::raw::c_uint,
- sendConnectionAttemptCount: ::std::os::raw::c_uint,
- timeBetweenSendConnectionAttemptsMS: ::std::os::raw::c_uint,
- timeoutTime: root::RakNet::TimeMS,
- socket: *mut root::RakNet::RakNetSocket2,
- ) -> root::RakNet::ConnectionAttemptResult;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer21SendConnectionRequestEPKctS2_iPNS_9PublicKeyEjjjjj"]
- pub fn RakPeer_SendConnectionRequest1(
- this: *mut root::RakNet::RakPeer,
- host: *const ::std::os::raw::c_char,
- remotePort: ::std::os::raw::c_ushort,
- passwordData: *const ::std::os::raw::c_char,
- passwordDataLength: ::std::os::raw::c_int,
- publicKey: *mut root::RakNet::PublicKey,
- connectionSocketIndex: ::std::os::raw::c_uint,
- extraData: ::std::os::raw::c_uint,
- sendConnectionAttemptCount: ::std::os::raw::c_uint,
- timeBetweenSendConnectionAttemptsMS: ::std::os::raw::c_uint,
- timeoutTime: root::RakNet::TimeMS,
- ) -> root::RakNet::ConnectionAttemptResult;
- }
- extern "C" {
- #[doc = "Get the reliability layer associated with a systemAddress."]
- #[doc = " \\param[in] systemAddress The player identifier"]
- #[doc = " \\return 0 if none"]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer32GetRemoteSystemFromSystemAddressENS_13SystemAddressEbb"]
- pub fn RakPeer_GetRemoteSystemFromSystemAddress(
- this: *const root::RakNet::RakPeer,
- systemAddress: root::RakNet::SystemAddress,
- calledFromNetworkThread: bool,
- onlyActive: bool,
- ) -> *mut root::RakNet::RakPeer_RemoteSystemStruct;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer15GetRemoteSystemENS_13AddressOrGUIDEbb"]
- pub fn RakPeer_GetRemoteSystem(
- this: *const root::RakNet::RakPeer,
- systemIdentifier: root::RakNet::AddressOrGUID,
- calledFromNetworkThread: bool,
- onlyActive: bool,
- ) -> *mut root::RakNet::RakPeer_RemoteSystemStruct;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer26ValidateRemoteSystemLookupEv"]
- pub fn RakPeer_ValidateRemoteSystemLookup(this: *const root::RakNet::RakPeer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer23GetRemoteSystemFromGUIDENS_10RakNetGUIDEb"]
- pub fn RakPeer_GetRemoteSystemFromGUID(
- this: *const root::RakNet::RakPeer,
- guid: root::RakNet::RakNetGUID,
- onlyActive: bool,
- ) -> *mut root::RakNet::RakPeer_RemoteSystemStruct;
- }
- extern "C" {
- #[doc = "Parse out a connection request packet"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer28ParseConnectionRequestPacketEPNS0_18RemoteSystemStructERKNS_13SystemAddressEPKci"]
- pub fn RakPeer_ParseConnectionRequestPacket(
- this: *mut root::RakNet::RakPeer,
- remoteSystem: *mut root::RakNet::RakPeer_RemoteSystemStruct,
- systemAddress: *const root::RakNet::SystemAddress,
- data: *const ::std::os::raw::c_char,
- byteSize: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer19OnConnectionRequestEPNS0_18RemoteSystemStructEm"]
- pub fn RakPeer_OnConnectionRequest(
- this: *mut root::RakNet::RakPeer,
- remoteSystem: *mut root::RakNet::RakPeer_RemoteSystemStruct,
- incomingTimestamp: root::RakNet::Time,
- );
- }
- extern "C" {
- #[doc = "Send a reliable disconnect packet to this player and disconnect them when it is delivered"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer24NotifyAndFlagForShutdownENS_13SystemAddressEbh14PacketPriority"]
- pub fn RakPeer_NotifyAndFlagForShutdown(
- this: *mut root::RakNet::RakPeer,
- systemAddress: root::RakNet::SystemAddress,
- performImmediate: bool,
- orderingChannel: ::std::os::raw::c_uchar,
- disconnectionNotificationPriority: root::PacketPriority,
- );
- }
- extern "C" {
- #[doc = "Returns how many remote systems initiated a connection to us"]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer37GetNumberOfRemoteInitiatedConnectionsEv"]
- pub fn RakPeer_GetNumberOfRemoteInitiatedConnections(
- this: *const root::RakNet::RakPeer,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[doc = "\t\\brief Get a free remote system from the list and assign our systemAddress to it."]
- #[doc = " \\note Should only be called from the update thread - not the user thread."]
- #[doc = " \\param[in] systemAddress\tsystemAddress to be assigned"]
- #[doc = " \\param[in] connectionMode\tconnection mode of the RemoteSystem."]
- #[doc = " \\param[in] rakNetSocket"]
- #[doc = " \\param[in] thisIPConnectedRecently\tIs this IP connected recently? set to False;"]
- #[doc = " \\param[in] bindingAddress\tAddress to be binded with the remote system"]
- #[doc = " \\param[in] incomingMTU\tMTU for the remote system"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer37AssignSystemAddressToRemoteSystemListENS_13SystemAddressENS0_18RemoteSystemStruct11ConnectModeEPNS_13RakNetSocket2EPbS1_iNS_10RakNetGUIDEb"]
- pub fn RakPeer_AssignSystemAddressToRemoteSystemList(
- this: *mut root::RakNet::RakPeer,
- systemAddress: root::RakNet::SystemAddress,
- connectionMode: root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode,
- incomingRakNetSocket: *mut root::RakNet::RakNetSocket2,
- thisIPConnectedRecently: *mut bool,
- bindingAddress: root::RakNet::SystemAddress,
- incomingMTU: ::std::os::raw::c_int,
- guid: root::RakNet::RakNetGUID,
- useSecurity: bool,
- ) -> *mut root::RakNet::RakPeer_RemoteSystemStruct;
- }
- extern "C" {
- #[doc = "\t\\brief Adjust the timestamp of the incoming packet to be relative to this system."]
- #[doc = " \\param[in] data\tData in the incoming packet."]
- #[doc = " \\param[in] systemAddress Sender of the incoming packet."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer22ShiftIncomingTimestampEPhRKNS_13SystemAddressE"]
- pub fn RakPeer_ShiftIncomingTimestamp(
- this: *const root::RakNet::RakPeer,
- data: *mut ::std::os::raw::c_uchar,
- systemAddress: *const root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[doc = " Get the most accurate clock differential for a certain player."]
- #[doc = " \\param[in] systemAddress The player with whose clock the time difference is calculated."]
- #[doc = " \\returns The clock differential for a certain player."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer24GetBestClockDifferentialENS_13SystemAddressE"]
- pub fn RakPeer_GetBestClockDifferential(
- this: *const root::RakNet::RakPeer,
- systemAddress: root::RakNet::SystemAddress,
- ) -> root::RakNet::Time;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer17IsLoopbackAddressERKNS_13AddressOrGUIDEb"]
- pub fn RakPeer_IsLoopbackAddress(
- this: *const root::RakNet::RakPeer,
- systemIdentifier: *const root::RakNet::AddressOrGUID,
- matchPort: bool,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer18GetLoopbackAddressEv"]
- pub fn RakPeer_GetLoopbackAddress(
- this: *const root::RakNet::RakPeer,
- ) -> root::RakNet::SystemAddress;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer27RemoteSystemLookupHashIndexERKNS_13SystemAddressE"]
- pub fn RakPeer_RemoteSystemLookupHashIndex(
- this: *const root::RakNet::RakPeer,
- sa: *const root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer21ReferenceRemoteSystemERKNS_13SystemAddressEj"]
- pub fn RakPeer_ReferenceRemoteSystem(
- this: *mut root::RakNet::RakPeer,
- sa: *const root::RakNet::SystemAddress,
- remoteSystemListIndex: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer23DereferenceRemoteSystemERKNS_13SystemAddressE"]
- pub fn RakPeer_DereferenceRemoteSystem(
- this: *mut root::RakNet::RakPeer,
- sa: *const root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer15GetRemoteSystemERKNS_13SystemAddressE"]
- pub fn RakPeer_GetRemoteSystem1(
- this: *const root::RakNet::RakPeer,
- sa: *const root::RakNet::SystemAddress,
- ) -> *mut root::RakNet::RakPeer_RemoteSystemStruct;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer20GetRemoteSystemIndexERKNS_13SystemAddressE"]
- pub fn RakPeer_GetRemoteSystemIndex(
- this: *const root::RakNet::RakPeer,
- sa: *const root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer23ClearRemoteSystemLookupEv"]
- pub fn RakPeer_ClearRemoteSystemLookup(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer21AddToActiveSystemListEj"]
- pub fn RakPeer_AddToActiveSystemList(
- this: *mut root::RakNet::RakPeer,
- remoteSystemListIndex: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer26RemoveFromActiveSystemListERKNS_13SystemAddressE"]
- pub fn RakPeer_RemoveFromActiveSystemList(
- this: *mut root::RakNet::RakPeer,
- sa: *const root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer20SetupBufferedPacketsEv"]
- pub fn RakPeer_SetupBufferedPackets(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer18PushBufferedPacketEPNS_14RNS2RecvStructE"]
- pub fn RakPeer_PushBufferedPacket(
- this: *mut root::RakNet::RakPeer,
- p: *mut root::RakNet::RNS2RecvStruct,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer17PopBufferedPacketEv"]
- pub fn RakPeer_PopBufferedPacket(
- this: *mut root::RakNet::RakPeer,
- ) -> *mut root::RakNet::RNS2RecvStruct;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer24AllowIncomingConnectionsEv"]
- pub fn RakPeer_AllowIncomingConnections(this: *const root::RakNet::RakPeer) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer12PingInternalENS_13SystemAddressEb17PacketReliability"]
- pub fn RakPeer_PingInternal(
- this: *mut root::RakNet::RakPeer,
- target: root::RakNet::SystemAddress,
- performImmediate: bool,
- reliability: root::PacketReliability,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer23CloseConnectionInternalERKNS_13AddressOrGUIDEbbh14PacketPriority"]
- pub fn RakPeer_CloseConnectionInternal(
- this: *mut root::RakNet::RakPeer,
- systemIdentifier: *const root::RakNet::AddressOrGUID,
- sendDisconnectionNotification: bool,
- performImmediate: bool,
- orderingChannel: ::std::os::raw::c_uchar,
- disconnectionNotificationPriority: root::PacketPriority,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer12SendBufferedEPKcj14PacketPriority17PacketReliabilitycNS_13AddressOrGUIDEbNS0_18RemoteSystemStruct11ConnectModeEj"]
- pub fn RakPeer_SendBuffered(
- this: *mut root::RakNet::RakPeer,
- data: *const ::std::os::raw::c_char,
- numberOfBitsToSend: root::RakNet::BitSize_t,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- connectionMode: root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode,
- receipt: u32,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer16SendBufferedListEPPKcPKii14PacketPriority17PacketReliabilitycNS_13AddressOrGUIDEbNS0_18RemoteSystemStruct11ConnectModeEj"]
- pub fn RakPeer_SendBufferedList(
- this: *mut root::RakNet::RakPeer,
- data: *mut *const ::std::os::raw::c_char,
- lengths: *const ::std::os::raw::c_int,
- numParameters: ::std::os::raw::c_int,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- connectionMode: root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode,
- receipt: u32,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer13SendImmediateEPcj14PacketPriority17PacketReliabilitycNS_13AddressOrGUIDEbbmj"]
- pub fn RakPeer_SendImmediate(
- this: *mut root::RakNet::RakPeer,
- data: *mut ::std::os::raw::c_char,
- numberOfBitsToSend: root::RakNet::BitSize_t,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- useCallerDataAllocation: bool,
- currentTime: root::RakNet::TimeUS,
- receipt: u32,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer21ClearBufferedCommandsEv"]
- pub fn RakPeer_ClearBufferedCommands(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer20ClearBufferedPacketsEv"]
- pub fn RakPeer_ClearBufferedPackets(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer22ClearSocketQueryOutputEv"]
- pub fn RakPeer_ClearSocketQueryOutput(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer28ClearRequestedConnectionListEv"]
- pub fn RakPeer_ClearRequestedConnectionList(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer19AddPacketToProducerEPNS_6PacketE"]
- pub fn RakPeer_AddPacketToProducer(
- this: *mut root::RakNet::RakPeer,
- p: *mut root::RakNet::Packet,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer20GenerateSeedFromGuidEv"]
- pub fn RakPeer_GenerateSeedFromGuid(
- this: *mut root::RakNet::RakPeer,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer23GetClockDifferentialIntEPNS0_18RemoteSystemStructE"]
- pub fn RakPeer_GetClockDifferentialInt(
- this: *const root::RakNet::RakPeer,
- remoteSystem: *mut root::RakNet::RakPeer_RemoteSystemStruct,
- ) -> root::RakNet::Time;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer15DerefAllSocketsEv"]
- pub fn RakPeer_DerefAllSockets(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer44GetRakNetSocketFromUserConnectionSocketIndexEj"]
- pub fn RakPeer_GetRakNetSocketFromUserConnectionSocketIndex(
- this: *const root::RakNet::RakPeer,
- userIndex: ::std::os::raw::c_uint,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer12GenerateGUIDEv"]
- pub fn RakPeer_GenerateGUID(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer22GetSystemIndexFromGuidENS_10RakNetGUIDE"]
- pub fn RakPeer_GetSystemIndexFromGuid(
- this: *const root::RakNet::RakPeer,
- input: root::RakNet::RakNetGUID,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer11AllocPacketEjPKcj"]
- pub fn RakPeer_AllocPacket(
- this: *mut root::RakNet::RakPeer,
- dataSize: ::std::os::raw::c_uint,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> *mut root::RakNet::Packet;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer11AllocPacketEjPhPKcj"]
- pub fn RakPeer_AllocPacket1(
- this: *mut root::RakNet::RakPeer,
- dataSize: ::std::os::raw::c_uint,
- data: *mut ::std::os::raw::c_uchar,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> *mut root::RakNet::Packet;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer16ResetSendReceiptEv"]
- pub fn RakPeer_ResetSendReceipt(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer15OnConnectedPongEmmPNS0_18RemoteSystemStructE"]
- pub fn RakPeer_OnConnectedPong(
- this: *mut root::RakNet::RakPeer,
- sendPingTime: root::RakNet::Time,
- sendPongTime: root::RakNet::Time,
- remoteSystem: *mut root::RakNet::RakPeer_RemoteSystemStruct,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer19CallPluginCallbacksERN14DataStructures4ListIPNS_16PluginInterface2EEEPNS_6PacketE"]
- pub fn RakPeer_CallPluginCallbacks(
- this: *mut root::RakNet::RakPeer,
- pluginList: *mut root::DataStructures::List<*mut root::RakNet::PluginInterface2>,
- packet: *mut root::RakNet::Packet,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer10FillIPListEv"]
- pub fn RakPeer_FillIPList(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[doc = "Constructor"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeerC1Ev"]
- pub fn RakPeer_RakPeer(this: *mut root::RakNet::RakPeer);
- }
- impl RakPeer {
- #[inline]
- pub unsafe fn GetIndexFromSystemAddress(
- &self,
- systemAddress: root::RakNet::SystemAddress,
- calledFromNetworkThread: bool,
- ) -> ::std::os::raw::c_int {
- RakPeer_GetIndexFromSystemAddress1(self, systemAddress, calledFromNetworkThread)
- }
- #[inline]
- pub unsafe fn GetIndexFromGuid(
- &mut self,
- guid: root::RakNet::RakNetGUID,
- ) -> ::std::os::raw::c_int {
- RakPeer_GetIndexFromGuid(self, guid)
- }
- #[inline]
- pub unsafe fn SendConnectionRequest(
- &mut self,
- host: *const ::std::os::raw::c_char,
- remotePort: ::std::os::raw::c_ushort,
- passwordData: *const ::std::os::raw::c_char,
- passwordDataLength: ::std::os::raw::c_int,
- publicKey: *mut root::RakNet::PublicKey,
- connectionSocketIndex: ::std::os::raw::c_uint,
- extraData: ::std::os::raw::c_uint,
- sendConnectionAttemptCount: ::std::os::raw::c_uint,
- timeBetweenSendConnectionAttemptsMS: ::std::os::raw::c_uint,
- timeoutTime: root::RakNet::TimeMS,
- socket: *mut root::RakNet::RakNetSocket2,
- ) -> root::RakNet::ConnectionAttemptResult {
- RakPeer_SendConnectionRequest(
- self,
- host,
- remotePort,
- passwordData,
- passwordDataLength,
- publicKey,
- connectionSocketIndex,
- extraData,
- sendConnectionAttemptCount,
- timeBetweenSendConnectionAttemptsMS,
- timeoutTime,
- socket,
- )
- }
- #[inline]
- pub unsafe fn SendConnectionRequest1(
- &mut self,
- host: *const ::std::os::raw::c_char,
- remotePort: ::std::os::raw::c_ushort,
- passwordData: *const ::std::os::raw::c_char,
- passwordDataLength: ::std::os::raw::c_int,
- publicKey: *mut root::RakNet::PublicKey,
- connectionSocketIndex: ::std::os::raw::c_uint,
- extraData: ::std::os::raw::c_uint,
- sendConnectionAttemptCount: ::std::os::raw::c_uint,
- timeBetweenSendConnectionAttemptsMS: ::std::os::raw::c_uint,
- timeoutTime: root::RakNet::TimeMS,
- ) -> root::RakNet::ConnectionAttemptResult {
- RakPeer_SendConnectionRequest1(
- self,
- host,
- remotePort,
- passwordData,
- passwordDataLength,
- publicKey,
- connectionSocketIndex,
- extraData,
- sendConnectionAttemptCount,
- timeBetweenSendConnectionAttemptsMS,
- timeoutTime,
- )
- }
- #[inline]
- pub unsafe fn GetRemoteSystemFromSystemAddress(
- &self,
- systemAddress: root::RakNet::SystemAddress,
- calledFromNetworkThread: bool,
- onlyActive: bool,
- ) -> *mut root::RakNet::RakPeer_RemoteSystemStruct {
- RakPeer_GetRemoteSystemFromSystemAddress(
- self,
- systemAddress,
- calledFromNetworkThread,
- onlyActive,
- )
- }
- #[inline]
- pub unsafe fn GetRemoteSystem(
- &self,
- systemIdentifier: root::RakNet::AddressOrGUID,
- calledFromNetworkThread: bool,
- onlyActive: bool,
- ) -> *mut root::RakNet::RakPeer_RemoteSystemStruct {
- RakPeer_GetRemoteSystem(self, systemIdentifier, calledFromNetworkThread, onlyActive)
- }
- #[inline]
- pub unsafe fn ValidateRemoteSystemLookup(&self) {
- RakPeer_ValidateRemoteSystemLookup(self)
- }
- #[inline]
- pub unsafe fn GetRemoteSystemFromGUID(
- &self,
- guid: root::RakNet::RakNetGUID,
- onlyActive: bool,
- ) -> *mut root::RakNet::RakPeer_RemoteSystemStruct {
- RakPeer_GetRemoteSystemFromGUID(self, guid, onlyActive)
- }
- #[inline]
- pub unsafe fn ParseConnectionRequestPacket(
- &mut self,
- remoteSystem: *mut root::RakNet::RakPeer_RemoteSystemStruct,
- systemAddress: *const root::RakNet::SystemAddress,
- data: *const ::std::os::raw::c_char,
- byteSize: ::std::os::raw::c_int,
- ) {
- RakPeer_ParseConnectionRequestPacket(
- self,
- remoteSystem,
- systemAddress,
- data,
- byteSize,
- )
- }
- #[inline]
- pub unsafe fn OnConnectionRequest(
- &mut self,
- remoteSystem: *mut root::RakNet::RakPeer_RemoteSystemStruct,
- incomingTimestamp: root::RakNet::Time,
- ) {
- RakPeer_OnConnectionRequest(self, remoteSystem, incomingTimestamp)
- }
- #[inline]
- pub unsafe fn NotifyAndFlagForShutdown(
- &mut self,
- systemAddress: root::RakNet::SystemAddress,
- performImmediate: bool,
- orderingChannel: ::std::os::raw::c_uchar,
- disconnectionNotificationPriority: root::PacketPriority,
- ) {
- RakPeer_NotifyAndFlagForShutdown(
- self,
- systemAddress,
- performImmediate,
- orderingChannel,
- disconnectionNotificationPriority,
- )
- }
- #[inline]
- pub unsafe fn GetNumberOfRemoteInitiatedConnections(&self) -> ::std::os::raw::c_uint {
- RakPeer_GetNumberOfRemoteInitiatedConnections(self)
- }
- #[inline]
- pub unsafe fn AssignSystemAddressToRemoteSystemList(
- &mut self,
- systemAddress: root::RakNet::SystemAddress,
- connectionMode: root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode,
- incomingRakNetSocket: *mut root::RakNet::RakNetSocket2,
- thisIPConnectedRecently: *mut bool,
- bindingAddress: root::RakNet::SystemAddress,
- incomingMTU: ::std::os::raw::c_int,
- guid: root::RakNet::RakNetGUID,
- useSecurity: bool,
- ) -> *mut root::RakNet::RakPeer_RemoteSystemStruct {
- RakPeer_AssignSystemAddressToRemoteSystemList(
- self,
- systemAddress,
- connectionMode,
- incomingRakNetSocket,
- thisIPConnectedRecently,
- bindingAddress,
- incomingMTU,
- guid,
- useSecurity,
- )
- }
- #[inline]
- pub unsafe fn ShiftIncomingTimestamp(
- &self,
- data: *mut ::std::os::raw::c_uchar,
- systemAddress: *const root::RakNet::SystemAddress,
- ) {
- RakPeer_ShiftIncomingTimestamp(self, data, systemAddress)
- }
- #[inline]
- pub unsafe fn GetBestClockDifferential(
- &self,
- systemAddress: root::RakNet::SystemAddress,
- ) -> root::RakNet::Time {
- RakPeer_GetBestClockDifferential(self, systemAddress)
- }
- #[inline]
- pub unsafe fn IsLoopbackAddress(
- &self,
- systemIdentifier: *const root::RakNet::AddressOrGUID,
- matchPort: bool,
- ) -> bool {
- RakPeer_IsLoopbackAddress(self, systemIdentifier, matchPort)
- }
- #[inline]
- pub unsafe fn GetLoopbackAddress(&self) -> root::RakNet::SystemAddress {
- RakPeer_GetLoopbackAddress(self)
- }
- #[inline]
- pub unsafe fn RemoteSystemLookupHashIndex(
- &self,
- sa: *const root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_uint {
- RakPeer_RemoteSystemLookupHashIndex(self, sa)
- }
- #[inline]
- pub unsafe fn ReferenceRemoteSystem(
- &mut self,
- sa: *const root::RakNet::SystemAddress,
- remoteSystemListIndex: ::std::os::raw::c_uint,
- ) {
- RakPeer_ReferenceRemoteSystem(self, sa, remoteSystemListIndex)
- }
- #[inline]
- pub unsafe fn DereferenceRemoteSystem(
- &mut self,
- sa: *const root::RakNet::SystemAddress,
- ) {
- RakPeer_DereferenceRemoteSystem(self, sa)
- }
- #[inline]
- pub unsafe fn GetRemoteSystem1(
- &self,
- sa: *const root::RakNet::SystemAddress,
- ) -> *mut root::RakNet::RakPeer_RemoteSystemStruct {
- RakPeer_GetRemoteSystem1(self, sa)
- }
- #[inline]
- pub unsafe fn GetRemoteSystemIndex(
- &self,
- sa: *const root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_uint {
- RakPeer_GetRemoteSystemIndex(self, sa)
- }
- #[inline]
- pub unsafe fn ClearRemoteSystemLookup(&mut self) {
- RakPeer_ClearRemoteSystemLookup(self)
- }
- #[inline]
- pub unsafe fn AddToActiveSystemList(
- &mut self,
- remoteSystemListIndex: ::std::os::raw::c_uint,
- ) {
- RakPeer_AddToActiveSystemList(self, remoteSystemListIndex)
- }
- #[inline]
- pub unsafe fn RemoveFromActiveSystemList(
- &mut self,
- sa: *const root::RakNet::SystemAddress,
- ) {
- RakPeer_RemoveFromActiveSystemList(self, sa)
- }
- #[inline]
- pub unsafe fn SetupBufferedPackets(&mut self) {
- RakPeer_SetupBufferedPackets(self)
- }
- #[inline]
- pub unsafe fn PushBufferedPacket(&mut self, p: *mut root::RakNet::RNS2RecvStruct) {
- RakPeer_PushBufferedPacket(self, p)
- }
- #[inline]
- pub unsafe fn PopBufferedPacket(&mut self) -> *mut root::RakNet::RNS2RecvStruct {
- RakPeer_PopBufferedPacket(self)
- }
- #[inline]
- pub unsafe fn AllowIncomingConnections(&self) -> bool {
- RakPeer_AllowIncomingConnections(self)
- }
- #[inline]
- pub unsafe fn PingInternal(
- &mut self,
- target: root::RakNet::SystemAddress,
- performImmediate: bool,
- reliability: root::PacketReliability,
- ) {
- RakPeer_PingInternal(self, target, performImmediate, reliability)
- }
- #[inline]
- pub unsafe fn CloseConnectionInternal(
- &mut self,
- systemIdentifier: *const root::RakNet::AddressOrGUID,
- sendDisconnectionNotification: bool,
- performImmediate: bool,
- orderingChannel: ::std::os::raw::c_uchar,
- disconnectionNotificationPriority: root::PacketPriority,
- ) {
- RakPeer_CloseConnectionInternal(
- self,
- systemIdentifier,
- sendDisconnectionNotification,
- performImmediate,
- orderingChannel,
- disconnectionNotificationPriority,
- )
- }
- #[inline]
- pub unsafe fn SendBuffered(
- &mut self,
- data: *const ::std::os::raw::c_char,
- numberOfBitsToSend: root::RakNet::BitSize_t,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- connectionMode: root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode,
- receipt: u32,
- ) {
- RakPeer_SendBuffered(
- self,
- data,
- numberOfBitsToSend,
- priority,
- reliability,
- orderingChannel,
- systemIdentifier,
- broadcast,
- connectionMode,
- receipt,
- )
- }
- #[inline]
- pub unsafe fn SendBufferedList(
- &mut self,
- data: *mut *const ::std::os::raw::c_char,
- lengths: *const ::std::os::raw::c_int,
- numParameters: ::std::os::raw::c_int,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- connectionMode: root::RakNet::RakPeer_RemoteSystemStruct_ConnectMode,
- receipt: u32,
- ) {
- RakPeer_SendBufferedList(
- self,
- data,
- lengths,
- numParameters,
- priority,
- reliability,
- orderingChannel,
- systemIdentifier,
- broadcast,
- connectionMode,
- receipt,
- )
- }
- #[inline]
- pub unsafe fn SendImmediate(
- &mut self,
- data: *mut ::std::os::raw::c_char,
- numberOfBitsToSend: root::RakNet::BitSize_t,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- useCallerDataAllocation: bool,
- currentTime: root::RakNet::TimeUS,
- receipt: u32,
- ) -> bool {
- RakPeer_SendImmediate(
- self,
- data,
- numberOfBitsToSend,
- priority,
- reliability,
- orderingChannel,
- systemIdentifier,
- broadcast,
- useCallerDataAllocation,
- currentTime,
- receipt,
- )
- }
- #[inline]
- pub unsafe fn ClearBufferedCommands(&mut self) {
- RakPeer_ClearBufferedCommands(self)
- }
- #[inline]
- pub unsafe fn ClearBufferedPackets(&mut self) {
- RakPeer_ClearBufferedPackets(self)
- }
- #[inline]
- pub unsafe fn ClearSocketQueryOutput(&mut self) {
- RakPeer_ClearSocketQueryOutput(self)
- }
- #[inline]
- pub unsafe fn ClearRequestedConnectionList(&mut self) {
- RakPeer_ClearRequestedConnectionList(self)
- }
- #[inline]
- pub unsafe fn AddPacketToProducer(&mut self, p: *mut root::RakNet::Packet) {
- RakPeer_AddPacketToProducer(self, p)
- }
- #[inline]
- pub unsafe fn GenerateSeedFromGuid(&mut self) -> ::std::os::raw::c_uint {
- RakPeer_GenerateSeedFromGuid(self)
- }
- #[inline]
- pub unsafe fn GetClockDifferentialInt(
- &self,
- remoteSystem: *mut root::RakNet::RakPeer_RemoteSystemStruct,
- ) -> root::RakNet::Time {
- RakPeer_GetClockDifferentialInt(self, remoteSystem)
- }
- #[inline]
- pub unsafe fn DerefAllSockets(&mut self) {
- RakPeer_DerefAllSockets(self)
- }
- #[inline]
- pub unsafe fn GetRakNetSocketFromUserConnectionSocketIndex(
- &self,
- userIndex: ::std::os::raw::c_uint,
- ) -> ::std::os::raw::c_uint {
- RakPeer_GetRakNetSocketFromUserConnectionSocketIndex(self, userIndex)
- }
- #[inline]
- pub unsafe fn GenerateGUID(&mut self) {
- RakPeer_GenerateGUID(self)
- }
- #[inline]
- pub unsafe fn GetSystemIndexFromGuid(
- &self,
- input: root::RakNet::RakNetGUID,
- ) -> ::std::os::raw::c_uint {
- RakPeer_GetSystemIndexFromGuid(self, input)
- }
- #[inline]
- pub unsafe fn AllocPacket(
- &mut self,
- dataSize: ::std::os::raw::c_uint,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> *mut root::RakNet::Packet {
- RakPeer_AllocPacket(self, dataSize, file, line)
- }
- #[inline]
- pub unsafe fn AllocPacket1(
- &mut self,
- dataSize: ::std::os::raw::c_uint,
- data: *mut ::std::os::raw::c_uchar,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> *mut root::RakNet::Packet {
- RakPeer_AllocPacket1(self, dataSize, data, file, line)
- }
- #[inline]
- pub unsafe fn ResetSendReceipt(&mut self) {
- RakPeer_ResetSendReceipt(self)
- }
- #[inline]
- pub unsafe fn OnConnectedPong(
- &mut self,
- sendPingTime: root::RakNet::Time,
- sendPongTime: root::RakNet::Time,
- remoteSystem: *mut root::RakNet::RakPeer_RemoteSystemStruct,
- ) {
- RakPeer_OnConnectedPong(self, sendPingTime, sendPongTime, remoteSystem)
- }
- #[inline]
- pub unsafe fn CallPluginCallbacks(
- &mut self,
- pluginList: *mut root::DataStructures::List<*mut root::RakNet::PluginInterface2>,
- packet: *mut root::RakNet::Packet,
- ) {
- RakPeer_CallPluginCallbacks(self, pluginList, packet)
- }
- #[inline]
- pub unsafe fn FillIPList(&mut self) {
- RakPeer_FillIPList(self)
- }
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- RakPeer_RakPeer(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
- }
- extern "C" {
- #[doc = "Destructor"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeerD1Ev"]
- pub fn RakPeer_RakPeer_destructor(this: *mut root::RakNet::RakPeer);
- }
- extern "C" {
- #[doc = " \\brief Starts the network threads and opens the listen port."]
- #[doc = " \\details You must call this before calling Connect()."]
- #[doc = " \\pre On the PS3, call Startup() after Client_Login()"]
- #[doc = " \\note Multiple calls while already active are ignored. To call this function again with different settings, you must first call Shutdown()."]
- #[doc = " \\note Call SetMaximumIncomingConnections if you want to accept incoming connections."]
- #[doc = " \\param[in] maxConnections Maximum number of connections between this instance of RakPeer and another instance of RakPeer. Required so that the network can preallocate and for thread safety. A pure client would set this to 1. A pure server would set it to the number of allowed clients.A hybrid would set it to the sum of both types of connections."]
- #[doc = " \\param[in] localPort The port to listen for connections on. On linux the system may be set up so thast ports under 1024 are restricted for everything but the root user. Use a higher port for maximum compatibility."]
- #[doc = " \\param[in] socketDescriptors An array of SocketDescriptor structures to force RakNet to listen on a particular IP address or port (or both). Each SocketDescriptor will represent one unique socket. Do not pass redundant structures. To listen on a specific port, you can pass SocketDescriptor(myPort,0); such as for a server. For a client, it is usually OK to just pass SocketDescriptor(); However, on the XBOX be sure to use IPPROTO_VDP"]
- #[doc = " \\param[in] socketDescriptorCount The size of the \\a socketDescriptors array. Pass 1 if you are not sure what to pass."]
- #[doc = " \\param[in] threadPriority Passed to the thread creation routine. Use THREAD_PRIORITY_NORMAL for Windows. For Linux based systems, you MUST pass something reasonable based on the thread priorities for your application."]
- #[doc = " \\return RAKNET_STARTED on success, otherwise appropriate failure enumeration."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer7StartupEjPNS_16SocketDescriptorEji"]
- pub fn RakPeer_Startup(
- this: *mut ::std::os::raw::c_void,
- maxConnections: ::std::os::raw::c_uint,
- socketDescriptors: *mut root::RakNet::SocketDescriptor,
- socketDescriptorCount: ::std::os::raw::c_uint,
- threadPriority: ::std::os::raw::c_int,
- ) -> root::RakNet::StartupResult;
- }
- extern "C" {
- #[doc = " If you accept connections, you must call this or else security will not be enabled for incoming connections."]
- #[doc = " This feature requires more round trips, bandwidth, and CPU time for the connection handshake"]
- #[doc = " x64 builds require under 25% of the CPU time of other builds"]
- #[doc = " See the Encryption sample for example usage"]
- #[doc = " \\pre Must be called while offline"]
- #[doc = " \\pre LIBCAT_SECURITY must be defined to 1 in NativeFeatureIncludes.h for this function to have any effect"]
- #[doc = " \\param[in] publicKey A pointer to the public key for accepting new connections"]
- #[doc = " \\param[in] privateKey A pointer to the private key for accepting new connections"]
- #[doc = " \\param[in] bRequireClientKey: Should be set to false for most servers. Allows the server to accept a public key from connecting clients as a proof of identity but eats twice as much CPU time as a normal connection"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer18InitializeSecurityEPKcS2_b"]
- pub fn RakPeer_InitializeSecurity(
- this: *mut ::std::os::raw::c_void,
- publicKey: *const ::std::os::raw::c_char,
- privateKey: *const ::std::os::raw::c_char,
- bRequireClientKey: bool,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Disables security for incoming connections."]
- #[doc = " \\note Must be called while offline"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer15DisableSecurityEv"]
- pub fn RakPeer_DisableSecurity(this: *mut ::std::os::raw::c_void);
- }
- extern "C" {
- #[doc = " \\brief This is useful if you have a fixed-address internal server behind a LAN."]
- #[doc = ""]
- #[doc = " Secure connections are determined by the recipient of an incoming connection. This has no effect if called on the system attempting to connect."]
- #[doc = " \\note If secure connections are on, do not use secure connections for a specific IP address."]
- #[doc = " \\param[in] ip IP address to add. * wildcards are supported."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer26AddToSecurityExceptionListEPKc"]
- pub fn RakPeer_AddToSecurityExceptionList(
- this: *mut ::std::os::raw::c_void,
- ip: *const ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " \\brief Remove a specific connection previously added via AddToSecurityExceptionList."]
- #[doc = " \\param[in] ip IP address to remove. Pass 0 to remove all IP addresses. * wildcards are supported."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer31RemoveFromSecurityExceptionListEPKc"]
- pub fn RakPeer_RemoveFromSecurityExceptionList(
- this: *mut ::std::os::raw::c_void,
- ip: *const ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " \\brief Checks to see if a given IP is in the security exception list."]
- #[doc = " \\param[in] IP address to check."]
- #[doc = " \\return True if the IP address is found in security exception list, else returns false."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer25IsInSecurityExceptionListEPKc"]
- pub fn RakPeer_IsInSecurityExceptionList(
- this: *mut ::std::os::raw::c_void,
- ip: *const ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Sets the maximum number of incoming connections allowed."]
- #[doc = " \\details If the number of incoming connections is less than the number of players currently connected,"]
- #[doc = " no more players will be allowed to connect. If this is greater than the maximum number of peers allowed,"]
- #[doc = " it will be reduced to the maximum number of peers allowed."]
- #[doc = ""]
- #[doc = " Defaults to 0, meaning by default, nobody can connect to you"]
- #[doc = " \\param[in] numberAllowed Maximum number of incoming connections allowed."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer29SetMaximumIncomingConnectionsEt"]
- pub fn RakPeer_SetMaximumIncomingConnections(
- this: *mut ::std::os::raw::c_void,
- numberAllowed: ::std::os::raw::c_ushort,
- );
- }
- extern "C" {
- #[doc = " \\brief Returns the value passed to SetMaximumIncomingConnections()."]
- #[doc = " \\return Maximum number of incoming connections, which is always <= maxConnections"]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer29GetMaximumIncomingConnectionsEv"]
- pub fn RakPeer_GetMaximumIncomingConnections(
- this: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[doc = " \\brief Returns how many open connections exist at this time."]
- #[doc = " \\return Number of open connections."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer19NumberOfConnectionsEv"]
- pub fn RakPeer_NumberOfConnections(
- this: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_ushort;
- }
- extern "C" {
- #[doc = " \\brief Sets the password for the incoming connections."]
- #[doc = " \\details The password must match in the call to Connect (defaults to none)."]
- #[doc = " Pass 0 to passwordData to specify no password."]
- #[doc = " This is a way to set a low level password for all incoming connections. To selectively reject connections, implement your own scheme using CloseConnection() to remove unwanted connections."]
- #[doc = " \\param[in] passwordData A data block that incoming connections must match. This can be just a password, or can be a stream of data. Specify 0 for no password data"]
- #[doc = " \\param[in] passwordDataLength The length in bytes of passwordData"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer19SetIncomingPasswordEPKci"]
- pub fn RakPeer_SetIncomingPassword(
- this: *mut ::std::os::raw::c_void,
- passwordData: *const ::std::os::raw::c_char,
- passwordDataLength: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[doc = " \\brief Gets the password passed to SetIncomingPassword"]
- #[doc = " \\param[out] passwordData Should point to a block large enough to hold the password data you passed to SetIncomingPassword()"]
- #[doc = " \\param[in,out] passwordDataLength Maximum size of the passwordData array. Modified to hold the number of bytes actually written."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer19GetIncomingPasswordEPcPi"]
- pub fn RakPeer_GetIncomingPassword(
- this: *mut ::std::os::raw::c_void,
- passwordData: *mut ::std::os::raw::c_char,
- passwordDataLength: *mut ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[doc = " \\brief Connect to the specified host (ip or domain name) and server port."]
- #[doc = " \\details Calling Connect and not calling SetMaximumIncomingConnections acts as a dedicated client."]
- #[doc = " Calling both acts as a true peer."]
- #[doc = ""]
- #[doc = " This is a non-blocking connection."]
- #[doc = ""]
- #[doc = " The connection is successful when GetConnectionState() returns IS_CONNECTED or Receive() gets a message with the type identifier ID_CONNECTION_REQUEST_ACCEPTED."]
- #[doc = " If the connection is not successful, such as a rejected connection or no response then neither of these things will happen."]
- #[doc = " \\pre Requires that you first call Startup()."]
- #[doc = " \\param[in] host Either a dotted IP address or a domain name."]
- #[doc = " \\param[in] remotePort Port to connect to on the remote machine."]
- #[doc = " \\param[in] passwordData A data block that must match the data block on the server passed to SetIncomingPassword(). This can be a string or can be a stream of data. Use 0 for no password."]
- #[doc = " \\param[in] passwordDataLength The length in bytes of passwordData."]
- #[doc = " \\param[in] publicKey The public key the server is using. If 0, the server is not using security. If non-zero, the publicKeyMode member determines how to connect"]
- #[doc = " \\param[in] connectionSocketIndex Index into the array of socket descriptors passed to socketDescriptors in RakPeer::Startup() to determine the one to send on."]
- #[doc = " \\param[in] sendConnectionAttemptCount Number of datagrams to send to the other system to try to connect."]
- #[doc = " \\param[in] timeBetweenSendConnectionAttemptsMS Time to elapse before a datagram is sent to the other system to try to connect. After sendConnectionAttemptCount number of attempts, ID_CONNECTION_ATTEMPT_FAILED is returned. Under low bandwidth conditions with multiple simultaneous outgoing connections, this value should be raised to 1000 or higher, or else the MTU detection can overrun the available bandwidth."]
- #[doc = " \\param[in] timeoutTime Time to elapse before dropping the connection if a reliable message could not be sent. 0 to use the default value from SetTimeoutTime(UNASSIGNED_SYSTEM_ADDRESS);"]
- #[doc = " \\return CONNECTION_ATTEMPT_STARTED on successful initiation. Otherwise, an appropriate enumeration indicating failure."]
- #[doc = " \\note CONNECTION_ATTEMPT_STARTED does not mean you are already connected!"]
- #[doc = " \\note It is possible to immediately get back ID_CONNECTION_ATTEMPT_FAILED if you exceed the maxConnections parameter passed to Startup(). This could happen if you call CloseConnection() with sendDisconnectionNotificaiton true, then immediately call Connect() before the connection has closed."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer7ConnectEPKctS2_iPNS_9PublicKeyEjjjj"]
- pub fn RakPeer_Connect(
- this: *mut ::std::os::raw::c_void,
- host: *const ::std::os::raw::c_char,
- remotePort: ::std::os::raw::c_ushort,
- passwordData: *const ::std::os::raw::c_char,
- passwordDataLength: ::std::os::raw::c_int,
- publicKey: *mut root::RakNet::PublicKey,
- connectionSocketIndex: ::std::os::raw::c_uint,
- sendConnectionAttemptCount: ::std::os::raw::c_uint,
- timeBetweenSendConnectionAttemptsMS: ::std::os::raw::c_uint,
- timeoutTime: root::RakNet::TimeMS,
- ) -> root::RakNet::ConnectionAttemptResult;
- }
- extern "C" {
- #[doc = " \\brief Connect to the specified host (ip or domain name) and server port."]
- #[doc = " \\param[in] host Either a dotted IP address or a domain name."]
- #[doc = " \\param[in] remotePort Which port to connect to on the remote machine."]
- #[doc = " \\param[in] passwordData A data block that must match the data block on the server passed to SetIncomingPassword(). This can be a string or can be a stream of data. Use 0 for no password."]
- #[doc = " \\param[in] passwordDataLength The length in bytes of passwordData."]
- #[doc = " \\param[in] socket A bound socket returned by another instance of RakPeerInterface."]
- #[doc = " \\param[in] sendConnectionAttemptCount Number of datagrams to send to the other system to try to connect."]
- #[doc = " \\param[in] timeBetweenSendConnectionAttemptsMS Time to elapse before a datagram is sent to the other system to try to connect. After sendConnectionAttemptCount number of attempts, ID_CONNECTION_ATTEMPT_FAILED is returned.. Under low bandwidth conditions with multiple simultaneous outgoing connections, this value should be raised to 1000 or higher, or else the MTU detection can overrun the available bandwidth."]
- #[doc = " \\param[in] timeoutTime Time to elapse before dropping the connection if a reliable message could not be sent. 0 to use the default from SetTimeoutTime(UNASSIGNED_SYSTEM_ADDRESS);"]
- #[doc = " \\return CONNECTION_ATTEMPT_STARTED on successful initiation. Otherwise, an appropriate enumeration indicating failure."]
- #[doc = " \\note CONNECTION_ATTEMPT_STARTED does not mean you are already connected!"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer17ConnectWithSocketEPKctS2_iPNS_13RakNetSocket2EPNS_9PublicKeyEjjj"]
- pub fn RakPeer_ConnectWithSocket(
- this: *mut ::std::os::raw::c_void,
- host: *const ::std::os::raw::c_char,
- remotePort: ::std::os::raw::c_ushort,
- passwordData: *const ::std::os::raw::c_char,
- passwordDataLength: ::std::os::raw::c_int,
- socket: *mut root::RakNet::RakNetSocket2,
- publicKey: *mut root::RakNet::PublicKey,
- sendConnectionAttemptCount: ::std::os::raw::c_uint,
- timeBetweenSendConnectionAttemptsMS: ::std::os::raw::c_uint,
- timeoutTime: root::RakNet::TimeMS,
- ) -> root::RakNet::ConnectionAttemptResult;
- }
- extern "C" {
- #[doc = " \\brief Stops the network threads and closes all connections."]
- #[doc = " \\param[in] blockDuration Wait time(milli seconds) for all remaining messages to go out, including ID_DISCONNECTION_NOTIFICATION. If 0, it doesn't wait at all."]
- #[doc = " \\param[in] orderingChannel Channel on which ID_DISCONNECTION_NOTIFICATION will be sent, if blockDuration > 0."]
- #[doc = " \\param[in] disconnectionNotificationPriority Priority of sending ID_DISCONNECTION_NOTIFICATION."]
- #[doc = " If set to 0, the disconnection notification won't be sent."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer8ShutdownEjh14PacketPriority"]
- pub fn RakPeer_Shutdown(
- this: *mut ::std::os::raw::c_void,
- blockDuration: ::std::os::raw::c_uint,
- orderingChannel: ::std::os::raw::c_uchar,
- disconnectionNotificationPriority: root::PacketPriority,
- );
- }
- extern "C" {
- #[doc = " \\brief Returns true if the network thread is running."]
- #[doc = " \\return True if the network thread is running, False otherwise"]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer8IsActiveEv"]
- pub fn RakPeer_IsActive(this: *mut ::std::os::raw::c_void) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Fills the array remoteSystems with the SystemAddress of all the systems we are connected to."]
- #[doc = " \\param[out] remoteSystems An array of SystemAddress structures, to be filled with the SystemAddresss of the systems we are connected to. Pass 0 to remoteSystems to get the number of systems we are connected to."]
- #[doc = " \\param[in, out] numberOfSystems As input, the size of remoteSystems array. As output, the number of elements put into the array."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer17GetConnectionListEPNS_13SystemAddressEPt"]
- pub fn RakPeer_GetConnectionList(
- this: *mut ::std::os::raw::c_void,
- remoteSystems: *mut root::RakNet::SystemAddress,
- numberOfSystems: *mut ::std::os::raw::c_ushort,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Returns the next uint32_t that Send() will return"]
- #[doc = " \\note If using RakPeer from multiple threads, this may not be accurate for your thread. Use IncrementNextSendReceipt() in that case."]
- #[doc = " \\return The next uint32_t that Send() or SendList will return"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer18GetNextSendReceiptEv"]
- pub fn RakPeer_GetNextSendReceipt(this: *mut ::std::os::raw::c_void) -> u32;
- }
- extern "C" {
- #[doc = " Returns the next uint32_t that Send() will return, and increments the value by one"]
- #[doc = " \\note If using RakPeer from multiple threads, pass this to forceReceipt in the send function"]
- #[doc = " \\return The next uint32_t that Send() or SendList will return"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer24IncrementNextSendReceiptEv"]
- pub fn RakPeer_IncrementNextSendReceipt(this: *mut ::std::os::raw::c_void) -> u32;
- }
- extern "C" {
- #[doc = " \\brief Sends a block of data to the specified system that you are connected to."]
- #[doc = " \\note This function only works while connected."]
- #[doc = " \\note The first byte should be a message identifier starting at ID_USER_PACKET_ENUM."]
- #[doc = " \\param[in] data Block of data to send."]
- #[doc = " \\param[in] length Size in bytes of the data to send."]
- #[doc = " \\param[in] priority Priority level to send on. See PacketPriority.h"]
- #[doc = " \\param[in] reliability How reliably to send this data. See PacketPriority.h"]
- #[doc = " \\param[in] orderingChannel When using ordered or sequenced messages, the channel to order these on. Messages are only ordered relative to other messages on the same stream."]
- #[doc = " \\param[in] systemIdentifier Who to send this packet to, or in the case of broadcasting who not to send it to. Pass either a SystemAddress structure or a RakNetGUID structure. Use UNASSIGNED_SYSTEM_ADDRESS or to specify none"]
- #[doc = " \\param[in] broadcast True to send this packet to all connected systems. If true, then systemAddress specifies who not to send the packet to."]
- #[doc = " \\param[in] forceReceipt If 0, will automatically determine the receipt number to return. If non-zero, will return what you give it."]
- #[doc = " \\return 0 on bad input. Otherwise a number that identifies this message. If \\a reliability is a type that returns a receipt, on a later call to Receive() you will get ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS with bytes 1-4 inclusive containing this number"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer4SendEPKci14PacketPriority17PacketReliabilitycNS_13AddressOrGUIDEbj"]
- pub fn RakPeer_Send(
- this: *mut ::std::os::raw::c_void,
- data: *const ::std::os::raw::c_char,
- length: ::std::os::raw::c_int,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- forceReceiptNumber: u32,
- ) -> u32;
- }
- extern "C" {
- #[doc = " \\brief \"Send\" to yourself rather than a remote system."]
- #[doc = " \\details The message will be processed through the plugins and returned to the game as usual."]
- #[doc = " This function works anytime"]
- #[doc = " \\note The first byte should be a message identifier starting at ID_USER_PACKET_ENUM"]
- #[doc = " \\param[in] data Block of data to send."]
- #[doc = " \\param[in] length Size in bytes of the data to send."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer12SendLoopbackEPKci"]
- pub fn RakPeer_SendLoopback(
- this: *mut ::std::os::raw::c_void,
- data: *const ::std::os::raw::c_char,
- length: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[doc = " \\brief Sends a block of data to the specified system that you are connected to."]
- #[doc = ""]
- #[doc = " Same as the above version, but takes a BitStream as input."]
- #[doc = " \\param[in] bitStream Bitstream to send"]
- #[doc = " \\param[in] priority Priority level to send on. See PacketPriority.h"]
- #[doc = " \\param[in] reliability How reliably to send this data. See PacketPriority.h"]
- #[doc = " \\param[in] orderingChannel Channel to order the messages on, when using ordered or sequenced messages. Messages are only ordered relative to other messages on the same stream."]
- #[doc = " \\param[in] systemIdentifier System Address or RakNetGUID to send this packet to, or in the case of broadcasting, the address not to send it to. Use UNASSIGNED_SYSTEM_ADDRESS to specify none."]
- #[doc = " \\param[in] broadcast True to send this packet to all connected systems. If true, then systemAddress specifies who not to send the packet to."]
- #[doc = " \\param[in] forceReceipt If 0, will automatically determine the receipt number to return. If non-zero, will return what you give it."]
- #[doc = " \\return 0 on bad input. Otherwise a number that identifies this message. If \\a reliability is a type that returns a receipt, on a later call to Receive() you will get ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS with bytes 1-4 inclusive containing this number"]
- #[doc = " \\note COMMON MISTAKE: When writing the first byte, bitStream->Write((unsigned char) ID_MY_TYPE) be sure it is casted to a byte, and you are not writing a 4 byte enumeration."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer4SendEPKNS_9BitStreamE14PacketPriority17PacketReliabilitycNS_13AddressOrGUIDEbj"]
- pub fn RakPeer_Send1(
- this: *mut ::std::os::raw::c_void,
- bitStream: *const root::RakNet::BitStream,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- forceReceiptNumber: u32,
- ) -> u32;
- }
- extern "C" {
- #[doc = " \\brief Sends multiple blocks of data, concatenating them automatically."]
- #[doc = ""]
- #[doc = " This is equivalent to:"]
- #[doc = " RakNet::BitStream bs;"]
- #[doc = " bs.WriteAlignedBytes(block1, blockLength1);"]
- #[doc = " bs.WriteAlignedBytes(block2, blockLength2);"]
- #[doc = " bs.WriteAlignedBytes(block3, blockLength3);"]
- #[doc = " Send(&bs, ...)"]
- #[doc = ""]
- #[doc = " This function only works when connected."]
- #[doc = " \\param[in] data An array of pointers to blocks of data"]
- #[doc = " \\param[in] lengths An array of integers indicating the length of each block of data"]
- #[doc = " \\param[in] numParameters Length of the arrays data and lengths"]
- #[doc = " \\param[in] priority Priority level to send on. See PacketPriority.h"]
- #[doc = " \\param[in] reliability How reliably to send this data. See PacketPriority.h"]
- #[doc = " \\param[in] orderingChannel Channel to order the messages on, when using ordered or sequenced messages. Messages are only ordered relative to other messages on the same stream."]
- #[doc = " \\param[in] systemIdentifier System Address or RakNetGUID to send this packet to, or in the case of broadcasting, the address not to send it to. Use UNASSIGNED_SYSTEM_ADDRESS to specify none."]
- #[doc = " \\param[in] broadcast True to send this packet to all connected systems. If true, then systemAddress specifies who not to send the packet to."]
- #[doc = " \\param[in] forceReceipt If 0, will automatically determine the receipt number to return. If non-zero, will return what you give it."]
- #[doc = " \\return 0 on bad input. Otherwise a number that identifies this message. If \\a reliability is a type that returns a receipt, on a later call to Receive() you will get ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS with bytes 1-4 inclusive containing this number"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer8SendListEPPKcPKii14PacketPriority17PacketReliabilitycNS_13AddressOrGUIDEbj"]
- pub fn RakPeer_SendList(
- this: *mut ::std::os::raw::c_void,
- data: *mut *const ::std::os::raw::c_char,
- lengths: *const ::std::os::raw::c_int,
- numParameters: ::std::os::raw::c_int,
- priority: root::PacketPriority,
- reliability: root::PacketReliability,
- orderingChannel: ::std::os::raw::c_char,
- systemIdentifier: root::RakNet::AddressOrGUID,
- broadcast: bool,
- forceReceiptNumber: u32,
- ) -> u32;
- }
- extern "C" {
- #[doc = " \\brief Gets a message from the incoming message queue."]
- #[doc = " \\details Use DeallocatePacket() to deallocate the message after you are done with it."]
- #[doc = " User-thread functions, such as RPC calls and the plugin function PluginInterface::Update occur here."]
- #[doc = " \\return 0 if no packets are waiting to be handled, otherwise a pointer to a packet."]
- #[doc = " \\note COMMON MISTAKE: Be sure to call this in a loop, once per game tick, until it returns 0. If you only process one packet per game tick they will buffer up."]
- #[doc = " \\sa RakNetTypes.h contains struct Packet."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer7ReceiveEv"]
- pub fn RakPeer_Receive(this: *mut ::std::os::raw::c_void) -> *mut root::RakNet::Packet;
- }
- extern "C" {
- #[doc = " \\brief Call this to deallocate a message returned by Receive() when you are done handling it."]
- #[doc = " \\param[in] packet Message to deallocate."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer16DeallocatePacketEPNS_6PacketE"]
- pub fn RakPeer_DeallocatePacket(
- this: *mut ::std::os::raw::c_void,
- packet: *mut root::RakNet::Packet,
- );
- }
- extern "C" {
- #[doc = " \\brief Return the total number of connections we are allowed."]
- #[doc = " \\return Total number of connections allowed."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer23GetMaximumNumberOfPeersEv"]
- pub fn RakPeer_GetMaximumNumberOfPeers(
- this: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[doc = " \\brief Close the connection to another host (if we initiated the connection it will disconnect, if they did it will kick them out)."]
- #[doc = " \\details This method closes the connection irrespective of who initiated the connection."]
- #[doc = " \\param[in] target Which system to close the connection to."]
- #[doc = " \\param[in] sendDisconnectionNotification True to send ID_DISCONNECTION_NOTIFICATION to the recipient. False to close it silently."]
- #[doc = " \\param[in] channel Which ordering channel to send the disconnection notification on, if any"]
- #[doc = " \\param[in] disconnectionNotificationPriority Priority to send ID_DISCONNECTION_NOTIFICATION on."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer15CloseConnectionENS_13AddressOrGUIDEbh14PacketPriority"]
- pub fn RakPeer_CloseConnection(
- this: *mut ::std::os::raw::c_void,
- target: root::RakNet::AddressOrGUID,
- sendDisconnectionNotification: bool,
- orderingChannel: ::std::os::raw::c_uchar,
- disconnectionNotificationPriority: root::PacketPriority,
- );
- }
- extern "C" {
- #[doc = " \\brief Cancel a pending connection attempt."]
- #[doc = " \\details If we are already connected, the connection stays open"]
- #[doc = " \\param[in] target Target system to cancel."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer23CancelConnectionAttemptENS_13SystemAddressE"]
- pub fn RakPeer_CancelConnectionAttempt(
- this: *mut ::std::os::raw::c_void,
- target: root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[doc = " Returns if a system is connected, disconnected, connecting in progress, or various other states"]
- #[doc = " \\param[in] systemIdentifier The system we are referring to"]
- #[doc = " \\note This locks a mutex, do not call too frequently during connection attempts or the attempt will take longer and possibly even timeout"]
- #[doc = " \\return What state the remote system is in"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer18GetConnectionStateENS_13AddressOrGUIDE"]
- pub fn RakPeer_GetConnectionState(
- this: *mut ::std::os::raw::c_void,
- systemIdentifier: root::RakNet::AddressOrGUID,
- ) -> root::RakNet::ConnectionState;
- }
- extern "C" {
- #[doc = " \\brief Given \\a systemAddress, returns its index into remoteSystemList."]
- #[doc = " \\details Values range from 0 to the maximum number of players allowed - 1."]
- #[doc = " This includes systems which were formerly connected, but are now not connected."]
- #[doc = " \\param[in] systemAddress The SystemAddress we are referring to"]
- #[doc = " \\return The index of this SystemAddress or -1 on system not found."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer25GetIndexFromSystemAddressENS_13SystemAddressE"]
- pub fn RakPeer_GetIndexFromSystemAddress(
- this: *mut ::std::os::raw::c_void,
- systemAddress: root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " \\brief Given \\a index into remoteSystemList, will return a SystemAddress."]
- #[doc = " This function is only useful for looping through all systems."]
- #[doc = ""]
- #[doc = " \\param[in] index Index should range between 0 and the maximum number of players allowed - 1."]
- #[doc = " \\return The SystemAddress structure corresponding to \\a index in remoteSystemList."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer25GetSystemAddressFromIndexEj"]
- pub fn RakPeer_GetSystemAddressFromIndex(
- this: *mut ::std::os::raw::c_void,
- index: ::std::os::raw::c_uint,
- ) -> root::RakNet::SystemAddress;
- }
- extern "C" {
- #[doc = " \\brief Same as GetSystemAddressFromIndex but returns RakNetGUID"]
- #[doc = " \\param[in] index Index should range between 0 and the maximum number of players allowed - 1."]
- #[doc = " \\return The RakNetGUID"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer16GetGUIDFromIndexEj"]
- pub fn RakPeer_GetGUIDFromIndex(
- this: *mut ::std::os::raw::c_void,
- index: ::std::os::raw::c_uint,
- ) -> root::RakNet::RakNetGUID;
- }
- extern "C" {
- #[doc = " \\brief Same as calling GetSystemAddressFromIndex and GetGUIDFromIndex for all systems, but more efficient"]
- #[doc = " Indices match each other, so \\a addresses[0] and \\a guids[0] refer to the same system"]
- #[doc = " \\param[out] addresses All system addresses. Size of the list is the number of connections. Size of the \\a addresses list will match the size of the \\a guids list."]
- #[doc = " \\param[out] guids All guids. Size of the list is the number of connections. Size of the list will match the size of the \\a addresses list."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer13GetSystemListERN14DataStructures4ListINS_13SystemAddressEEERNS2_INS_10RakNetGUIDEEE"]
- pub fn RakPeer_GetSystemList(
- this: *mut ::std::os::raw::c_void,
- addresses: *mut root::DataStructures::List<root::RakNet::SystemAddress>,
- guids: *mut root::DataStructures::List<root::RakNet::RakNetGUID>,
- );
- }
- extern "C" {
- #[doc = " \\brief Bans an IP from connecting."]
- #[doc = " \\details Banned IPs persist between connections but are not saved on shutdown nor loaded on startup."]
- #[doc = " \\param[in] IP Dotted IP address. You can use * for a wildcard address, such as 128.0.0. * will ban all IP addresses starting with 128.0.0."]
- #[doc = " \\param[in] milliseconds Gives time in milli seconds for a temporary ban of the IP address. Use 0 for a permanent ban."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer12AddToBanListEPKcj"]
- pub fn RakPeer_AddToBanList(
- this: *mut ::std::os::raw::c_void,
- IP: *const ::std::os::raw::c_char,
- milliseconds: root::RakNet::TimeMS,
- );
- }
- extern "C" {
- #[doc = " \\brief Allows a previously banned IP to connect."]
- #[doc = " param[in] Dotted IP address. You can use * as a wildcard. An IP such as 128.0.0.* will ban all IP addresses starting with 128.0.0."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer17RemoveFromBanListEPKc"]
- pub fn RakPeer_RemoveFromBanList(
- this: *mut ::std::os::raw::c_void,
- IP: *const ::std::os::raw::c_char,
- );
- }
- extern "C" {
- #[doc = " \\brief Allows all previously banned IPs to connect."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer12ClearBanListEv"]
- pub fn RakPeer_ClearBanList(this: *mut ::std::os::raw::c_void);
- }
- extern "C" {
- #[doc = " \\brief Returns true or false indicating if a particular IP is banned."]
- #[doc = " \\param[in] IP Dotted IP address."]
- #[doc = " \\return True if IP matches any IPs in the ban list, accounting for any wildcards. False otherwise."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer8IsBannedEPKc"]
- pub fn RakPeer_IsBanned(
- this: *mut ::std::os::raw::c_void,
- IP: *const ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Enable or disable allowing frequent connections from the same IP adderss"]
- #[doc = " \\details This is a security measure which is disabled by default, but can be set to true to prevent attackers from using up all connection slots."]
- #[doc = " \\param[in] b True to limit connections from the same ip to at most 1 per 100 milliseconds."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer29SetLimitIPConnectionFrequencyEb"]
- pub fn RakPeer_SetLimitIPConnectionFrequency(
- this: *mut ::std::os::raw::c_void,
- b: bool,
- );
- }
- extern "C" {
- #[doc = " Send a ping to the specified connected system."]
- #[doc = " \\pre The sender and recipient must already be started via a successful call to Startup()"]
- #[doc = " \\param[in] target Which system to ping"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer4PingENS_13SystemAddressE"]
- pub fn RakPeer_Ping(
- this: *mut ::std::os::raw::c_void,
- target: root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[doc = " \\brief Send a ping to the specified unconnected system."]
- #[doc = " \\details The remote system, if it is Initialized, will respond with ID_PONG followed by sizeof(RakNet::TimeMS) containing the system time the ping was sent. Default is 4 bytes - See __GET_TIME_64BIT in RakNetTypes.h"]
- #[doc = " System should reply with ID_PONG if it is active"]
- #[doc = " \\param[in] host Either a dotted IP address or a domain name. Can be 255.255.255.255 for LAN broadcast."]
- #[doc = " \\param[in] remotePort Which port to connect to on the remote machine."]
- #[doc = " \\param[in] onlyReplyOnAcceptingConnections Only request a reply if the remote system is accepting connections"]
- #[doc = " \\param[in] connectionSocketIndex Index into the array of socket descriptors passed to socketDescriptors in RakPeer::Startup() to send on."]
- #[doc = " \\return true on success, false on failure (unknown hostname)"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer4PingEPKctbj"]
- pub fn RakPeer_Ping1(
- this: *mut ::std::os::raw::c_void,
- host: *const ::std::os::raw::c_char,
- remotePort: ::std::os::raw::c_ushort,
- onlyReplyOnAcceptingConnections: bool,
- connectionSocketIndex: ::std::os::raw::c_uint,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Returns the average of all ping times read for the specific system or -1 if none read yet"]
- #[doc = " \\param[in] systemAddress Which system we are referring to"]
- #[doc = " \\return The ping time for this system, or -1"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer14GetAveragePingENS_13AddressOrGUIDE"]
- pub fn RakPeer_GetAveragePing(
- this: *mut ::std::os::raw::c_void,
- systemIdentifier: root::RakNet::AddressOrGUID,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " \\brief Returns the last ping time read for the specific system or -1 if none read yet."]
- #[doc = " \\param[in] systemAddress Which system we are referring to"]
- #[doc = " \\return The last ping time for this system, or -1."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer11GetLastPingENS_13AddressOrGUIDE"]
- pub fn RakPeer_GetLastPing(
- this: *mut ::std::os::raw::c_void,
- systemIdentifier: root::RakNet::AddressOrGUID,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " \\brief Returns the lowest ping time read or -1 if none read yet."]
- #[doc = " \\param[in] systemIdentifier Which system we are referring to"]
- #[doc = " \\return The lowest ping time for this system, or -1."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer13GetLowestPingENS_13AddressOrGUIDE"]
- pub fn RakPeer_GetLowestPing(
- this: *mut ::std::os::raw::c_void,
- systemIdentifier: root::RakNet::AddressOrGUID,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " Ping the remote systems every so often, or not. Can be called anytime."]
- #[doc = " By default this is true. Recommended to leave on, because congestion control uses it to determine how often to resend lost packets."]
- #[doc = " It would be true by default to prevent timestamp drift, since in the event of a clock spike, the timestamp deltas would no longer be accurate"]
- #[doc = " \\param[in] doPing True to start occasional pings. False to stop them."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer17SetOccasionalPingEb"]
- pub fn RakPeer_SetOccasionalPing(this: *mut ::std::os::raw::c_void, doPing: bool);
- }
- extern "C" {
- #[doc = " Return the clock difference between your system and the specified system"]
- #[doc = " Subtract GetClockDifferential() from a time returned by the remote system to get that time relative to your own system"]
- #[doc = " Returns 0 if the system is unknown"]
- #[doc = " \\param[in] systemIdentifier Which system we are referring to"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer20GetClockDifferentialENS_13AddressOrGUIDE"]
- pub fn RakPeer_GetClockDifferential(
- this: *mut ::std::os::raw::c_void,
- systemIdentifier: root::RakNet::AddressOrGUID,
- ) -> root::RakNet::Time;
- }
- extern "C" {
- #[doc = " \\brief Sets the data to send along with a LAN server discovery or offline ping reply."]
- #[doc = " \\param[in] data Block of data to send, or 0 for none"]
- #[doc = " \\param[in] length Length of the data in bytes, or 0 for none"]
- #[doc = " \\note \\a length should be under 400 bytes, as a security measure against flood attacks"]
- #[doc = " \\sa Ping.cpp"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer22SetOfflinePingResponseEPKcj"]
- pub fn RakPeer_SetOfflinePingResponse(
- this: *mut ::std::os::raw::c_void,
- data: *const ::std::os::raw::c_char,
- length: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " \\brief Returns pointers to a copy of the \\a data passed to SetOfflinePingResponse."]
- #[doc = " \\param[out] data A pointer to a copy of the data passed to SetOfflinePingResponse()"]
- #[doc = " \\param[out] length A pointer filled in with the length parameter passed to SetOfflinePingResponse()"]
- #[doc = " \\sa SetOfflinePingResponse"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer22GetOfflinePingResponseEPPcPj"]
- pub fn RakPeer_GetOfflinePingResponse(
- this: *mut ::std::os::raw::c_void,
- data: *mut *mut ::std::os::raw::c_char,
- length: *mut ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " \\brief Returns the unique address identifier that represents you or another system on the the network"]
- #[doc = " \\note Not supported by the XBOX"]
- #[doc = " \\param[in] systemAddress Use UNASSIGNED_SYSTEM_ADDRESS to get your behind-LAN address. Use a connected system to get their behind-LAN address. This does not return the port."]
- #[doc = " \\param[in] index When you have multiple internal IDs, which index to return? Currently limited to MAXIMUM_NUMBER_OF_INTERNAL_IDS (so the maximum value of this variable is MAXIMUM_NUMBER_OF_INTERNAL_IDS-1)"]
- #[doc = " \\return Identifier of your system internally, which may not be how other systems see if you if you are behind a NAT or proxy."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer13GetInternalIDENS_13SystemAddressEi"]
- pub fn RakPeer_GetInternalID(
- this: *mut ::std::os::raw::c_void,
- systemAddress: root::RakNet::SystemAddress,
- index: ::std::os::raw::c_int,
- ) -> root::RakNet::SystemAddress;
- }
- extern "C" {
- #[doc = " \\brief Sets your internal IP address, for platforms that do not support reading it, or to override a value"]
- #[doc = " \\param[in] systemAddress. The address to set. Use SystemAddress::FromString() if you want to use a dotted string"]
- #[doc = " \\param[in] index When you have multiple internal IDs, which index to set?"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer13SetInternalIDENS_13SystemAddressEi"]
- pub fn RakPeer_SetInternalID(
- this: *mut ::std::os::raw::c_void,
- systemAddress: root::RakNet::SystemAddress,
- index: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[doc = " \\brief Returns the unique address identifier that represents the target on the the network and is based on the target's external IP / port."]
- #[doc = " \\param[in] target The SystemAddress of the remote system. Usually the same for all systems, unless you have two or more network cards."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer13GetExternalIDENS_13SystemAddressE"]
- pub fn RakPeer_GetExternalID(
- this: *mut ::std::os::raw::c_void,
- target: root::RakNet::SystemAddress,
- ) -> root::RakNet::SystemAddress;
- }
- extern "C" {
- #[doc = " Return my own GUID"]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer9GetMyGUIDEv"]
- pub fn RakPeer_GetMyGUID(this: *mut ::std::os::raw::c_void)
- -> root::RakNet::RakNetGUID;
- }
- extern "C" {
- #[doc = " Return the address bound to a socket at the specified index"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer17GetMyBoundAddressEi"]
- pub fn RakPeer_GetMyBoundAddress(
- this: *mut ::std::os::raw::c_void,
- socketIndex: ::std::os::raw::c_int,
- ) -> root::RakNet::SystemAddress;
- }
- extern "C" {
- #[doc = " \\brief Given a connected system address, this method gives the unique GUID representing that instance of RakPeer."]
- #[doc = " This will be the same on all systems connected to that instance of RakPeer, even if the external system addresses are different."]
- #[doc = " Complexity is O(log2(n))."]
- #[doc = " If \\a input is UNASSIGNED_SYSTEM_ADDRESS, will return your own GUID"]
- #[doc = " \\pre Call Startup() first, or the function will return UNASSIGNED_RAKNET_GUID"]
- #[doc = " \\param[in] input The system address of the target system we are connected to."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer24GetGuidFromSystemAddressENS_13SystemAddressE"]
- pub fn RakPeer_GetGuidFromSystemAddress(
- this: *mut ::std::os::raw::c_void,
- input: root::RakNet::SystemAddress,
- ) -> *const root::RakNet::RakNetGUID;
- }
- extern "C" {
- #[doc = " \\brief Gives the system address of a connected system, given its GUID."]
- #[doc = " The GUID will be the same on all systems connected to that instance of RakPeer, even if the external system addresses are different."]
- #[doc = " Currently O(log(n)), but this may be improved in the future"]
- #[doc = " If \\a input is UNASSIGNED_RAKNET_GUID, UNASSIGNED_SYSTEM_ADDRESS is returned."]
- #[doc = " \\param[in] input The RakNetGUID of the target system."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer24GetSystemAddressFromGuidENS_10RakNetGUIDE"]
- pub fn RakPeer_GetSystemAddressFromGuid(
- this: *mut ::std::os::raw::c_void,
- input: root::RakNet::RakNetGUID,
- ) -> root::RakNet::SystemAddress;
- }
- extern "C" {
- #[doc = " Given the SystemAddress of a connected system, get the public key they provided as an identity"]
- #[doc = " Returns false if system address was not found or client public key is not known"]
- #[doc = " \\param[in] input The RakNetGUID of the system"]
- #[doc = " \\param[in] client_public_key The connected client's public key is copied to this address. Buffer must be cat::EasyHandshake::PUBLIC_KEY_BYTES bytes in length."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer35GetClientPublicKeyFromSystemAddressENS_13SystemAddressEPc"]
- pub fn RakPeer_GetClientPublicKeyFromSystemAddress(
- this: *mut ::std::os::raw::c_void,
- input: root::RakNet::SystemAddress,
- client_public_key: *mut ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[doc = " Set the time, in MS, to use before considering ourselves disconnected after not being able to deliver a reliable message."]
- #[doc = " Default time is 10,000 or 10 seconds in release and 30,000 or 30 seconds in debug."]
- #[doc = " Do not set different values for different computers that are connected to each other, or you won't be able to reconnect after ID_CONNECTION_LOST"]
- #[doc = " \\param[in] timeMS Time, in MS"]
- #[doc = " \\param[in] target SystemAddress structure of the target system. Pass UNASSIGNED_SYSTEM_ADDRESS for all systems."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer14SetTimeoutTimeEjNS_13SystemAddressE"]
- pub fn RakPeer_SetTimeoutTime(
- this: *mut ::std::os::raw::c_void,
- timeMS: root::RakNet::TimeMS,
- target: root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[doc = " \\brief Returns the Timeout time for the given system."]
- #[doc = " \\param[in] target Target system to get the TimeoutTime for. Pass UNASSIGNED_SYSTEM_ADDRESS to get the default value."]
- #[doc = " \\return Timeout time for a given system."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer14GetTimeoutTimeENS_13SystemAddressE"]
- pub fn RakPeer_GetTimeoutTime(
- this: *mut ::std::os::raw::c_void,
- target: root::RakNet::SystemAddress,
- ) -> root::RakNet::TimeMS;
- }
- extern "C" {
- #[doc = " \\brief Returns the current MTU size"]
- #[doc = " \\param[in] target Which system to get MTU for. UNASSIGNED_SYSTEM_ADDRESS to get the default"]
- #[doc = " \\return The current MTU size of the target system."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer10GetMTUSizeENS_13SystemAddressE"]
- pub fn RakPeer_GetMTUSize(
- this: *mut ::std::os::raw::c_void,
- target: root::RakNet::SystemAddress,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " \\brief Returns the number of IP addresses this system has internally."]
- #[doc = " \\details Get the actual addresses from GetLocalIP()"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer20GetNumberOfAddressesEv"]
- pub fn RakPeer_GetNumberOfAddresses(
- this: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[doc = " Returns an IP address at index 0 to GetNumberOfAddresses-1 in ipList array."]
- #[doc = " \\param[in] index index into the list of IP addresses"]
- #[doc = " \\return The local IP address at this index"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer10GetLocalIPEj"]
- pub fn RakPeer_GetLocalIP(
- this: *mut ::std::os::raw::c_void,
- index: ::std::os::raw::c_uint,
- ) -> *const ::std::os::raw::c_char;
- }
- extern "C" {
- #[doc = " Is this a local IP?"]
- #[doc = " Checks if this ip is in the ipList array."]
- #[doc = " \\param[in] An IP address to check, excluding the port."]
- #[doc = " \\return True if this is one of the IP addresses returned by GetLocalIP"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer9IsLocalIPEPKc"]
- pub fn RakPeer_IsLocalIP(
- this: *mut ::std::os::raw::c_void,
- ip: *const ::std::os::raw::c_char,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Allow or disallow connection responses from any IP."]
- #[doc = " \\details Normally this should be false, but may be necessary when connecting to servers with multiple IP addresses."]
- #[doc = " \\param[in] allow - True to allow this behavior, false to not allow. Defaults to false. Value persists between connections."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer34AllowConnectionResponseIPMigrationEb"]
- pub fn RakPeer_AllowConnectionResponseIPMigration(
- this: *mut ::std::os::raw::c_void,
- allow: bool,
- );
- }
- extern "C" {
- #[doc = " \\brief Sends a one byte message ID_ADVERTISE_SYSTEM to the remote unconnected system."]
- #[doc = " This will send our external IP outside the LAN along with some user data to the remote system."]
- #[doc = " \\pre The sender and recipient must already be started via a successful call to Initialize"]
- #[doc = " \\param[in] host Either a dotted IP address or a domain name"]
- #[doc = " \\param[in] remotePort Which port to connect to on the remote machine."]
- #[doc = " \\param[in] data Optional data to append to the packet."]
- #[doc = " \\param[in] dataLength Length of data in bytes. Use 0 if no data."]
- #[doc = " \\param[in] connectionSocketIndex Index into the array of socket descriptors passed to socketDescriptors in RakPeer::Startup() to send on."]
- #[doc = " \\return False if IsActive()==false or the host is unresolvable. True otherwise."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer15AdvertiseSystemEPKctS2_ij"]
- pub fn RakPeer_AdvertiseSystem(
- this: *mut ::std::os::raw::c_void,
- host: *const ::std::os::raw::c_char,
- remotePort: ::std::os::raw::c_ushort,
- data: *const ::std::os::raw::c_char,
- dataLength: ::std::os::raw::c_int,
- connectionSocketIndex: ::std::os::raw::c_uint,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Controls how often to return ID_DOWNLOAD_PROGRESS for large message downloads."]
- #[doc = " \\details ID_DOWNLOAD_PROGRESS is returned to indicate a new partial message chunk, roughly the MTU size, has arrived."]
- #[doc = " As it can be slow or cumbersome to get this notification for every chunk, you can set the interval at which it is returned."]
- #[doc = " Defaults to 0 (never return this notification)."]
- #[doc = " \\param[in] interval How many messages to use as an interval before a download progress notification is returned."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer31SetSplitMessageProgressIntervalEi"]
- pub fn RakPeer_SetSplitMessageProgressInterval(
- this: *mut ::std::os::raw::c_void,
- interval: ::std::os::raw::c_int,
- );
- }
- extern "C" {
- #[doc = " \\brief Returns what was passed to SetSplitMessageProgressInterval()."]
- #[doc = " \\return Number of messages to be recieved before a download progress notification is returned. Default to 0."]
- #[link_name = "\u{1}_ZNK6RakNet7RakPeer31GetSplitMessageProgressIntervalEv"]
- pub fn RakPeer_GetSplitMessageProgressInterval(
- this: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_int;
- }
- extern "C" {
- #[doc = " \\brief Set how long to wait before giving up on sending an unreliable message."]
- #[doc = " Useful if the network is clogged up."]
- #[doc = " Set to 0 or less to never timeout. Defaults to 0."]
- #[doc = " \\param[in] timeoutMS How many ms to wait before simply not sending an unreliable message."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer20SetUnreliableTimeoutEj"]
- pub fn RakPeer_SetUnreliableTimeout(
- this: *mut ::std::os::raw::c_void,
- timeoutMS: root::RakNet::TimeMS,
- );
- }
- extern "C" {
- #[doc = " \\brief Send a message to a host, with the IP socket option TTL set to 3."]
- #[doc = " \\details This message will not reach the host, but will open the router."]
- #[doc = " \\param[in] host The address of the remote host in dotted notation."]
- #[doc = " \\param[in] remotePort The port number to send to."]
- #[doc = " \\param[in] ttl Max hops of datagram, set to 3"]
- #[doc = " \\param[in] connectionSocketIndex userConnectionSocketIndex."]
- #[doc = " \\remarks Used for NAT-Punchthrough"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer7SendTTLEPKctij"]
- pub fn RakPeer_SendTTL(
- this: *mut ::std::os::raw::c_void,
- host: *const ::std::os::raw::c_char,
- remotePort: ::std::os::raw::c_ushort,
- ttl: ::std::os::raw::c_int,
- connectionSocketIndex: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " \\brief Attaches a Plugin interface to an instance of the base class (RakPeer or PacketizedTCP) to run code automatically on message receipt in the Receive call."]
- #[doc = " If the plugin returns false from PluginInterface::UsesReliabilityLayer(), which is the case for all plugins except PacketLogger, you can call AttachPlugin() and DetachPlugin() for this plugin while RakPeer is active."]
- #[doc = " \\param[in] messageHandler Pointer to the plugin to attach."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer12AttachPluginEPNS_16PluginInterface2E"]
- pub fn RakPeer_AttachPlugin(
- this: *mut ::std::os::raw::c_void,
- plugin: *mut root::RakNet::PluginInterface2,
- );
- }
- extern "C" {
- #[doc = " \\brief Detaches a Plugin interface from the instance of the base class (RakPeer or PacketizedTCP) it is attached to."]
- #[doc = "\t\\details This method disables the plugin code from running automatically on base class's updates or message receipt."]
- #[doc = " If the plugin returns false from PluginInterface::UsesReliabilityLayer(), which is the case for all plugins except PacketLogger, you can call AttachPlugin() and DetachPlugin() for this plugin while RakPeer is active."]
- #[doc = " \\param[in] messageHandler Pointer to a plugin to detach."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer12DetachPluginEPNS_16PluginInterface2E"]
- pub fn RakPeer_DetachPlugin(
- this: *mut ::std::os::raw::c_void,
- messageHandler: *mut root::RakNet::PluginInterface2,
- );
- }
- extern "C" {
- #[doc = " \\brief Puts a message back in the receive queue in case you don't want to deal with it immediately."]
- #[doc = " \\param[in] packet The pointer to the packet you want to push back."]
- #[doc = " \\param[in] pushAtHead True to push the packet at the start of the queue so that the next receive call returns it. False to push it at the end of the queue."]
- #[doc = " \\note Setting pushAtHead to false end makes the packets out of order."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer14PushBackPacketEPNS_6PacketEb"]
- pub fn RakPeer_PushBackPacket(
- this: *mut ::std::os::raw::c_void,
- packet: *mut root::RakNet::Packet,
- pushAtHead: bool,
- );
- }
- extern "C" {
- #[doc = " \\internal"]
- #[doc = " \\brief For a given system identified by \\a guid, change the SystemAddress to send to."]
- #[doc = " \\param[in] guid The connection we are referring to"]
- #[doc = " \\param[in] systemAddress The new address to send to"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer19ChangeSystemAddressENS_10RakNetGUIDERKNS_13SystemAddressE"]
- pub fn RakPeer_ChangeSystemAddress(
- this: *mut ::std::os::raw::c_void,
- guid: root::RakNet::RakNetGUID,
- systemAddress: *const root::RakNet::SystemAddress,
- );
- }
- extern "C" {
- #[doc = " \\brief Returns a packet for you to write to if you want to create a Packet for some reason."]
- #[doc = " You can add it to the receive buffer with PushBackPacket"]
- #[doc = " \\param[in] dataSize How many bytes to allocate for the buffer"]
- #[doc = " \\return A packet."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer14AllocatePacketEj"]
- pub fn RakPeer_AllocatePacket(
- this: *mut ::std::os::raw::c_void,
- dataSize: ::std::os::raw::c_uint,
- ) -> *mut root::RakNet::Packet;
- }
- extern "C" {
- #[doc = " \\brief Get the socket used with a particular active connection."]
- #[doc = " The smart pointer reference counts the RakNetSocket object, so the socket will remain active as long as the smart pointer does, even if RakNet were to shutdown or close the connection."]
- #[doc = " \\note This sends a query to the thread and blocks on the return value for up to one second. In practice it should only take a millisecond or so."]
- #[doc = " \\param[in] target Which system."]
- #[doc = " \\return A smart pointer object containing the socket information about the target. Be sure to check IsNull() which is returned if the update thread is unresponsive, shutting down, or if this system is not connected."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer9GetSocketENS_13SystemAddressE"]
- pub fn RakPeer_GetSocket(
- this: *mut ::std::os::raw::c_void,
- target: root::RakNet::SystemAddress,
- ) -> *mut root::RakNet::RakNetSocket2;
- }
- extern "C" {
- #[doc = " \\brief Gets all sockets in use."]
- #[doc = " \\note This sends a query to the thread and blocks on the return value for up to one second. In practice it should only take a millisecond or so."]
- #[doc = " \\param[out] sockets List of RakNetSocket structures in use."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer10GetSocketsERN14DataStructures4ListIPNS_13RakNetSocket2EEE"]
- pub fn RakPeer_GetSockets(
- this: *mut ::std::os::raw::c_void,
- sockets: *mut root::DataStructures::List<*mut root::RakNet::RakNetSocket2>,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer14ReleaseSocketsERN14DataStructures4ListIPNS_13RakNetSocket2EEE"]
- pub fn RakPeer_ReleaseSockets(
- this: *mut ::std::os::raw::c_void,
- sockets: *mut root::DataStructures::List<*mut root::RakNet::RakNetSocket2>,
- );
- }
- extern "C" {
- #[doc = " \\internal"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer20WriteOutOfBandHeaderEPNS_9BitStreamE"]
- pub fn RakPeer_WriteOutOfBandHeader(
- this: *mut ::std::os::raw::c_void,
- bitStream: *mut root::RakNet::BitStream,
- );
- }
- extern "C" {
- #[doc = " If you need code to run in the same thread as RakNet's update thread, this function can be used for that"]
- #[doc = " \\param[in] _userUpdateThreadPtr C callback function"]
- #[doc = " \\param[in] _userUpdateThreadData Passed to C callback function"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer19SetUserUpdateThreadEPFvPNS_16RakPeerInterfaceEPvES3_"]
- pub fn RakPeer_SetUserUpdateThread(
- this: *mut ::std::os::raw::c_void,
- _userUpdateThreadPtr: ::std::option::Option<
- unsafe extern "C" fn(
- arg1: *mut root::RakNet::RakPeerInterface,
- arg2: *mut ::std::os::raw::c_void,
- ),
- >,
- _userUpdateThreadData: *mut ::std::os::raw::c_void,
- );
- }
- extern "C" {
- #[doc = " Set a C callback to be called whenever a datagram arrives"]
- #[doc = " Return true from the callback to have RakPeer handle the datagram. Return false and RakPeer will ignore the datagram."]
- #[doc = " This can be used to filter incoming datagrams by system, or to share a recvfrom socket with RakPeer"]
- #[doc = " RNS2RecvStruct will only remain valid for the duration of the call"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer31SetIncomingDatagramEventHandlerEPFbPNS_14RNS2RecvStructEE"]
- pub fn RakPeer_SetIncomingDatagramEventHandler(
- this: *mut ::std::os::raw::c_void,
- _incomingDatagramEventHandler: ::std::option::Option<
- unsafe extern "C" fn(arg1: *mut root::RakNet::RNS2RecvStruct) -> bool,
- >,
- );
- }
- extern "C" {
- #[doc = " Adds simulated ping and packet loss to the outgoing data flow."]
- #[doc = " To simulate bi-directional ping and packet loss, you should call this on both the sender and the recipient, with half the total ping and packetloss value on each."]
- #[doc = " You can exclude network simulator code with the _RELEASE #define to decrease code size"]
- #[doc = " \\deprecated Use http://www.jenkinssoftware.com/forum/index.php?topic=1671.0 instead."]
- #[doc = " \\note Doesn't work past version 3.6201"]
- #[doc = " \\param[in] packetloss Chance to lose a packet. Ranges from 0 to 1."]
- #[doc = " \\param[in] minExtraPing The minimum time to delay sends."]
- #[doc = " \\param[in] extraPingVariance The additional random time to delay sends."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer21ApplyNetworkSimulatorEftt"]
- pub fn RakPeer_ApplyNetworkSimulator(
- this: *mut ::std::os::raw::c_void,
- packetloss: f32,
- minExtraPing: ::std::os::raw::c_ushort,
- extraPingVariance: ::std::os::raw::c_ushort,
- );
- }
- extern "C" {
- #[doc = " Limits how much outgoing bandwidth can be sent per-connection."]
- #[doc = " This limit does not apply to the sum of all connections!"]
- #[doc = " Exceeding the limit queues up outgoing traffic"]
- #[doc = " \\param[in] maxBitsPerSecond Maximum bits per second to send. Use 0 for unlimited (default). Once set, it takes effect immedately and persists until called again."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer38SetPerConnectionOutgoingBandwidthLimitEj"]
- pub fn RakPeer_SetPerConnectionOutgoingBandwidthLimit(
- this: *mut ::std::os::raw::c_void,
- maxBitsPerSecond: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[doc = " Returns if you previously called ApplyNetworkSimulator"]
- #[doc = " \\return If you previously called ApplyNetworkSimulator"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer24IsNetworkSimulatorActiveEv"]
- pub fn RakPeer_IsNetworkSimulatorActive(this: *mut ::std::os::raw::c_void) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Returns a structure containing a large set of network statistics for the specified system."]
- #[doc = " You can map this data to a string using the C style StatisticsToString() function"]
- #[doc = " \\param[in] systemAddress Which connected system to get statistics for."]
- #[doc = " \\param[in] rns If you supply this structure,the network statistics will be written to it. Otherwise the method uses a static struct to write the data, which is not threadsafe."]
- #[doc = " \\return 0 if the specified system can't be found. Otherwise a pointer to the struct containing the specified system's network statistics."]
- #[doc = " \\sa RakNetStatistics.h"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer13GetStatisticsENS_13SystemAddressEPNS_16RakNetStatisticsE"]
- pub fn RakPeer_GetStatistics(
- this: *mut ::std::os::raw::c_void,
- systemAddress: root::RakNet::SystemAddress,
- rns: *mut root::RakNet::RakNetStatistics,
- ) -> *mut root::RakNet::RakNetStatistics;
- }
- extern "C" {
- #[doc = " \\brief Returns the network statistics of the system at the given index in the remoteSystemList."]
- #[doc = "\t\\return True if the index is less than the maximum number of peers allowed and the system is active. False otherwise."]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer13GetStatisticsEjPNS_16RakNetStatisticsE"]
- pub fn RakPeer_GetStatistics1(
- this: *mut ::std::os::raw::c_void,
- index: ::std::os::raw::c_uint,
- rns: *mut root::RakNet::RakNetStatistics,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\brief Returns the list of systems, and statistics for each of those systems"]
- #[doc = " Each system has one entry in each of the lists, in the same order"]
- #[doc = " \\param[out] addresses SystemAddress for each connected system"]
- #[doc = " \\param[out] guids RakNetGUID for each connected system"]
- #[doc = " \\param[out] statistics Calculated RakNetStatistics for each connected system"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer17GetStatisticsListERN14DataStructures4ListINS_13SystemAddressEEERNS2_INS_10RakNetGUIDEEERNS2_INS_16RakNetStatisticsEEE"]
- pub fn RakPeer_GetStatisticsList(
- this: *mut ::std::os::raw::c_void,
- addresses: *mut root::DataStructures::List<root::RakNet::SystemAddress>,
- guids: *mut root::DataStructures::List<root::RakNet::RakNetGUID>,
- statistics: *mut root::DataStructures::List<root::RakNet::RakNetStatistics>,
- );
- }
- extern "C" {
- #[doc = " \\Returns how many messages are waiting when you call Receive()"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer20GetReceiveBufferSizeEv"]
- pub fn RakPeer_GetReceiveBufferSize(
- this: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_uint;
- }
- extern "C" {
- #[link_name = "\u{1}_ZN6RakNet7RakPeer14RunUpdateCycleERNS_9BitStreamE"]
- pub fn RakPeer_RunUpdateCycle(
- this: *mut ::std::os::raw::c_void,
- updateBitStream: *mut root::RakNet::BitStream,
- ) -> bool;
- }
- extern "C" {
- #[doc = " \\internal"]
- #[link_name = "\u{1}_ZN6RakNet7RakPeer13SendOutOfBandEPKctS2_jj"]
- pub fn RakPeer_SendOutOfBand(
- this: *mut ::std::os::raw::c_void,
- host: *const ::std::os::raw::c_char,
- remotePort: ::std::os::raw::c_ushort,
- data: *const ::std::os::raw::c_char,
- dataLength: root::RakNet::BitSize_t,
- connectionSocketIndex: ::std::os::raw::c_uint,
- ) -> bool;
- }
- extern "C" {
- #[link_name = "\u{1}_ZThn8_N6RakNet7RakPeer21DeallocRNS2RecvStructEPNS_14RNS2RecvStructEPKcj"]
- pub fn RakPeer_DeallocRNS2RecvStruct(
- this: *mut ::std::os::raw::c_void,
- s: *mut root::RakNet::RNS2RecvStruct,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- );
- }
- extern "C" {
- #[link_name = "\u{1}_ZThn8_N6RakNet7RakPeer19AllocRNS2RecvStructEPKcj"]
- pub fn RakPeer_AllocRNS2RecvStruct(
- this: *mut ::std::os::raw::c_void,
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_uint,
- ) -> *mut root::RakNet::RNS2RecvStruct;
- }
- extern "C" {
- #[link_name = "\u{1}_ZThn8_N6RakNet7RakPeer10OnRNS2RecvEPNS_14RNS2RecvStructE"]
- pub fn RakPeer_OnRNS2Recv(
- this: *mut ::std::os::raw::c_void,
- recvStruct: *mut root::RakNet::RNS2RecvStruct,
- );
- }
- }
- pub mod DataStructures {
- #[allow(unused_imports)]
- use self::super::super::root;
- #[doc = " \\brief Array based implementation of a list."]
- #[doc = " \\note ONLY USE THIS FOR SHALLOW COPIES. I don't bother with operator= to improve performance."]
- #[repr(C)]
- #[derive(Debug)]
- pub struct List<list_type> {
- #[doc = " An array of user values"]
- pub listArray: *mut list_type,
- #[doc = " Number of elements in the list"]
- pub list_size: ::std::os::raw::c_uint,
- #[doc = " Size of \\a array"]
- pub allocation_size: ::std::os::raw::c_uint,
- pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<list_type>>,
- }
- #[doc = " \\brief A queue implemented as an array with a read and write index."]
- #[repr(C)]
- #[derive(Debug)]
- pub struct Queue<queue_type> {
- pub array: *mut queue_type,
- pub head: ::std::os::raw::c_uint,
- pub tail: ::std::os::raw::c_uint,
- pub allocation_size: ::std::os::raw::c_uint,
- pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<queue_type>>,
- }
- #[repr(C)]
- #[derive(Debug)]
- pub struct RangeList {
- pub ranges: u8,
- }
- #[doc = " Very fast memory pool for allocating and deallocating structures that don't have constructors or destructors."]
- #[doc = " Contains a list of pages, each of which has an array of the user structures"]
- #[repr(C)]
- #[derive(Debug)]
- pub struct MemoryPool<MemoryBlockType> {
- pub availablePages: *mut root::DataStructures::MemoryPool_Page<MemoryBlockType>,
- pub unavailablePages: *mut root::DataStructures::MemoryPool_Page<MemoryBlockType>,
- pub availablePagesSize: ::std::os::raw::c_int,
- pub unavailablePagesSize: ::std::os::raw::c_int,
- pub memoryPoolPageSize: ::std::os::raw::c_int,
- pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<MemoryBlockType>>,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct MemoryPool_MemoryWithPage<MemoryBlockType> {
- pub userMemory: MemoryBlockType,
- pub parentPage: *mut root::DataStructures::MemoryPool_Page<MemoryBlockType>,
- pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<MemoryBlockType>>,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct MemoryPool_Page<MemoryBlockType> {
- pub availableStack:
- *mut *mut root::DataStructures::MemoryPool_MemoryWithPage<MemoryBlockType>,
- pub availableStackSize: ::std::os::raw::c_int,
- pub block: *mut root::DataStructures::MemoryPool_MemoryWithPage<MemoryBlockType>,
- pub next: *mut root::DataStructures::MemoryPool_Page<MemoryBlockType>,
- pub prev: *mut root::DataStructures::MemoryPool_Page<MemoryBlockType>,
- pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<MemoryBlockType>>,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct Heap_HeapNode<weight_type, data_type> {
- pub weight: weight_type,
- pub data: data_type,
- pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<weight_type>>,
- pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<data_type>>,
- }
- #[repr(C)]
- pub struct ThreadsafeAllocatingQueue<structureType> {
- pub memoryPool: root::DataStructures::MemoryPool<structureType>,
- pub memoryPoolMutex: root::RakNet::SimpleMutex,
- pub queue: root::DataStructures::Queue<structureType>,
- pub queueMutex: root::RakNet::SimpleMutex,
- pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<structureType>>,
- }
- }
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub union __atomic_wide_counter {
- pub __value64: ::std::os::raw::c_ulonglong,
- pub __value32: root::__atomic_wide_counter__bindgen_ty_1,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct __atomic_wide_counter__bindgen_ty_1 {
- pub __low: ::std::os::raw::c_uint,
- pub __high: ::std::os::raw::c_uint,
- }
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct __pthread_internal_list {
- pub __prev: *mut root::__pthread_internal_list,
- pub __next: *mut root::__pthread_internal_list,
- }
- pub type __pthread_list_t = root::__pthread_internal_list;
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct __pthread_mutex_s {
- pub __lock: ::std::os::raw::c_int,
- pub __count: ::std::os::raw::c_uint,
- pub __owner: ::std::os::raw::c_int,
- pub __nusers: ::std::os::raw::c_uint,
- pub __kind: ::std::os::raw::c_int,
- pub __spins: ::std::os::raw::c_short,
- pub __elision: ::std::os::raw::c_short,
- pub __list: root::__pthread_list_t,
- }
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub struct __pthread_cond_s {
- pub __wseq: root::__atomic_wide_counter,
- pub __g1_start: root::__atomic_wide_counter,
- pub __g_refs: [::std::os::raw::c_uint; 2usize],
- pub __g_size: [::std::os::raw::c_uint; 2usize],
- pub __g1_orig_size: ::std::os::raw::c_uint,
- pub __wrefs: ::std::os::raw::c_uint,
- pub __g_signals: [::std::os::raw::c_uint; 2usize],
- }
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub union pthread_mutexattr_t {
- pub __size: [::std::os::raw::c_char; 4usize],
- pub __align: ::std::os::raw::c_int,
- }
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub union pthread_condattr_t {
- pub __size: [::std::os::raw::c_char; 4usize],
- pub __align: ::std::os::raw::c_int,
- }
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub union pthread_mutex_t {
- pub __data: root::__pthread_mutex_s,
- pub __size: [::std::os::raw::c_char; 40usize],
- pub __align: ::std::os::raw::c_long,
- }
- #[repr(C)]
- #[derive(Copy, Clone)]
- pub union pthread_cond_t {
- pub __data: root::__pthread_cond_s,
- pub __size: [::std::os::raw::c_char; 48usize],
- pub __align: ::std::os::raw::c_longlong,
- }
- pub type sa_family_t = ::std::os::raw::c_ushort;
- pub type in_addr_t = u32;
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct in_addr {
- pub s_addr: root::in_addr_t,
- }
- pub type in_port_t = u16;
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct sockaddr_in {
- pub sin_family: root::sa_family_t,
- pub sin_port: root::in_port_t,
- pub sin_addr: root::in_addr,
- pub sin_zero: [::std::os::raw::c_uchar; 8usize],
- }
- #[doc = " Unix/Linux uses ints for sockets"]
- pub type __UDPSOCKET__ = ::std::os::raw::c_int;
- #[doc = " The highest possible priority. These message trigger sends immediately, and are generally not buffered or aggregated into a single datagram."]
- pub const PacketPriority_IMMEDIATE_PRIORITY: root::PacketPriority = 0;
- #[doc = " For every 2 IMMEDIATE_PRIORITY messages, 1 HIGH_PRIORITY will be sent."]
- #[doc = " Messages at this priority and lower are buffered to be sent in groups at 10 millisecond intervals to reduce UDP overhead and better measure congestion control."]
- pub const PacketPriority_HIGH_PRIORITY: root::PacketPriority = 1;
- #[doc = " For every 2 HIGH_PRIORITY messages, 1 MEDIUM_PRIORITY will be sent."]
- #[doc = " Messages at this priority and lower are buffered to be sent in groups at 10 millisecond intervals to reduce UDP overhead and better measure congestion control."]
- pub const PacketPriority_MEDIUM_PRIORITY: root::PacketPriority = 2;
- #[doc = " For every 2 MEDIUM_PRIORITY messages, 1 LOW_PRIORITY will be sent."]
- #[doc = " Messages at this priority and lower are buffered to be sent in groups at 10 millisecond intervals to reduce UDP overhead and better measure congestion control."]
- pub const PacketPriority_LOW_PRIORITY: root::PacketPriority = 3;
- #[doc = " \\internal"]
- pub const PacketPriority_NUMBER_OF_PRIORITIES: root::PacketPriority = 4;
- #[doc = " These enumerations are used to describe when packets are delivered."]
- pub type PacketPriority = ::std::os::raw::c_uint;
- #[doc = " Same as regular UDP, except that it will also discard duplicate datagrams. RakNet adds (6 to 17) + 21 bits of overhead, 16 of which is used to detect duplicate packets and 6 to 17 of which is used for message length."]
- pub const PacketReliability_UNRELIABLE: root::PacketReliability = 0;
- #[doc = " Regular UDP with a sequence counter. Out of order messages will be discarded."]
- #[doc = " Sequenced and ordered messages sent on the same channel will arrive in the order sent."]
- pub const PacketReliability_UNRELIABLE_SEQUENCED: root::PacketReliability = 1;
- #[doc = " The message is sent reliably, but not necessarily in any order. Same overhead as UNRELIABLE."]
- pub const PacketReliability_RELIABLE: root::PacketReliability = 2;
- #[doc = " This message is reliable and will arrive in the order you sent it. Messages will be delayed while waiting for out of order messages. Same overhead as UNRELIABLE_SEQUENCED."]
- #[doc = " Sequenced and ordered messages sent on the same channel will arrive in the order sent."]
- pub const PacketReliability_RELIABLE_ORDERED: root::PacketReliability = 3;
- #[doc = " This message is reliable and will arrive in the sequence you sent it. Out or order messages will be dropped. Same overhead as UNRELIABLE_SEQUENCED."]
- #[doc = " Sequenced and ordered messages sent on the same channel will arrive in the order sent."]
- pub const PacketReliability_RELIABLE_SEQUENCED: root::PacketReliability = 4;
- #[doc = " Same as UNRELIABLE, however the user will get either ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS based on the result of sending this message when calling RakPeerInterface::Receive(). Bytes 1-4 will contain the number returned from the Send() function. On disconnect or shutdown, all messages not previously acked should be considered lost."]
- pub const PacketReliability_UNRELIABLE_WITH_ACK_RECEIPT: root::PacketReliability = 5;
- #[doc = " Same as RELIABLE. The user will also get ID_SND_RECEIPT_ACKED after the message is delivered when calling RakPeerInterface::Receive(). ID_SND_RECEIPT_ACKED is returned when the message arrives, not necessarily the order when it was sent. Bytes 1-4 will contain the number returned from the Send() function. On disconnect or shutdown, all messages not previously acked should be considered lost. This does not return ID_SND_RECEIPT_LOSS."]
- pub const PacketReliability_RELIABLE_WITH_ACK_RECEIPT: root::PacketReliability = 6;
- #[doc = " Same as RELIABLE_ORDERED_ACK_RECEIPT. The user will also get ID_SND_RECEIPT_ACKED after the message is delivered when calling RakPeerInterface::Receive(). ID_SND_RECEIPT_ACKED is returned when the message arrives, not necessarily the order when it was sent. Bytes 1-4 will contain the number returned from the Send() function. On disconnect or shutdown, all messages not previously acked should be considered lost. This does not return ID_SND_RECEIPT_LOSS."]
- pub const PacketReliability_RELIABLE_ORDERED_WITH_ACK_RECEIPT: root::PacketReliability = 7;
- #[doc = " \\internal"]
- pub const PacketReliability_NUMBER_OF_RELIABILITIES: root::PacketReliability = 8;
- #[doc = " These enumerations are used to describe how packets are delivered."]
- #[doc = " \\note Note to self: I write this with 3 bits in the stream. If I add more remember to change that"]
- #[doc = " \\note In ReliabilityLayer::WriteToBitStreamFromInternalPacket I assume there are 5 major types"]
- #[doc = " \\note Do not reorder, I check on >= UNRELIABLE_WITH_ACK_RECEIPT"]
- pub type PacketReliability = ::std::os::raw::c_uint;
- pub type CCTimeType = root::RakNet::TimeUS;
- pub type DatagramSequenceNumberType = root::RakNet::uint24_t;
- pub type BytesPerMicrosecond = f64;
- #[doc = " These types are never returned to the user."]
- #[doc = " Ping from a connected system. Update timestamps (internal use only)"]
- pub const DefaultMessageIDTypes_ID_CONNECTED_PING: root::DefaultMessageIDTypes = 0;
- #[doc = " Ping from an unconnected system. Reply but do not update timestamps. (internal use only)"]
- pub const DefaultMessageIDTypes_ID_UNCONNECTED_PING: root::DefaultMessageIDTypes = 1;
- #[doc = " Ping from an unconnected system. Only reply if we have open connections. Do not update timestamps. (internal use only)"]
- pub const DefaultMessageIDTypes_ID_UNCONNECTED_PING_OPEN_CONNECTIONS:
- root::DefaultMessageIDTypes = 2;
- #[doc = " Pong from a connected system. Update timestamps (internal use only)"]
- pub const DefaultMessageIDTypes_ID_CONNECTED_PONG: root::DefaultMessageIDTypes = 3;
- #[doc = " A reliable packet to detect lost connections (internal use only)"]
- pub const DefaultMessageIDTypes_ID_DETECT_LOST_CONNECTIONS: root::DefaultMessageIDTypes = 4;
- #[doc = " C2S: Initial query: Header(1), OfflineMesageID(16), Protocol number(1), Pad(toMTU), sent with no fragment set."]
- #[doc = " If protocol fails on server, returns ID_INCOMPATIBLE_PROTOCOL_VERSION to client"]
- pub const DefaultMessageIDTypes_ID_OPEN_CONNECTION_REQUEST_1: root::DefaultMessageIDTypes = 5;
- #[doc = " S2C: Header(1), OfflineMesageID(16), server GUID(8), HasSecurity(1), Cookie(4, if HasSecurity)"]
- #[doc = " , public key (if do security is true), MTU(2). If public key fails on client, returns ID_PUBLIC_KEY_MISMATCH"]
- pub const DefaultMessageIDTypes_ID_OPEN_CONNECTION_REPLY_1: root::DefaultMessageIDTypes = 6;
- #[doc = " C2S: Header(1), OfflineMesageID(16), Cookie(4, if HasSecurity is true on the server), clientSupportsSecurity(1 bit),"]
- #[doc = " handshakeChallenge (if has security on both server and client), remoteBindingAddress(6), MTU(2), client GUID(8)"]
- #[doc = " Connection slot allocated if cookie is valid, server is not full, GUID and IP not already in use."]
- pub const DefaultMessageIDTypes_ID_OPEN_CONNECTION_REQUEST_2: root::DefaultMessageIDTypes = 7;
- #[doc = " S2C: Header(1), OfflineMesageID(16), server GUID(8), mtu(2), doSecurity(1 bit), handshakeAnswer (if do security is true)"]
- pub const DefaultMessageIDTypes_ID_OPEN_CONNECTION_REPLY_2: root::DefaultMessageIDTypes = 8;
- #[doc = " C2S: Header(1), GUID(8), Timestamp, HasSecurity(1), Proof(32)"]
- pub const DefaultMessageIDTypes_ID_CONNECTION_REQUEST: root::DefaultMessageIDTypes = 9;
- #[doc = " RakPeer - Remote system requires secure connections, pass a public key to RakPeerInterface::Connect()"]
- pub const DefaultMessageIDTypes_ID_REMOTE_SYSTEM_REQUIRES_PUBLIC_KEY:
- root::DefaultMessageIDTypes = 10;
- #[doc = " RakPeer - We passed a public key to RakPeerInterface::Connect(), but the other system did not have security turned on"]
- pub const DefaultMessageIDTypes_ID_OUR_SYSTEM_REQUIRES_SECURITY: root::DefaultMessageIDTypes =
- 11;
- #[doc = " RakPeer - Wrong public key passed to RakPeerInterface::Connect()"]
- pub const DefaultMessageIDTypes_ID_PUBLIC_KEY_MISMATCH: root::DefaultMessageIDTypes = 12;
- #[doc = " RakPeer - Same as ID_ADVERTISE_SYSTEM, but intended for internal use rather than being passed to the user."]
- #[doc = " Second byte indicates type. Used currently for NAT punchthrough for receiver port advertisement. See ID_NAT_ADVERTISE_RECIPIENT_PORT"]
- pub const DefaultMessageIDTypes_ID_OUT_OF_BAND_INTERNAL: root::DefaultMessageIDTypes = 13;
- #[doc = " If RakPeerInterface::Send() is called where PacketReliability contains _WITH_ACK_RECEIPT, then on a later call to"]
- #[doc = " RakPeerInterface::Receive() you will get ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS. The message will be 5 bytes long,"]
- #[doc = " and bytes 1-4 inclusive will contain a number in native order containing a number that identifies this message."]
- #[doc = " This number will be returned by RakPeerInterface::Send() or RakPeerInterface::SendList(). ID_SND_RECEIPT_ACKED means that"]
- #[doc = " the message arrived"]
- pub const DefaultMessageIDTypes_ID_SND_RECEIPT_ACKED: root::DefaultMessageIDTypes = 14;
- #[doc = " If RakPeerInterface::Send() is called where PacketReliability contains UNRELIABLE_WITH_ACK_RECEIPT, then on a later call to"]
- #[doc = " RakPeerInterface::Receive() you will get ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS. The message will be 5 bytes long,"]
- #[doc = " and bytes 1-4 inclusive will contain a number in native order containing a number that identifies this message. This number"]
- #[doc = " will be returned by RakPeerInterface::Send() or RakPeerInterface::SendList(). ID_SND_RECEIPT_LOSS means that an ack for the"]
- #[doc = " message did not arrive (it may or may not have been delivered, probably not). On disconnect or shutdown, you will not get"]
- #[doc = " ID_SND_RECEIPT_LOSS for unsent messages, you should consider those messages as all lost."]
- pub const DefaultMessageIDTypes_ID_SND_RECEIPT_LOSS: root::DefaultMessageIDTypes = 15;
- #[doc = " RakPeer - In a client/server environment, our connection request to the server has been accepted."]
- pub const DefaultMessageIDTypes_ID_CONNECTION_REQUEST_ACCEPTED: root::DefaultMessageIDTypes =
- 16;
- #[doc = " RakPeer - Sent to the player when a connection request cannot be completed due to inability to connect."]
- pub const DefaultMessageIDTypes_ID_CONNECTION_ATTEMPT_FAILED: root::DefaultMessageIDTypes = 17;
- #[doc = " RakPeer - Sent a connect request to a system we are currently connected to."]
- pub const DefaultMessageIDTypes_ID_ALREADY_CONNECTED: root::DefaultMessageIDTypes = 18;
- #[doc = " RakPeer - A remote system has successfully connected."]
- pub const DefaultMessageIDTypes_ID_NEW_INCOMING_CONNECTION: root::DefaultMessageIDTypes = 19;
- #[doc = " RakPeer - The system we attempted to connect to is not accepting new connections."]
- pub const DefaultMessageIDTypes_ID_NO_FREE_INCOMING_CONNECTIONS: root::DefaultMessageIDTypes =
- 20;
- #[doc = " RakPeer - The system specified in Packet::systemAddress has disconnected from us. For the client, this would mean the"]
- #[doc = " server has shutdown."]
- pub const DefaultMessageIDTypes_ID_DISCONNECTION_NOTIFICATION: root::DefaultMessageIDTypes = 21;
- #[doc = " RakPeer - Reliable packets cannot be delivered to the system specified in Packet::systemAddress. The connection to that"]
- #[doc = " system has been closed."]
- pub const DefaultMessageIDTypes_ID_CONNECTION_LOST: root::DefaultMessageIDTypes = 22;
- #[doc = " RakPeer - We are banned from the system we attempted to connect to."]
- pub const DefaultMessageIDTypes_ID_CONNECTION_BANNED: root::DefaultMessageIDTypes = 23;
- #[doc = " RakPeer - The remote system is using a password and has refused our connection because we did not set the correct password."]
- pub const DefaultMessageIDTypes_ID_INVALID_PASSWORD: root::DefaultMessageIDTypes = 24;
- #[doc = " RakPeer - The remote system is using a password and has refused our connection because we did not set the correct password."]
- pub const DefaultMessageIDTypes_ID_INCOMPATIBLE_PROTOCOL_VERSION: root::DefaultMessageIDTypes =
- 25;
- #[doc = " RakPeer::SetLimitIPConnectionFrequency()"]
- pub const DefaultMessageIDTypes_ID_IP_RECENTLY_CONNECTED: root::DefaultMessageIDTypes = 26;
- #[doc = " RakPeer - The sizeof(RakNetTime) bytes following this byte represent a value which is automatically modified by the difference"]
- #[doc = " in system times between the sender and the recipient. Requires that you call SetOccasionalPing."]
- pub const DefaultMessageIDTypes_ID_TIMESTAMP: root::DefaultMessageIDTypes = 27;
- #[doc = " RakPeer - Pong from an unconnected system. First byte is ID_UNCONNECTED_PONG, second sizeof(RakNet::TimeMS) bytes is the ping,"]
- #[doc = " following bytes is system specific enumeration data."]
- #[doc = " Read using bitstreams"]
- pub const DefaultMessageIDTypes_ID_UNCONNECTED_PONG: root::DefaultMessageIDTypes = 28;
- #[doc = " RakPeer - Inform a remote system of our IP/Port. On the recipient, all data past ID_ADVERTISE_SYSTEM is whatever was passed to"]
- #[doc = " the data parameter"]
- pub const DefaultMessageIDTypes_ID_ADVERTISE_SYSTEM: root::DefaultMessageIDTypes = 29;
- #[doc = " partTotal (unsigned int),"]
- #[doc = " partLength (unsigned int), first part data (length <= MAX_MTU_SIZE). See the three parameters partCount, partTotal"]
- #[doc = " and partLength in OnFileProgress in FileListTransferCBInterface.h"]
- pub const DefaultMessageIDTypes_ID_DOWNLOAD_PROGRESS: root::DefaultMessageIDTypes = 30;
- #[doc = " ConnectionGraph2 plugin - In a client/server environment, a client other than ourselves has disconnected gracefully."]
- #[doc = " Packet::systemAddress is modified to reflect the systemAddress of this client."]
- pub const DefaultMessageIDTypes_ID_REMOTE_DISCONNECTION_NOTIFICATION:
- root::DefaultMessageIDTypes = 31;
- #[doc = " ConnectionGraph2 plugin - In a client/server environment, a client other than ourselves has been forcefully dropped."]
- #[doc = " Packet::systemAddress is modified to reflect the systemAddress of this client."]
- pub const DefaultMessageIDTypes_ID_REMOTE_CONNECTION_LOST: root::DefaultMessageIDTypes = 32;
- #[doc = " ConnectionGraph2 plugin: Bytes 1-4 = count. for (count items) contains {SystemAddress, RakNetGUID, 2 byte ping}"]
- pub const DefaultMessageIDTypes_ID_REMOTE_NEW_INCOMING_CONNECTION: root::DefaultMessageIDTypes =
- 33;
- #[doc = " FileListTransfer plugin - Setup data"]
- pub const DefaultMessageIDTypes_ID_FILE_LIST_TRANSFER_HEADER: root::DefaultMessageIDTypes = 34;
- #[doc = " FileListTransfer plugin - A file"]
- pub const DefaultMessageIDTypes_ID_FILE_LIST_TRANSFER_FILE: root::DefaultMessageIDTypes = 35;
- #[doc = " FileListTransfer plugin - A file"]
- pub const DefaultMessageIDTypes_ID_FILE_LIST_REFERENCE_PUSH_ACK: root::DefaultMessageIDTypes =
- 36;
- #[doc = " DirectoryDeltaTransfer plugin - Request from a remote system for a download of a directory"]
- pub const DefaultMessageIDTypes_ID_DDT_DOWNLOAD_REQUEST: root::DefaultMessageIDTypes = 37;
- #[doc = " RakNetTransport plugin - Transport provider message, used for remote console"]
- pub const DefaultMessageIDTypes_ID_TRANSPORT_STRING: root::DefaultMessageIDTypes = 38;
- #[doc = " ReplicaManager plugin - Create an object"]
- pub const DefaultMessageIDTypes_ID_REPLICA_MANAGER_CONSTRUCTION: root::DefaultMessageIDTypes =
- 39;
- #[doc = " ReplicaManager plugin - Changed scope of an object"]
- pub const DefaultMessageIDTypes_ID_REPLICA_MANAGER_SCOPE_CHANGE: root::DefaultMessageIDTypes =
- 40;
- #[doc = " ReplicaManager plugin - Serialized data of an object"]
- pub const DefaultMessageIDTypes_ID_REPLICA_MANAGER_SERIALIZE: root::DefaultMessageIDTypes = 41;
- #[doc = " ReplicaManager plugin - New connection, about to send all world objects"]
- pub const DefaultMessageIDTypes_ID_REPLICA_MANAGER_DOWNLOAD_STARTED:
- root::DefaultMessageIDTypes = 42;
- #[doc = " ReplicaManager plugin - Finished downloading all serialized objects"]
- pub const DefaultMessageIDTypes_ID_REPLICA_MANAGER_DOWNLOAD_COMPLETE:
- root::DefaultMessageIDTypes = 43;
- #[doc = " RakVoice plugin - Open a communication channel"]
- pub const DefaultMessageIDTypes_ID_RAKVOICE_OPEN_CHANNEL_REQUEST: root::DefaultMessageIDTypes =
- 44;
- #[doc = " RakVoice plugin - Communication channel accepted"]
- pub const DefaultMessageIDTypes_ID_RAKVOICE_OPEN_CHANNEL_REPLY: root::DefaultMessageIDTypes =
- 45;
- #[doc = " RakVoice plugin - Close a communication channel"]
- pub const DefaultMessageIDTypes_ID_RAKVOICE_CLOSE_CHANNEL: root::DefaultMessageIDTypes = 46;
- #[doc = " RakVoice plugin - Voice data"]
- pub const DefaultMessageIDTypes_ID_RAKVOICE_DATA: root::DefaultMessageIDTypes = 47;
- #[doc = " Autopatcher plugin - Get a list of files that have changed since a certain date"]
- pub const DefaultMessageIDTypes_ID_AUTOPATCHER_GET_CHANGELIST_SINCE_DATE:
- root::DefaultMessageIDTypes = 48;
- #[doc = " Autopatcher plugin - A list of files to create"]
- pub const DefaultMessageIDTypes_ID_AUTOPATCHER_CREATION_LIST: root::DefaultMessageIDTypes = 49;
- #[doc = " Autopatcher plugin - A list of files to delete"]
- pub const DefaultMessageIDTypes_ID_AUTOPATCHER_DELETION_LIST: root::DefaultMessageIDTypes = 50;
- #[doc = " Autopatcher plugin - A list of files to get patches for"]
- pub const DefaultMessageIDTypes_ID_AUTOPATCHER_GET_PATCH: root::DefaultMessageIDTypes = 51;
- #[doc = " Autopatcher plugin - A list of patches for a list of files"]
- pub const DefaultMessageIDTypes_ID_AUTOPATCHER_PATCH_LIST: root::DefaultMessageIDTypes = 52;
- #[doc = " Autopatcher plugin - Returned to the user: An error from the database repository for the autopatcher."]
- pub const DefaultMessageIDTypes_ID_AUTOPATCHER_REPOSITORY_FATAL_ERROR:
- root::DefaultMessageIDTypes = 53;
- #[doc = " Autopatcher plugin - Returned to the user: The server does not allow downloading unmodified game files."]
- pub const DefaultMessageIDTypes_ID_AUTOPATCHER_CANNOT_DOWNLOAD_ORIGINAL_UNMODIFIED_FILES:
- root::DefaultMessageIDTypes = 54;
- #[doc = " Autopatcher plugin - Finished getting all files from the autopatcher"]
- pub const DefaultMessageIDTypes_ID_AUTOPATCHER_FINISHED_INTERNAL: root::DefaultMessageIDTypes =
- 55;
- #[doc = " Autopatcher plugin - Finished getting all files from the autopatcher"]
- pub const DefaultMessageIDTypes_ID_AUTOPATCHER_FINISHED: root::DefaultMessageIDTypes = 56;
- #[doc = " Autopatcher plugin - Returned to the user: You must restart the application to finish patching."]
- pub const DefaultMessageIDTypes_ID_AUTOPATCHER_RESTART_APPLICATION:
- root::DefaultMessageIDTypes = 57;
- #[doc = " NATPunchthrough plugin: internal"]
- pub const DefaultMessageIDTypes_ID_NAT_PUNCHTHROUGH_REQUEST: root::DefaultMessageIDTypes = 58;
- #[doc = " NATPunchthrough plugin: internal"]
- pub const DefaultMessageIDTypes_ID_NAT_CONNECT_AT_TIME: root::DefaultMessageIDTypes = 59;
- #[doc = " NATPunchthrough plugin: internal"]
- pub const DefaultMessageIDTypes_ID_NAT_GET_MOST_RECENT_PORT: root::DefaultMessageIDTypes = 60;
- #[doc = " NATPunchthrough plugin: internal"]
- pub const DefaultMessageIDTypes_ID_NAT_CLIENT_READY: root::DefaultMessageIDTypes = 61;
- #[doc = " NATPunchthrough plugin: Destination system is not connected to the server. Bytes starting at offset 1 contains the"]
- #[doc = " RakNetGUID destination field of NatPunchthroughClient::OpenNAT()."]
- pub const DefaultMessageIDTypes_ID_NAT_TARGET_NOT_CONNECTED: root::DefaultMessageIDTypes = 62;
- #[doc = " NATPunchthrough plugin: Destination system is not responding to ID_NAT_GET_MOST_RECENT_PORT. Possibly the plugin is not installed."]
- #[doc = " Bytes starting at offset 1 contains the RakNetGUID destination field of NatPunchthroughClient::OpenNAT()."]
- pub const DefaultMessageIDTypes_ID_NAT_TARGET_UNRESPONSIVE: root::DefaultMessageIDTypes = 63;
- #[doc = " NATPunchthrough plugin: The server lost the connection to the destination system while setting up punchthrough."]
- #[doc = " Possibly the plugin is not installed. Bytes starting at offset 1 contains the RakNetGUID destination"]
- #[doc = " field of NatPunchthroughClient::OpenNAT()."]
- pub const DefaultMessageIDTypes_ID_NAT_CONNECTION_TO_TARGET_LOST: root::DefaultMessageIDTypes =
- 64;
- #[doc = " NATPunchthrough plugin: This punchthrough is already in progress. Possibly the plugin is not installed."]
- #[doc = " Bytes starting at offset 1 contains the RakNetGUID destination field of NatPunchthroughClient::OpenNAT()."]
- pub const DefaultMessageIDTypes_ID_NAT_ALREADY_IN_PROGRESS: root::DefaultMessageIDTypes = 65;
- #[doc = " NATPunchthrough plugin: This message is generated on the local system, and does not come from the network."]
- #[doc = " packet::guid contains the destination field of NatPunchthroughClient::OpenNAT(). Byte 1 contains 1 if you are the sender, 0 if not"]
- pub const DefaultMessageIDTypes_ID_NAT_PUNCHTHROUGH_FAILED: root::DefaultMessageIDTypes = 66;
- #[doc = " NATPunchthrough plugin: Punchthrough succeeded. See packet::systemAddress and packet::guid. Byte 1 contains 1 if you are the sender,"]
- #[doc = " 0 if not. You can now use RakPeer::Connect() or other calls to communicate with this system."]
- pub const DefaultMessageIDTypes_ID_NAT_PUNCHTHROUGH_SUCCEEDED: root::DefaultMessageIDTypes = 67;
- #[doc = " ReadyEvent plugin - Set the ready state for a particular system"]
- #[doc = " First 4 bytes after the message contains the id"]
- pub const DefaultMessageIDTypes_ID_READY_EVENT_SET: root::DefaultMessageIDTypes = 68;
- #[doc = " ReadyEvent plugin - Unset the ready state for a particular system"]
- #[doc = " First 4 bytes after the message contains the id"]
- pub const DefaultMessageIDTypes_ID_READY_EVENT_UNSET: root::DefaultMessageIDTypes = 69;
- #[doc = " All systems are in state ID_READY_EVENT_SET"]
- #[doc = " First 4 bytes after the message contains the id"]
- pub const DefaultMessageIDTypes_ID_READY_EVENT_ALL_SET: root::DefaultMessageIDTypes = 70;
- #[doc = " \\internal, do not process in your game"]
- #[doc = " ReadyEvent plugin - Request of ready event state - used for pulling data when newly connecting"]
- pub const DefaultMessageIDTypes_ID_READY_EVENT_QUERY: root::DefaultMessageIDTypes = 71;
- #[doc = " Lobby packets. Second byte indicates type."]
- pub const DefaultMessageIDTypes_ID_LOBBY_GENERAL: root::DefaultMessageIDTypes = 72;
- #[doc = " Lobby packets. Second byte indicates type."]
- pub const DefaultMessageIDTypes_ID_RPC_REMOTE_ERROR: root::DefaultMessageIDTypes = 73;
- #[doc = " Plugin based replacement for RPC system"]
- pub const DefaultMessageIDTypes_ID_RPC_PLUGIN: root::DefaultMessageIDTypes = 74;
- #[doc = " FileListTransfer transferring large files in chunks that are read only when needed, to save memory"]
- pub const DefaultMessageIDTypes_ID_FILE_LIST_REFERENCE_PUSH: root::DefaultMessageIDTypes = 75;
- #[doc = " Force the ready event to all set"]
- pub const DefaultMessageIDTypes_ID_READY_EVENT_FORCE_ALL_SET: root::DefaultMessageIDTypes = 76;
- #[doc = " Rooms function"]
- pub const DefaultMessageIDTypes_ID_ROOMS_EXECUTE_FUNC: root::DefaultMessageIDTypes = 77;
- #[doc = " Rooms function"]
- pub const DefaultMessageIDTypes_ID_ROOMS_LOGON_STATUS: root::DefaultMessageIDTypes = 78;
- #[doc = " Rooms function"]
- pub const DefaultMessageIDTypes_ID_ROOMS_HANDLE_CHANGE: root::DefaultMessageIDTypes = 79;
- #[doc = " Lobby2 message"]
- pub const DefaultMessageIDTypes_ID_LOBBY2_SEND_MESSAGE: root::DefaultMessageIDTypes = 80;
- #[doc = " Lobby2 message"]
- pub const DefaultMessageIDTypes_ID_LOBBY2_SERVER_ERROR: root::DefaultMessageIDTypes = 81;
- #[doc = " Informs user of a new host GUID. Packet::Guid contains this new host RakNetGuid. The old host can be read out using BitStream->Read(RakNetGuid) starting on byte 1"]
- #[doc = " This is not returned until connected to a remote system"]
- #[doc = " If the oldHost is UNASSIGNED_RAKNET_GUID, then this is the first time the host has been determined"]
- pub const DefaultMessageIDTypes_ID_FCM2_NEW_HOST: root::DefaultMessageIDTypes = 82;
- #[doc = " \\internal For FullyConnectedMesh2 plugin"]
- pub const DefaultMessageIDTypes_ID_FCM2_REQUEST_FCMGUID: root::DefaultMessageIDTypes = 83;
- #[doc = " \\internal For FullyConnectedMesh2 plugin"]
- pub const DefaultMessageIDTypes_ID_FCM2_RESPOND_CONNECTION_COUNT: root::DefaultMessageIDTypes =
- 84;
- #[doc = " \\internal For FullyConnectedMesh2 plugin"]
- pub const DefaultMessageIDTypes_ID_FCM2_INFORM_FCMGUID: root::DefaultMessageIDTypes = 85;
- #[doc = " \\internal For FullyConnectedMesh2 plugin"]
- pub const DefaultMessageIDTypes_ID_FCM2_UPDATE_MIN_TOTAL_CONNECTION_COUNT:
- root::DefaultMessageIDTypes = 86;
- #[doc = " A remote system (not necessarily the host) called FullyConnectedMesh2::StartVerifiedJoin() with our system as the client"]
- #[doc = " Use FullyConnectedMesh2::GetVerifiedJoinRequiredProcessingList() to read systems"]
- #[doc = " For each system, attempt NatPunchthroughClient::OpenNAT() and/or RakPeerInterface::Connect()"]
- #[doc = " When this has been done for all systems, the remote system will automatically be informed of the results"]
- #[doc = " \\note Only the designated client gets this message"]
- #[doc = " \\note You won't get this message if you are already connected to all target systems"]
- #[doc = " \\note If you fail to connect to a system, this does not automatically mean you will get ID_FCM2_VERIFIED_JOIN_FAILED as that system may have been shutting down from the host too"]
- #[doc = " \\sa FullyConnectedMesh2::StartVerifiedJoin()"]
- pub const DefaultMessageIDTypes_ID_FCM2_VERIFIED_JOIN_START: root::DefaultMessageIDTypes = 87;
- #[doc = " \\internal The client has completed processing for all systems designated in ID_FCM2_VERIFIED_JOIN_START"]
- pub const DefaultMessageIDTypes_ID_FCM2_VERIFIED_JOIN_CAPABLE: root::DefaultMessageIDTypes = 88;
- #[doc = " Client failed to connect to a required systems notified via FullyConnectedMesh2::StartVerifiedJoin()"]
- #[doc = " RakPeerInterface::CloseConnection() was automatically called for all systems connected due to ID_FCM2_VERIFIED_JOIN_START"]
- #[doc = " Programmer should inform the player via the UI that they cannot join this session, and to choose a different session"]
- #[doc = " \\note Server normally sends us this message, however if connection to the server was lost, message will be returned locally"]
- #[doc = " \\note Only the designated client gets this message"]
- pub const DefaultMessageIDTypes_ID_FCM2_VERIFIED_JOIN_FAILED: root::DefaultMessageIDTypes = 89;
- #[doc = " The system that called StartVerifiedJoin() got ID_FCM2_VERIFIED_JOIN_CAPABLE from the client and then called RespondOnVerifiedJoinCapable() with true"]
- #[doc = " AddParticipant() has automatically been called for this system"]
- #[doc = " Use GetVerifiedJoinAcceptedAdditionalData() to read any additional data passed to RespondOnVerifiedJoinCapable()"]
- #[doc = " \\note All systems in the mesh get this message"]
- #[doc = " \\sa RespondOnVerifiedJoinCapable()"]
- pub const DefaultMessageIDTypes_ID_FCM2_VERIFIED_JOIN_ACCEPTED: root::DefaultMessageIDTypes =
- 90;
- #[doc = " The system that called StartVerifiedJoin() got ID_FCM2_VERIFIED_JOIN_CAPABLE from the client and then called RespondOnVerifiedJoinCapable() with false"]
- #[doc = " CloseConnection() has been automatically called for each system connected to since ID_FCM2_VERIFIED_JOIN_START."]
- #[doc = " The connection is NOT automatically closed to the original host that sent StartVerifiedJoin()"]
- #[doc = " Use GetVerifiedJoinRejectedAdditionalData() to read any additional data passed to RespondOnVerifiedJoinCapable()"]
- #[doc = " \\note Only the designated client gets this message"]
- #[doc = " \\sa RespondOnVerifiedJoinCapable()"]
- pub const DefaultMessageIDTypes_ID_FCM2_VERIFIED_JOIN_REJECTED: root::DefaultMessageIDTypes =
- 91;
- #[doc = " UDP proxy messages. Second byte indicates type."]
- pub const DefaultMessageIDTypes_ID_UDP_PROXY_GENERAL: root::DefaultMessageIDTypes = 92;
- #[doc = " SQLite3Plugin - execute"]
- pub const DefaultMessageIDTypes_ID_SQLite3_EXEC: root::DefaultMessageIDTypes = 93;
- #[doc = " SQLite3Plugin - Remote database is unknown"]
- pub const DefaultMessageIDTypes_ID_SQLite3_UNKNOWN_DB: root::DefaultMessageIDTypes = 94;
- #[doc = " Events happening with SQLiteClientLoggerPlugin"]
- pub const DefaultMessageIDTypes_ID_SQLLITE_LOGGER: root::DefaultMessageIDTypes = 95;
- #[doc = " Sent to NatTypeDetectionServer"]
- pub const DefaultMessageIDTypes_ID_NAT_TYPE_DETECTION_REQUEST: root::DefaultMessageIDTypes = 96;
- #[doc = " Sent to NatTypeDetectionClient. Byte 1 contains the type of NAT detected."]
- pub const DefaultMessageIDTypes_ID_NAT_TYPE_DETECTION_RESULT: root::DefaultMessageIDTypes = 97;
- #[doc = " Used by the router2 plugin"]
- pub const DefaultMessageIDTypes_ID_ROUTER_2_INTERNAL: root::DefaultMessageIDTypes = 98;
- #[doc = " No path is available or can be established to the remote system"]
- #[doc = " Packet::guid contains the endpoint guid that we were trying to reach"]
- pub const DefaultMessageIDTypes_ID_ROUTER_2_FORWARDING_NO_PATH: root::DefaultMessageIDTypes =
- 99;
- #[doc = " \\brief You can now call connect, ping, or other operations to the destination system."]
- #[doc = ""]
- #[doc = " Connect as follows:"]
- #[doc = ""]
- #[doc = " RakNet::BitStream bs(packet->data, packet->length, false);"]
- #[doc = " bs.IgnoreBytes(sizeof(MessageID));"]
- #[doc = " RakNetGUID endpointGuid;"]
- #[doc = " bs.Read(endpointGuid);"]
- #[doc = " unsigned short sourceToDestPort;"]
- #[doc = " bs.Read(sourceToDestPort);"]
- #[doc = " char ipAddressString[32];"]
- #[doc = " packet->systemAddress.ToString(false, ipAddressString);"]
- #[doc = " rakPeerInterface->Connect(ipAddressString, sourceToDestPort, 0,0);"]
- pub const DefaultMessageIDTypes_ID_ROUTER_2_FORWARDING_ESTABLISHED:
- root::DefaultMessageIDTypes = 100;
- #[doc = " The IP address for a forwarded connection has changed"]
- #[doc = " Read endpointGuid and port as per ID_ROUTER_2_FORWARDING_ESTABLISHED"]
- pub const DefaultMessageIDTypes_ID_ROUTER_2_REROUTED: root::DefaultMessageIDTypes = 101;
- #[doc = " \\internal Used by the team balancer plugin"]
- pub const DefaultMessageIDTypes_ID_TEAM_BALANCER_INTERNAL: root::DefaultMessageIDTypes = 102;
- #[doc = " Cannot switch to the desired team because it is full. However, if someone on that team leaves, you will"]
- #[doc = " get ID_TEAM_BALANCER_TEAM_ASSIGNED later."]
- #[doc = " For TeamBalancer: Byte 1 contains the team you requested to join. Following bytes contain NetworkID of which member"]
- pub const DefaultMessageIDTypes_ID_TEAM_BALANCER_REQUESTED_TEAM_FULL:
- root::DefaultMessageIDTypes = 103;
- #[doc = " Cannot switch to the desired team because all teams are locked. However, if someone on that team leaves,"]
- #[doc = " you will get ID_TEAM_BALANCER_SET_TEAM later."]
- #[doc = " For TeamBalancer: Byte 1 contains the team you requested to join."]
- pub const DefaultMessageIDTypes_ID_TEAM_BALANCER_REQUESTED_TEAM_LOCKED:
- root::DefaultMessageIDTypes = 104;
- #[doc = " Cannot switch to the desired team because all teams are locked. However, if someone on that team leaves,"]
- #[doc = " you will get ID_TEAM_BALANCER_SET_TEAM later."]
- #[doc = " For TeamBalancer: Byte 1 contains the team you requested to join."]
- pub const DefaultMessageIDTypes_ID_TEAM_BALANCER_TEAM_REQUESTED_CANCELLED:
- root::DefaultMessageIDTypes = 105;
- #[doc = " Team balancer plugin informing you of your team. Byte 1 contains the team you requested to join. Following bytes contain NetworkID of which member."]
- pub const DefaultMessageIDTypes_ID_TEAM_BALANCER_TEAM_ASSIGNED: root::DefaultMessageIDTypes =
- 106;
- #[doc = " Gamebryo Lightspeed integration"]
- pub const DefaultMessageIDTypes_ID_LIGHTSPEED_INTEGRATION: root::DefaultMessageIDTypes = 107;
- #[doc = " XBOX integration"]
- pub const DefaultMessageIDTypes_ID_XBOX_LOBBY: root::DefaultMessageIDTypes = 108;
- #[doc = " The password we used to challenge the other system passed, meaning the other system has called TwoWayAuthentication::AddPassword() with the same password we passed to TwoWayAuthentication::Challenge()"]
- #[doc = " You can read the identifier used to challenge as follows:"]
- #[doc = " RakNet::BitStream bs(packet->data, packet->length, false); bs.IgnoreBytes(sizeof(RakNet::MessageID)); RakNet::RakString password; bs.Read(password);"]
- pub const DefaultMessageIDTypes_ID_TWO_WAY_AUTHENTICATION_INCOMING_CHALLENGE_SUCCESS:
- root::DefaultMessageIDTypes = 109;
- #[doc = " The password we used to challenge the other system passed, meaning the other system has called TwoWayAuthentication::AddPassword() with the same password we passed to TwoWayAuthentication::Challenge()"]
- #[doc = " You can read the identifier used to challenge as follows:"]
- #[doc = " RakNet::BitStream bs(packet->data, packet->length, false); bs.IgnoreBytes(sizeof(RakNet::MessageID)); RakNet::RakString password; bs.Read(password);"]
- pub const DefaultMessageIDTypes_ID_TWO_WAY_AUTHENTICATION_OUTGOING_CHALLENGE_SUCCESS:
- root::DefaultMessageIDTypes = 110;
- #[doc = " A remote system sent us a challenge using TwoWayAuthentication::Challenge(), and the challenge failed."]
- #[doc = " If the other system must pass the challenge to stay connected, you should call RakPeer::CloseConnection() to terminate the connection to the other system."]
- pub const DefaultMessageIDTypes_ID_TWO_WAY_AUTHENTICATION_INCOMING_CHALLENGE_FAILURE:
- root::DefaultMessageIDTypes = 111;
- #[doc = " The other system did not add the password we used to TwoWayAuthentication::AddPassword()"]
- #[doc = " You can read the identifier used to challenge as follows:"]
- #[doc = " RakNet::BitStream bs(packet->data, packet->length, false); bs.IgnoreBytes(sizeof(MessageID)); RakNet::RakString password; bs.Read(password);"]
- pub const DefaultMessageIDTypes_ID_TWO_WAY_AUTHENTICATION_OUTGOING_CHALLENGE_FAILURE:
- root::DefaultMessageIDTypes = 112;
- #[doc = " The other system did not respond within a timeout threshhold. Either the other system is not running the plugin or the other system was blocking on some operation for a long time."]
- #[doc = " You can read the identifier used to challenge as follows:"]
- #[doc = " RakNet::BitStream bs(packet->data, packet->length, false); bs.IgnoreBytes(sizeof(MessageID)); RakNet::RakString password; bs.Read(password);"]
- pub const DefaultMessageIDTypes_ID_TWO_WAY_AUTHENTICATION_OUTGOING_CHALLENGE_TIMEOUT:
- root::DefaultMessageIDTypes = 113;
- #[doc = " \\internal"]
- pub const DefaultMessageIDTypes_ID_TWO_WAY_AUTHENTICATION_NEGOTIATION:
- root::DefaultMessageIDTypes = 114;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_CLOUD_POST_REQUEST: root::DefaultMessageIDTypes = 115;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_CLOUD_RELEASE_REQUEST: root::DefaultMessageIDTypes = 116;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_CLOUD_GET_REQUEST: root::DefaultMessageIDTypes = 117;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_CLOUD_GET_RESPONSE: root::DefaultMessageIDTypes = 118;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_CLOUD_UNSUBSCRIBE_REQUEST: root::DefaultMessageIDTypes = 119;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_CLOUD_SERVER_TO_SERVER_COMMAND: root::DefaultMessageIDTypes =
- 120;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_CLOUD_SUBSCRIPTION_NOTIFICATION:
- root::DefaultMessageIDTypes = 121;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_LIB_VOICE: root::DefaultMessageIDTypes = 122;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_RELAY_PLUGIN: root::DefaultMessageIDTypes = 123;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_NAT_REQUEST_BOUND_ADDRESSES: root::DefaultMessageIDTypes =
- 124;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_NAT_RESPOND_BOUND_ADDRESSES: root::DefaultMessageIDTypes =
- 125;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_FCM2_UPDATE_USER_CONTEXT: root::DefaultMessageIDTypes = 126;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_RESERVED_3: root::DefaultMessageIDTypes = 127;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_RESERVED_4: root::DefaultMessageIDTypes = 128;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_RESERVED_5: root::DefaultMessageIDTypes = 129;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_RESERVED_6: root::DefaultMessageIDTypes = 130;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_RESERVED_7: root::DefaultMessageIDTypes = 131;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_RESERVED_8: root::DefaultMessageIDTypes = 132;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_RESERVED_9: root::DefaultMessageIDTypes = 133;
- #[doc = " CloudClient / CloudServer"]
- pub const DefaultMessageIDTypes_ID_USER_PACKET_ENUM: root::DefaultMessageIDTypes = 134;
- #[doc = " You should not edit the file MessageIdentifiers.h as it is a part of RakNet static library"]
- #[doc = " To define your own message id, define an enum following the code example that follows."]
- #[doc = ""]
- #[doc = " \\code"]
- #[doc = " enum {"]
- #[doc = " ID_MYPROJECT_MSG_1 = ID_USER_PACKET_ENUM,"]
- #[doc = " ID_MYPROJECT_MSG_2,"]
- #[doc = " ..."]
- #[doc = " };"]
- #[doc = " \\endcode"]
- #[doc = ""]
- #[doc = " \\note All these enumerations should be casted to (unsigned char) before writing them to RakNet::BitStream"]
- pub type DefaultMessageIDTypes = ::std::os::raw::c_uint;
- pub type __builtin_va_list = [root::__va_list_tag; 1usize];
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct __va_list_tag {
- pub gp_offset: ::std::os::raw::c_uint,
- pub fp_offset: ::std::os::raw::c_uint,
- pub overflow_arg_area: *mut ::std::os::raw::c_void,
- pub reg_save_area: *mut ::std::os::raw::c_void,
- }
- }
Add Comment
Please, Sign In to add comment