[Jrisk-cvs] SF.net SVN: domination-code:[2599] Domination/sharedU I/src_mapstore_lobby/net/yura/lob
Brought to you by:
yuranet
|
From: <yu...@us...> - 2024-12-18 17:32:22
|
Revision: 2599
http://sourceforge.net/p/domination/code/2599
Author: yuranet
Date: 2024-12-18 17:32:15 +0000 (Wed, 18 Dec 2024)
Log Message:
-----------
always call objectForGame
Modified Paths:
--------------
Domination/sharedUI/src_mapstore_lobby/net/yura/lobby/mini/MiniLobbyClient.java
Domination/sharedUI/src_mapstore_lobby/net/yura/lobby/mini/MiniLobbyGame.java
Modified: Domination/sharedUI/src_mapstore_lobby/net/yura/lobby/mini/MiniLobbyClient.java
===================================================================
--- Domination/sharedUI/src_mapstore_lobby/net/yura/lobby/mini/MiniLobbyClient.java 2024-12-07 19:40:22 UTC (rev 2598)
+++ Domination/sharedUI/src_mapstore_lobby/net/yura/lobby/mini/MiniLobbyClient.java 2024-12-18 17:32:15 UTC (rev 2599)
@@ -796,21 +796,26 @@
}
}
else if (message instanceof byte[]) {
+ Object object = null;
try {
ByteArrayInputStream in = new ByteArrayInputStream( (byte[])message );
ObjectInputStream oin = new ObjectInputStream(in);
- Object object = oin.readObject();
- game.objectForGame(object);
+ object = oin.readObject();
}
catch (Exception ex) {
- throw new RuntimeException("objectForGame error for game: " + gameid, ex);
+ logger.log(Level.WARNING, "serialization error for game: " + gameid, ex);
+ error("unable to open game " + gameid + ": " + ex);
+ closeGame();
}
catch (StackOverflowError error) {
// this happens on large maps on android, so far i have not found a way round this
- logger.log(Level.WARNING, "objectForGame error for game: " + gameid, error);
+ logger.log(Level.WARNING, "serialization StackOverflowError for game: " + gameid, error);
error("device unable to open large game " + gameid + ": " + error);
closeGame();
}
+
+ // we want to ALWAYS call objectForGame, as that closes the loading screen
+ game.objectForGame(object);
}
else {
throw new RuntimeException("unknown object "+message);
Modified: Domination/sharedUI/src_mapstore_lobby/net/yura/lobby/mini/MiniLobbyGame.java
===================================================================
--- Domination/sharedUI/src_mapstore_lobby/net/yura/lobby/mini/MiniLobbyGame.java 2024-12-07 19:40:22 UTC (rev 2598)
+++ Domination/sharedUI/src_mapstore_lobby/net/yura/lobby/mini/MiniLobbyGame.java 2024-12-18 17:32:15 UTC (rev 2599)
@@ -33,6 +33,9 @@
*/
void prepareAndOpenGame(Game game);
+ /**
+ * @param object for game, if serialization error then null
+ */
void objectForGame(Object object);
void stringForGame(String message);
|