Image Image Image




Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 12:20 am 
Offline
Regular member
User avatar

Posts: 64
Favourite Bot: MCTSBot
Can you try not setting a single root project?


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 1:07 am 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Well, I can't really do that in JIDea, or I need to look for that. If I don't set any root, by default the one associated with the project you run is used (and project here is not everything, but all subprojects are separate project). So I have different root for server and for client.

I guess it should be somehow configurable to use more roots, but I'm not sure how. Well, anyway as I've seen things almost running 100% fine (and the new version looks better) this was quite motivating, so I might do a script that copies all resources to a single folder/root (something like this will help for producing builds anyhow).

It would be some good learning curve thou, next things I wanted to look at are basically:
1) What is your client/server protocol
2) Look at the bot API and possibly develop a Meerkat bridge to it. Setup few simple bots to play.
3) Make a client build so people can also play against bots
4) Automate the whole compile trunk -> build a release -> test full blown with bots process. This must have if someone starts to use CSPokerm, that is beyond looking at the code as a sample

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 3:11 pm 
Offline
Regular member
User avatar

Posts: 64
Favourite Bot: MCTSBot
I just noticed because of the problems you have: the image resources in the SWT client are loaded as files from a fixed path. This will not work when you make a jar for the client. This part should be rewritten to use the classloader to read from the image files so that the images can be included in the jar.


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 5:15 pm 
Offline
Regular member
User avatar

Posts: 64
Favourite Bot: MCTSBot
I changed the client so that it loads it images through the classloader. There's a good chance that your problems with misisng images are solved now if you update.


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 8:43 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Somehow now I'm getting exception when I open table, and I can't overcome that by changing or removing roots.

Last time (in a different dev. environment, I don't have ti with me now) I had the same thing and I managed to overcome this by setting a root folder.

I will experiment more, and eventually also try the new sources - in my other dev. environment.

Attachment:
error1.PNG
error1.PNG [ 63.97 KB | Viewed 1374 times ]


Code:
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalArgumentException: Argument cannot be null)
   at org.eclipse.swt.SWT.error(SWT.java:3563)
   at org.eclipse.swt.SWT.error(SWT.java:3481)
   at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
   at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
   at org.cspoker.client.gui.swt.window.LobbyWindow.show(LobbyWindow.java:484)
   at org.cspoker.client.gui.swt.control.ClientCore.run(ClientCore.java:162)
   at org.cspoker.client.gui.swt.control.ClientCore.main(ClientCore.java:83)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.lang.IllegalArgumentException: Argument cannot be null
   at org.eclipse.swt.SWT.error(SWT.java:3547)
   at org.eclipse.swt.SWT.error(SWT.java:3481)
   at org.eclipse.swt.SWT.error(SWT.java:3452)
   at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:125)
   at org.eclipse.swt.graphics.ImageDataLoader.load(ImageDataLoader.java:22)
   at org.eclipse.swt.graphics.ImageData.<init>(ImageData.java:328)
   at org.eclipse.swt.graphics.Image.<init>(Image.java:545)
   at org.cspoker.client.gui.swt.control.SWTResourceManager.getChipImage(SWTResourceManager.java:263)
   at org.cspoker.client.gui.swt.control.Chip.getImage(Chip.java:117)
   at org.cspoker.client.gui.swt.window.TableComposite.drawChips(TableComposite.java:478)
   at org.cspoker.client.gui.swt.window.TableComposite$1.paintControl(TableComposite.java:161)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:216)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
   at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1270)
   at org.eclipse.swt.widgets.Control.windowProc(Control.java:3725)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:4364)
   at org.eclipse.swt.internal.win32.OS.RedrawWindow(Native Method)
   at org.eclipse.swt.widgets.Control.update(Control.java:3537)
   at org.eclipse.swt.widgets.Control.update(Control.java:3527)
   at org.cspoker.client.gui.swt.window.TableComposite.updateTableGraphics(TableComposite.java:563)
   at org.cspoker.client.gui.swt.window.GameWindow$1.paintControl(GameWindow.java:135)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:216)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
   at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1270)
   at org.eclipse.swt.widgets.Control.windowProc(Control.java:3725)
   at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:291)
   at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1584)
   at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1753)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:4351)
   at org.eclipse.swt.internal.win32.OS.UpdateWindow(Native Method)
   at org.eclipse.swt.widgets.Decorations.setVisible(Decorations.java:1393)
   at org.eclipse.swt.widgets.Shell.setVisible(Shell.java:1599)
   at org.eclipse.swt.widgets.Shell.open(Shell.java:1080)
   at org.cspoker.client.gui.swt.window.GameWindow.show(GameWindow.java:406)
   at org.cspoker.client.gui.swt.window.LobbyWindow$1$1.run(LobbyWindow.java:190)
   at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
   at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
   ... 10 more
