Skip to content

Commit 137e9dd

Browse files
authored
Merge pull request supertuxkart#4056 from risostk/clean_IPV4_typo
Clean IPV4/ipv4 to IPv4, IPV6/ipv6 to IPv6
2 parents 84b8fe0 + 0e4f875 commit 137e9dd

File tree

17 files changed

+50
-50
lines changed

17 files changed

+50
-50
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ option(SERVER_ONLY "Create a server only (i.e. no graphics or sound)" OFF)
2222
option(CHECK_ASSETS "Check if assets are installed in ../stk-assets" ON)
2323
option(USE_SYSTEM_ANGELSCRIPT "Use system angelscript instead of built-in angelscript. If you enable this option, make sure to use a compatible version." OFF)
2424
option(USE_SYSTEM_ENET "Use system ENet instead of the built-in version, when available." ON)
25-
option(USE_IPV6 "Allow create or connect to game server with ipv6 address, system enet will not be used." ON)
25+
option(USE_IPV6 "Allow create or connect to game server with IPv6 address, system enet will not be used." ON)
2626
option(USE_SYSTEM_GLEW "Use system GLEW instead of the built-in version, when available." ON)
2727
option(USE_SYSTEM_WIIUSE "Use system WiiUse instead of the built-in version, when available." OFF)
2828
option(USE_SQLITE3 "Use sqlite to manage server stats and ban list." ON)

NETWORKING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The current server configuration xml looks like this:
7878
<!-- Disable it to turn off all stun related code in server, it allows saving server resource if your server is not behind a firewall. -->
7979
<firewalled-server value="true" />
8080

81-
<!-- Enable to allow ipv6 connection if you have a public ipv6 address. STK currently use dual-stack mode which requires server to have both ipv4 and ipv6 and listen to same port, firewalled-server will be disabled so you need to make sure this server has port forward configured properly if needed. -->
81+
<!-- Enable to allow IPv6 connection if you have a public IPv6 address. STK currently use dual-stack mode which requires server to have both IPv4 and IPv6 and listen to same port, firewalled-server will be disabled so you need to make sure this server has port forward configured properly if needed. -->
8282
<ipv6-server value="false" />
8383

8484
<!-- No server owner in lobby which can control the starting of game or kick any players. -->
@@ -224,9 +224,9 @@ You have the best gaming experience when choosing server having all players less
224224

225225
Currently STK uses sqlite (if building with sqlite3 on) for server management with the following functions at the moment:
226226
1. Server statistics
227-
2. IPV4 / online ID ban list
227+
2. IPv4 / online ID ban list
228228
3. Player reports
229-
4. IPV4 geolocation
229+
4. IPv4 geolocation
230230

231231
You need to create a database in sqlite first, run `sqlite3 stkservers.db` in the folder where (all) your server_config.xml(s) located.
232232

