jdmonin / JSettlers2

Java Settlers project home, downloads, and GPLv3 source code. To download the latest version as a JAR, see https://github.com/jdmonin/JSettlers2/releases/latest .
http://nand.net/jsettlers/
GNU General Public License v3.0
160 stars 63 forks source link

Unknown card #21

Closed alesky78 closed 7 years ago

alesky78 commented 7 years ago

after buy card same this you receive an unknown card

jdmonin commented 7 years ago

Hi alesky78,

Can you please provide more details and steps so I can reproduce the issue?

Thank you, -Jeremy

alesky78 commented 7 years ago

Hello jdmonin

unfortunatelly i'm not able to replicate the behavior and recreate the issue

i can just give you a description of what happened

this are the steps: 1- applicatio strated from the JSetter client 2- start server botton 3- pratics 4- created game

.... 5- during the match i bought a card but the system give me in the list of my card the Unknown card.. i also try to use it.... to verify if it was just a lable issue... but the system didnt reconize the action to do

neilweber commented 7 years ago

Do you have a resources/version.info file on the classpath? Without one, the client version is set to "error" and that causes a problem for some backward compatibility logic in the handling of development cards. There is a client version check in SOCGameMessageHandler.handleBUYCARDREQUEST() that converts the KNIGHT card to KNIGHT_FOR_VERS_1_X if the client version is less than 2000. If the client version is "error", this causes KNIGHT cards to be sent to the client as a 0 (instead of 9) which is no longer a valid value and is treated as "unknown."

jdmonin commented 7 years ago

Thanks @neilweber , that's a good theory. I've committed ff1057a so the client won't connect if it can't read its own version.

neilweber commented 7 years ago

It's more than a theory, because it happened to me when I downloaded the source code and ran the JSettlers2 client without ever having run the ant script. Once I found the problem, I ran the ant script and all was well. With your change, I think it's safe to mark this issue as closed.

jdmonin commented 7 years ago

That's good news, thank you again! Neil and Alessandro, this should be fixed: The client and server now check for the packaging error that caused this bug. If it reappears please open a new issue with details.