20:39:10,095 INFO  (org.cspoker.client.gui.swt.control.ClientCore.java:167) [run] - Attempting reset
20:39:10,111 ERROR (org.cspoker.client.gui.swt.control.ClientGUI.java:303) [displayException] - Unexpected error during client execution
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalArgumentException: Argument cannot be null)
   at org.eclipse.swt.SWT.error(SWT.java:3563)
   at org.eclipse.swt.SWT.error(SWT.java:3481)
   at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
   at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
   at org.cspoker.client.gui.swt.window.LobbyWindow.show(LobbyWindow.java:484)
   at org.cspoker.client.gui.swt.control.ClientCore.run(ClientCore.java:162)
   at org.cspoker.client.gui.swt.control.ClientCore.main(ClientCore.java:83)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.lang.IllegalArgumentException: Argument cannot be null
   at org.eclipse.swt.SWT.error(SWT.java:3547)
   at org.eclipse.swt.SWT.error(SWT.java:3481)
   at org.eclipse.swt.SWT.error(SWT.java:3452)
   at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:125)
   at org.eclipse.swt.graphics.ImageDataLoader.load(ImageDataLoader.java:22)
   at org.eclipse.swt.graphics.ImageData.<init>(ImageData.java:328)
   at org.eclipse.swt.graphics.Image.<init>(Image.java:545)
   at org.cspoker.client.gui.swt.control.SWTResourceManager.getChipImage(SWTResourceManager.java:263)
   at org.cspoker.client.gui.swt.control.Chip.getImage(Chip.java:117)
   at org.cspoker.client.gui.swt.window.TableComposite.drawChips(TableComposite.java:478)
   at org.cspoker.client.gui.swt.window.TableComposite$1.paintControl(TableComposite.java:161)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:216)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
   at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1270)
   at org.eclipse.swt.widgets.Control.windowProc(Control.java:3725)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:4364)
   at org.eclipse.swt.internal.win32.OS.RedrawWindow(Native Method)
   at org.eclipse.swt.widgets.Control.update(Control.java:3537)
   at org.eclipse.swt.widgets.Control.update(Control.java:3527)
   at org.cspoker.client.gui.swt.window.TableComposite.updateTableGraphics(TableComposite.java:563)
   at org.cspoker.client.gui.swt.window.GameWindow$1.paintControl(GameWindow.java:135)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:216)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
   at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1270)
   at org.eclipse.swt.widgets.Control.windowProc(Control.java:3725)
   at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:291)
   at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1584)
   at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1753)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:4351)
   at org.eclipse.swt.internal.win32.OS.UpdateWindow(Native Method)
   at org.eclipse.swt.widgets.Decorations.setVisible(Decorations.java:1393)
   at org.eclipse.swt.widgets.Shell.setVisible(Shell.java:1599)
   at org.eclipse.swt.widgets.Shell.open(Shell.java:1080)
   at org.cspoker.client.gui.swt.window.GameWindow.show(GameWindow.java:406)
   at org.cspoker.client.gui.swt.window.LobbyWindow$1$1.run(LobbyWindow.java:190)
   at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
   at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
   ... 10 more
20:39:10,111 INFO  (org.cspoker.client.gui.swt.control.ClientGUI.java:322) [displayMessage] - Failed to execute runnable (java.lang.IllegalArgumentException: Argument cannot be null)

org.eclipse.swt.SWT.error(SWT.java:3563)
org.eclipse.swt.SWT.error(SWT.java:3481)
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
org.cspoker.client.gui.swt.window.LobbyWindow.show(LobbyWindow.java:484)
org.cspoker.client.gui.swt.control.ClientCore.run(ClientCore.java:162)
org.cspoker.client.gui.swt.control.ClientCore.main(ClientCore.java:83)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 8:53 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Now I recall how I overcome this:

1) I set server root to:
dev\server\allcommunication\src\main\resources

2) I copy everything from:
dev\client\gui\swt\src\main\resources
to:
dev\client\gui\swt\target\classes
and I set the client root to that one. E.g., the Snd folder is originally not present there.

Then it runs fine, until I play a hand and reach showdown - then I get again exception (previously, before your modifications, I was somehow getting the file involved and needed, but now I'm only getting generic exceptions like the above one).

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 9:25 pm 
Offline
Regular member
User avatar

Posts: 64
Favourite Bot: MCTSBot
How to run a jar with all dependencies:
-go to /cspoker/client/gui/swt$
-execute "mvn assembly:assembly"
-go to "target"
-double click or execute " java -jar client-gui-swt-0.1-SNAPSHOT-jar-with-dependencies.jar"

Make sure you update before doing this. It shows that the resources are correctly found by the SWT client.
If you don't get IDEA to work then this can be a way to test your code.


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 9:43 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
With Maven I'm still getting the failure to resolve dependencies.

Code:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) org.cspoker:client-communication-remote-all:jar:0.1-SNAPSHOT
  Try downloading the file manually from the project website.


What's the reason btw of not having all resources under single root (of course different for client & server)?
Why would you want to put the resources in a jar file? Having them just inflated on the FS will make independant modding easier, which is normally good.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 9:50 pm 
Offline
Regular member
User avatar

Posts: 64
Favourite Bot: MCTSBot
also for mvn install?
what OS and version of maven are you using?

clearly your installation of maven has something wrong with it.


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 10:24 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
OK, I managed to build client-gui-swt-0.1-SNAPSHOT-jar-with-dependencies.jar with Maven.

You have the manifest.MF wrong in it, the "control" was missing in:
Main-Class: org.cspoker.client.gui.swt.control.ClientCore

I think the client ran fine then, but I faced few bugs, one was when hands got dealt, the cards of the opponent (their back) weren't shown, I tried once again, got 2 players allin, they went to showdown, it was resolved, but just after that I got exception.

Is there some overview what is the current state of this version, who's working on what?

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 11:15 pm 
Offline
Regular member
User avatar

Posts: 64
Favourite Bot: MCTSBot
Howcome it suddenly does work?

The missing "control" bug was fixed in r1282 when I was trying this out myself. You should update :-)

The SWT client is work by Stephan. He just had his second child so he's been inactive for about 2 months.
For server bugs you should talk to Kenzo.
For communication bugs you should talk to me.
In any case it's better to make an issue in the issue tracker or email the mailing list.


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sun Mar 08, 2009 11:57 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
The maven thing was pretty stupid, I was calling maven with absolute paths, instead of setting PATH as environment setting. This fixed the issue which bugged me originally. So I can compile the client now, but not the whole thing (bots aren't getting compiled).

Is there some kind of architecture overview? What is this communication layer at all?

Code:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
E:\CSPoker\CSPoker\dev\client\bots\src\main\java\org\cspoker\client\bots\bot\sea
rch\node\OpponentActionNode.java:[51,21] unmappable character for encoding Cp1252
E:\CSPoker\CSPoker\dev\client\bots\src\main\java\org\cspoker\client\bots\bot\sea
rch\node\OpponentActionNode.java:[51,21] unmappable character for encoding Cp1252

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Mon Mar 09, 2009 12:15 pm 
Offline
Regular member
User avatar

Posts: 64
Favourite Bot: MCTSBot
There was a bad character in the comments of that file. I think it should be fixed now.

The communication protocol can be either XML over sockets (for Flash), XML over HTTP (Rest) or RMI.
For each protocol there is a server module that accepts connections and a client module in Java. The Java API at the client side is identical for all modules so the protocol is abstracted away.


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Mon Mar 09, 2009 8:12 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Which class represents the client side Java API/interface?

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Tue Mar 10, 2009 1:08 am 
Offline
Regular member
User avatar

Posts: 64
Favourite Bot: MCTSBot
The Client API implements http://code.google.com/p/cspoker/source ... erver.java
As you can see it consists of multiple sub-interfaces.

There's a wrapper for these classes that adds extra functionality in http://code.google.com/p/cspoker/source ... ntext.java but it's API is a moving target.


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Wed Jan 13, 2010 7:51 pm 
Offline
Regular member
User avatar

Posts: 76
Favourite Bot: workinprogress...
Is this code still being developed ?

I'll switch from C++ to java if it is. i downloaded all code and it won't compile,
with netbeans. i'm just after a basic framework rather than coding my own from
scratch. wondering if it's my lack of java skills or just a pain to get running...


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Fri Jan 15, 2010 5:17 pm 
Offline
Regular member
User avatar

Posts: 76
Favourite Bot: workinprogress...
fixed it, jdk was set up wrong - my fault !


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Thu Jan 21, 2010 11:53 pm 
Offline
Junior member
User avatar

Posts: 14
Favourite Bot: Deep Thought
Code-Monkey wrote:
Is this code still being developed ?


Afaik - no it is not.

The thread below suggests that development ceased a few months ago...
http://groups.google.com/group/cspoker-discuss/browse_thread/thread/d8b2af66af53a08c


Top
 Profile E-mail  
 
 Post subject: Re: Compiling trunk
PostPosted: Sat Jan 30, 2010 5:35 pm 
Offline
Regular member
User avatar

Posts: 76
Favourite Bot: workinprogress...
mmm that's a pain. looks like i'll have to port the classes over to C++ for the framework of my bot.


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2


Who is online

Users browsing this forum: No registered users and 1 guest


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: