diff --git a/include/yojimbo_client.h b/include/yojimbo_client.h index 39583f3f..99236cc5 100644 --- a/include/yojimbo_client.h +++ b/include/yojimbo_client.h @@ -81,6 +81,8 @@ namespace yojimbo const Address & GetAddress() const { return m_boundAddress; } + netcode_client_t* GetClientDetail() const { return m_client; } + private: bool GenerateInsecureConnectToken( uint8_t * connectToken, diff --git a/include/yojimbo_server.h b/include/yojimbo_server.h index 33247b23..bf4c5c51 100644 --- a/include/yojimbo_server.h +++ b/include/yojimbo_server.h @@ -77,6 +77,8 @@ namespace yojimbo const Address & GetAddress() const { return m_boundAddress; } + netcode_server_t* GetServerDetail() const { return m_server; } + private: void TransmitPacketFunction( int clientIndex, uint16_t packetSequence, uint8_t * packetData, int packetBytes ); diff --git a/source/yojimbo_base_client.cpp b/source/yojimbo_base_client.cpp index 01c8efeb..3ec805dd 100644 --- a/source/yojimbo_base_client.cpp +++ b/source/yojimbo_base_client.cpp @@ -155,9 +155,9 @@ namespace yojimbo reliable_config.rtt_smoothing_factor = m_config.rttSmoothingFactor; reliable_config.transmit_packet_function = BaseClient::StaticTransmitPacketFunction; reliable_config.process_packet_function = BaseClient::StaticProcessPacketFunction; - reliable_config.allocator_context = m_clientAllocator; - reliable_config.allocate_function = BaseClient::StaticAllocateFunction; - reliable_config.free_function = BaseClient::StaticFreeFunction; + reliable_config.allocator_context = nullptr; + reliable_config.allocate_function = nullptr; + reliable_config.free_function = nullptr; m_endpoint = reliable_endpoint_create( &reliable_config, m_time ); reliable_endpoint_reset( m_endpoint ); } diff --git a/source/yojimbo_base_server.cpp b/source/yojimbo_base_server.cpp index d60c4403..59b822ad 100644 --- a/source/yojimbo_base_server.cpp +++ b/source/yojimbo_base_server.cpp @@ -82,14 +82,15 @@ namespace yojimbo reliable_config.max_fragments = m_config.maxPacketFragments; reliable_config.fragment_size = m_config.packetFragmentSize; reliable_config.ack_buffer_size = m_config.ackedPacketsBufferSize; + reliable_config.sent_packets_buffer_size = m_config.receivedPacketsBufferSize; reliable_config.received_packets_buffer_size = m_config.receivedPacketsBufferSize; reliable_config.fragment_reassembly_buffer_size = m_config.packetReassemblyBufferSize; reliable_config.rtt_smoothing_factor = m_config.rttSmoothingFactor; reliable_config.transmit_packet_function = BaseServer::StaticTransmitPacketFunction; reliable_config.process_packet_function = BaseServer::StaticProcessPacketFunction; - reliable_config.allocator_context = &GetGlobalAllocator(); - reliable_config.allocate_function = BaseServer::StaticAllocateFunction; - reliable_config.free_function = BaseServer::StaticFreeFunction; + reliable_config.allocator_context = nullptr; + reliable_config.allocate_function = nullptr; + reliable_config.free_function = nullptr; m_clientEndpoint[i] = reliable_endpoint_create( &reliable_config, m_time ); reliable_endpoint_reset( m_clientEndpoint[i] ); } diff --git a/source/yojimbo_client.cpp b/source/yojimbo_client.cpp index 67223b1d..262a547b 100644 --- a/source/yojimbo_client.cpp +++ b/source/yojimbo_client.cpp @@ -71,7 +71,7 @@ namespace yojimbo return netcode_generate_connect_token( numServerAddresses, serverAddressStringPointers, serverAddressStringPointers, - m_config.timeout, + -1, m_config.timeout, clientId, m_config.protocolId,