Page 4 of 5

Re: CheeseLobby *WIP*

Posted: 28 Dec 2011, 12:42
by Cheesecan
Lobby server is pretty weird. For instance here is a message I just got:
BATTLEOPENED 18288 0 0 Springie4 94.23.171.71 RULES 8474 1 0 0 85.0 Archers_Valley_v5

Well the syntax is supposed to be:
BATTLEOPENED BATTLE_ID type natType founder IP port maxplayers passworded rank maphash {map} {title} {modname}

I noticed SpringLobby is taking 8474 to mean maxplayers. So obviously this message is real if two different sources are getting it.

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 15:03
by AF
Chat only is impossible. One can not use this to join the lobby unless one has a spring install ( so I cant pull up the lobby in an emergency )

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 15:11
by AF
Also, you need to make sure on windows that you add a backslash to the paths, else it fails terribly.

When loading fails, you also need to bring the window to configure back up, so I don't have to manually delete the preferences file

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 15:48
by PicassoCT
I demand less demands.

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 17:25
by Cheesecan
Hey AF,

I use the File object for paths, so the slash direction shouldn't matter. I also use Windows 7 myself for gaming so I haven't only tested it under Linux.
http://cheeselobby-debug.appspot.com/ wrote:C:\Users\TNowell\Documents\spring-85.0\DevIL.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform net.cheesecan.cheeselobby.io.RemoteLogger.sendError(RemoteLogger.java:63)
Are you by any chance running a 64-bit JVM?

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 17:27
by very_bad_soldier
AF wrote:Also, you need to make sure on windows that you add a backslash to the paths, else it fails terribly.
Would kind of defeat the point in coding cross-platform software with Java, no?

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 17:44
by Cheesecan
Well it's not truly cross-platform when it comes to setting up the spring paths. I use different path setup methods for windows and linux because searching the filesystem is too slow under Windows, so I resorted to simply checking the default location for a spring installation. Anything else and the user needs to enter path manually.

If you are uncertain about which JRE you have run java -version and post the output here.
Edit: I'll add a feature to write JRE version into the error report so that this won't be necessary in the future.

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 18:05
by very_bad_soldier
Without reading much of the code, you hardcoded lots of pathes stuff there like

Code: Select all

disk + ":/Users/" + username + "/Documents/My Games/Spring/");
.Is there a special reason for it? Im afraid that might fail on many Windows systems for which those pathes wont be correct.

Im not used to Java but "System.getProperty("user.home")" should tell you the user's home directory, right? Why are you only using the first letter of it?

Maybe you can borrow some ideas from how ZK is doing it:
http://code.google.com/p/zero-k/source/ ... ngPaths.cs

PS.
I think its legit to have some os-specific optimizations. Sometimes you will need hacks. But it would be bad if you had to worry about fundamental things like path separators in languages that are meant to be cross-platform. Also I am quite sure that the Windows API is fine with (forward) slashes.

EDIT:
fixed the link

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 19:03
by Cheesecan
The first letter is the system drive. Maybe I should do something about the Windows autoconfigure now that you mention it. However the autoconfiguration isn't to blame for AF's problem with the lobby. The issue is that the program was trying to load a 32-bit DLL on a (presumably) 64-bit JVM. As I've stated in the readme you will need a 32-bit JRE, because unitsync is not available in AMD64 state unless you built it yourself with that architecture.

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 19:07
by knorke
disk + ":/Users/" + username + "/Documents/My Games/Spring/");
yea on non-english windows that will fail too. (at least on german windows "my documents" is "eigene dateien")
I guess %appdata% should work.

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 20:26
by AF
Cheesecan wrote:The first letter is the system drive. Maybe I should do something about the Windows autoconfigure now that you mention it. However the autoconfiguration isn't to blame for AF's problem with the lobby. The issue is that the program was trying to load a 32-bit DLL on a (presumably) 64-bit JVM. As I've stated in the readme you will need a 32-bit JRE, because unitsync is not available in AMD64 state unless you built it yourself with that architecture.
Not at all, initially I realised that passing dumym files to cheeselobby wouldnt work so I downloaded spring v85 portable on my lunchbreak, realised it was a 64bit jvm, uninstalled all traces of java, installed 32bit java and tried again.

Also its not backslash vs forwards slash its slash vs no slash of any kind, e.g.: it would try to load my document\springdevIL.dll rather than my documents\spring\devIL.dll

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 20:54
by very_bad_soldier
Cheesecan wrote:The first letter is the system drive.
Yes I know but I think you could use a lot more of it than just the first (drive) letter? People are able to move the Users-folder around freely. So when getProperty returns "D:/WindowsAttic/MyUserfolder" you would replace it by "D:/Users".
knorke wrote:
disk + ":/Users/" + username + "/Documents/My Games/Spring/");
yea on non-english windows that will fail too. (at least on german windows "my documents" is "eigene dateien")
I guess %appdata% should work.
I believe since Vista all those system folders (User, MyDocuments etc.) are identical for all Windows language versions but for XP (and probably 2000) it is language specific.
Also %appdata% points to Users/bla/appData instead of Users/bla/Documents AFAIK.
But since you have a Windows-specific codepath anyway now maybe you should use the Win32-API to get things right.
AF wrote: Also its not backslash vs forwards slash its slash vs no slash of any kind, e.g.: it would try to load my document\springdevIL.dll rather than my documents\spring\devIL.dll
I see, good point ^^

Re: CheeseLobby *WIP*

Posted: 03 Jan 2012, 21:36
by Cheesecan
AF wrote:
Cheesecan wrote:The first letter is the system drive. Maybe I should do something about the Windows autoconfigure now that you mention it. However the autoconfiguration isn't to blame for AF's problem with the lobby. The issue is that the program was trying to load a 32-bit DLL on a (presumably) 64-bit JVM. As I've stated in the readme you will need a 32-bit JRE, because unitsync is not available in AMD64 state unless you built it yourself with that architecture.
Not at all, initially I realised that passing dumym files to cheeselobby wouldnt work so I downloaded spring v85 portable on my lunchbreak, realised it was a 64bit jvm, uninstalled all traces of java, installed 32bit java and tried again.

Also its not backslash vs forwards slash its slash vs no slash of any kind, e.g.: it would try to load my document\springdevIL.dll rather than my documents\spring\devIL.dll
I have tried to reproduce this problem by placing my Spring install in the same location as yours, but it still works for me. The only thing I could think of is that you have in cheeselobby.properties set unitSyncPath to be "C:\Users\TNowell\Documents\spring-85.0". If it's not that then you're welcome to fix it and commit a patch..

Re: CheeseLobby *WIP*

Posted: 04 Jan 2012, 10:21
by Tobi
Maybe the .properties files have backslash escaping, so "Documents\spring-85.0" becomes "Documentspring-85.0" when read, because "\s" can't be decoded?

(Might be what you are implying.)

Re: CheeseLobby *WIP*

Posted: 04 Jan 2012, 19:25
by hoijui
i am not sure how exactly that is meant, but the \s encoding thing sounds pretty unlikely to me.
if you imply that the path has to have a final slash/back-slash in the properties file to work right, then i would also consider it a bug in the software, which should be possible to avoid by using one of these (ctors of java.io.File):
http://docs.oracle.com/javase/6/docs/ap ... .String%29
http://docs.oracle.com/javase/6/docs/ap ... .String%29

Re: CheeseLobby *WIP*

Posted: 05 Jan 2012, 13:24
by AF
Tobi wrote:Maybe the .properties files have backslash escaping, so "Documents\spring-85.0" becomes "Documentspring-85.0" when read, because "\s" can't be decoded?

