[iortcw] 22/497: MP: Use Punkbuster MD5 implementation for cl_guid / Rename autogenerated key to avoid confusion

Simon McVittie smcv at debian.org
Fri Sep 8 10:36:05 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 79137ec27d8589259f18701d05a2b67746991695
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date:   Fri Jan 24 01:04:08 2014 +0000

    MP: Use Punkbuster MD5 implementation for cl_guid / Rename autogenerated key to avoid confusion
---
 MP/Makefile               | 8 ++++++++
 MP/code/client/cl_main.c  | 4 ++++
 MP/code/client/client.h   | 2 +-
 MP/code/qcommon/md5.c     | 4 ++++
 MP/code/qcommon/qcommon.h | 4 ++++
 5 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/MP/Makefile b/MP/Makefile
index bb13532..55ac0a5 100644
--- a/MP/Makefile
+++ b/MP/Makefile
@@ -244,6 +244,10 @@ ifndef USE_OPENGLES
 USE_OPENGLES=0
 endif
 
+ifndef USE_PBMD5
+USE_PBMD5=1
+endif
+
 
 #############################################################################
 
@@ -1115,6 +1119,9 @@ ifeq ($(USE_BLOOM),1)
   CLIENT_CFLAGS += -DUSE_BLOOM
 endif
 
+ifeq ($(USE_PBMD5),1)
+  CLIENT_CFLAGS += -DUSE_PBMD5
+endif
 
 
 BASE_CFLAGS += -DPRODUCT_VERSION=\\\"$(VERSION)\\\"
@@ -1492,6 +1499,7 @@ Q3OBJ = \
   $(B)/client/files.o \
   $(B)/client/md4.o \
   $(B)/client/md5.o \
+  $(B)/client/pbmd5.o \
   $(B)/client/msg.o \
   $(B)/client/net_chan.o \
   $(B)/client/net_ip.o \
diff --git a/MP/code/client/cl_main.c b/MP/code/client/cl_main.c
index 0824bca..06bc9f6 100644
--- a/MP/code/client/cl_main.c
+++ b/MP/code/client/cl_main.c
@@ -1425,6 +1425,7 @@ update cl_guid using QKEY_FILE and optional prefix
 */
 static void CL_UpdateGUID( const char *prefix, int prefix_len )
 {
+#if !defined( USE_PBMD5 )
 	fileHandle_t f;
 	int len;
 
@@ -1436,6 +1437,9 @@ static void CL_UpdateGUID( const char *prefix, int prefix_len )
 	else
 		Cvar_Set( "cl_guid", Com_MD5File( QKEY_FILE, QKEY_SIZE,
 			prefix, prefix_len ) );
+#else
+	Cvar_Set( "cl_guid", Com_PBMD5File( cl_cdkey ) );
+#endif
 }
 
 static void CL_OldGame(void)
diff --git a/MP/code/client/client.h b/MP/code/client/client.h
index aa5a2cc..cdd2fe7 100644
--- a/MP/code/client/client.h
+++ b/MP/code/client/client.h
@@ -46,7 +46,7 @@ If you have questions concerning this license or the applicable additional terms
 #endif
 
 // file full of random crap that gets used to create cl_guid
-#define QKEY_FILE "rtcwkey"
+#define QKEY_FILE "wkey"
 #define QKEY_SIZE 2048
  
 #define	RETRANSMIT_TIMEOUT	3000	// time between connection packet retransmits
diff --git a/MP/code/qcommon/md5.c b/MP/code/qcommon/md5.c
index 994083f..4396fa1 100644
--- a/MP/code/qcommon/md5.c
+++ b/MP/code/qcommon/md5.c
@@ -14,6 +14,8 @@
  * needed on buffers full of bytes, and then call MD5Final, which
  * will fill a supplied 16-byte array with the digest.
  */
+#ifndef USE_PBMD5
+
 #include "q_shared.h"
 #include "qcommon.h"
 
@@ -308,3 +310,5 @@ char *Com_MD5File( const char *fn, int length, const char *prefix, int prefix_le
 	}
 	return final;
 }
+
+#endif // USE_PBMD5
diff --git a/MP/code/qcommon/qcommon.h b/MP/code/qcommon/qcommon.h
index 7d511d6..3626fa8 100644
--- a/MP/code/qcommon/qcommon.h
+++ b/MP/code/qcommon/qcommon.h
@@ -938,7 +938,11 @@ void		Com_GameRestart(int checksumFeed, qboolean disconnect);
 
 int         Com_Milliseconds( void );   // will be journaled properly
 unsigned    Com_BlockChecksum( const void *buffer, int length );
+#if !defined( USE_PBMD5 )
 char		*Com_MD5File(const char *filename, int length, const char *prefix, int prefix_len);
+#else
+char		*Com_PBMD5File( char *key );
+#endif
 int         Com_Filter( char *filter, char *name, int casesensitive );
 int         Com_FilterPath( char *filter, char *name, int casesensitive );
 int         Com_RealTime( qtime_t *qtime );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list