projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6027c8d
)
Disallow the name 'singleplayer' in a multiplayer server
author
PilzAdam
<pilzadam@minetest.net>
Thu, 11 Jul 2013 22:53:30 +0000
(
00:53
+0200)
committer
PilzAdam
<pilzadam@minetest.net>
Fri, 12 Jul 2013 00:15:09 +0000
(
02:15
+0200)
src/server.cpp
patch
|
blob
|
history
diff --git
a/src/server.cpp
b/src/server.cpp
index 1618a091522f885f29df63c49009135026a78558..60bf422f7fbba4d8422f98bc9fccb429326809a3 100644
(file)
--- a/
src/server.cpp
+++ b/
src/server.cpp
@@
-1922,6
+1922,15
@@
void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
return;
}
+ if(!isSingleplayer() && strcasecmp(playername, "singleplayer") == 0)
+ {
+ actionstream<<"Server: Player with an invalid name "
+ <<"tried to connect from "<<addr_s<<std::endl;
+ SendAccessDenied(m_con, peer_id,
+ L"Name is not allowed");
+ return;
+ }
+
infostream<<"Server: New connection: \""<<playername<<"\" from "
<<m_con.GetPeerAddress(peer_id).serializeString()<<std::endl;