#309

Solved

Changing card order in client doesn't always change the order in server's game

Reported by Manu on OCTGN · 07/10/2010 10:55:30

Assigned to:
jods
Priority:
Normal
Status:
Solved
Category:
None
Version:
0.7.*
Issue type:
Bug

First of: OCTGN’s really a great program, thanks very much! I encountered a small bug. I’m using version 0.7.6.0 on Win7 32 bit.

Sometimes in a two player game, changing the order of the cards e.g. by pressing “page up” only affects one game, but isn’t done in the other . The bug is reproducable following these steps:

Server starts a new Magic game, 2 sided table. Client joins server on 127.0.0.1, server starts the game. Client loads deck consisting of exactly 2 cards. Client draws 2 cards with double click by mouse. Client plays both cards to the table via double-click, and moves them to his side of the table. Client moves one card a little bit away from the other, so that both are visible but still do overlap. Setting the cursor over the card in the back and pressing “page up” only changes the order in the client’s game, not in server’s game.

I’ve done some searching, I think the reason is the interplay of the functions Octgn.Play.Group.SetCardIndex(…) and Octgn.Networking.Handler.MoveCardAt(…).
In Group.cs in the fct Octgn.Play.Group.SetCardIndex, I don’t quite understand “if (idx > currentIdx) idx—;”, perhaps it should be replaced by “if (idx >= cards.Count) idx = cards.Count – 1;”.
Because in combination with MoveCardAt “if (card.Group == table) { if (idx >= table.Count) idx = table.Count – 1; }” the original destination index of 2 gets finally reduced down to 0, having no effect on server side.

Attachments

No attachment has been uploaded, yet.


Loading comments...