Maelstrom: The score server no longer exists.

https://github.com/libsdl-org/Maelstrom/commit/050a546ab34c2672e759e88d344d46f3d5493768

From 050a546ab34c2672e759e88d344d46f3d5493768 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 30 Oct 2011 10:21:47 -0400
Subject: [PATCH] The score server no longer exists. We may do global high
 scores later, but it'll likely be web-based.

---
 Maelstrom_Globals.h |  22 ++--
 Makefile.am         |   5 -
 checksum.cpp        | 288 --------------------------------------------
 checksum.h          |  32 -----
 configure.in        |  11 --
 main.cpp            |  15 ---
 netlogic/game.cpp   |   5 +-
 netscore.cpp        | 231 -----------------------------------
 netscore.h          |  31 -----
 public_key.h        |  30 -----
 scores.cpp          |  14 ---
 11 files changed, 9 insertions(+), 675 deletions(-)
 delete mode 100644 checksum.cpp
 delete mode 100644 checksum.h
 delete mode 100644 netscore.cpp
 delete mode 100644 netscore.h
 delete mode 100644 public_key.h

diff --git a/Maelstrom_Globals.h b/Maelstrom_Globals.h
index 4301254b..07eb07e2 100644
--- a/Maelstrom_Globals.h
+++ b/Maelstrom_Globals.h
@@ -74,26 +74,22 @@ typedef Uint8 Bool;
 #define false	0
 #endif
 
-// Functions from main.cc
+// Functions from main.cpp
 extern void   PrintUsage(void);
 extern int    DrawText(int x, int y, const char *text, MFont *font, Uint8 style,
 						Uint8 R, Uint8 G, Uint8 B);
 extern void   Message(const char *message);
 
-// Functions from init.cc
+// Functions from init.cpp
 extern void  SetStar(int which);
 
-// Functions from netscore.cc
-extern void  RegisterHighScore(Scores high);
-extern int   NetLoadScores(void);
-
 // External variables...
-// in main.cc : 
+// in main.cpp : 
 extern Bool	gUpdateBuffer;
 extern Bool	gRunning;
 extern int	gNoDelay;
 
-// in init.cc : 
+// in init.cpp : 
 extern Sint32	gLastHigh;
 extern Rect	gScrnRect;
 extern SDL_Rect	gClipRect;
@@ -104,22 +100,20 @@ extern MPoint	gThrustOrigins[SHIP_FRAMES];
 extern MPoint	gVelocityTable[SHIP_FRAMES];
 extern StarPtr	gTheStars[MAX_STARS];
 extern Uint32	gStarColors[];
-// in controls.cc :
+// in controls.cpp :
 extern Controls	controls;
 extern Uint8	gSoundLevel;
 extern Uint8	gGammaCorrect;
-// int scores.cc :
+// int scores.cpp :
 extern Scores	hScores[];
 
 // -- Variables specific to each game 
-// in main.cc : 
+// in main.cpp : 
 extern int	gStartLives;
 extern int	gStartLevel;
-// in init.cc : 
+// in init.cpp : 
 extern Uint32	gLastDrawn;
 extern int	gNumSprites;
-// in scores.cc :
-extern Bool	gNetScores;
 
 // UI panel definitions...
 #define PANEL_SPLASH	"splash"
diff --git a/Makefile.am b/Makefile.am
index 9e26e7e4..ca10aa3d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,8 +8,6 @@ Maelstrom_SOURCES =		\
 	MaelstromUI.cpp		\
 	MaelstromUI.h		\
 	buttonlist.h		\
-	checksum.cpp		\
-	checksum.h		\
 	colortable.h		\
 	controls.cpp		\
 	controls.h		\
@@ -23,9 +21,6 @@ Maelstrom_SOURCES =		\
 	main.h			\
 	myerror.cpp		\
 	myerror.h		\
-	netscore.cpp		\
-	netscore.h		\
-	public_key.h		\
 	rect.cpp		\
 	rect.h			\
 	scores.cpp		\
