Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable currentTerrariaVersion in config?It cause some problem when some plugins check player version. #95

Closed
ACaiCat opened this issue Apr 9, 2022 · 8 comments · Fixed by #98

Comments

@ACaiCat
Copy link

ACaiCat commented Apr 9, 2022

 ```

The currentTerrariaVersion in config makes some plugins check player version wrongly.
Plugins check the player version normally when player join the fisrst Server.But when play use command to enter anther server,all plugins's player version check result is currentTerrariaVersion(230).It cause PC player's client version is changed into 1.4.0.5(230),but the server version is 1.4.3.2.It causes many bugs.
Last week,I turn to a lot of people who understand TShock programming in China.Almost everyone thinks that it is currentTerrariaVersion
in config.js problem, not @Moneylover3246‘s Crossplay.But they have not time to further research Dimensions.So I ask help for you.
Chinese players just use 1.4.0.5 and 1.4.3.2.So we must use CrossPlay to allows for cross-platform play.
Dimensions is the most stable multi world I've ever seen, so I'm not like giving up using it.Could you share a solution or help me modify the code?

@ACaiCat
Copy link
Author

ACaiCat commented Apr 9, 2022

The "加入了多人运动" means "have joined" . "正在连接" means “Connecting”
IMG_20220407_185426
IMG_20220407_185045
IMG_20220407_184405

@popstarfreas
Copy link
Owner

The currentTerrariaVersion is used when switching for all players. Are you saying you want to use the client version instead?

@ACaiCat
Copy link
Author

ACaiCat commented Apr 9, 2022

Yes

@popstarfreas
Copy link
Owner

popstarfreas commented Apr 9, 2022

Option 1 (Extension):
You could create an extension to read and force the client's own version in the connect request packets (similar to MCL in a way), e.g. https://github.com/popstarfreas/dimensions-mcl/blob/6fdfeaa01a665c7c04d93f14bdf34e53317dc481/app/priorclienthandler.ts#L44-L62 is where MCL for 1412 and above rewrites to 1.4.1.1, which could be changed to store the version of the client and then force it for every new connect request sent by the same client.

Option 2 (Dimensions):
Where currentTerrariaVersion is used:
https://github.com/popstarfreas/Dimensions/blob/dev/app/node_modules/dimensions/client.ts#L445-L449

You can replace it with the client version, but you also need to obtain that information which dimensions does not currently, but you could add it: https://github.com/popstarfreas/Dimensions/blob/dev/app/node_modules/dimensions/clientpackethandler.ts#L49-L66 in there is where client packets are parsed, you can just add one for connect request and store the version in the client object.

If you go for option 2, it might be worth making a PR for it so that the config option is not necessary anymore. Of course if you are not a programmer than possibly I can do option 2 myself at some point.

@ACaiCat
Copy link
Author

ACaiCat commented Apr 9, 2022

OK,I will have a try.Thank you for you answer.

@ACaiCat
Copy link
Author

ACaiCat commented Apr 10, 2022

I seem to have failed.I don't know how to add one for connect request.

@ACaiCat
Copy link
Author

ACaiCat commented Apr 23, 2022

I think that I must fix it as soon as possible because players on my server is a little angry.Could you help me do option 2?

@popstarfreas
Copy link
Owner

I'll see what I can do.

popstarfreas added a commit that referenced this issue Apr 24, 2022
Removes currentTerrariaVersion from config. Fixes #95
popstarfreas added a commit that referenced this issue Apr 24, 2022
Removes currentTerrariaVersion from config.

Fixes #95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants