It is currently 10 Dec 2018, 23:51
   
Text Size

Maven project

Moderators: silly freak, CCGHQ Admins

Maven project

Postby nantuko84 » 27 Aug 2010, 03:51

Could you please create general pom file, to build the project at once? It will define the build order. Otherwise you need to guess what to build first.

And tests in TreeProperties are broken, I had to use -DskipTests to build it.
Code: Select all
Results :

Tests in error:
  testPropertiesFormat(net.slightlymagic.treeProperties.dom4j.TestDOM4JImpl)

Tests run: 5, Failures: 0, Errors: 1, Skipped: 1
Thanks.
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Maven project

Postby silly freak » 27 Aug 2010, 17:11

nantuko84 wrote:And tests in TreeProperties are broken, I had to use -DskipTests to build it.
Code: Select all
Results :

Tests in error:
  testPropertiesFormat(net.slightlymagic.treeProperties.dom4j.TestDOM4JImpl)

Tests run: 5, Failures: 0, Errors: 1, Skipped: 1
Thanks.
The problem might be that the test is not platform independent (prepending "file:" to a path might be the correct URL on linux, but is not on windows)

As for a master POM, I will try, but I'm pretty new to maven. e.g. where should I place it? (btw, I have looked in your repo to find a little info, but couldn't find any POMs?)
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Maven project

Postby nantuko84 » 28 Aug 2010, 10:28

you have to put master pom into root directory (in your case it is /trunk)

then, along with other properties, it will have 'pom' in packaging:
Code: Select all
    ...
    <artifactId>some-root</artifactId>
    <version>0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    ...
and the build order. I usually do it in default profile:

Code: Select all
<profiles>
    <profile>
        <id>normal-build</id>
        <modules>
            <module>module1</module>
            <module>module2</module>
            <module>module3</module>
        </modules>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
    </profile>
...
</profiles>      
Also as far as I remember all modules should have ref to parent pom in <parent> tag.

MagicWars unfortunately doesn't use maven ;( we use jardesc for building jar and ant for other stuff.
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Maven project

Postby silly freak » 28 Aug 2010, 14:52

thank you very much for your help! I looked around and found profiles, but not how to use modules. I tried and built the project using the master pom, so hopefully it works for you too.

btw, did you add any comments on google code? i don't know if I get a mail when you would do so. so, if you added a comment, that's the reason I didn't see it yet ;)
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Maven project

Postby nantuko84 » 30 Aug 2010, 03:44

I added one comment, have you seen it?
to get notification, you need to put "stars" before every commit in the first column. usually (but not always for some reason) it is being set automatically for your own commits. also it is possible to configure receiving notifications in Administer - Source - Email all comments to: []

one question: in the code I need to send move to zone event to clients, what is the best (right) way to do it. Should I add moveCard listeners to every card? if so, should it implement MoveCardListener or MoveCardListener.Internal?
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Maven project

Postby silly freak » 30 Aug 2010, 14:03

you shouldn't use the Internal interface. the internals are only meant for inside the rules-engine. For example, the zones have internal move card listeners to add/remove moved cards automatically.

however, since you're talking about GUI, you should probably use a PropertyChangeListener, see here starting at line 161. The reason is that the PCL will also be notified undo. In LM, this happens during the normal flow of the game if you can't pay for an action, for example.

And thanks for the tip on comments, I enabled it now. I haven't seen or found your existing comment, however.
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Maven project

Postby nantuko84 » 31 Aug 2010, 10:49

hi, thanks for your tip regarding listener.
one more question if you don't mind:
whenever you start playing any magic object (PlayAction), you move the object to Zones.Stack. In this case the card will be displayed to all players (as listeners will be informed that new object came to Stack zone).
In case player chooses not to play the card, or there is not enough mana in manapool, the card will be returned back to Zones.Hand. But all players have already seen the card, so got some extra information.
What is the best way to fix that? Is there any possibility to separate these two events: when player puts spell info the stack, and when player finished choosing targets, additional costs, paying manacost, etc. so other player will be allowed to see new card in the stack.
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Maven project

Postby silly freak » 31 Aug 2010, 12:12

Rules-wise, it's the correct behavior. Putting the spell onto the stack is the first action in playing it, and all players will see it at that point (unless the card is face-down...):

601.2a. The player announces that he or she is casting the spell. That card (or that copy of a card) moves from where it is to the stack. It becomes the topmost object on the stack. It has all the characteristics of the card (or the copy of a card) associated with it, and that player becomes its controller. The spell remains on the stack until it's countered, it resolves, or an effect moves it elsewhere.
so I don't see a need for this. If you absolutely need to do so, I would suggest to make an actor that caches all the choices and only then performs the actual casting. this would be a pretty dirty hack, though; it duplicates the functions in PlayAction and will mess up if they don't sync (e.g. you have to account for additional payments to have the right choices ready)

EDIT: This is a little futuristic, but it could probably be implemented sometimes by playing the card in an alternate Universe and then echoing the actions in the actual game. I don't know how this could work with a client-server based architecture where clients don't have the whole game state...
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Maven project

Postby nantuko84 » 31 Aug 2010, 14:50

ok, I don't like this hacks, so will just keep it as is for a while

then another side effect of such behavior is card blinking in the stack.
if you run TestCardPanel and will try to play the spell, then it will appear and disappear immediately from the stack whenever you have not enough mana in your manapool.
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Maven project

Postby silly freak » 31 Aug 2010, 22:46

you *were* right, but looking at the newest revision it doesn't matter at all, because you can now pay after announcing the spell ;)
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 1 guest

Login Form