i hate auth grr

This commit is contained in:
kai
2026-10-25 21:40:25 +00:00
parent 72f0aef305
commit cbe737524d
4 changed files with 10 additions and 16 deletions
+1 -1
View File
@@ -29,7 +29,7 @@
// -Y // 32-byte private server key (you should maybe include that from another config file and remove it from the server after startup)
// -m // masterserver URL (no parameter uses default URL), if not set, the server will be LAN-only
-Y AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA // this default value is a security risk so please define your own private server key (!!)
// No private server key (-Y) set: the server runs LAN-only without any key or auth setup.
// the switches o, n, n1 and n2 support coloring and character escaping; 'o' also supports escaped newlines
// the available colors are: 0: green, 1: blue, 2: yellow, 3: red, 4: gray, 5: white, 6: dark brown, 7: dark red
+6
View File
@@ -57,6 +57,12 @@ if [ "$1" = "--outputbinarypath" ]; then
echo "${BINARYPATH}"
exit 0
elif [ -x "${BINARYPATH}" ]; then
# Kill any leftover server instances from previous runs, so the ports are free.
# (anchored on "/<binary> " so we can never match our own command line)
if command -v pkill >/dev/null 2>&1; then
pkill -f "(^|/)$(basename "${BINARYPATH}")( |$)" >/dev/null 2>&1 || true
sleep 1
fi
cd "${CUBE_DIR}"
exec "${BINARYPATH}" ${CUBE_OPTIONS} ${CUBE_OPTIONFILE} "$@"
else
+3 -14
View File
@@ -1204,20 +1204,9 @@ struct servercommandline
// client: dtwhzbsave
switch(arg[1])
{ // todo: gjlqEJQU
case 'Y': // private server key
{
bool allas = true; // a is all A's?
loopi(strlen(a)){ if(a[i]!='A') allas = false; }
if(allas)
{
printf("KEY FAILURE: you provided the (inacceptable) example private key.\nKEY FAILURE: generate your own - read: https://assault.cubers.net/docs/server.html\n");
}
else
{
ssk = a;
}
}
break;
case 'Y': // private server key (optional, only needed to register with the masterserver)
ssk = a;
break;
case '-':
if(!strncmp(arg, "--masterport=", 13))
{
-1
View File
@@ -364,7 +364,6 @@ void servermsinit(bool listen)
if(!usemaster){
mlog(ACLOG_INFO, "server is LAN-only - without connection to masterserver");
if(listen){
if(!scl.ssk) mlog(ACLOG_INFO, "ACTION REQUIRED: you must provide a PRIVATE SERVER KEY via the '-Y' command line argument");
if(!scl.master) mlog(ACLOG_INFO, "LAN-only because no master is given");
if(scl.maxclients>MAXCLIENTSONMASTER) mlog(ACLOG_INFO, "LAN-only because too many clients for master");
}