This site requires JavaScript, please enable it in your browser!
Greenfoot back
Dalvengyr
Dalvengyr wrote ...

2014/11/30

is storage available?

1
2
Dalvengyr Dalvengyr

2014/11/30

#
Guys, I have a situation here. My scenario can't be run in this site (link: Medieval Defense) and I suspect the problem is here. I declare a variable called LoggedIn (boolean):
    public static boolean LoggedIn    = UserInfo.isStorageAvailable();
    public static UserInfo User       = UserInfo.getMyInfo();
So that I don't need to recall that function over again. The question, is it the possible cause? And FYI, it run normally in the editor.
NikZ NikZ

2014/11/30

#
Use Java 7. You can see a discussion on this here. The problem is not in the code.
Dalvengyr Dalvengyr

2014/11/30

#
And how to check what version of my java? Ah, yes, I use Java 8. Is there any disadvantage for reverting to Java 7?
NikZ NikZ

2014/11/30

#
Probably some, but whether it affects you or not depends on what you are currently programming.
Dalvengyr Dalvengyr

2014/11/30

#
I see, thanks for your help :) By the way is it possible that Greenfoot will be updated to fit the newest Java?
NikZ NikZ

2014/11/30

#
It is possible, as said on the discussion "We need to come up with a suitable fix on our side, I guess (I mean, in Greenfoot and in the storage software on the server)."
Dalvengyr Dalvengyr

2014/11/30

#
Good, hope that update will happen soon. I can't revert to version 7 :/ Everytime I finished installing and checked the version, it somehow stays at 8 update 25. Guess the installer auto-downloads to the last version :(
Dalvengyr Dalvengyr

2014/11/30

#
I have tried Java 7 but still the scenario is not loaded? It loads normally when I logged out (storage is unavailable). And it's what's printed in the detail Java Plug-in 11.25.2.18 Using JRE version 1.8.0_25-b18 Java HotSpot(TM) Client VM User home directory = C:\Users\user ---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging q: hide console r: reload policy configuration s: dump system and deployment properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level to <n> ---------------------------------------------------- CacheEntry: updateAvailable=false,lastModified=Sun Nov 30 23:40:37 ICT 2014,length=6579326 CacheEntry: updateAvailable=false,lastModified=Tue Aug 05 19:34:31 ICT 2014,length=295591 0 CacheEntry: updateAvailable=false,lastModified=Fri Aug 17 18:49:55 ICT 2012,length=143160 Attempting to reconnect to storage server Trace level set to 0: none ... completed.
NikZ NikZ

2014/11/30

#
This detail is when you are logged in and using 8, correct?
Dalvengyr Dalvengyr

2014/11/30

#
It is when I logged in, but even after I use Java 7 update 71 it still happens Anyway, are you currently using Java 7? Can you load the game?
Super_Hippo Super_Hippo

2014/11/30

#
I can load the game. But like every scenario right now, it always wants to update java and it says that it is dangerous to use java 7 and so on... To the code in the first post: Keep in mind that the user might lose connection to the server while running the scenario. So if you only check this Boolean and store something then, your scenario maybe stops then, when the storage isn't available at this moment.
Dalvengyr Dalvengyr

2014/11/30

#
I have removed that boolean, how about the UserInfo variable? It's okay right?
Super_Hippo Super_Hippo

2014/11/30

#
If you change it (store something), then you have to update it. For example you lose the game, your score is stored and it has to be showed on a highscore table or something later. If you don't update it then, it will have the old data in it. So I don't know if it really helps to have it as a static field.
Dalvengyr Dalvengyr

2014/11/30

#
I will update it right away. Thanks for the information. Oh, what version is your Java if you don't mind? :)
NikZ NikZ

2014/11/30

#
Dalvengyr wrote...
It is when I logged in, but even after I use Java 7 update 71 it still happens Anyway, are you currently using Java 7? Can you load the game?
When you use 7u71 it shows "Using JRE version 1.8.0_25-b18 Java HotSpot(TM) Client VM"? You could just ask the player, in the beginning before retrieving data, if their Java supports UserInfo. That way running it with 8 will still work. Of course, then there will be no high scores but at least it works.
There are more replies on the next page.
1
2