magefree / mage

Magic Another Game Engine
http://xmage.today
MIT License
1.9k stars 774 forks source link

Define X Value (e.g. Black Sun's Zenith) or Choices don't work correct using a Linux system while XMage tray bar icon is blinking #584

Closed quantumfx closed 8 years ago

quantumfx commented 10 years ago

Choosing X doesn't work and it always only ask you to pay BB. Used to work on previous versions. It looks like it might be a general issue for any card with casting cost X? screenshot from 2014-09-29 13 32 22

LevelX2 commented 10 years ago

I can't reproduce this problem. Is this linux os? And why is on your screenshot the declare window and the pay prompt shown? The Pay {B}{B} prompt is normally shown as you click the ok button of the define x value. You see it at the same time?

xcosts xcosts2

quantumfx commented 10 years ago

Yes this was on Ubuntu 14.04. When I play BSZ the declare value window comes up and "Pay {B}{B}" appears right after without giving me a chance to choose the value. No matter what {X} I choose, xmage thinks I chose 0.

Simown commented 10 years ago

I can confirm this for Linux OS (Linux Mint 17). I saw exactly the same issue @quantumfx is describing. I tried to play Mindswipe for X=4 and it resolved with X=0. I think this is a general choosing "X" issue rather than that specific card.

On another note I have just set up a dev environment and forked the repository, I'll take a look at it this week time permitting if it's not cleared up by then.

LevelX2 commented 10 years ago

Only change that I can remember that could have influence is: https://github.com/magefree/mage/commit/6d0d511323de3650295842dd5aecd65d124c7968 But also this doesn't look for me like it's related. @Simown If you got the time would be nice. I have no linux system available, so it's a bit hard to check and fix.

LevelX2 commented 10 years ago

Maybe this is also related: http://www.slightlymagic.net/forum/viewtopic.php?f=70&t=15336&sid=1febfc6710d4b8a2a6296a5e70c848da&start=45#p162383

fireshoes commented 10 years ago

That was my screenshot you linked to. I'm on Linux also (Centos 6).

Simown commented 10 years ago

I've had a quick look at it this evening and so far haven't found the root of the problem, yet. Initially I thought it was to do with the mousePressed/mouseReleased difference between Linux and Windows as @LevelX2 change linked to suggests, but I am beginning to think otherwise. I can only see the issue on human vs human games with two clients, but it's always repeatable. Any luck I'll have a fix before the weekend's out if I can find my way around the codebase!

LevelX2 commented 10 years ago

related: http://www.slightlymagic.net/forum/viewtopic.php?f=70&t=15960&p=167100#p167100

LevelX2 commented 10 years ago

There seems to be a Tray Icon / Application icon relation: http://www.slightlymagic.net/forum/viewtopic.php?f=70&t=15960#p167104 The problem only occurs when the Xmage icon in the taskbar notification area is blinking between brown and green. It only blinks like that when you have created a match and then a player joins or leaves the table. If you right-click the icon and choose Stop Blinking, you shouldn't have any problems with the choice boxes like Sylvan Caryatid or Phyrexian Revoker.

troyready commented 9 years ago

FWIW, I seem to be experiencing this issue consistently regardless of the blinking state of the tray icon.

LevelX2 commented 9 years ago

FWIW, I seem to be experiencing this issue consistently regardless of the blinking state of the tray icon.

Which Linux Distribution and which Desktop do you use?

troyready commented 9 years ago

It's Ubuntu 14.04 w/ the default Unity desktop environment. I've tried launching the client app with the launcher's provided Oracle JRE & my system's build of openjdk7 but the results are the same.

What is interesting is that it functions properly when testing against AI on a local server -- it's only when I try to use the public server with another real client that the issue manifests.

Simown commented 9 years ago

I had a look at this over the span of a few days and it looks like a generic Linux issue rather than a distribution specific one (e.g. Ubuntu). I wasn't able to get to the root of the problem, but was able to reproduce it fairly consistently. It doesn't only seem to happen Human vs Human. Maybe it's a concurrency issue or an odd quirk with Java on Linux.

LevelX2 commented 9 years ago

Just to get the problematic behaviour of the bug correctly: 1) You play a spell with a {X} cost. 2) The small window to choose {X} opens. 3) Meanwhile the program runs further and thinks you did choose X = 0. 4) But the window is still open. 5) As you push OK on the small window it closes and your can pay the remaining costs beside X. 6) It doesn't matter what you enter and confirm in the X window.

Is this description correct?

troyready commented 9 years ago