@@ -236,7 +236,7 @@ CREATE TABLE IF NOT EXISTS (table name above)
236236
(
237237
host_id INTEGER UNSIGNED NOT NULL PRIMARY KEY, -- Unique host id in STKHost of each connection session for a STKPeer
238238
ip INTEGER UNSIGNED NOT NULL, -- IP decimal of host
239-
ipv6 TEXT NOT NULL DEFAULT '', -- IPV6 (if exists) in string of host (only created if ipv6 server)
239+
ipv6 TEXT NOT NULL DEFAULT '', -- IPv6 (if exists) in string of host (only created if IPv6 server)
240240
port INTEGER UNSIGNED NOT NULL, -- Port of host
241241
online_id INTEGER UNSIGNED NOT NULL, -- Online if of the host (0 for offline account)
242242
username TEXT NOT NULL, -- First player name in the host (if the host has splitscreen player)
@@ -273,7 +273,7 @@ CREATE TABLE IF NOT EXISTS (table name above)
273273

274274
If you want to see flags and readable names of countries in the above views, you need to initialize `v(server database version)_countries` table, check [this script](tools/generate-countries-table.py).
275275

276-
For IPV4 and online ID ban list, player reports or IP mapping, you need to create one yourself:
276+
For IPv4 and online ID ban list, player reports or IP mapping, you need to create one yourself:
277277
```sql
278278
CREATE TABLE ip_ban
279279
(
@@ -302,13 +302,13 @@ CREATE TABLE player_reports
302302
(
303303
server_uid TEXT NOT NULL, -- Report from which server unique id (config filename)
304304
reporter_ip INTEGER UNSIGNED NOT NULL, -- IP decimal of player who reports
305-
reporter_ipv6 TEXT NOT NULL DEFAULT '', -- IPV6 (if exists) in string of player who reports (only needed for ipv6 server)
305+
reporter_ipv6 TEXT NOT NULL DEFAULT '', -- IPv6 (if exists) in string of player who reports (only needed for IPv6 server)
306306
reporter_online_id INTEGER UNSIGNED NOT NULL, -- Online id of player who reports, 0 for offline player
307307
reporter_username TEXT NOT NULL, -- Player name who reports
308308
reported_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- Time of reporting
309309
info TEXT NOT NULL, -- Report info by reporter
310310
reporting_ip INTEGER UNSIGNED NOT NULL, -- IP decimal of player being reported
311-
reporting_ipv6 TEXT NOT NULL DEFAULT '', -- IPV6 (if exists) in string of player who reports (only needed for ipv6 server)
311+
reporting_ipv6 TEXT NOT NULL DEFAULT '', -- IPv6 (if exists) in string of player who reports (only needed for IPv6 server)
312312
reporting_online_id INTEGER UNSIGNED NOT NULL, -- Online id of player being reported, 0 for offline player
313313
reporting_username TEXT NOT NULL -- Player name being reported
314314
);

data/gui/screens/online/server_selection.stkgui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<checkbox width="fit" id="ipv6" text_align="left"/>
2323
<spacer width="10"/>
2424
<label proportion="1" height="100%" text_align="left"
25-
I18N="In the server selection screen" text="Use IPV6 connection if server supports"/>
25+
I18N="In the server selection screen" text="Use IPv6 connection if server supports"/>
2626
</div>
2727
</div>
2828
</div>

lib/enet/unix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ enet_socket_create (ENetSocketType type)
271271
if (isIPV6() && socket_fd != -1)
272272
{
273273
int no = 0;
274-
// Allow ipv6 socket listen to ipv4 connection (as long as the host has ipv4 address)
274+
// Allow IPv6 socket listen to IPv4 connection (as long as the host has IPv4 address)
275275
int ret = setsockopt(socket_fd, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&no, sizeof(no));
276276
if (ret != 0)
277277
{

lib/enet/win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ enet_socket_create (ENetSocketType type)
204204
if (isIPV6() && socket_fd != INVALID_SOCKET)
205205
{
206206
int no = 0;
207-
// Allow ipv6 socket listen to ipv4 connection (as long as the host has ipv4 address)
207+
// Allow IPv6 socket listen to IPv4 connection (as long as the host has IPv4 address)
208208
int ret = setsockopt(socket_fd, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&no, sizeof(no));
209209
if (ret != 0)
210210
{

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ void cmdLineHelp()
612612
" --connect-now=ip Connect to a server with IP known now\n"
613613
" (in format x.x.x.x:xxx(port)), the port should be its\n"
614614
" public port.\n"
615-
" --connect-now6=ip Connect to a server with IPV6 known now\n"
615+
" --connect-now6=ip Connect to a server with IPv6 known now\n"
616616
" (in format [x:x:x:x:x:x:x:x]:xxx(port)), the port should be its\n"
617617
" public port.\n"
618618
" --server-id=n Server id in stk addons for --connect-now.\n"

src/network/ios_ipv6.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// along with this program; if not, write to the Free Software
1616
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717

18-
// Minimum code to allow iOS device to connect to ipv4 non-firewalled game server
18+
// Minimum code to allow iOS device to connect to IPv4 non-firewalled game server
1919

2020
#ifdef IOS_STK
2121

@@ -266,9 +266,9 @@ namespace Mars
266266
}
267267

268268
// ============================================================================
269-
/** Return 1 if this iOS device has only IPV6 address, in this case we always
269+
/** Return 1 if this iOS device has only IPv6 address, in this case we always
270270
* create inet6 socket in enet and try to use the NAT64 (provided by iOS)
271-
* to connect to ipv4 server. */
271+
* to connect to IPv4 server. */
272272
int isIPV6Only()
273273
{
274274
using namespace Mars;

src/network/network_console.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void mainLoop(STKHost* host)
9191
peer->kick();
9292
// ATM use permanently ban
9393
auto sl = LobbyProtocol::get<ServerLobby>();
94-
// We don't support banning ipv6 address atm
94+
// We don't support banning IPv6 address atm
9595
if (sl && peer->getIPV6Address().empty())
9696
sl->saveIPBanTable(peer->getAddress());
9797
}

src/network/protocols/connect_to_server.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ void ConnectToServer::asynchronousUpdate()
226226
}
227227
if (m_server->useIPV6Connection())
228228
{
229-
// Disable STUN if using ipv6 (check in setPublicAddress)
229+
// Disable STUN if using IPv6 (check in setPublicAddress)
230230
setIPV6(1);
231231
}
232232
if (m_server->supportsEncryption())
@@ -265,10 +265,10 @@ void ConnectToServer::asynchronousUpdate()
265265
// direct connection to server first, if failed than use the one
266266
// that has stun mapped, the first 8 seconds allow the server to
267267
// start the connect to peer protocol first before the port is
268-
// remapped. IPV6 has no stun so try once with any port
268+
// remapped. IPv6 has no stun so try once with any port
269269
if (isIPV6())
270270
{
271-
if (!tryConnect(2000, 15, true/*another_port*/, true/*ipv6*/))
271+
if (!tryConnect(2000, 15, true/*another_port*/, true/*IPv6*/))
272272
m_state = DONE;
273273
}
274274
else
@@ -396,7 +396,7 @@ bool ConnectToServer::tryConnect(int timeout, int retry, bool another_port,
396396
// in iOS 9.2
397397
if (!m_server->useIPV6Connection())
398398
{
399-
// From IPV4
399+
// From IPv4
400400
addr_string = m_server->getAddress().toString(false/*show_port*/);
401401
}
402402
#endif

src/network/protocols/server_lobby.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ void ServerLobby::initServerStatsTable()
227227
" host_id INTEGER UNSIGNED NOT NULL PRIMARY KEY, -- Unique host id in STKHost of each connection session for a STKPeer\n"
228228
" ip INTEGER UNSIGNED NOT NULL, -- IP decimal of host\n";
229229
if (ServerConfig::m_ipv6_server)
230-
oss << " ipv6 TEXT NOT NULL DEFAULT '', -- IPV6 (if exists) in string of host\n";
230+
oss << " ipv6 TEXT NOT NULL DEFAULT '', -- IPv6 (if exists) in string of host\n";
231231
oss << " port INTEGER UNSIGNED NOT NULL, -- Port of host\n"
232232
" online_id INTEGER UNSIGNED NOT NULL, -- Online if of the host (0 for offline account)\n"
233233
" username TEXT NOT NULL, -- First player name in the host (if the host has splitscreen player)\n"
@@ -936,7 +936,7 @@ void ServerLobby::writePlayerReport(Event* event)
936936
std::string query;
937937
if (ServerConfig::m_ipv6_server)
938938
{
939-
// We don't save the internally mapped ipv4 (0.x.x.x)
939+
// We don't save the internally mapped IPv4 (0.x.x.x)
940940
query = StringUtils::insertValues(
941941
"INSERT INTO %s "
942942
"(server_uid, reporter_ip, reporter_ipv6, reporter_online_id, reporter_username, "
@@ -1899,7 +1899,7 @@ bool ServerLobby::registerServer(bool now)
18991899
{
19001900
request->addParameter("address_ipv6",
19011901
STKHost::get()->getPublicIPV6Address());
1902-
Log::info("ServerLobby", "Public IPV6 server address %s",
1902+
Log::info("ServerLobby", "Public IPv6 server address %s",
19031903
STKHost::get()->getPublicIPV6Address().c_str());
19041904
}
19051905
if (now)
@@ -3057,7 +3057,7 @@ void ServerLobby::handleUnencryptedConnection(std::shared_ptr<STKPeer> peer,
30573057
std::string query;
30583058
if (ServerConfig::m_ipv6_server && !peer->getIPV6Address().empty())
30593059
{
3060-
// We don't save the internally mapped ipv4 (0.x.x.x)
3060+
// We don't save the internally mapped IPv4 (0.x.x.x)
30613061
query = StringUtils::insertValues(
30623062
"INSERT INTO %s "
30633063
"(host_id, ip, ipv6 ,port, online_id, username, player_num, "
@@ -3885,7 +3885,7 @@ void ServerLobby::testBannedForIP(STKPeer* peer) const
38853885
if (!m_db || !m_ip_ban_table_exists)
38863886
return;
38873887

3888-
// We only test for ipv4 atm
3888+
// We only test for IPv4 atm
38893889
if (!peer->getIPV6Address().empty())
38903890
return;
38913891

0 commit comments

Comments
 (0)