mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fixed prev commit (mostly)
This commit is contained in:
parent
ed36428cbb
commit
5e3e8d5a5f
@ -320,6 +320,7 @@
|
||||
<ClInclude Include="include\pch.h" />
|
||||
<ClInclude Include="include\r5dev.h" />
|
||||
<ClInclude Include="include\structs.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\external\imgui\src\imgui.cpp">
|
||||
|
@ -551,6 +551,7 @@
|
||||
<ClInclude Include="include\gui_utility.h">
|
||||
<Filter>gui\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="r5dev.def">
|
||||
|
@ -97,7 +97,7 @@ void CCompanion::RefreshServerList()
|
||||
void CCompanion::SendHostingPostRequest()
|
||||
{
|
||||
HostToken = "";
|
||||
bool result = r5net.PostServerHost(HostRequestMessage, HostToken, ServerListing{ MyServer.name, std::string(GameGlobals::HostState->m_levelName), GameGlobals::Cvar->FindVar("hostport")->m_pzsCurrentValue, MyServer.password });
|
||||
bool result = r5net.PostServerHost(HostRequestMessage, HostToken, ServerListing{ MyServer.name, std::string(GameGlobals::HostState->m_levelName), "", GameGlobals::Cvar->FindVar("hostport")->m_pzsCurrentValue, MyServer.password});
|
||||
if (result)
|
||||
{
|
||||
HostRequestMessageColor = ImVec4(0.00f, 1.00f, 0.00f, 1.00f);
|
||||
@ -150,7 +150,7 @@ void CCompanion::ServerBrowserSection()
|
||||
|
||||
const float FooterHeight = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing();
|
||||
ImGui::BeginChild("ServerListChild", { 0, -FooterHeight }, true, ImGuiWindowFlags_AlwaysVerticalScrollbar);
|
||||
ImGui::BeginTable("##ServerBrowser_ServerList", 4, ImGuiTableFlags_Resizable);
|
||||
if(ImGui::BeginTable("##ServerBrowser_ServerList", 4, ImGuiTableFlags_Resizable))
|
||||
{
|
||||
ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthStretch, 35);
|
||||
ImGui::TableSetupColumn("Map", ImGuiTableColumnFlags_WidthStretch, 25);
|
||||
@ -183,18 +183,19 @@ void CCompanion::ServerBrowserSection()
|
||||
|
||||
if (ImGui::Button(selectButtonText.c_str()))
|
||||
{
|
||||
//server->Select();
|
||||
ConnectToServer(server.ip, server.port);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
ImGui::EndTable();
|
||||
}
|
||||
ImGui::EndTable();
|
||||
ImGui::EndChild();
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::InputTextWithHint("##ServerBrowser_ServerConnString", "Enter IP address or \"localhost\"", ServerConnStringBuffer, IM_ARRAYSIZE(ServerConnStringBuffer));
|
||||
|
||||
ImGui::Text("hello");
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button("Connect", ImVec2(ImGui::GetWindowContentRegionWidth() * (1.f / 3.f /2.f), 19)))
|
||||
|
@ -19,6 +19,7 @@ namespace R5Net
|
||||
Client(std::string serverString) : m_HttpClient(serverString.c_str())
|
||||
{
|
||||
m_HttpClient.set_connection_timeout(10);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "pch.h"
|
||||
#include "netpch.h"
|
||||
|
||||
struct ServerListing
|
||||
{
|
||||
|
@ -19,12 +19,12 @@
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\pch.h" />
|
||||
<ClInclude Include="include\netpch.h" />
|
||||
<ClInclude Include="include\r5net.h" />
|
||||
<ClInclude Include="include\serverlisting.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\pch.cpp">
|
||||
<ClCompile Include="src\netpch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
@ -142,7 +142,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderFile>netpch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@ -160,7 +160,7 @@
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderFile>netpch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<ClInclude Include="include\serverlisting.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\pch.h">
|
||||
<ClInclude Include="include\netpch.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
@ -26,7 +26,7 @@
|
||||
<ClCompile Include="src\serverlisting.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\pch.cpp">
|
||||
<ClCompile Include="src\netpch.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
|
3
r5net/src/netpch.cpp
Normal file
3
r5net/src/netpch.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "netpch.h"
|
@ -1,3 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "pch.h"
|
@ -1,7 +1,7 @@
|
||||
// r5net.cpp : Defines the functions for the static library.
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "netpch.h"
|
||||
#include "r5net.h"
|
||||
|
||||
|
||||
@ -77,10 +77,10 @@ bool R5Net::Client::GetServerByToken(ServerListing& outServer, std::string& outE
|
||||
if (res && resBody["success"].is_boolean() && resBody["success"])
|
||||
{
|
||||
outServer = ServerListing{
|
||||
reqBody["name"].get<std::string>(),
|
||||
reqBody["map"].get<std::string>(),
|
||||
reqBody["ip"].get<std::string>(),
|
||||
reqBody["port"].get<std::string>()
|
||||
resBody["server"]["name"].get<std::string>(),
|
||||
resBody["server"]["map"].get<std::string>(),
|
||||
resBody["server"]["ip"].get<std::string>(),
|
||||
resBody["server"]["port"].get<std::string>()
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
#include "pch.h"
|
||||
#include "netpch.h"
|
||||
|
||||
#include "serverlisting.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user