OpenLobby - Page 4

OpenLobby

Discuss development of lobby clients, server, autohosts and auto-download software.

Moderators: Moderators, Lobby Developers

User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: CheeseLobby *WIP*

Post 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.
User avatar
AF
AI Developer
Posts: 20686
Joined: 14 Sep 2004, 11:32

Re: CheeseLobby *WIP*

Post 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 )
User avatar
AF
AI Developer
Posts: 20686
Joined: 14 Sep 2004, 11:32

Re: CheeseLobby *WIP*

Post 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
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10355
Joined: 24 Jan 2006, 21:12

Re: CheeseLobby *WIP*

Post by PicassoCT »

I demand less demands.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: CheeseLobby *WIP*

Post 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?
User avatar
very_bad_soldier
Posts: 1387
Joined: 20 Feb 2007, 01:10

Re: CheeseLobby *WIP*

Post 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?
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: CheeseLobby *WIP*

Post 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.
User avatar
very_bad_soldier
Posts: 1387
Joined: 20 Feb 2007, 01:10

Re: CheeseLobby *WIP*

Post 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
Last edited by very_bad_soldier on 03 Jan 2012, 20:21, edited 1 time in total.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: CheeseLobby *WIP*

Post 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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: CheeseLobby *WIP*

Post 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.
User avatar
AF
AI Developer
Posts: 20686
Joined: 14 Sep 2004, 11:32

Re: CheeseLobby *WIP*

Post 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
User avatar
very_bad_soldier
Posts: 1387
Joined: 20 Feb 2007, 01:10

Re: CheeseLobby *WIP*

Post 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 ^^
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: CheeseLobby *WIP*

Post 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..
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: CheeseLobby *WIP*

Post 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.)
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: CheeseLobby *WIP*

Post 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
User avatar
AF
AI Developer
Posts: 20686
Joined: 14 Sep 2004, 11:32

Re: CheeseLobby *WIP*

Post 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.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: CheeseLobby *WIP*

Post by Cheesecan »

I'll release a new version soon, just relax and thank you for your patience.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: CheeseLobby *WIP*

Post by Cheesecan »

Okey new version is up, try it out.
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Re: CheeseLobby *WIP*

Post 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)
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: CheeseLobby *WIP*

Post 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.
Post Reply

Return to “Lobby Clients & Server”