Znote / ZnoteAAC

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

Nostalrius 7.72 compatibility #343

Closed Znote closed 4 years ago

Znote commented 5 years ago

Nostalrius is a TFS 1.2 backported to client version 7.72. Presumably with a good data pack that represents itself as a 7.72 clone of the good old days. The release has gotten attention and people are starting to use it.

Issue initiated: https://otland.net/threads/znote-aac-1-4-tfs-0-2-13-tfs-0-3-6-0-4.166722/page-60#post-2545051

Nostalrius release: https://otland.net/threads/nostalrius-7-7.262407/#post-2538042

Nostalrius github: https://github.com/TwistedScorpio/Nostalrius

Someone has already modified a version of Znote AAC for nostalrius (by breaking/modifying TFS_10 engine compatibility): https://otland.net/threads/znote-change-name-to-id.262497/#post-2538850

Since this is based on TFS 1.2, I don't think we need to identify it as its own server engine. Instead, we can grab client version from config.php to determine what availability we should have in the database. (client 7.72 = 772 = no name field in accounts table etc). And adjust the neccesary TFS 1.2 queries to support the backport.

Does anyone actually remember which protocol version account ids got changed into name? I can't remember the exact version.

Nottinghster commented 5 years ago

Version 8.3

tarantonio commented 5 years ago

You have to modify register.php to accept only numbers: if (preg_match("/^[0-9]+$/", $_POST['username']) == false) { $errors[] = 'Your account name can only contain characters 0-9.'; }

Also, the best way to manage the account numbers is to generate them from the aac itself, and not get them typed by hand from the user.

tarantonio commented 5 years ago

I think OTHire should be renamed to ‘OLDTIBIA’ or similar because Nostalrius and OTHire share the same needs in terms of features. They only accept numbers on account ids, and the best way to manage them is to create those numbers automatically on register, instead of try to guess an empty one.

Znote commented 5 years ago

@tarantonio No, because there are other differences in the database, inconsistencies in the naming of columns. For instance: https://github.com/Znote/ZnoteAAC/blob/58e6300cf71c28b27d46f000b4b29388774896e2/characterprofile.php#L119-L135

This sample shows TFS_10 by default uses townid, TFS 0.3/4 uses town, and OTHire uses townid. (without an underscore ) Therefore, Nostalrius using a stripped down version of TFS 1.2 will not directly match OTHire, even though the protocol mandates a similar structure. (i.e the ServerEngine is different, column names and references in the database is different).

What I suggest is to use $config['client'] to determine difference in availability in the database even if the ServerEngine is the same. Thus OTHIRE is not neccesarily OLDTIBIA, its an own engine based on otserv (if I remember correctly), and it could potentially support multiple protocols depending on what the developer of that engine wants to do.

tarantonio commented 5 years ago

@Znote what about to generate account id with numbers automatically from the aac? That's the best way to manage in old versions, like RL Tibia did. Maybe an email sent to user with credentials should be helpful

Znote commented 5 years ago

@tarantonio Sure, will add it to config

tarantonio commented 5 years ago

Only to remember, no bank balance on Nostalrius so house auctions can check depot gold amount or similar.

Znote commented 4 years ago

I'm very hesitant on pushing Nostalrius support.

  1. The last closed issue is 6 months ago, 2 months ago since a comment.
  2. Overall activity there is low, there arent many commits.
  3. Its based on TFS 1.2 which is already over 3 years old.
  4. The owner decided to mess up the database structure, forcing me to spend much time if I want to support it. It should have retained the TFS 1.2 database schema
  5. The repo doesn't have the previous commit history, and is separated from the TFS git network, making maintaining the project harder.

Maybe someone can bother @nekiro to create a 7.7 downport fork of TFS. His repo https://github.com/nekiro/forgottenserver is absolutely awesome.