diff --git a/checksum.cpp b/checksum.cpp
deleted file mode 100644
index 1cb5a369..00000000
--- a/checksum.cpp
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
-    Maelstrom: Open Source version of the classic game by Ambrosia Software
-    Copyright (C) 1997-2011  Sam Lantinga
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-
-/* Okay, here is a method of doing checksumming on ourselves.
-
-   We calculate a checksum over the text segment from the address
-   of main() to the end of the text segment (etext), and then 
-   encrypt it and ascii armour it (base64) for transport.
-
-   Note, this is NOT foolproof, so don't rely on it for critical software!
-
-   It is pretty slick though. :)
-   The md5 checksum is xor'd with a random value, which is stored in
-   the authentication packet.  This gives relatively random input to
-   the RSA encryption engine which encrypts the packet with the server's
-   public key.  The result is ascii armoured and sent to the server
-   where the md5 checksum is extracted.  Each time the packet is sent,
-   it is a different ascii text, but decodes to a known checksum.
-
-   This method should be resistant to cracking by snooping, spoofing,
-   and code tampering, as long as the private key remains private.
-*/
-
-/* These checksum routines are activated by -DUSE_CHECKSUM */
-#if defined(WIN32) || defined(__BEOS__)
-/* How do we get the end of the text segment with this OS? */
-#undef USE_CHECKSUM
-#endif
-
-#ifdef USE_CHECKSUM
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/time.h>
-#ifdef WIN32
-#include <windows.h>
-#endif
-#include "checksum.h"
-#include "myerror.h"
-
-/* RSA MD5 checksum, public key routines */
-#include "global.h"
-#include "rsaref.h"
-extern "C" {
-	extern int RSAPublicEncrypt (
-			unsigned char *output,	/* output block */
-			unsigned int *outputLen,/* length of output block */
-			unsigned char *input,	/* input block */
-			unsigned int inputLen,	/* length of input block */
-			R_RSA_PUBLIC_KEY *publicKey,	/* RSA public key */
-			R_RANDOM_STRUCT *randomStruct	/* random structure */
-	);
-};
-#include "public_key.h"
-
-/* Encrypt and ascii armour a message */
-static char *armour_encrypt(unsigned char *buf, unsigned int len);
-
-/* Here is where we save the checksum and encrypted checksum */
-#define MD5LEN	16
-static unsigned char our_checksum[MD5LEN];
-static unsigned char weak_encoder;
-
-/* How many times do you see this? :) */
-extern "C" int main(int argc, char *argv[]);
-
-/* Call this to calculate the checksum -- first thing in main()! */
-void checksum(void)
-{
-	struct timeval now;
-
-	/* These are the end of the text and data segments. */
-	extern int etext, edata;
-
-#ifdef PRINT_CHECKSUM
-error("Main = 0x%x, etext = 0x%x, edata = 0x%x\n",main,&etext,&edata);
-#endif
-	/* Local variables */
-	void *mem_end=NULL;
-	int   i;
-	MD5_CTX *ctx;
-
-	/* Find the end of our code segment */
-	mem_end = &etext;
-	if ( (caddr_t)mem_end < (caddr_t)main ) {	// Uh oh...
-		error("Warning: unexpected environment -- no checksum!!\n");
-		return;
-	}
-
-	/* Allocate and calculate our checksum */
- 	ctx = new MD5_CTX;
-	MD5Init(ctx);
-	MD5Update(ctx, (unsigned char *)main, (caddr_t)mem_end-(caddr_t)main);
-	MD5Final(our_checksum, ctx);
-
-/* ERASE THIS!! */
-#ifdef PRINT_CHECKSUM
-error("Real checksum: ");
-for ( i=0; i<MD5LEN; ++i )
-	error("%.2x", our_checksum[i]&0xFF);
-error("\n");
-#endif
-
-	/* Use weak random encoding, to discourage hackers */
-	gettimeofday(&now, NULL);
-	weak_encoder = (now.tv_usec&0xFF);
-	memset(&now, 0, sizeof(now));
-	for ( i=0; i<MD5LEN; ++i )
-		our_checksum[i] =  our_checksum[i]^weak_encoder;
-	return;
-}
-
-/* Convert to Base64 encoding */
-static char to_base64[64] = {
-	'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 
-	'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 
-	'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 
-	'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 
-	'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' 
-	};
-#define PAD	'='		/* Trailing pad character */
-
-
-void base64_encode(char **dstptr, unsigned char *from, unsigned int fromlen)
-{
-	char *to = *dstptr = new char[(fromlen*4)/3+5];
-	unsigned char sextet[4];
-	unsigned int i, index=0, o=0;
-
-#ifdef PRINT_CHECKSUM
-error("Encoding %d chars...", fromlen);
-#endif
-	for ( i=0; i<fromlen; ++i ) {
-		switch (index++) {
-			case 0: sextet[0]  = ((from[i]&0xfc)>>2);
-					sextet[1]  = ((from[i]&0x03)<<4);
-					break;
-			case 1: sextet[1] |= ((from[i]&0xf0)>>4);
-					sextet[2]  = ((from[i]&0x0f)<<2);
-					break;
-			case 2: sextet[2] |= ((from[i]&0xc0)>>6);
-					sextet[3]  = (from[i]&0x3f);
-					/* Now output the encoded data */
-					for ( index=0; index<4; ++index )
-						to[o++] = to_base64[sextet[index]];
-					index=0;
-					break;
-			default:  /* Never reached */ ;
-		}
-	}
-	if ( index ) { /* We must flush the output */
-		for ( i=0; i<=index; ++i )
-			to[o++] = to_base64[sextet[i]];
-		for ( ; index<3; ++index )
-			to[o++] = PAD;
-	}
-	to[o] = 0;
-#ifdef PRINT_CHECKSUM
-error("into %d chars. (allocated %d chars)\n", o+1, (fromlen*4)/3+5);
-#endif
-	return;
-}
-
-/* Okay, encryption method:
-	Get a random seed, use generic random encoding on
-	our message digest.  Then use the server's public key to
-	RSA encrypt the encrypted message together with the seed.
-	Translate this encapsulated message to ascii and we're done.
-*/
-static char *armour_encrypt(unsigned char *buf, unsigned int len)
-{
-	unsigned int i;
-	struct timeval now;
-	unsigned char *tmp, seed=0;
-	char *encoded;
-
-	/* Use weak random encoding, erase as we go. :-) */
-	tmp = new unsigned char[++len];
-	gettimeofday(&now, NULL);
-	seed = (now.tv_usec&0xFF);
-	memset(&now, 0, sizeof(now));
-	for ( tmp[0]=seed, i=1; i<len; ++i ) {
-		tmp[i] =  buf[i-1]^seed;
-		buf[i-1] = 0;
-	}
-	seed = 0;
-
-	/* RSA encrypt the seed+digest */
-	R_RSA_PUBLIC_KEY *pkey=&public_key;
-	unsigned int clen=0;
-	unsigned char *cbuf = new unsigned char[MAX_ENCRYPTED_KEY_LEN];
-	{
-		unsigned int bytesleft; unsigned char randbyte;
-		R_RANDOM_STRUCT weewee;
-
-		/* Initialize silly random struct */
-		R_RandomInit(&weewee);
-		gettimeofday(&now, NULL);
-		srand(now.tv_usec);
-		for ( R_GetRandomBytesNeeded(&bytesleft, &weewee);
-						bytesleft > 0; --bytesleft ) {
-			randbyte = (rand()%256);
-			R_RandomUpdate(&weewee, &randbyte, 1);
-		}
-			
-		/* Get down to business! */
-		if (RSAPublicEncrypt(cbuf, &clen, tmp, len, pkey, &weewee)) {
-			/* Uh oh... what do we do? */
-			error("Warning!  RSA encryption failed!\n");
-			clen = 0;
-		}
-	}
-	/* Clear out the original buffer, just in case */
-	for ( i=0; i<len; tmp[i++]=0 );
-
-	/* Now ascii encode it */
-#ifdef PRINT_CHECKSUM
-error("Encoding: ");
-for ( i=0; i<clen; ++i )
-	error("%.2x", cbuf[i]&0xFF);
-error("\n");
-#endif
-	base64_encode(&encoded, cbuf, clen);
-
-	/* Clean up and return */
-	for ( i=0; i<clen; cbuf[i++]=0 );
-	delete[] cbuf;
-	return(encoded);
-}
-
-/* Call this later, when you want to see the checksum */
-const char *get_checksum(unsigned char *key, int keylen)
-{
-	unsigned char csum[MD5LEN], seed;
-	int i, j;
-	char *encap_csum;
-
-	memcpy(csum, our_checksum, MD5LEN);
-	if ( keylen ) {
-		for ( i=0, j=0; i<MD5LEN; ++i ) {
-			seed = key[j++];
-			j %= keylen;
-			csum[i] ^= weak_encoder;
-			csum[i] ^= seed;
-		}
-	} else {
-		for ( i=0, j=0; i<MD5LEN; ++i )
-			csum[i] ^= weak_encoder;
-	}
-	encap_csum = armour_encrypt(csum, MD5LEN);
-	memset(csum, 0, MD5LEN);
-	
-	return(encap_csum);
-}
-
-#else  /* Don't use checksumming */
-static inline void Unused(...) { }	/* For eliminating compiler warnings */
-
-void checksum(void) { return; }
-
-const char *get_checksum(unsigned char *key, int keylen)
-{
-	Unused(key); Unused(keylen);
-	static const char *foo = "Checksum Not Enabled";
-	return(foo);
-}
-#endif /* USE_CHECKSUM */
diff --git a/checksum.h b/checksum.h
deleted file mode 100644
index 7d9d0113..00000000
--- a/checksum.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-    Maelstrom: Open Source version of the classic game by Ambrosia Software
-    Copyright (C) 1997-2011  Sam Lantinga
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-
-/* Okay, here is a method of doing checksumming on ourselves.
-
-   Note, this is NOT foolproof, so don't rely on it for critical software!
-*/
-
-/* Call this to calculate the checksum -- first thing in main()! */
-extern void checksum(void);
-
-/* Call this later, when you want to see the checksum */
-extern char *get_checksum(unsigned char *key, int keylen);
diff --git a/configure.in b/configure.in
index 66c5cefe..e2cde2e2 100644
--- a/configure.in
+++ b/configure.in
@@ -76,17 +76,6 @@ http://icculus.org/physfs
 ])
 fi
 
