From 5175775b1d669abc9a87c10cb519f61602f73840 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 27 Dec 2022 17:35:44 -0800 Subject: [PATCH] don't truncate gameID In some cases games were created with 32-bit ids, and sometimes only 20 bits were used. --- .../src/main/java/org/eehouse/android/xw4/GameUtils.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameUtils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameUtils.java index 2bdebf1d8..69d594dfa 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameUtils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameUtils.java @@ -1312,8 +1312,9 @@ public class GameUtils { public static String formatGameID( int gameID ) { Assert.assertTrue( 0 != gameID ); - // substring: Keep it short so fits in SMS better - return String.format( "%X", gameID ).substring( 0, 5 ); + // I used to truncate this for smaller SMS messages, but gameID has + // become important enough that we want to use all 32 bits. + return String.format( "%X", gameID ); } public static String makeRandomID() @@ -1322,7 +1323,7 @@ public class GameUtils { return formatGameID( rint ); } - public static int newGameID() + private static int newGameID() { int rint; do {