Skip to content

Commit

Permalink
Reapply yojimbo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
geneotech committed Apr 8, 2024
1 parent 4c1b01c commit 7d1e816
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions include/yojimbo_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions include/yojimbo_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
6 changes: 3 additions & 3 deletions source/yojimbo_base_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
7 changes: 4 additions & 3 deletions source/yojimbo_base_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] );
}
Expand Down
2 changes: 1 addition & 1 deletion source/yojimbo_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7d1e816

Please sign in to comment.