-dnl Check for RSA checksum authentication
-AC_MSG_CHECKING(for RSA checksum authentication)
-if test -d $HOME/RSA; then
-    CFLAGS="$CFLAGS -DUSE_CHECKSUM -I$HOME/RSA/source"
-    LIBS="$LIBS $HOME/RSA/install/rsaref.a"
-    use_checksum=yes
-else
-    use_checksum=no
-fi
-AC_MSG_RESULT($use_checksum)
-
 dnl Set up the icon object file, for Mingw32
 case "$target" in
     *-*-mingw32*)
diff --git a/main.cpp b/main.cpp
index c64c3e5c..31bd6817 100644
--- a/main.cpp
+++ b/main.cpp
@@ -35,7 +35,6 @@
 #include "Maelstrom_Globals.h"
 #include "load.h"
 #include "fastrand.h"
-#include "checksum.h"
 #include "netlogic/about.h"
 #include "main.h"
 
@@ -242,11 +241,6 @@ int main(int argc, char *argv[])
 		exit(1);
 	}
 
-#ifndef __WIN95__
-	/* The first thing we do is calculate our checksum */
-	(void) checksum();
-#endif /* ! Win95 */
-
 	/* Seed the random number generator */
 	SeedRandom(0L);
 	/* Initialize the controls */
