mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2025-08-18 12:45:36 +00:00
Windows compile fix
This commit is contained in:
parent
36db73b562
commit
fbbdc084a4
@ -13,8 +13,6 @@ elseif (WIN32)
|
|||||||
# completely cross platform. For fixes to common issues arising from /permissive- visit:
|
# completely cross platform. For fixes to common issues arising from /permissive- visit:
|
||||||
# https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance
|
# https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /permissive-")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /permissive-")
|
||||||
# disables warnings about _s variants of stdc functions
|
|
||||||
add_definitions(_CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE)
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
find_package(Boost 1.71.0 REQUIRED COMPONENTS system thread)
|
find_package(Boost 1.71.0 REQUIRED COMPONENTS system thread)
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include <future>
|
#include <future>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
std::unique_ptr<LuaArg> CreateArg(lua_State* L, int T, int S) {
|
std::unique_ptr<LuaArg> CreateArg(lua_State* L, int T, int S) {
|
||||||
if (S > T)
|
if (S > T)
|
||||||
@ -566,21 +567,13 @@ int CallFunction(Lua* lua, const std::string& FuncName, std::unique_ptr<LuaArg>
|
|||||||
Size = int(Arg->args.size());
|
Size = int(Arg->args.size());
|
||||||
Arg->PushArgs(luaState);
|
Arg->PushArgs(luaState);
|
||||||
}
|
}
|
||||||
int R = 0;
|
|
||||||
std::string Origin = lua->GetOrigin();
|
std::string Origin = lua->GetOrigin();
|
||||||
#ifdef WIN32
|
int R = lua_pcall(luaState, Size, 1, 0);
|
||||||
__try {
|
if (CheckLua(luaState, R)) {
|
||||||
#endif // WIN32
|
if (lua_isnumber(luaState, -1)) {
|
||||||
R = lua_pcall(luaState, Size, 1, 0);
|
return int(lua_tointeger(luaState, -1));
|
||||||
if (CheckLua(luaState, R)) {
|
|
||||||
if (lua_isnumber(luaState, -1)) {
|
|
||||||
return int(lua_tointeger(luaState, -1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#ifdef WIN32
|
|
||||||
} __except (Handle(GetExceptionInformation(), Origin.data())) {
|
|
||||||
}
|
}
|
||||||
#endif // WIN32
|
|
||||||
}
|
}
|
||||||
ClearStack(luaState);
|
ClearStack(luaState);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -71,13 +71,7 @@ void TCPClient(Client*c){
|
|||||||
}
|
}
|
||||||
OnConnect(c);
|
OnConnect(c);
|
||||||
while (c->GetStatus() > -1)TCPRcv(c);
|
while (c->GetStatus() > -1)TCPRcv(c);
|
||||||
#ifdef WIN32
|
OnDisconnect(c, c->GetStatus() == -2);
|
||||||
__try{
|
|
||||||
#endif // WIN32
|
|
||||||
OnDisconnect(c, c->GetStatus() == -2);
|
|
||||||
#ifdef WIN32
|
|
||||||
}__except(Handle(GetExceptionInformation(),Sec("OnDisconnect"))){}
|
|
||||||
#endif // WIN32
|
|
||||||
}
|
}
|
||||||
void InitClient(Client*c){
|
void InitClient(Client*c){
|
||||||
std::thread NewClient(TCPClient,c);
|
std::thread NewClient(TCPClient,c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user