diff options
-rwxr-xr-x[-rw-r--r--] | CMakeLists.txt | 26 | ||||
-rw-r--r-- | INSTALL.md | 12 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | cmake/FindLIBCONFIG.cmake | 15 | ||||
-rw-r--r-- | cmake/FindNaCl.cmake | 17 | ||||
-rw-r--r-- | cmake/FindSODIUM.cmake | 15 | ||||
-rw-r--r-- | core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | core/friend_requests.h | 2 | ||||
-rw-r--r-- | core/network.h | 6 | ||||
-rw-r--r-- | docs/commands.md | 25 | ||||
-rw-r--r-- | docs/using_tox.md | 38 | ||||
-rw-r--r-- | other/bootstrap_serverdaemon/CMakeLists.txt | 6 | ||||
-rw-r--r-- | other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c | 11 | ||||
-rw-r--r-- | start_guide.de.md | 40 | ||||
-rw-r--r-- | start_guide.md | 38 | ||||
-rw-r--r-- | testing/DHT_cryptosendfiletest.c | 4 | ||||
-rw-r--r-- | testing/DHT_test.c | 2 | ||||
-rw-r--r-- | testing/Lossless_UDP_testclient.c | 2 | ||||
-rw-r--r-- | testing/Lossless_UDP_testserver.c | 2 | ||||
-rw-r--r-- | testing/misc_tools.h | 2 | ||||
-rw-r--r-- | testing/nTox.c | 24 | ||||
-rw-r--r-- | testing/nTox_win32.c | 1 | ||||
-rw-r--r-- | testing/toxic/prompt.c | 4 |
23 files changed, 263 insertions, 35 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c16ce6fe..9b7db143 100644..100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -1,11 +1,31 @@ | |||
1 | cmake_minimum_required(VERSION 2.6.0) | 1 | cmake_minimum_required(VERSION 2.6.0) |
2 | 2 | ||
3 | set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) | ||
4 | |||
5 | if(NOT WIN32) | ||
6 | option(USE_NACL "Use NaCl library instead of libsodium") | ||
7 | endif() | ||
8 | |||
9 | if(USE_NACL) | ||
10 | find_package(NaCl REQUIRED) | ||
11 | |||
12 | include_directories(${NACL_INCLUDE_DIR}) | ||
13 | add_definitions(-DVANILLA_NACL) | ||
14 | |||
15 | set(LINK_CRYPTO_LIBRARY ${NACL_LIBRARIES}) | ||
16 | endif() | ||
17 | |||
3 | #MinGW prints more warnings for -Wall than gcc does, thus causing build to fail | 18 | #MinGW prints more warnings for -Wall than gcc does, thus causing build to fail |
4 | if(NOT WIN32) | 19 | if(NOT WIN32) |
5 | if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) | 20 | if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) |
6 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") | 21 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") |
7 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") | 22 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") |
8 | endif() | 23 | endif() |
24 | find_package(SODIUM REQUIRED) | ||
25 | endif() | ||
26 | |||
27 | if(NOT USE_NACL) | ||
28 | set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARY}) | ||
9 | endif() | 29 | endif() |
10 | 30 | ||
11 | macro(linkCoreLibraries exe_name) | 31 | macro(linkCoreLibraries exe_name) |
@@ -16,8 +36,10 @@ macro(linkCoreLibraries exe_name) | |||
16 | ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a | 36 | ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a |
17 | ws2_32) | 37 | ws2_32) |
18 | else() | 38 | else() |
39 | include_directories(${SODIUM_INCLUDE_DIR}) | ||
19 | target_link_libraries(${exe_name} core | 40 | target_link_libraries(${exe_name} core |
20 | sodium) | 41 | ${LINK_CRYPTO_LIBRARY}) |
42 | |||
21 | endif() | 43 | endif() |
22 | endmacro() | 44 | endmacro() |
23 | 45 | ||
@@ -25,4 +47,4 @@ cmake_policy(SET CMP0011 NEW) | |||
25 | 47 | ||
26 | add_subdirectory(core) | 48 | add_subdirectory(core) |
27 | add_subdirectory(testing) | 49 | add_subdirectory(testing) |
28 | add_subdirectory(other) \ No newline at end of file | 50 | add_subdirectory(other) |
@@ -42,7 +42,17 @@ make | |||
42 | 42 | ||
43 | ###OSX: | 43 | ###OSX: |
44 | 44 | ||
45 | Much the same as above, remember to install the latest XCode and the developer tools (Preferences -> Downloads -> Command Line Tools). | 45 | ####Homebrew: |
46 | ``` | ||
47 | brew install libtool automake autoconf libconfig libsodium | ||
48 | cmake . | ||
49 | make | ||
50 | sudo make install | ||
51 | ``` | ||
52 | |||
53 | ####Non-homebrew: | ||
54 | |||
55 | Much the same as Linux, remember to install the latest XCode and the developer tools (Preferences -> Downloads -> Command Line Tools). | ||
46 | Users running Mountain Lion and the latest version of XCode (4.6.3) will also need to install libtool, automake and autoconf. | 56 | Users running Mountain Lion and the latest version of XCode (4.6.3) will also need to install libtool, automake and autoconf. |
47 | They are easy enough to install, grab them from http://www.gnu.org/software/libtool/, http://www.gnu.org/software/autoconf/ and http://www.gnu.org/software/automake/, then follow these steps for each: | 57 | They are easy enough to install, grab them from http://www.gnu.org/software/libtool/, http://www.gnu.org/software/autoconf/ and http://www.gnu.org/software/automake/, then follow these steps for each: |
48 | 58 | ||
@@ -20,14 +20,14 @@ With the rise of governmental monitoring programs, Tox aims to be an easy to use | |||
20 | + Every peer is represented as a byte string (the public key of the peer [client id]) | 20 | + Every peer is represented as a byte string (the public key of the peer [client id]) |
21 | + We're using torrent-style DHT so that peers can find the IP of the other peers when they have their ID. | 21 | + We're using torrent-style DHT so that peers can find the IP of the other peers when they have their ID. |
22 | + Once the client has the IP of that peer, they start initiating a secure connection with each other. (See [Crypto](https://github.com/irungentoo/ProjectTox-Core/wiki/Crypto)) | 22 | + Once the client has the IP of that peer, they start initiating a secure connection with each other. (See [Crypto](https://github.com/irungentoo/ProjectTox-Core/wiki/Crypto)) |
23 | + When both peers are securely connect with the encryption, they can securely exchange messages, initiate a video chat, send files, etc.<br /> | 23 | + When both peers are securely connected, they can exchange messages, initiate a video chat, send files, etc, all using encrypted communications.<br /> |
24 | + Current build status: [![Build Status](https://travis-ci.org/irungentoo/ProjectTox-Core.png?branch=master)](https://travis-ci.org/irungentoo/ProjectTox-Core) | 24 | + Current build status: [![Build Status](https://travis-ci.org/irungentoo/ProjectTox-Core.png?branch=master)](https://travis-ci.org/irungentoo/ProjectTox-Core) |
25 | 25 | ||
26 | ## Roadmap: | 26 | ## Roadmap: |
27 | - [x] Get our DHT working perfectly.(Done, needs large scale testing though.) | 27 | - [x] Get our DHT working perfectly.(Done, needs large scale testing though.) |
28 | - [x] Reliable connection (See Lossless_UDP protocol) to other peers according to client id. (Done, see DHT_sendfiletest.c for an example) | 28 | - [x] Reliable connection (See Lossless_UDP protocol) to other peers according to client id. (Done, see DHT_sendfiletest.c for an example) |
29 | - [x] Encryption. (Done) | 29 | - [x] Encryption. (Done) |
30 | - [ ] Get a simple text only im client working perfectly. (This is where we are) | 30 | - [ ] Get a simple text only IM client working perfectly. (This is where we are) |
31 | - [ ] Streaming media | 31 | - [ ] Streaming media |
32 | - [ ] ??? | 32 | - [ ] ??? |
33 | 33 | ||
diff --git a/cmake/FindLIBCONFIG.cmake b/cmake/FindLIBCONFIG.cmake new file mode 100644 index 00000000..d5018240 --- /dev/null +++ b/cmake/FindLIBCONFIG.cmake | |||
@@ -0,0 +1,15 @@ | |||
1 | # Find LIBCONFIG | ||
2 | # | ||
3 | # LIBCONFIG_INCLUDE_DIR | ||
4 | # LIBCONFIG_LIBRARY | ||
5 | # LIBCONFIG_FOUND | ||
6 | # | ||
7 | |||
8 | FIND_PATH(LIBCONFIG_INCLUDE_DIR NAMES libconfig.h) | ||
9 | |||
10 | FIND_LIBRARY(LIBCONFIG_LIBRARY NAMES config) | ||
11 | |||
12 | INCLUDE(FindPackageHandleStandardArgs) | ||
13 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBCONFIG DEFAULT_MSG LIBCONFIG_LIBRARY LIBCONFIG_INCLUDE_DIR) | ||
14 | |||
15 | MARK_AS_ADVANCED(LIBCONFIG_INCLUDE_DIR LIBCONFIG_LIBRARY) | ||
diff --git a/cmake/FindNaCl.cmake b/cmake/FindNaCl.cmake new file mode 100644 index 00000000..cdd6248a --- /dev/null +++ b/cmake/FindNaCl.cmake | |||
@@ -0,0 +1,17 @@ | |||
1 | find_path(NACL_INCLUDE_DIR crypto_box.h | ||
2 | $ENV{NACL_INCLUDE_DIR} /usr/include/nacl/ | ||
3 | DOC "Directory which contain NaCl headers") | ||
4 | |||
5 | find_path(NACL_LIBRARY_DIR libnacl.a | ||
6 | $ENV{NACL_LIBRARY_DIR} /usr/lib/nacl | ||
7 | DOC "Directory which contain libnacl.a, cpucycles.o, and randombytes.o") | ||
8 | |||
9 | if(NACL_LIBRARY_DIR) | ||
10 | set(NACL_LIBRARIES | ||
11 | "${NACL_LIBRARY_DIR}/cpucycles.o" | ||
12 | "${NACL_LIBRARY_DIR}/libnacl.a" | ||
13 | "${NACL_LIBRARY_DIR}/randombytes.o") | ||
14 | endif() | ||
15 | |||
16 | include(FindPackageHandleStandardArgs) | ||
17 | find_package_handle_standard_args(NaCl DEFAULT_MSG NACL_INCLUDE_DIR NACL_LIBRARY_DIR NACL_LIBRARIES) | ||
diff --git a/cmake/FindSODIUM.cmake b/cmake/FindSODIUM.cmake new file mode 100644 index 00000000..ffb6a1f7 --- /dev/null +++ b/cmake/FindSODIUM.cmake | |||
@@ -0,0 +1,15 @@ | |||
1 | # Find SODIUM | ||
2 | # | ||
3 | # SODIUM_INCLUDE_DIR | ||
4 | # SODIUM_LIBRARY | ||
5 | # SODIUM_FOUND | ||
6 | # | ||
7 | |||
8 | FIND_PATH(SODIUM_INCLUDE_DIR NAMES sodium.h) | ||
9 | |||
10 | FIND_LIBRARY(SODIUM_LIBRARY NAMES sodium) | ||
11 | |||
12 | INCLUDE(FindPackageHandleStandardArgs) | ||
13 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(SODIUM DEFAULT_MSG SODIUM_LIBRARY SODIUM_INCLUDE_DIR) | ||
14 | |||
15 | MARK_AS_ADVANCED(SODIUM_INCLUDE_DIR SODIUM_LIBRARY) | ||
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 420308d8..44ae980c 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt | |||
@@ -3,6 +3,8 @@ project(core C) | |||
3 | 3 | ||
4 | if(WIN32) | 4 | if(WIN32) |
5 | include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) | 5 | include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) |
6 | else(WIN32) | ||
7 | include_directories(${SODIUM_INCLUDE_DIR}) | ||
6 | endif() | 8 | endif() |
7 | 9 | ||
8 | set(core_sources | 10 | set(core_sources |
diff --git a/core/friend_requests.h b/core/friend_requests.h index e38f7edc..4dfc5130 100644 --- a/core/friend_requests.h +++ b/core/friend_requests.h | |||
@@ -48,4 +48,4 @@ int friendreq_handlepacket(uint8_t *packet, uint32_t length, IP_Port source); | |||
48 | } | 48 | } |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #endif \ No newline at end of file | 51 | #endif |
diff --git a/core/network.h b/core/network.h index 8af4b32f..3277070c 100644 --- a/core/network.h +++ b/core/network.h | |||
@@ -56,11 +56,7 @@ | |||
56 | /* we use libsodium by default */ | 56 | /* we use libsodium by default */ |
57 | #include <sodium.h> | 57 | #include <sodium.h> |
58 | #else | 58 | #else |
59 | 59 | #include <crypto_box.h> | |
60 | /* TODO: Including stuff like this is bad. This needs fixing. | ||
61 | We keep support for the original NaCl for now. */ | ||
62 | #include "../nacl/build/Linux/include/amd64/crypto_box.h" | ||
63 | |||
64 | #endif | 60 | #endif |
65 | 61 | ||
66 | #ifdef __cplusplus | 62 | #ifdef __cplusplus |
diff --git a/docs/commands.md b/docs/commands.md new file mode 100644 index 00000000..8669bb9b --- /dev/null +++ b/docs/commands.md | |||
@@ -0,0 +1,25 @@ | |||
1 | # Tox User Commands | ||
2 | Here's a list of commands that nTox accepts, | ||
3 | which can all be used by starting your line with | ||
4 | a */*. Currently there can be no spaces before this. | ||
5 | |||
6 | * */f* [ID] | ||
7 | + Add a friend with ID [ID]. | ||
8 | * */d* | ||
9 | + Call doMessenger() which does...something? | ||
10 | * */m* \[FRIEND\_NUM\] \[MESSAGE\] | ||
11 | + Message \[FRIEND\_NUM\] \[MESSAGE\]. | ||
12 | * */n* \[NAME\] | ||
13 | + Change your username to \[NAME\]. | ||
14 | * */l* | ||
15 | + Print your list of friends. (like you have any) | ||
16 | * */s* \[STATUS\] | ||
17 | + Set your status to \[STATUS\]. | ||
18 | * */a* \[ID\] | ||
19 | + Accept friend request from \[ID\]. | ||
20 | * */i* | ||
21 | + Print useful info about your client. | ||
22 | * */h* | ||
23 | + Print some help. | ||
24 | * */q/* | ||
25 | + Quit Tox. (why ;_;) | ||
diff --git a/docs/using_tox.md b/docs/using_tox.md new file mode 100644 index 00000000..b4f4310d --- /dev/null +++ b/docs/using_tox.md | |||
@@ -0,0 +1,38 @@ | |||
1 | # Using Tox | ||
2 | 1. Build Tox | ||
3 | 2. Fix errors | ||
4 | 3. Consult IRC for help | ||
5 | 4. Go on debugging journy for devs | ||
6 | 5. Build Tox for real | ||
7 | 6. ??? | ||
8 | |||
9 | For all the work we've put into Tox so far, | ||
10 | there isn't yet a decent guide for how you _use_ | ||
11 | Tox. Here's a user-friendly attempt at it. | ||
12 | |||
13 | 1. Connect to the network! | ||
14 | + You need to connect to a bootstrapping server, to give you a public key. | ||
15 | + Where can I find a public server? Right here, as of now: | ||
16 | (the help message from running nTox with no args will help) | ||
17 | + 198.46.136.167 33445 728925473812C7AAC482BE7250BCCAD0B8CB9F737BF3D42ABD34459C1768F854 | ||
18 | + 192.81.133.111 33445 8CD5A9BF0A6CE358BA36F7A653F99FA6B258FF756E490F52C1F98CC420F78858 | ||
19 | + 66.175.223.88 33445 AC4112C975240CAD260BB2FCD134266521FAAF0A5D159C5FD3201196191E4F5D | ||
20 | + 192.184.81.118 33445 5CD7EB176C19A2FD840406CD56177BB8E75587BB366F7BB3004B19E3EDC04143 | ||
21 | 2. Find a friend! | ||
22 | + Now that you're on the network, you need a friend. To get one of those, | ||
23 | you need to to send or receive a request. What's a request, you ask? | ||
24 | It's like a friend request, but we use really scary and cryptic numbers | ||
25 | instead of names. When nTox starts, it shows your _your_ long, scary number, | ||
26 | called your *public key*. Give that to people, and they can add you as | ||
27 | as "friend". Or, you can add someone else, with the */f* command, if you like. | ||
28 | 3. Chat it up! | ||
29 | + Now use the */m* command to send a message to someone. Wow, you're chatting! | ||
30 | 4. But something broke! | ||
31 | + Yeah, pre-alpha-alpha software tends to do that. We're working on it. | ||
32 | + Please report all crashes to either the github page, or #tox-dev on freenode. | ||
33 | 5. Nothing broke, but what does */f* mean? | ||
34 | + nTox parses text as a command if the first character is a forward-slash ('/'). | ||
35 | You can check all commands in commands.md. | ||
36 | 6. Use and support Tox! | ||
37 | + Code for us, debug for us, document for us, translate for us, even just talk about us! | ||
38 | + The more interest we get, the more work gets done, the better Tox is. | ||
diff --git a/other/bootstrap_serverdaemon/CMakeLists.txt b/other/bootstrap_serverdaemon/CMakeLists.txt index f675396d..512179f3 100644 --- a/other/bootstrap_serverdaemon/CMakeLists.txt +++ b/other/bootstrap_serverdaemon/CMakeLists.txt | |||
@@ -3,11 +3,15 @@ project(DHT_bootstrap_daemon C) | |||
3 | 3 | ||
4 | set(exe_name DHT_bootstrap_daemon) | 4 | set(exe_name DHT_bootstrap_daemon) |
5 | 5 | ||
6 | find_package(LIBCONFIG REQUIRED) | ||
7 | |||
8 | include_directories(${LIBCONFIG_INCLUDE_DIR}) | ||
9 | |||
6 | add_executable(${exe_name} | 10 | add_executable(${exe_name} |
7 | DHT_bootstrap_daemon.c) | 11 | DHT_bootstrap_daemon.c) |
8 | 12 | ||
9 | target_link_libraries(${exe_name} | 13 | target_link_libraries(${exe_name} |
10 | config) | 14 | ${LIBCONFIG_LIBRARY}) |
11 | 15 | ||
12 | linkCoreLibraries(${exe_name}) | 16 | linkCoreLibraries(${exe_name}) |
13 | 17 | ||
diff --git a/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c b/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c index 8e278b28..4f28fb3c 100644 --- a/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c +++ b/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c | |||
@@ -123,11 +123,12 @@ void manage_keys(char *keys_file) | |||
123 | { | 123 | { |
124 | const uint32_t KEYS_SIZE = crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES; | 124 | const uint32_t KEYS_SIZE = crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES; |
125 | uint8_t keys[KEYS_SIZE]; | 125 | uint8_t keys[KEYS_SIZE]; |
126 | 126 | struct stat existence; | |
127 | /* TODO: stat the file before trying to open it. We aren't cave people! */ | 127 | FILE *keysf; |
128 | FILE *keysf = fopen(keys_file, "r"); | 128 | |
129 | if (keysf != NULL) { | 129 | /* Check if file exits, proceed to open and load keys */ |
130 | /* if file was opened successfully -- load keys */ | 130 | if(stat(keys_file,&existence) >= 0) { |
131 | keysf = fopen(keys_file, "r"); | ||
131 | size_t read_size = fread(keys, sizeof(uint8_t), KEYS_SIZE, keysf); | 132 | size_t read_size = fread(keys, sizeof(uint8_t), KEYS_SIZE, keysf); |
132 | if (read_size != KEYS_SIZE) { | 133 | if (read_size != KEYS_SIZE) { |
133 | printf("Error while reading the key file\nExiting.\n"); | 134 | printf("Error while reading the key file\nExiting.\n"); |
diff --git a/start_guide.de.md b/start_guide.de.md new file mode 100644 index 00000000..7dfd52ca --- /dev/null +++ b/start_guide.de.md | |||
@@ -0,0 +1,40 @@ | |||
1 | # Tox nutzen | ||
2 | 1. Tox erstellen | ||
3 | 2. Fehler korrigieren | ||
4 | 3. Im IRC nach Hilfe fragen | ||
5 | 4. Auf Debug-Reise für Entwickler | ||
6 | 5. Tox wirklich erstellen | ||
7 | 6. ??? | ||
8 | |||
9 | Trotz der ganzen Arbeit, die wir bisher in Tox | ||
10 | gesteckt haben, gibt es noch keine richtige | ||
11 | Anleitung, wie man Tox _benutzt_. | ||
12 | Dies ist ein anwenderfreundlicher Versuch. | ||
13 | |||
14 | 1. Verbinde dich zum Netzwerk! | ||
15 | + Du musst dich zu einem Bootstrap-Server verbinden, um einen öffentlichen Schlüssel zu erhalten. | ||
16 | + Wo finde ich einen öffentlichen Server? Zur Zeit hier: | ||
17 | (die Hilfe-Nachricht von nTox ohne Kommandos hilft auch) | ||
18 | + 198.46.136.167 33445 728925473812C7AAC482BE7250BCCAD0B8CB9F737BF3D42ABD34459C1768F854 | ||
19 | + 192.81.133.111 33445 8CD5A9BF0A6CE358BA36F7A653F99FA6B258FF756E490F52C1F98CC420F78858 | ||
20 | + 66.175.223.88 33445 AC4112C975240CAD260BB2FCD134266521FAAF0A5D159C5FD3201196191E4F5D | ||
21 | + 192.184.81.118 33445 5CD7EB176C19A2FD840406CD56177BB8E75587BB366F7BB3004B19E3EDC04143 | ||
22 | 2. Finde einen Freund! | ||
23 | + Jetzt, da du im Netzwerk bist, brauchst du einen Freund. Um einen zu bekommen, | ||
24 | musst du eine Anfrage senden oder erhalten. Was eine Anfrage ist? | ||
25 | Es ist wie eine Freundschaftsanfrage, jedoch benutzen wir unglaublich schaurige | ||
26 | und kryptische Nummern anstatt Namen. When nTox startet, erscheint _deine_ lange, | ||
27 | schaurige Nummer, auch *öffentlicher Schlüssel* genannt. Diesen kannst du an | ||
28 | andere Personen weitergeben und sie können dich als "Freund" hinzufügen. Oder du | ||
29 | fügst andere Personen mit dem */f*-Befehl hinzu, wenn du möchtest. | ||
30 | 3. Chatte drauf los! | ||
31 | + Benutze nun den */m*-Befehl, um eine Nachricht an jemanden zu senden. Wow, du chattest! | ||
32 | 4. Mach etwas kaputt! | ||
33 | + Jep, pre-alpha-alpha-Software stürzt manchmal ab. Wir arbeiten daran. | ||
34 | + Bitte melde alle Abstürze entweder an die GitHub-Seite oder #tox-dev im freenode-IRC. | ||
35 | 5. Nichts ist kaputt, aber was bedeutet */f*? | ||
36 | + nTox liest einen Text als Befehl, wenn das erste Zeichen ein Schrägstrich ist ('/'). | ||
37 | Du kannst alle Befehle in commands.md nachlesen. | ||
38 | 6. Benutze und unterstütze Tox! | ||
39 | + Programmiere, debugge, dokumentiere, übersetze für uns, oder sprich einfach über uns! | ||
40 | + Je mehr Interesse wir erhalten, desto mehr Arbeit wird getan und desto besser wird Tox. | ||
diff --git a/start_guide.md b/start_guide.md new file mode 100644 index 00000000..b4f4310d --- /dev/null +++ b/start_guide.md | |||
@@ -0,0 +1,38 @@ | |||
1 | # Using Tox | ||
2 | 1. Build Tox | ||
3 | 2. Fix errors | ||
4 | 3. Consult IRC for help | ||
5 | 4. Go on debugging journy for devs | ||
6 | 5. Build Tox for real | ||
7 | 6. ??? | ||
8 | |||
9 | For all the work we've put into Tox so far, | ||
10 | there isn't yet a decent guide for how you _use_ | ||
11 | Tox. Here's a user-friendly attempt at it. | ||
12 | |||
13 | 1. Connect to the network! | ||
14 | + You need to connect to a bootstrapping server, to give you a public key. | ||
15 | + Where can I find a public server? Right here, as of now: | ||
16 | (the help message from running nTox with no args will help) | ||
17 | + 198.46.136.167 33445 728925473812C7AAC482BE7250BCCAD0B8CB9F737BF3D42ABD34459C1768F854 | ||
18 | + 192.81.133.111 33445 8CD5A9BF0A6CE358BA36F7A653F99FA6B258FF756E490F52C1F98CC420F78858 | ||
19 | + 66.175.223.88 33445 AC4112C975240CAD260BB2FCD134266521FAAF0A5D159C5FD3201196191E4F5D | ||
20 | + 192.184.81.118 33445 5CD7EB176C19A2FD840406CD56177BB8E75587BB366F7BB3004B19E3EDC04143 | ||
21 | 2. Find a friend! | ||
22 | + Now that you're on the network, you need a friend. To get one of those, | ||
23 | you need to to send or receive a request. What's a request, you ask? | ||
24 | It's like a friend request, but we use really scary and cryptic numbers | ||
25 | instead of names. When nTox starts, it shows your _your_ long, scary number, | ||
26 | called your *public key*. Give that to people, and they can add you as | ||
27 | as "friend". Or, you can add someone else, with the */f* command, if you like. | ||
28 | 3. Chat it up! | ||
29 | + Now use the */m* command to send a message to someone. Wow, you're chatting! | ||
30 | 4. But something broke! | ||
31 | + Yeah, pre-alpha-alpha software tends to do that. We're working on it. | ||
32 | + Please report all crashes to either the github page, or #tox-dev on freenode. | ||
33 | 5. Nothing broke, but what does */f* mean? | ||
34 | + nTox parses text as a command if the first character is a forward-slash ('/'). | ||
35 | You can check all commands in commands.md. | ||
36 | 6. Use and support Tox! | ||
37 | + Code for us, debug for us, document for us, translate for us, even just talk about us! | ||
38 | + The more interest we get, the more work gets done, the better Tox is. | ||
diff --git a/testing/DHT_cryptosendfiletest.c b/testing/DHT_cryptosendfiletest.c index c7c33531..888dac0f 100644 --- a/testing/DHT_cryptosendfiletest.c +++ b/testing/DHT_cryptosendfiletest.c | |||
@@ -186,7 +186,7 @@ int main(int argc, char *argv[]) | |||
186 | fclose(file2); | 186 | fclose(file2); |
187 | } | 187 | } |
188 | } | 188 | } |
189 | /* if buffer is empty and the connection timed out. */ | 189 | /* if buffer is empty and the connection timed out. */ |
190 | else if(is_cryptoconnected(inconnection) == 4) { | 190 | else if(is_cryptoconnected(inconnection) == 4) { |
191 | crypto_kill(inconnection); | 191 | crypto_kill(inconnection); |
192 | } | 192 | } |
@@ -209,7 +209,7 @@ int main(int argc, char *argv[]) | |||
209 | fclose(file2); | 209 | fclose(file2); |
210 | } | 210 | } |
211 | } | 211 | } |
212 | /* if buffer is empty and the connection timed out. */ | 212 | /* if buffer is empty and the connection timed out. */ |
213 | else if(is_cryptoconnected(connection) == 4) { | 213 | else if(is_cryptoconnected(connection) == 4) { |
214 | crypto_kill(connection); | 214 | crypto_kill(connection); |
215 | } | 215 | } |
diff --git a/testing/DHT_test.c b/testing/DHT_test.c index a215463d..588450e2 100644 --- a/testing/DHT_test.c +++ b/testing/DHT_test.c | |||
@@ -87,7 +87,7 @@ void print_friendlist() | |||
87 | for(i = 0; i < 4; i++) { | 87 | for(i = 0; i < 4; i++) { |
88 | printf("ClientID: "); | 88 | printf("ClientID: "); |
89 | for(j = 0; j < 32; j++) { | 89 | for(j = 0; j < 32; j++) { |
90 | if(0 <= friends_list[k].client_list[i].client_id[j] && friends_list[k].client_list[i].client_id[j] < 16) | 90 | if(friends_list[k].client_list[i].client_id[j] < 16) |
91 | printf("0"); | 91 | printf("0"); |
92 | printf("%hhX", friends_list[k].client_list[i].client_id[j]); | 92 | printf("%hhX", friends_list[k].client_list[i].client_id[j]); |
93 | } | 93 | } |
diff --git a/testing/Lossless_UDP_testclient.c b/testing/Lossless_UDP_testclient.c index c1eaa69d..b96756ab 100644 --- a/testing/Lossless_UDP_testclient.c +++ b/testing/Lossless_UDP_testclient.c | |||
@@ -211,4 +211,4 @@ int main(int argc, char *argv[]) | |||
211 | } | 211 | } |
212 | 212 | ||
213 | return 0; | 213 | return 0; |
214 | } \ No newline at end of file | 214 | } |
diff --git a/testing/Lossless_UDP_testserver.c b/testing/Lossless_UDP_testserver.c index 4b437f0e..29b0ade5 100644 --- a/testing/Lossless_UDP_testserver.c +++ b/testing/Lossless_UDP_testserver.c | |||
@@ -198,4 +198,4 @@ int main(int argc, char *argv[]) | |||
198 | } | 198 | } |
199 | 199 | ||
200 | return 0; | 200 | return 0; |
201 | } \ No newline at end of file | 201 | } |
diff --git a/testing/misc_tools.h b/testing/misc_tools.h index 29b37ce5..5079e15d 100644 --- a/testing/misc_tools.h +++ b/testing/misc_tools.h | |||
@@ -26,4 +26,4 @@ | |||
26 | 26 | ||
27 | unsigned char * hex_string_to_bin(char hex_string[]); | 27 | unsigned char * hex_string_to_bin(char hex_string[]); |
28 | 28 | ||
29 | #endif // MISC_TOOLS_H \ No newline at end of file | 29 | #endif // MISC_TOOLS_H |
diff --git a/testing/nTox.c b/testing/nTox.c index 54f973d0..29726a3a 100644 --- a/testing/nTox.c +++ b/testing/nTox.c | |||
@@ -35,8 +35,12 @@ | |||
35 | 35 | ||
36 | char lines[HISTORY][STRING_LENGTH]; | 36 | char lines[HISTORY][STRING_LENGTH]; |
37 | char line[STRING_LENGTH]; | 37 | char line[STRING_LENGTH]; |
38 | |||
39 | char *help = "[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)\n" | ||
40 | "[i] /l list (list friends), /h for help, /i for info, /n nick (to change nickname), /q (to quit)"; | ||
38 | int x, y; | 41 | int x, y; |
39 | 42 | ||
43 | |||
40 | uint8_t pending_requests[256][CLIENT_ID_SIZE]; | 44 | uint8_t pending_requests[256][CLIENT_ID_SIZE]; |
41 | uint8_t num_requests = 0; | 45 | uint8_t num_requests = 0; |
42 | 46 | ||
@@ -72,13 +76,14 @@ void print_friendlist() | |||
72 | 76 | ||
73 | char *format_message(char *message, int friendnum) | 77 | char *format_message(char *message, int friendnum) |
74 | { | 78 | { |
75 | char name[MAX_NAME_LENGTH]; | 79 | char name[MAX_NAME_LENGTH]; |
76 | if (friendnum != -1) { | 80 | if (friendnum != -1) { |
77 | getname(friendnum, (uint8_t*)name); | 81 | getname(friendnum, (uint8_t*)name); |
78 | } else { | 82 | } else { |
79 | getself_name((uint8_t*)name); | 83 | getself_name((uint8_t*)name); |
80 | } | 84 | } |
81 | char *msg = malloc(100+strlen(message)+strlen(name)+1); | 85 | char *msg = malloc(100+strlen(message)+strlen(name)+1); |
86 | |||
82 | time_t rawtime; | 87 | time_t rawtime; |
83 | struct tm * timeinfo; | 88 | struct tm * timeinfo; |
84 | time ( &rawtime ); | 89 | time ( &rawtime ); |
@@ -130,7 +135,7 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) | |||
130 | if (m_sendmessage(num, (uint8_t*) message, sizeof(message)) != 1) { | 135 | if (m_sendmessage(num, (uint8_t*) message, sizeof(message)) != 1) { |
131 | new_lines("[i] could not send message"); | 136 | new_lines("[i] could not send message"); |
132 | } else { | 137 | } else { |
133 | new_lines(format_message(message, -1)); | 138 | new_lines(format_message(message, -1)); |
134 | } | 139 | } |
135 | } | 140 | } |
136 | else if (inpt_command == 'n') { | 141 | else if (inpt_command == 'n') { |
@@ -394,8 +399,7 @@ int main(int argc, char *argv[]) | |||
394 | raw(); | 399 | raw(); |
395 | getmaxyx(stdscr, y, x); | 400 | getmaxyx(stdscr, y, x); |
396 | new_lines(idstring0); | 401 | new_lines(idstring0); |
397 | new_lines("[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)"); | 402 | new_lines(help); |
398 | new_lines("[i] /l list (list friends), /h for help, /i for info, /n nick (to change nickname), /q (to quit)"); | ||
399 | strcpy(line, ""); | 403 | strcpy(line, ""); |
400 | IP_Port bootstrap_ip_port; | 404 | IP_Port bootstrap_ip_port; |
401 | bootstrap_ip_port.port = htons(atoi(argv[2])); | 405 | bootstrap_ip_port.port = htons(atoi(argv[2])); |
diff --git a/testing/nTox_win32.c b/testing/nTox_win32.c index 27ab6a77..b7b6a70d 100644 --- a/testing/nTox_win32.c +++ b/testing/nTox_win32.c | |||
@@ -305,6 +305,7 @@ int main(int argc, char *argv[]) | |||
305 | on = 1; | 305 | on = 1; |
306 | } | 306 | } |
307 | doMessenger(); | 307 | doMessenger(); |
308 | Sleep(1); | ||
308 | } | 309 | } |
309 | return 0; | 310 | return 0; |
310 | } \ No newline at end of file | 311 | } \ No newline at end of file |
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c index 22d9eb9e..0cd10730 100644 --- a/testing/toxic/prompt.c +++ b/testing/toxic/prompt.c | |||
@@ -125,8 +125,8 @@ static void execute(ToxWindow* self, char* cmd) { | |||
125 | xx[2] = '\0'; | 125 | xx[2] = '\0'; |
126 | 126 | ||
127 | if(sscanf(xx, "%02x", &x) != 1) { | 127 | if(sscanf(xx, "%02x", &x) != 1) { |
128 | wprintw(self->window, "Invalid ID.\n"); | 128 | wprintw(self->window, "Invalid ID.\n"); |
129 | return; | 129 | return; |
130 | } | 130 | } |
131 | 131 | ||
132 | id_bin[i] = x; | 132 | id_bin[i] = x; |