@@ -309,17 +303,8 @@ int main(int argc, char *argv[])
 			++argv;
 			--argc;
 		}
-#define CHECKSUM_DEBUG
-#ifdef CHECKSUM_DEBUG
-		else if ( strcmp(argv[1], "-checksum") == 0 ) {
-			mesg("Checksum = %s\n", get_checksum(NULL, 0));
-			exit(0);
-		}
-#endif /* CHECKSUM_DEBUG */
 		else if ( strcmp(argv[1], "-printscores") == 0 )
 			doprinthigh = 1;
-		else if ( strcmp(argv[1], "-netscores") == 0 )
-			gNetScores = 1;
 		else if ( strcmp(argv[1], "-speedtest") == 0 ) {
 			speedtest = 1;
 			render_flags &= ~SDL_RENDERER_PRESENTVSYNC;
diff --git a/netlogic/game.cpp b/netlogic/game.cpp
index d6806d2c..48c985ba 100644
--- a/netlogic/game.cpp
+++ b/netlogic/game.cpp
@@ -1060,10 +1060,7 @@ static void DoGameOver(void)
 
 		sound->HaltSound();
 		sound->PlaySound(gGotPrize, 6);
-		if ( gNetScores )	// All time high!
-			RegisterHighScore(hScores[which]);
-		else
-			SaveScores();
+		SaveScores();
 	} else
 	if ( gNumPlayers > 1 )	/* Let them watch their ranking */
 		SDL_Delay(3000);
