Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of documentation or CMake. #227

Open
JG-Adams opened this issue Feb 8, 2025 · 1 comment
Open

Lack of documentation or CMake. #227

JG-Adams opened this issue Feb 8, 2025 · 1 comment

Comments

@JG-Adams
Copy link

JG-Adams commented Feb 8, 2025

I'm interested in using this because it appears to be quite easy enough to use and it has the important focus on game itself with UDP. But it's missing some crucial informations.

No information for Connect() or to Generate connectToken. And Unexplained missing privateKey and serverAddresses

I noticed the InsecureConnect and the Connect so I figured that the Connect is the encrypted variant of connection. However I found myself confused by the different set of parameters. No private key or server Address in Connect(). There is no information provided for any of these thing. Yet I tried to do it anyway and it simply crashed. So I have no guidance whatsoever on how to get Connect() to work. Not even AI knows what to do here.

Unexplained feature creep

There is also some confusion of features. In test.cpp there are CreateClients() and ConnectClients() for example. But in other .cpp it doesn't use those and it seems like a complete program I can use. There is no explanation for these things.
However, I do see it being used inside InsecureConnect() and Connect(). So what is the point here?

No generate for privateKey

privateKey is set to all zeros for some reason. It is not explained what it's for. There is never an example of it being generated. And if I were to generate it, I don't have a clues where to start.

No explanation for loopback

loopback is not explained at all. I have no clue what it's for.

Suggestion:

  • Please give each functions a comment descriptions for each parameters that needs to be explained.
  • Provide suggestion of what functions to use if a function requires it.
  • Explain how Secure connect is used.

CMake

Now when it comes to CMake this is the only thing I can use.
I made mine work by doing this.

includes all necessary files

include_directories(${PROJECT_NAME} PUBLIC "include/")
include_directories(${PROJECT_NAME} PUBLIC "sodium/")
include_directories(${PROJECT_NAME} PUBLIC "tlsf/")
include_directories(${PROJECT_NAME} PUBLIC "netcode/")
include_directories(${PROJECT_NAME} PUBLIC "reliable/")
include_directories(${PROJECT_NAME} PUBLIC "serialize/")

get all cpp-files

file(GLOB_RECURSE SRC_FILES
source/.cpp
sodium/
.c
netcode/netcode.c
reliable/reliable.c
tlsf/tlsf.c
CMAKE_CONFIGURE_DEPENDS)
project(Network VERSION 0.0.1)
add_executable(${PROJECT_NAME} ${SRC_FILES} client.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE mingw32 wsock32 ws2_32 sodium qwave)
project(Network_server VERSION 0.0.1)
add_executable(${PROJECT_NAME} ${SRC_FILES} server.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE mingw32 wsock32 ws2_32 sodium qwave)

NOTE: I am using MinGW so that's where the mingw32 comes from.
Every CPP file works except for test.cpp It has undefined functions that I'm unable to find.

@JG-Adams
Copy link
Author

JG-Adams commented Feb 9, 2025

I figured out how to get test.cpp to work.
It needed these macros.

target_compile_definitions ( ${PROJECT_NAME} PUBLIC
SERIALIZE_ENABLE_TESTS
RELIABLE_ENABLE_TESTS
NETCODE_ENABLE_TESTS
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant