Loading tnl2/net_connection.h +1 −1 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public: TorqueLogMessageFormatted(LogNetConnection, ("connection %d: END - %llu bits", _connection, stream.get_bit_position() - start) ); logprintf("NC packet write data: %s", buffer_encode_base_16(stream.get_buffer(), stream.get_next_byte_position())->get_buffer()); _interface->get_socket().send_to_connection(_connection, stream, &_last_send_sequence); torque_socket_send_to_connection(_interface->get_socket(), _connection, stream.get_next_byte_position(), stream.get_buffer(), &_last_send_sequence); //torque_connection_send_to(_connection, stream.get_next_byte_position(), stream.get_buffer(), &_last_send_sequence); _notify_queue_tail->sequence = _last_send_sequence; } Loading tnl2/net_interface.h +18 −26 Original line number Diff line number Diff line Loading @@ -16,7 +16,8 @@ class net_interface : public ref_object public: void set_private_key(asymmetric_key_ptr the_key) { _socket.set_private_key(the_key); byte_buffer_ptr key_buffer = the_key->get_private_key(); torque_socket_set_private_key(_socket, key_buffer->get_buffer_size(), key_buffer->get_buffer()); //byte_buffer_ptr private_key = the_key->get_private_key(); //torque_socket_set_private_key(_socket, private_key->get_buffer_size(), private_key->get_buffer()); Loading @@ -24,26 +25,18 @@ public: void set_challenge_response_data(byte_buffer_ptr data) { _socket.set_challenge_response(data); //torque_socket_set_challenge_response_data(_socket, the_data.get_next_byte_position(), the_data.get_buffer()); torque_socket_set_challenge_response(_socket, data->get_buffer_size(), data->get_buffer()); } void set_allows_connections(bool allow) { _socket.set_allows_connections(allow); //torque_socket_allow_incoming_connections(_socket, allow); } bool does_allow_connections() { return _socket.does_allow_connections(); //return torque_socket_does_allow_incoming_connections(_socket); torque_socket_allow_incoming_connections(_socket, allow); } void process_socket() { torque_socket_event *event; while((event = _socket.get_next_event()) != NULL) while((event = torque_socket_get_next_event(_socket)) != NULL) { logprintf("Processing event of type %d, connection_index = %d, size = %d", event->event_type, event->connection, event->data_size); switch(event->event_type) Loading Loading @@ -191,7 +184,7 @@ public: { (*the_connection)->set_connection_state(net_connection::state_requesting_connection); (*the_connection)->on_challenge_response(challenge_response, public_key); _socket.accept_connection_challenge(event->connection); torque_socket_accept_challenge(_socket, event->connection); } } Loading @@ -207,8 +200,7 @@ public: type_record *rec = find_connection_type(type_identifier); if(!rec) { _socket.disconnect(event->connection, 0, 0); //torque_connection_reject(event->connection, 0, response_stream.get_buffer()); torque_socket_disconnect(_socket, event->connection, 0, 0); } net_connection *allocated = (net_connection *) operator new(rec->size); rec->construct_object(allocated); Loading @@ -218,12 +210,10 @@ public: if(the_connection->read_connect_request(request_stream, response_stream)) { _add_connection(the_connection, event->connection); _socket.accept_connection(event->connection); //torque_connection_accept(event->connection, response_stream.get_byte_position(), response_stream.get_buffer()); torque_socket_accept_connection(_socket, event->connection); } else _socket.disconnect(event->connection, response_stream.get_buffer(), response_stream.get_next_byte_position()); //torque_connection_reject(event->connection, response_stream.get_next_byte_position(), response_stream.get_buffer()); torque_socket_disconnect(_socket, event->connection, response_stream.get_next_byte_position(), response_stream.get_buffer() ); } void _process_arranged_connection_request(torque_socket_event *event) Loading Loading @@ -328,11 +318,11 @@ public: the_connection->write_connect_request(connect_stream); torque_connection_id connection_id = _socket.connect(remote_host, connect_stream.get_buffer(), connect_stream.get_next_byte_position()); sockaddr the_sockaddr; remote_host.to_sockaddr(&the_sockaddr); torque_connection_id connection_id = torque_socket_connect(_socket, &the_sockaddr, connect_stream.get_next_byte_position(), connect_stream.get_buffer()); logprintf("opened connection id = %d", connection_id); _add_connection(the_connection, connection_id); //torque_socket_connect(_socket, connect_address, connect_stream.get_next_byte_position(), connect_buffer); //the_connection->set_torque_connection(connection_id); } virtual ~net_interface() Loading @@ -341,14 +331,16 @@ public: _dirty_list_head._next_dirty_list = 0; } torque_socket &get_socket() torque_socket_handle &get_socket() { return _socket; } net_interface(const address &bind_address) : _socket(bind_address) net_interface(const address &bind_address) { //_socket = torque_socket_create(&bind_address); sockaddr sa_bind_address; bind_address.to_sockaddr(&sa_bind_address); _socket = torque_socket_create(&sa_bind_address); _dirty_list_head._next_dirty_list = &_dirty_list_tail; _dirty_list_tail._prev_dirty_list = &_dirty_list_head; Loading @@ -356,7 +348,7 @@ public: _dirty_list_tail._next_dirty_list = 0; } protected: torque_socket _socket; torque_socket_handle _socket; time _process_start_time; net_object _dirty_list_head; net_object _dirty_list_tail; Loading tnl2_test/Makefile +2 −2 Original line number Diff line number Diff line ############################################################################# # Makefile for building: tnl2_test.app/Contents/MacOS/tnl2_test # Generated by qmake (2.01a) (Qt 4.6.2) on: Tue Mar 16 11:11:31 2010 # Generated by qmake (2.01a) (Qt 4.6.2) on: Thu Mar 18 18:20:20 2010 # Project: tnl2_test.pro # Template: app # Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile tnl2_test.pro Loading Loading @@ -203,7 +203,7 @@ tnl2_test.app/Contents/Info.plist: @sed -e "s,@ICON@,,g" -e "s,@EXECUTABLE@,tnl2_test,g" -e "s,@TYPEINFO@,????,g" /usr/local/Qt4.6/mkspecs/macx-g++/Info.plist.app >tnl2_test.app/Contents/Info.plist dist: @$(CHK_DIR_EXISTS) .tmp/tnl2_test1.0.0 || $(MKDIR) .tmp/tnl2_test1.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/tnl2_test1.0.0/ && $(COPY_FILE) --parents tnl2_test_widget.h test_player.h test_net_interface.h test_game.h test_connection.h test_building.h ../tnl2/tnl2.h ../tnl2/net_object.h ../tnl2/net_interface.h ../tnl2/net_connection.h ../tnl2/ghost_connection.h ../tnl2/exceptions.h ../tnl2/event_connection.h window.h ../../torque_sockets/core/zone_allocator.h ../../torque_sockets/core/utils.h ../../torque_sockets/core/type_record.h ../../torque_sockets/core/type_database.h ../../torque_sockets/core/thread_queue.h ../../torque_sockets/core/thread.h ../../torque_sockets/core/system_includes_win32.h ../../torque_sockets/core/system_includes_mac_osx.h ../../torque_sockets/core/system_includes_linux.h ../../torque_sockets/core/string.h ../../torque_sockets/core/static_to_indexed_string_map.h ../../torque_sockets/core/small_block_allocator.h ../../torque_sockets/core/ref_object.h ../../torque_sockets/core/power_two_functions.h ../../torque_sockets/core/platform.h ../../torque_sockets/core/page_allocator.h ../../torque_sockets/core/memory_functions.h ../../torque_sockets/core/log.h ../../torque_sockets/core/indexed_string.h ../../torque_sockets/core/hash_table_flat.h ../../torque_sockets/core/hash_table_array.h ../../torque_sockets/core/hash.h ../../torque_sockets/core/functor.h ../../torque_sockets/core/function_record.h ../../torque_sockets/core/formatted_string_buffer.h ../../torque_sockets/core/dictionary.h ../../torque_sockets/core/cpu_endian.h ../../torque_sockets/core/core.h ../../torque_sockets/core/context.h ../../torque_sockets/core/construct.h ../../torque_sockets/core/byte_stream_fixed.h ../../torque_sockets/core/byte_buffer.h ../../torque_sockets/core/bit_stream.h ../../torque_sockets/core/base_types.h ../../torque_sockets/core/base_type_traits.h ../../torque_sockets/core/base_type_io.h ../../torque_sockets/core/base_type_declarations.h ../../torque_sockets/core/assert.h ../../torque_sockets/core/array.h ../../torque_sockets/core/algorithm_templates.h ../../torque_sockets/torque_sockets/udp_socket.h ../../torque_sockets/torque_sockets/torque_sockets.h ../../torque_sockets/torque_sockets/torque_socket_event.h ../../torque_sockets/torque_sockets/torque_socket.h ../../torque_sockets/torque_sockets/torque_connection.h ../../torque_sockets/torque_sockets/time.h ../../torque_sockets/torque_sockets/symmetric_cipher.h ../../torque_sockets/torque_sockets/sockets.h ../../torque_sockets/torque_sockets/random_generator.h ../../torque_sockets/torque_sockets/packet_stream.h ../../torque_sockets/torque_sockets/nonce.h ../../torque_sockets/torque_sockets/client_puzzle.h ../../torque_sockets/torque_sockets/buffer_utils.h ../../torque_sockets/torque_sockets/asymmetric_key.h ../../torque_sockets/torque_sockets/address.h ../../torque_sockets/torque_sockets/pending_connection.h .tmp/tnl2_test1.0.0/ && $(COPY_FILE) --parents main.cpp tnl2_test_widget.cpp test_game.cpp window.cpp .tmp/tnl2_test1.0.0/ && (cd `dirname .tmp/tnl2_test1.0.0` && $(TAR) tnl2_test1.0.0.tar tnl2_test1.0.0 && $(COMPRESS) tnl2_test1.0.0.tar) && $(MOVE) `dirname .tmp/tnl2_test1.0.0`/tnl2_test1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/tnl2_test1.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/tnl2_test1.0.0/ && $(COPY_FILE) --parents tnl2_test_widget.h test_player.h test_net_interface.h test_game.h test_connection.h test_building.h ../tnl2/tnl2.h ../tnl2/net_object.h ../tnl2/net_interface.h ../tnl2/net_connection.h ../tnl2/ghost_connection.h ../tnl2/exceptions.h ../tnl2/event_connection.h window.h ../../torque_sockets/core/zone_allocator.h ../../torque_sockets/core/utils.h ../../torque_sockets/core/type_record.h ../../torque_sockets/core/type_database.h ../../torque_sockets/core/thread_queue.h ../../torque_sockets/core/thread.h ../../torque_sockets/core/system_includes_win32.h ../../torque_sockets/core/system_includes_mac_osx.h ../../torque_sockets/core/system_includes_linux.h ../../torque_sockets/core/string.h ../../torque_sockets/core/static_to_indexed_string_map.h ../../torque_sockets/core/small_block_allocator.h ../../torque_sockets/core/ref_object.h ../../torque_sockets/core/power_two_functions.h ../../torque_sockets/core/platform.h ../../torque_sockets/core/page_allocator.h ../../torque_sockets/core/memory_functions.h ../../torque_sockets/core/log.h ../../torque_sockets/core/indexed_string.h ../../torque_sockets/core/hash_table_flat.h ../../torque_sockets/core/hash_table_array.h ../../torque_sockets/core/hash.h ../../torque_sockets/core/functor.h ../../torque_sockets/core/function_record.h ../../torque_sockets/core/formatted_string_buffer.h ../../torque_sockets/core/dictionary.h ../../torque_sockets/core/cpu_endian.h ../../torque_sockets/core/core.h ../../torque_sockets/core/context.h ../../torque_sockets/core/construct.h ../../torque_sockets/core/byte_stream_fixed.h ../../torque_sockets/core/byte_buffer.h ../../torque_sockets/core/bit_stream.h ../../torque_sockets/core/base_types.h ../../torque_sockets/core/base_type_traits.h ../../torque_sockets/core/base_type_io.h ../../torque_sockets/core/base_type_declarations.h ../../torque_sockets/core/assert.h ../../torque_sockets/core/array.h ../../torque_sockets/core/algorithm_templates.h ../../torque_sockets/torque_sockets/udp_socket.h ../../torque_sockets/torque_sockets/torque_sockets.h ../../torque_sockets/torque_sockets/torque_socket.h ../../torque_sockets/torque_sockets/torque_connection.h ../../torque_sockets/torque_sockets/time.h ../../torque_sockets/torque_sockets/symmetric_cipher.h ../../torque_sockets/torque_sockets/sockets.h ../../torque_sockets/torque_sockets/random_generator.h ../../torque_sockets/torque_sockets/packet_stream.h ../../torque_sockets/torque_sockets/nonce.h ../../torque_sockets/torque_sockets/client_puzzle.h ../../torque_sockets/torque_sockets/buffer_utils.h ../../torque_sockets/torque_sockets/asymmetric_key.h ../../torque_sockets/torque_sockets/address.h ../../torque_sockets/torque_sockets/pending_connection.h ../../torque_sockets/torque_sockets/torque_sockets_c_api.h ../../torque_sockets/torque_sockets_reference_api.h ../../torque_sockets/torque_sockets/torque_sockets_c_implementation.h .tmp/tnl2_test1.0.0/ && $(COPY_FILE) --parents main.cpp tnl2_test_widget.cpp test_game.cpp window.cpp .tmp/tnl2_test1.0.0/ && (cd `dirname .tmp/tnl2_test1.0.0` && $(TAR) tnl2_test1.0.0.tar tnl2_test1.0.0 && $(COMPRESS) tnl2_test1.0.0.tar) && $(MOVE) `dirname .tmp/tnl2_test1.0.0`/tnl2_test1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/tnl2_test1.0.0 clean:compiler_clean Loading tnl2_test/test_game.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ #include "tomcrypt.h" #include "core/platform.h" #include "torque_sockets/torque_socket_event.h" #include "torque_sockets/torque_sockets_c_api.h" namespace core { Loading Loading @@ -45,7 +45,7 @@ namespace core }; }; //#include "torque_sockets_implementation.h" #include "torque_sockets/torque_sockets_c_implementation.h" namespace core { Loading tnl2_test/test_net_interface.h +2 −5 Original line number Diff line number Diff line Loading @@ -46,8 +46,7 @@ public: logprintf("%s - received ping.", from_string.c_str()); // we're a server, and we got a ping packet from a client, so send back a GamePingResponse to let the client know it has found a server. core::write(write_stream, uint8(GamePingResponse)); _socket.send_to(from, write_stream); //torque_socket_send_to(_socket, &event->source_address, write_stream.get_next_byte_position(), write_stream.get_buffer()); torque_socket_send_to(_socket, &event->source_address, write_stream.get_byte_position(), write_stream.get_buffer()); logprintf("%s - sending ping response.", from_string.c_str()); } Loading @@ -72,9 +71,7 @@ public: packet_stream write_stream; core::write(write_stream, uint8(GamePingRequest)); address ping_addr(_ping_address); _socket.send_to(ping_addr, write_stream); //torque_socket_send_to(_socket, &_ping_address, write_stream.get_next_byte_position(), write_stream.get_buffer()); torque_socket_send_to(_socket, &_ping_address, write_stream.get_next_byte_position(), write_stream.get_buffer()); string ping_address_string = address(_ping_address).to_string(); logprintf("%s - sending ping.", ping_address_string.c_str()); Loading Loading
tnl2/net_connection.h +1 −1 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public: TorqueLogMessageFormatted(LogNetConnection, ("connection %d: END - %llu bits", _connection, stream.get_bit_position() - start) ); logprintf("NC packet write data: %s", buffer_encode_base_16(stream.get_buffer(), stream.get_next_byte_position())->get_buffer()); _interface->get_socket().send_to_connection(_connection, stream, &_last_send_sequence); torque_socket_send_to_connection(_interface->get_socket(), _connection, stream.get_next_byte_position(), stream.get_buffer(), &_last_send_sequence); //torque_connection_send_to(_connection, stream.get_next_byte_position(), stream.get_buffer(), &_last_send_sequence); _notify_queue_tail->sequence = _last_send_sequence; } Loading
tnl2/net_interface.h +18 −26 Original line number Diff line number Diff line Loading @@ -16,7 +16,8 @@ class net_interface : public ref_object public: void set_private_key(asymmetric_key_ptr the_key) { _socket.set_private_key(the_key); byte_buffer_ptr key_buffer = the_key->get_private_key(); torque_socket_set_private_key(_socket, key_buffer->get_buffer_size(), key_buffer->get_buffer()); //byte_buffer_ptr private_key = the_key->get_private_key(); //torque_socket_set_private_key(_socket, private_key->get_buffer_size(), private_key->get_buffer()); Loading @@ -24,26 +25,18 @@ public: void set_challenge_response_data(byte_buffer_ptr data) { _socket.set_challenge_response(data); //torque_socket_set_challenge_response_data(_socket, the_data.get_next_byte_position(), the_data.get_buffer()); torque_socket_set_challenge_response(_socket, data->get_buffer_size(), data->get_buffer()); } void set_allows_connections(bool allow) { _socket.set_allows_connections(allow); //torque_socket_allow_incoming_connections(_socket, allow); } bool does_allow_connections() { return _socket.does_allow_connections(); //return torque_socket_does_allow_incoming_connections(_socket); torque_socket_allow_incoming_connections(_socket, allow); } void process_socket() { torque_socket_event *event; while((event = _socket.get_next_event()) != NULL) while((event = torque_socket_get_next_event(_socket)) != NULL) { logprintf("Processing event of type %d, connection_index = %d, size = %d", event->event_type, event->connection, event->data_size); switch(event->event_type) Loading Loading @@ -191,7 +184,7 @@ public: { (*the_connection)->set_connection_state(net_connection::state_requesting_connection); (*the_connection)->on_challenge_response(challenge_response, public_key); _socket.accept_connection_challenge(event->connection); torque_socket_accept_challenge(_socket, event->connection); } } Loading @@ -207,8 +200,7 @@ public: type_record *rec = find_connection_type(type_identifier); if(!rec) { _socket.disconnect(event->connection, 0, 0); //torque_connection_reject(event->connection, 0, response_stream.get_buffer()); torque_socket_disconnect(_socket, event->connection, 0, 0); } net_connection *allocated = (net_connection *) operator new(rec->size); rec->construct_object(allocated); Loading @@ -218,12 +210,10 @@ public: if(the_connection->read_connect_request(request_stream, response_stream)) { _add_connection(the_connection, event->connection); _socket.accept_connection(event->connection); //torque_connection_accept(event->connection, response_stream.get_byte_position(), response_stream.get_buffer()); torque_socket_accept_connection(_socket, event->connection); } else _socket.disconnect(event->connection, response_stream.get_buffer(), response_stream.get_next_byte_position()); //torque_connection_reject(event->connection, response_stream.get_next_byte_position(), response_stream.get_buffer()); torque_socket_disconnect(_socket, event->connection, response_stream.get_next_byte_position(), response_stream.get_buffer() ); } void _process_arranged_connection_request(torque_socket_event *event) Loading Loading @@ -328,11 +318,11 @@ public: the_connection->write_connect_request(connect_stream); torque_connection_id connection_id = _socket.connect(remote_host, connect_stream.get_buffer(), connect_stream.get_next_byte_position()); sockaddr the_sockaddr; remote_host.to_sockaddr(&the_sockaddr); torque_connection_id connection_id = torque_socket_connect(_socket, &the_sockaddr, connect_stream.get_next_byte_position(), connect_stream.get_buffer()); logprintf("opened connection id = %d", connection_id); _add_connection(the_connection, connection_id); //torque_socket_connect(_socket, connect_address, connect_stream.get_next_byte_position(), connect_buffer); //the_connection->set_torque_connection(connection_id); } virtual ~net_interface() Loading @@ -341,14 +331,16 @@ public: _dirty_list_head._next_dirty_list = 0; } torque_socket &get_socket() torque_socket_handle &get_socket() { return _socket; } net_interface(const address &bind_address) : _socket(bind_address) net_interface(const address &bind_address) { //_socket = torque_socket_create(&bind_address); sockaddr sa_bind_address; bind_address.to_sockaddr(&sa_bind_address); _socket = torque_socket_create(&sa_bind_address); _dirty_list_head._next_dirty_list = &_dirty_list_tail; _dirty_list_tail._prev_dirty_list = &_dirty_list_head; Loading @@ -356,7 +348,7 @@ public: _dirty_list_tail._next_dirty_list = 0; } protected: torque_socket _socket; torque_socket_handle _socket; time _process_start_time; net_object _dirty_list_head; net_object _dirty_list_tail; Loading
tnl2_test/Makefile +2 −2 Original line number Diff line number Diff line ############################################################################# # Makefile for building: tnl2_test.app/Contents/MacOS/tnl2_test # Generated by qmake (2.01a) (Qt 4.6.2) on: Tue Mar 16 11:11:31 2010 # Generated by qmake (2.01a) (Qt 4.6.2) on: Thu Mar 18 18:20:20 2010 # Project: tnl2_test.pro # Template: app # Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile tnl2_test.pro Loading Loading @@ -203,7 +203,7 @@ tnl2_test.app/Contents/Info.plist: @sed -e "s,@ICON@,,g" -e "s,@EXECUTABLE@,tnl2_test,g" -e "s,@TYPEINFO@,????,g" /usr/local/Qt4.6/mkspecs/macx-g++/Info.plist.app >tnl2_test.app/Contents/Info.plist dist: @$(CHK_DIR_EXISTS) .tmp/tnl2_test1.0.0 || $(MKDIR) .tmp/tnl2_test1.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/tnl2_test1.0.0/ && $(COPY_FILE) --parents tnl2_test_widget.h test_player.h test_net_interface.h test_game.h test_connection.h test_building.h ../tnl2/tnl2.h ../tnl2/net_object.h ../tnl2/net_interface.h ../tnl2/net_connection.h ../tnl2/ghost_connection.h ../tnl2/exceptions.h ../tnl2/event_connection.h window.h ../../torque_sockets/core/zone_allocator.h ../../torque_sockets/core/utils.h ../../torque_sockets/core/type_record.h ../../torque_sockets/core/type_database.h ../../torque_sockets/core/thread_queue.h ../../torque_sockets/core/thread.h ../../torque_sockets/core/system_includes_win32.h ../../torque_sockets/core/system_includes_mac_osx.h ../../torque_sockets/core/system_includes_linux.h ../../torque_sockets/core/string.h ../../torque_sockets/core/static_to_indexed_string_map.h ../../torque_sockets/core/small_block_allocator.h ../../torque_sockets/core/ref_object.h ../../torque_sockets/core/power_two_functions.h ../../torque_sockets/core/platform.h ../../torque_sockets/core/page_allocator.h ../../torque_sockets/core/memory_functions.h ../../torque_sockets/core/log.h ../../torque_sockets/core/indexed_string.h ../../torque_sockets/core/hash_table_flat.h ../../torque_sockets/core/hash_table_array.h ../../torque_sockets/core/hash.h ../../torque_sockets/core/functor.h ../../torque_sockets/core/function_record.h ../../torque_sockets/core/formatted_string_buffer.h ../../torque_sockets/core/dictionary.h ../../torque_sockets/core/cpu_endian.h ../../torque_sockets/core/core.h ../../torque_sockets/core/context.h ../../torque_sockets/core/construct.h ../../torque_sockets/core/byte_stream_fixed.h ../../torque_sockets/core/byte_buffer.h ../../torque_sockets/core/bit_stream.h ../../torque_sockets/core/base_types.h ../../torque_sockets/core/base_type_traits.h ../../torque_sockets/core/base_type_io.h ../../torque_sockets/core/base_type_declarations.h ../../torque_sockets/core/assert.h ../../torque_sockets/core/array.h ../../torque_sockets/core/algorithm_templates.h ../../torque_sockets/torque_sockets/udp_socket.h ../../torque_sockets/torque_sockets/torque_sockets.h ../../torque_sockets/torque_sockets/torque_socket_event.h ../../torque_sockets/torque_sockets/torque_socket.h ../../torque_sockets/torque_sockets/torque_connection.h ../../torque_sockets/torque_sockets/time.h ../../torque_sockets/torque_sockets/symmetric_cipher.h ../../torque_sockets/torque_sockets/sockets.h ../../torque_sockets/torque_sockets/random_generator.h ../../torque_sockets/torque_sockets/packet_stream.h ../../torque_sockets/torque_sockets/nonce.h ../../torque_sockets/torque_sockets/client_puzzle.h ../../torque_sockets/torque_sockets/buffer_utils.h ../../torque_sockets/torque_sockets/asymmetric_key.h ../../torque_sockets/torque_sockets/address.h ../../torque_sockets/torque_sockets/pending_connection.h .tmp/tnl2_test1.0.0/ && $(COPY_FILE) --parents main.cpp tnl2_test_widget.cpp test_game.cpp window.cpp .tmp/tnl2_test1.0.0/ && (cd `dirname .tmp/tnl2_test1.0.0` && $(TAR) tnl2_test1.0.0.tar tnl2_test1.0.0 && $(COMPRESS) tnl2_test1.0.0.tar) && $(MOVE) `dirname .tmp/tnl2_test1.0.0`/tnl2_test1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/tnl2_test1.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/tnl2_test1.0.0/ && $(COPY_FILE) --parents tnl2_test_widget.h test_player.h test_net_interface.h test_game.h test_connection.h test_building.h ../tnl2/tnl2.h ../tnl2/net_object.h ../tnl2/net_interface.h ../tnl2/net_connection.h ../tnl2/ghost_connection.h ../tnl2/exceptions.h ../tnl2/event_connection.h window.h ../../torque_sockets/core/zone_allocator.h ../../torque_sockets/core/utils.h ../../torque_sockets/core/type_record.h ../../torque_sockets/core/type_database.h ../../torque_sockets/core/thread_queue.h ../../torque_sockets/core/thread.h ../../torque_sockets/core/system_includes_win32.h ../../torque_sockets/core/system_includes_mac_osx.h ../../torque_sockets/core/system_includes_linux.h ../../torque_sockets/core/string.h ../../torque_sockets/core/static_to_indexed_string_map.h ../../torque_sockets/core/small_block_allocator.h ../../torque_sockets/core/ref_object.h ../../torque_sockets/core/power_two_functions.h ../../torque_sockets/core/platform.h ../../torque_sockets/core/page_allocator.h ../../torque_sockets/core/memory_functions.h ../../torque_sockets/core/log.h ../../torque_sockets/core/indexed_string.h ../../torque_sockets/core/hash_table_flat.h ../../torque_sockets/core/hash_table_array.h ../../torque_sockets/core/hash.h ../../torque_sockets/core/functor.h ../../torque_sockets/core/function_record.h ../../torque_sockets/core/formatted_string_buffer.h ../../torque_sockets/core/dictionary.h ../../torque_sockets/core/cpu_endian.h ../../torque_sockets/core/core.h ../../torque_sockets/core/context.h ../../torque_sockets/core/construct.h ../../torque_sockets/core/byte_stream_fixed.h ../../torque_sockets/core/byte_buffer.h ../../torque_sockets/core/bit_stream.h ../../torque_sockets/core/base_types.h ../../torque_sockets/core/base_type_traits.h ../../torque_sockets/core/base_type_io.h ../../torque_sockets/core/base_type_declarations.h ../../torque_sockets/core/assert.h ../../torque_sockets/core/array.h ../../torque_sockets/core/algorithm_templates.h ../../torque_sockets/torque_sockets/udp_socket.h ../../torque_sockets/torque_sockets/torque_sockets.h ../../torque_sockets/torque_sockets/torque_socket.h ../../torque_sockets/torque_sockets/torque_connection.h ../../torque_sockets/torque_sockets/time.h ../../torque_sockets/torque_sockets/symmetric_cipher.h ../../torque_sockets/torque_sockets/sockets.h ../../torque_sockets/torque_sockets/random_generator.h ../../torque_sockets/torque_sockets/packet_stream.h ../../torque_sockets/torque_sockets/nonce.h ../../torque_sockets/torque_sockets/client_puzzle.h ../../torque_sockets/torque_sockets/buffer_utils.h ../../torque_sockets/torque_sockets/asymmetric_key.h ../../torque_sockets/torque_sockets/address.h ../../torque_sockets/torque_sockets/pending_connection.h ../../torque_sockets/torque_sockets/torque_sockets_c_api.h ../../torque_sockets/torque_sockets_reference_api.h ../../torque_sockets/torque_sockets/torque_sockets_c_implementation.h .tmp/tnl2_test1.0.0/ && $(COPY_FILE) --parents main.cpp tnl2_test_widget.cpp test_game.cpp window.cpp .tmp/tnl2_test1.0.0/ && (cd `dirname .tmp/tnl2_test1.0.0` && $(TAR) tnl2_test1.0.0.tar tnl2_test1.0.0 && $(COMPRESS) tnl2_test1.0.0.tar) && $(MOVE) `dirname .tmp/tnl2_test1.0.0`/tnl2_test1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/tnl2_test1.0.0 clean:compiler_clean Loading
tnl2_test/test_game.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ #include "tomcrypt.h" #include "core/platform.h" #include "torque_sockets/torque_socket_event.h" #include "torque_sockets/torque_sockets_c_api.h" namespace core { Loading Loading @@ -45,7 +45,7 @@ namespace core }; }; //#include "torque_sockets_implementation.h" #include "torque_sockets/torque_sockets_c_implementation.h" namespace core { Loading
tnl2_test/test_net_interface.h +2 −5 Original line number Diff line number Diff line Loading @@ -46,8 +46,7 @@ public: logprintf("%s - received ping.", from_string.c_str()); // we're a server, and we got a ping packet from a client, so send back a GamePingResponse to let the client know it has found a server. core::write(write_stream, uint8(GamePingResponse)); _socket.send_to(from, write_stream); //torque_socket_send_to(_socket, &event->source_address, write_stream.get_next_byte_position(), write_stream.get_buffer()); torque_socket_send_to(_socket, &event->source_address, write_stream.get_byte_position(), write_stream.get_buffer()); logprintf("%s - sending ping response.", from_string.c_str()); } Loading @@ -72,9 +71,7 @@ public: packet_stream write_stream; core::write(write_stream, uint8(GamePingRequest)); address ping_addr(_ping_address); _socket.send_to(ping_addr, write_stream); //torque_socket_send_to(_socket, &_ping_address, write_stream.get_next_byte_position(), write_stream.get_buffer()); torque_socket_send_to(_socket, &_ping_address, write_stream.get_next_byte_position(), write_stream.get_buffer()); string ping_address_string = address(_ping_address).to_string(); logprintf("%s - sending ping.", ping_address_string.c_str()); Loading