diff --git a/netscore.cpp b/netscore.cpp
deleted file mode 100644
index 0b232ed1..00000000
--- a/netscore.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
-    Maelstrom: Open Source version of the classic game by Ambrosia Software
-    Copyright (C) 1997-2011  Sam Lantinga
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-
-/* This module registers a high score with the official Maelstrom
-   score server
-*/
-#include <ctype.h>
-
-#include "SDL_net.h"
-
-#include "Maelstrom_Globals.h"
-#include "netscore.h"
-#include "checksum.h"
-
-#define NUM_SCORES	10		// Copied from scores.cc 
-
-static TCPsocket Goto_ScoreServer(const char *server, int port);
-static void Leave_ScoreServer(TCPsocket remote);
-
-/* This function actually registers the high scores */
-void RegisterHighScore(Scores high)
-{
-	TCPsocket remote;
-	int i, n;
-	unsigned char key[KEY_LEN];
-	unsigned int  keynums[KEY_LEN];
-	char netbuf[1024], *crc;
-
-	remote = Goto_ScoreServer(SCORE_HOST, SCORE_PORT);
-	if ( remote == NULL ) {
-		error(
-		"Warning: Couldn't connect to Maelstrom Score Server.\r\n");
-		error("-- High Score not registered.\r\n");
-		return;
-	}
-
-	/* Read the welcome banner */
-	SDLNet_TCP_Recv(remote, netbuf, 1024);
-
-	/* Get the key... */
-	strcpy(netbuf, "SHOWKEY\n");
-	SDLNet_TCP_Send(remote, netbuf, strlen(netbuf));
-	if ( SDLNet_TCP_Recv(remote, netbuf, 1024) <= 0 ) {
-		error("Warning: Score Server protocol error.\r\n");
-		error("-- High Score not registered.\r\n");
-		return;
-	}
-	for ( i=0, n=0, crc=netbuf; i < KEY_LEN; ++i, ++n ) {
-		key[i] = 0xFF;
-		if ( ! (crc=strchr(++crc, ':')) ||
-				(sscanf(crc, ": 0x%x", &keynums[i]) <= 0) )
-			break;
-	}
-/*error("%d items read:\n", n);*/
-	if ( n != KEY_LEN )
-		error("Warning: short authentication key.\n");
-	for ( i=0; i<n; ++i ) {
-		key[i] = (keynums[i]&0xFF);
-/*error("\t0x%.2x\n", key[i]);*/
-	}
-
-	/* Send the scores */
-	crc = get_checksum(key, KEY_LEN);
-	sprintf(netbuf, SCOREFMT, crc, high.name, high.score, high.wave);
-	SDLNet_TCP_Send(remote, netbuf, strlen(netbuf));
-	n = SDLNet_TCP_Recv(remote, netbuf, 1024);
-	if ( n > 0 ) {
-		netbuf[n] = '\0';
-		if ( strncmp(netbuf, "Accepted!", 9) != 0 ) {
-			error("New high score was rejected: %s", netbuf);
-		}
-	} else
-		perror("Read error on socket");
-	Leave_ScoreServer(remote);
-}
-
-/* This function is just a hack */
-int GetLine(TCPsocket remote, char *buffer, int maxlen)
-{
-	int packed = 0;
-	static int lenleft, len;
-	static char netbuf[1024], *ptr=NULL;
-
-	if ( buffer == NULL ) {
-		lenleft = 0;
-		return(0);
-	}
-	if ( lenleft <= 0 ) {
-		len = SDLNet_TCP_Recv(remote, netbuf, 1024);
-		if ( len <= 0 )
-			return(-1);
-		lenleft = len;
-		ptr = netbuf;
-	}
-	while ( (*ptr != '\n') && (*ptr != '\r') ) {
-		if ( lenleft <= 0 ) {
-			len = SDLNet_TCP_Recv(remote, netbuf, 1024);
-			if ( len <= 0 ) {
-				*buffer = '\0';
-				return(packed);
-			}
-			lenleft = len;
-			ptr = netbuf;
-		}
-		if ( maxlen == 0 ) {
-			*buffer = '\0';
-			return(packed);
-		}
-		*(buffer++) = *(ptr++);
-		++packed;
-		--maxlen;
-		--lenleft;
-	}
-	++ptr; --lenleft;
-	*buffer = '\0';
-	return(packed);
-}
-
-/* Load the scores from the network score server */
-int NetLoadScores(void)
-{
-	TCPsocket remote;
-	int  i;
-	char netbuf[1024], *ptr;
-
-	remote = Goto_ScoreServer(SCORE_HOST, SCORE_PORT);
-	if ( remote == NULL ) {
-		error(
-		"Warning: Couldn't connect to Maelstrom Score Server.\r\n");
-		return(-1);
-	}
-	
-	/* Read the welcome banner */
-	SDLNet_TCP_Recv(remote, netbuf, 1024);
-
-	/* Send our request */
-	strcpy(netbuf, "SHOWSCORES\n");
-	SDLNet_TCP_Send(remote, netbuf, strlen(netbuf));
-
-	/* Read the response */
-	GetLine(remote, NULL, 0);
-	GetLine(remote, netbuf, 1024-1);
-	memset(&hScores, 0, NUM_SCORES*sizeof(Scores));
-        for ( i=0; i<NUM_SCORES; ++i ) {
-		if ( GetLine(remote, netbuf, 1024-1) < 0 ) {
-			perror("Read error on socket stream");
-			break;
-		}
-		strcpy(hScores[i].name, "Invalid Name");
-		for ( ptr = netbuf; *ptr; ++ptr ) {
-			if ( *ptr == '\t' ) {
-				/* This is just to remove trailing whitespace
-				   and make sure we don't overflow our buffer.
-				*/
-				char *tail = ptr;
-				int   len;
-
-				while ( (tail >= netbuf) && isspace(*tail) )
-					*(tail--) = '\0';
-				strncpy(hScores[i].name, netbuf,
-						sizeof(hScores[i].name)-1);
-				if ( (len=strlen(netbuf)) >
-					(int)(sizeof(hScores[i].name)-1) )
-					len = (sizeof(hScores[i].name)-1);
-				hScores[i].name[len] = '\0';
-				*ptr = '\t';
-				break;
-			}
-		}
-		if ( sscanf(ptr, "%u %u", &hScores[i].score,
-						&hScores[i].wave) != 2 ) {
-			error(
-			"Warning: Couldn't read complete score list!\r\n");
-			error("Line was: %s", netbuf);
-			break;
-		}
-        }
-	Leave_ScoreServer(remote);
-	return(0);
-}
-
-static TCPsocket Goto_ScoreServer(const char *server, int port)
-{
-	TCPsocket remote;
-	IPaddress remote_address;
-
-	if ( SDLNet_Init() < 0 ) {
-		return(NULL);
-	}
-
-	/*
-	 * Fill in the structure "serv_addr" with the address of the
-	 * server that we want to connect with.
-	 */
-	SDLNet_ResolveHost(&remote_address, server, port);
-	if ( remote_address.host == INADDR_NONE ) {
-		/*error("%s: host name error.\n", server);*/
-		return(NULL);
-	}
-
-	/*
-	 * Open a TCP socket (an Internet stream socket).
-	 */
-	remote = SDLNet_TCP_Open(&remote_address);
-	return(remote);
-}
-
-static void Leave_ScoreServer(TCPsocket remote)
-{
-	SDLNet_TCP_Close(remote);
-	SDLNet_Quit();
-}
diff --git a/netscore.h b/netscore.h
deleted file mode 100644
index 983366c0..00000000
--- a/netscore.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-    Maelstrom: Open Source version of the classic game by Ambrosia Software
-    Copyright (C) 1997-2011  Sam Lantinga
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-
-/* Definitions for the network part of the score service */
-
-#define SCORE_HOST	"devolution.com"
-#define SCORE_PORT	4444
-
-#define KEY_LEN		4	/* Auth key length in bytes */
-
-/*			         CRC  Name    Score Wave */
-#define SCOREFMT	"NEWSCORE\t%s\t%s\t%-3.1u\t%u\n"
diff --git a/public_key.h b/public_key.h
deleted file mode 100644
index 94d2036f..00000000
--- a/public_key.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-    Maelstrom: Open Source version of the classic game by Ambrosia Software
-    Copyright (C) 1997-2011  Sam Lantinga
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-
-/* RSA Public Key */
-
-static R_RSA_PUBLIC_KEY public_key = {
-	/* bits */ 512,
-	/* modulus */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x68, 0x99, 0xB7, 0x4E, 0x93, 0xE1, 0x51, 0x26, 0x1A, 0x15, 0xB6, 0xF7, 0xE4, 0x12, 0xF8, 0xFE, 0x0F, 0x41, 0x5C, 0x31, 0x0B, 0xD1, 0x7B, 0x20, 0x10, 0x0D, 0x73, 0xD8, 0x05, 0xAE, 0x96, 0x32, 0x49, 0x54, 0x57, 0xD0, 0x15, 0x77, 0xD2, 0x33, 0x90, 0xF9, 0x44, 0x30, 0xCB, 0xE3, 0x3E, 0xF0, 0x63, 0xF7, 0x49, 0x23, 0xC1, 0xF2, 0x27, 0x66, 0x13, 0xCB, 0xCC, 0x54, 0x1B, 0x1E, 0xB9, },
-	/* exponent */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, },
-};
-
diff --git a/scores.cpp b/scores.cpp
index 442d20e8..ed6e3437 100644
--- a/scores.cpp
+++ b/scores.cpp
@@ -41,7 +41,6 @@
 /* Everyone can write to scores file if defined to 0 */
 #define SCORES_PERMMASK		0
 
-Bool gNetScores = 0;
 Scores hScores[NUM_SCORES];
 
 void LoadScores(void)
@@ -49,15 +48,6 @@ void LoadScores(void)
 	SDL_RWops *scores_src;
 	int i;
 
-	/* Try to load network scores, if we can */
-	if ( gNetScores ) {
-		if ( NetLoadScores() == 0 )
-			return;
-		else {
-			mesg("Using local score file\n\n");
-			gNetScores = 0;
-		}
-	}
 	memset(&hScores, 0, sizeof(hScores));
 
 	scores_src = PHYSFSRWOPS_openRead(MAELSTROM_SCORES);
@@ -80,10 +70,6 @@ void SaveScores(void)
 	int omask;
 #endif
 
-	/* Don't save network scores */
-	if ( gNetScores )
-		return;
-
 #ifdef unix
 	omask=umask(SCORES_PERMMASK);
 #endif