The issue that I'm experiencing is a bit different - nothing appears at all when I attempt to cast spells with a {0} mama cost (e.g. Mox Opal, Ornithopter). The card is highlighted purple (indicating that it can be cast), but no feedback at all appears when clicking on it.

In an AI game or on Windows, clicking on the card properly pops up a small black box with a "Cast..." option.

quantumfx commented 9 years ago

@LevelX2 that description is correct for the original bug reported.

LevelX2 commented 9 years ago

Related posts/infos: http://www.reddit.com/r/XMage/comments/2vllp6/serious_bug_with_protection_effects_ubuntu_1204/

fireshoes commented 9 years ago

Can we just update the code to take the blinking function out of the icon? The blinking starts when a player joins or leaves a table or when you open a new pack in draft (usually just if you are on a different screen when the pack opens).

fireshoes commented 9 years ago

Re: Bug Reports 1.3.0 dev 2015-02-07 Postby aging-goblin » 23 Feb 2015, 15:12

Confirmed on Arch Linux using DWM. All spells with X in casting cost are X=0 when the tray icon is blinking. It would be nice to be able to disable blinking, or disable the icon entirely.

skeet70 commented 9 years ago

I've experienced the same/a similar issue with any cards that require choices. If a choice of cards (eg Ancient Stirrings) or a search is required (eg Rampant Growth), no dialog comes up and the program doesn't accept any user input. The tray icon doesn't ever seem to blink. This is on Ubuntu 14.04 LTS.

Semi-randomly selecting the stop blinking option in the tray before the problem occurs seems to prevent it, trying to select it after lockup presents no context menu at all when clicking the tray icon.

Just thought I'd add my data to the issue. No errors or anything in the log files.

@LevelX2 do you have any ideas I could try to reproduce for you? I can setup the dev environment if necessary.

skeet70 commented 9 years ago

I'm trying to find out where this problem is coming from. For one thing, my tray icon blinks, but not when this problem occurs. Once the lockup has happened I also can't click the tray icon to tell it to stop blinking (not that it is). If my opponent quits I regain the ability to use the program again. I'm under the impression that the dialogs are being incorrectly created somehow, and you can't click anywhere until you've finished selecting things in those (hidden/non-existant) dialogs.

I can only get the client to run locally, can't get a server up, and can't connect to a remote server with the source client (even if I change the version constant to match the server's, I get NPEs when I try to connect), so I can't reproduce the issue in a version of the client that I can try debugging. Any advice?

ghost commented 9 years ago

Patch for this issue sent to LevelX

LevelX2 commented 9 years ago

Can anyone confirm, that the problem with 1.4.2v0 or later is fixed on linux systems?

Simown commented 9 years ago

I hasn't been an issue when I've been playing over the weekend, can't remember if there were any {X} cost cards, however. I will test it tonight if no one else confirms.

ghost commented 9 years ago

Important note for testing: The bug only occured when the tray icon was flashing! So make sure the tray icon blinks while testing (best option: you open the table, after a player joins the icon starts flashing. Do not click on the icon and you will have a flashing icon the whole match!). @LevelX2, didnt you mean 1.4.2v0? I fixed the bug after 1.4.1v3 release.

skeet70 commented 9 years ago

The bug wasn't related to flashing for me, but I'll try to check today if it's fixed.

On Mon, Jul 6, 2015, 5:07 AM Nidhoegger notifications@github.com wrote:

Important note for testing: The bug only occured when the tray icon was flashing! So make sure the tray icon blinks while testing (best option: you open the table, after a player joins the icon starts flashing. Do not click on the icon and you will have a flashing icon the whole match!).

— Reply to this email directly or view it on GitHub https://github.com/magefree/mage/issues/584#issuecomment-118818328.

LevelX2 commented 9 years ago

@LevelX2, didnt you mean 1.4.2v0? I fixed the bug after 1.4.1v3 release.

True that was a typo, I mean 1.4.2v0.

Simown commented 9 years ago

I have tested it on the development environment, Linux Mint 17.1 and it seems to be working and not showing the bug that was on X cost cards before, I have not exhaustively tested it but it has been working in all of my tests so far. If this fix was in 1.4.2v0 it should be in the release. I'd be happy to close it unless anyone finds a different result.

skeet70 commented 9 years ago

Tried to test it, but I couldn't get things to work unrelated. Had to pass proxy settings from the command line, and then the launcher (while running in java) says it can't find Java and won't let me start anything. I'll keep trying to get to the point where I can test this bug.

troyready commented 9 years ago

This is working perfectly for me now (Ubuntu 15.04) -- everything that I'd previously reported in this issue and the main 'define x' issue appear to be resolved. Thanks for the great work!