From dfa8683c473395a83d6b9ae7416bb1764a011ba1 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sun, 23 Aug 2015 19:41:01 +1000 Subject: [PATCH] Tweaks for windows --- client/makefile | 2 +- client/menu_scenes/lobby_menu.cpp | 3 ++- server/makefile | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/makefile b/client/makefile index 1bf8ddb..bbba8d9 100644 --- a/client/makefile +++ b/client/makefile @@ -3,7 +3,7 @@ INCLUDES+=. client_utilities entities gameplay_scenes menu_scenes ../common/debu #libraries #the order of the $(LIBS) is important, at least for MinGW -LIBS+=client.a ../common/libcommon.a -lSDL_net +LIBS+=client.a ../common/libcommon.a -lSDL2_net ifeq ($(OS),Windows_NT) LIBS+=-lwsock32 -liphlpapi -lmingw32 endif diff --git a/client/menu_scenes/lobby_menu.cpp b/client/menu_scenes/lobby_menu.cpp index 8481e2f..6740dc1 100644 --- a/client/menu_scenes/lobby_menu.cpp +++ b/client/menu_scenes/lobby_menu.cpp @@ -23,6 +23,7 @@ #include "channels.hpp" +#include #include #include @@ -307,7 +308,7 @@ void LobbyMenu::SendLoginRequest() { ClientPacket packet; packet.type = SerialPacketType::LOGIN_REQUEST; packet.clientIndex = clientIndex; - strncpy(packet.username, config["client.username"].c_str(), PACKET_STRING_SIZE); + strncpy(packet.username, config["client.username"].c_str(), PACKET_STRING_SIZE+1); network.SendTo(Channels::SERVER, &packet); } diff --git a/server/makefile b/server/makefile index 9fab003..77053cf 100644 --- a/server/makefile +++ b/server/makefile @@ -1,13 +1,13 @@ #include directories -INCLUDES+=SDL . accounts characters clients entities rooms server_utilities triggers ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities +INCLUDES+=. accounts characters clients entities rooms server_utilities triggers ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities #libraries #the order of the $(LIBS) is important, at least for MinGW -LIBS+=server.a ../common/libcommon.a -lSDL_net +LIBS+=server.a ../common/libcommon.a -lSDL2_net ifeq ($(OS),Windows_NT) LIBS+=-lwsock32 -liphlpapi -lmingw32 endif -LIBS+=-lSDLmain -lSDL -llua -lsqlite3 +LIBS+=-lSDL2main -lSDL2 -llua -lsqlite3 ifeq ($(shell uname), Linux) #I don't know what this does, but Ubuntu needs it (dynamic linking for lua) LIBS+=-ldl