From be3767b15e510f81ea4199417f72883d285053e4 Mon Sep 17 00:00:00 2001 From: lotodore Date: Sat, 29 Jan 2011 16:35:04 +0000 Subject: [PATCH] Make test cases ipv4 compatible (they were ipv6 only...) --- src/net/common/serverlobbythread.cpp | 2 ++ tests/src/pokerth_test/RunRankingGameTest.java | 2 +- tests/src/pokerth_test/TestBase.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 708bd7dc..a28228dd 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -66,6 +66,7 @@ #define SERVER_SESSION_ACTIVITY_TIMEOUT_SEC 1800 // 30 min, MUST be > SERVER_TIMEOUT_WARNING_REMAINING_SEC #define SERVER_SESSION_FORCED_TIMEOUT_SEC 86400 // 1 day, should be quite large. +#define SERVER_ADDRESS_LOCALHOST_STR_V4 "::ffff:127.0.0.1" #define SERVER_ADDRESS_LOCALHOST_STR "::1" #define SERVER_STATISTICS_FILE_NAME "server_statistics.log" @@ -1425,6 +1426,7 @@ ServerLobbyThread::HandleNetPacketJoinGame(SessionWrapper session, const std::st } else if (tmpData.gameType == GAME_TYPE_RANKING && session.sessionData->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR + && session.sessionData->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4 && game.IsClientAddressConnected(session.sessionData->GetClientAddr())) { SendJoinGameFailed(session.sessionData, joinGame.gameId, NTF_NET_JOIN_IP_BLOCKED); diff --git a/tests/src/pokerth_test/RunRankingGameTest.java b/tests/src/pokerth_test/RunRankingGameTest.java index f257bfe6..a257cc0b 100644 --- a/tests/src/pokerth_test/RunRankingGameTest.java +++ b/tests/src/pokerth_test/RunRankingGameTest.java @@ -130,7 +130,7 @@ public class RunRankingGameTest extends TestBase { Socket s[] = new Socket[9]; long playerId[] = new long[9]; for (int i = 0; i < 9; i++) { - s[i] = new Socket("::1", 7234); + s[i] = new Socket("localhost", 7234); String username = "test" + (i+1); String password = username; playerId[i] = userInit(s[i], username, password); diff --git a/tests/src/pokerth_test/TestBase.java b/tests/src/pokerth_test/TestBase.java index ca1050c9..f5404258 100644 --- a/tests/src/pokerth_test/TestBase.java +++ b/tests/src/pokerth_test/TestBase.java @@ -54,7 +54,7 @@ public abstract class TestBase { @Before public void setUp() throws Exception { Thread.sleep(2000); - sock = new Socket("::1", 7234); + sock = new Socket("localhost", 7234); encoder = CoderFactory.getInstance().newEncoder("BER"); decoder = CoderFactory.getInstance().newDecoder("BER"); }