diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..530cacd9 --- /dev/null +++ b/.clang-format @@ -0,0 +1,36 @@ +--- +# Use defaults from the GNU style, but with 4 columns indentation. +BasedOnStyle: LLVM +UseTab: Always +IndentWidth: 4 +TabWidth: 4 +--- +Language: Cpp + +# Force pointers to the type for C++. +DerivePointerAlignment: false +PointerAlignment: Left + +# Indent all namespaces +NamespaceIndentation: All + +# Do not enforce a column limit +ColumnLimit: 0 + +# Allow short statements on one line +AllowShortIfStatementsOnASingleLine: AllIfsAndElse +AllowShortLoopsOnASingleLine: true +AllowShortBlocksOnASingleLine: Always +AllowShortEnumsOnASingleLine: true +AllowShortFunctionsOnASingleLine: true + +# Do not remove braces on short statements +RemoveBracesLLVM: false + +# Add spaces between braces and contents +Cpp11BracedListStyle: false + +# Brace wrapping rules +# BreakBeforeBraces: Custom +# BraceWrapping: +# BraceWrappingAfterControlStatementStyle: MultiLine diff --git a/dNet/AuthPackets.cpp b/dNet/AuthPackets.cpp index a2bf731c..184dc205 100644 --- a/dNet/AuthPackets.cpp +++ b/dNet/AuthPackets.cpp @@ -63,7 +63,7 @@ void AuthPackets::HandleHandshake(dServer* server, Packet* packet) { if (port != packet->systemAddress.port) LOG("WARNING: Port written in packet does not match the port the client is connecting over!"); inStream.IgnoreBytes(33); - + LOG_DEBUG("Client Data [Version: %i, Service: %s, Process: %u, Port: %u, Sysaddr Port: %u]", clientVersion, StringifiedEnum::ToString(serviceId).data(), processID, port, packet->systemAddress.port); SendHandshake(server, packet->systemAddress, server->GetIP(), server->GetPort(), server->GetServerType()); @@ -72,7 +72,7 @@ void AuthPackets::HandleHandshake(dServer* server, Packet* packet) { void AuthPackets::SendHandshake(dServer* server, const SystemAddress& sysAddr, const std::string& nextServerIP, uint16_t nextServerPort, const ServerType serverType) { RakNet::BitStream bitStream; BitStreamUtils::WriteHeader(bitStream, eConnectionType::SERVER, eServerMessageType::VERSION_CONFIRM); - + const auto clientNetVersionString = Game::config->GetValue("client_net_version"); const uint32_t clientNetVersion = GeneralUtils::TryParse(clientNetVersionString).value_or(171022);