Znote / ZnoteAAC

Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server.
MIT License
145 stars 127 forks source link

Added client 11 and above restriction to login webservice #414

Closed EPuncker closed 4 years ago

EPuncker commented 4 years ago

not tested

Znote commented 4 years ago

$config['client'] is often used to auto-generate download links to tibia clients, unfortunately we don't have a good download mirror for clients above 11.

https://github.com/Znote/ZnoteAAC/blob/ada8e470d80309a00997203b1f0af2c6c0a7c7d4/config.php#L629-L635

This means that many client 11 servers also supplement the classic client for those who wish to use that, and use this configuration to let them easily download the classic client instead.

If they were to get this patch, their client 11 players wouldn't be able to login to the game server. I wonder if a better method would be to read the client 11 response and see if they provide which version they are, and use that instead?

Or just another config value (default to true) that allows you to toggle login protocol for client 11?

OR improve this PR by sending a dialog box back to the client, telling them the client they should use for this OT server.

EPuncker commented 4 years ago

@Znote ok, like this? or should it be === true?

Znote commented 4 years ago

Both works fine for this scenario.

In PHP, the difference between == and === is: double: Verify that the value matches triple: Verify that the value and type matches

so etc:

if (true == 1) // Returns "true" because "true" is considered value 1. (false is value 0)
if (true === 1) // Returns "false" because true is a boolean type, and 1 is an integer type.