mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-08 08:46:04 +00:00
Fixed windows build not compiling
This commit is contained in:
committed by
Anonymous275
parent
f13523fbe5
commit
218504e674
@@ -178,11 +178,11 @@ void SafeExecution(TLuaEngine& Engine, TLuaFile* lua, const std::string& FuncNam
|
||||
if (lua_isfunction(luaState, -1)) {
|
||||
char* Origin = ThreadOrigin(lua);
|
||||
#ifdef WIN32
|
||||
__try {
|
||||
//__try {
|
||||
int R = lua_pcall(luaState, 0, 0, 0);
|
||||
CheckLua(luaState, R);
|
||||
} __except (Handle(GetExceptionInformation(), Origin)) {
|
||||
}
|
||||
/*} __except (Handle(GetExceptionInformation(), Origin)) {
|
||||
}*/
|
||||
#else // unix
|
||||
int R = lua_pcall(luaState, 0, 0, 0);
|
||||
CheckLua(luaState, R);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "CustomAssert.h"
|
||||
#include "TTCPServer.h"
|
||||
#include <any>
|
||||
#include <array>
|
||||
#include <cstring>
|
||||
#include <utility>
|
||||
|
||||
@@ -119,7 +120,7 @@ void TUDPServer::UDPSend(TClient& Client, std::string Data) const {
|
||||
return;
|
||||
}
|
||||
sockaddr_in Addr = Client.GetUDPAddr();
|
||||
socklen_t AddrSize = sizeof(Client.GetUDPAddr());
|
||||
auto AddrSize = sizeof(Client.GetUDPAddr());
|
||||
if (Data.length() > 400) {
|
||||
std::string CMP(Comp(Data));
|
||||
Data = "ABG:" + CMP;
|
||||
@@ -159,7 +160,12 @@ void TUDPServer::UDPSend(TClient& Client, std::string Data) const {
|
||||
std::string TUDPServer::UDPRcvFromClient(sockaddr_in& client) const {
|
||||
size_t clientLength = sizeof(client);
|
||||
std::array<char, 1024> Ret {};
|
||||
#ifdef WIN32
|
||||
int64_t Rcv = recvfrom(mUDPSock, Ret.data(), Ret.size(), 0, (sockaddr*)&client, (int*)&clientLength);
|
||||
#else // unix
|
||||
int64_t Rcv = recvfrom(mUDPSock, Ret.data(), Ret.size(), 0, (sockaddr*)&client, (socklen_t*)&clientLength);
|
||||
#endif // WIN32
|
||||
|
||||
if (Rcv == -1) {
|
||||
#ifdef WIN32
|
||||
error(("(UDP) Error receiving from Client! Code : ") + std::to_string(WSAGetLastError()));
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
#include "TUDPServer.h"
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
#include <TTCPServer.h>
|
||||
|
||||
#ifdef __unix
|
||||
#include <TTCPServer.h>
|
||||
#include <csignal>
|
||||
|
||||
void UnixSignalHandler(int sig) {
|
||||
|
||||
Reference in New Issue
Block a user