(Might be what you are implying.)
Nope, if I go directly to the folder using the browse button and select my spring folder, it does not add a trailing slash, and fails when saving.


Also, the settings dialogue does not ask for the absolute path of unitsync.dll it asks for unitsyncs path. Since this is immediatley below 'spring path' one assume it is the folder unitsync is in that is wanted, not the full path to unitsync itself complete with filename.

This is a cross platform bug in cheeselobby. I suggest changing the wording to make it clearer, and adding safeguards and checks. Also when loading fails, do not dump the user and crash, instead catch the failure and open up the settings dialogue shown on first run.

Also the window with the settings first shown on first run is not a normal window, as such it does not appear in the task bar, making it impossible to select without alt+Tab or minimising every other window if it goes behind another window.


edit: Upon reading the above posts, I tested out this revelation, and proceeded, only to be told "Can't find dependant Libraries". Note that the unitsync in question is from the spring portable download. I've dumped it in a folder and picked it using cheeselobby. No modifications have been made to the spring folder beyond unzipping it into that directory.

Re: CheeseLobby *WIP*

Posted: 05 Jan 2012, 15:46
by Cheesecan
I'll release a new version soon, just relax and thank you for your patience.

Re: CheeseLobby *WIP*

Posted: 05 Jan 2012, 18:42
by Cheesecan
Okey new version is up, try it out.

Re: CheeseLobby *WIP*

Posted: 05 Jan 2012, 19:04
by Satirik
tried, failed to detect all required paths, and then nothing shows up when I run it ...

Code: Select all

C:\Program Files\Spring>java -jar -Djava.library.path="natives/" "cheeselobby-0.
2.3-SNAPSHOT.jar"
java.lang.IllegalStateException: This method must be called on the Event Dispatc
h Thread
        at org.pushingpixels.substance.api.SubstanceLookAndFeel.setSkin(Substanc
eLookAndFeel.java:1916)
        at org.pushingpixels.substance.api.SubstanceLookAndFeel.setSkin(Substanc
eLookAndFeel.java:2022)
        at org.pushingpixels.substance.api.SubstanceLookAndFeel.setSkin(Substanc
eLookAndFeel.java:2058)
        at net.cheesecan.cheeselobby.ui.NewMainFrame.initializeTheme(NewMainFram
e.java:155)
        at net.cheesecan.cheeselobby.ui.NewMainFrame.<init>(NewMainFrame.java:13
3)
        at net.cheesecan.cheeselobby.ui.NewMainFrame$1.run(NewMainFrame.java:106
)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
unitsync dir:null
Caught an error. Unable to send error report.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at java.util.Hashtable.get(Unknown Source)
        at javax.swing.JLayeredPane.getLayer(Unknown Source)
        at javax.swing.JLayeredPane.addImpl(Unknown Source)
        at javax.swing.JDesktopPane.addImpl(Unknown Source)
        at java.awt.Container.add(Unknown Source)
        at net.cheesecan.cheeselobby.ui.NewMainFrame.initializeWindows(NewMainFr
ame.java:389)
        at net.cheesecan.cheeselobby.ui.NewMainFrame.initLoginWindow(NewMainFram
e.java:351)
        at net.cheesecan.cheeselobby.ui.NewMainFrame.<init>(NewMainFrame.java:14
2)
        at net.cheesecan.cheeselobby.ui.NewMainFrame$1.run(NewMainFrame.java:106
)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

Re: CheeseLobby *WIP*

Posted: 05 Jan 2012, 23:53
by hoijui
*cries* NOOOOOOO

Javaaaaa
java, oh my java!

back to this thread i come, to find you laying here in the mud, with your teeth kicked out, and your GUI thread leaking out your stomach.
what did they do to you?!!
java, ohhhh my good old java ...
oh my good lord that you gave us our CPUs, please have mercy with the bestest of your souls here on the hard grounds where the bytes rule, and give it an other cycle.