View topic - OpenLobby


All times are UTC + 1 hour


Post new topic Reply to topic  [ 99 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 28 Dec 2011, 12:42 
User avatar

Joined: 07 Feb 2005, 21:30
Location: Cheese factory
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.
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 15:03 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
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 )
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 15:11 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
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
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 15:48 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: weblobby.springrts.com/jw-battleroom_joinMe-PW:-GURL
I demand less demands.
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 17:25 
User avatar

Joined: 07 Feb 2005, 21:30
Location: Cheese factory
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?
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 17:27 
Lua Coder
User avatar

Joined: 20 Feb 2007, 01:10
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?
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 17:44 
User avatar

Joined: 07 Feb 2005, 21:30
Location: Cheese factory
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.
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 18:05 
Lua Coder
User avatar

Joined: 20 Feb 2007, 01:10
Without reading much of the code, you hardcoded lots of pathes stuff there like
Code:
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/browse/trunk/other/Shared/PlasmaShared/SpringPaths.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.
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 19:03 
User avatar

Joined: 07 Feb 2005, 21:30
Location: Cheese factory
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.
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 19:07 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Quote:
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.
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 20:26 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
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
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 20:54 
Lua Coder
User avatar

Joined: 20 Feb 2007, 01:10
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:
Quote:
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 ^^
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 03 Jan 2012, 21:36 
User avatar

Joined: 07 Feb 2005, 21:30
Location: Cheese factory
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..
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 04 Jan 2012, 10:21 
Spring Developer

Joined: 01 Jun 2005, 10:36
Location: The Netherlands
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.)
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 04 Jan 2012, 19:25 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
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
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 05 Jan 2012, 13:24 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
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.
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 05 Jan 2012, 15:46 
User avatar

Joined: 07 Feb 2005, 21:30
Location: Cheese factory
I'll release a new version soon, just relax and thank you for your patience.
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 05 Jan 2012, 18:42 
User avatar

Joined: 07 Feb 2005, 21:30
Location: Cheese factory
Okey new version is up, try it out.
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 05 Jan 2012, 19:04 
Lobby Developer

Joined: 16 Mar 2007, 18:27
tried, failed to detect all required paths, and then nothing shows up when I run it ...

Code:
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)
Top
 Offline Profile  
 
 Post subject: Re: CheeseLobby *WIP*
PostPosted: 05 Jan 2012, 23:53 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
*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.
Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 99 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: bibim and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Site layout created by Roflcopter et al.