openplanet-nl / plugin-signing

The place to request plugin signatures.
7 stars 1 forks source link

Alt Camera Blocker 1.0 #108

Closed ZayshaaCodes closed 2 years ago

ZayshaaCodes commented 2 years ago

Plugin description

Disables the ability to switch to alternate cameras when you double tab the camera change button.

Did you provide a perms meta value or a #perms preprocessor option?

no

Did you use Permissions.as?

no

Attach your plugin

AltCamBlocker.zip

codecat commented 2 years ago

This plugin will crash the game when the address is not found. Game updates are therefore very likely to crash the game. You should check for this possibility.

Additionally; have you tried solving this problem without a hook? Is it not possible?

ZayshaaCodes commented 2 years ago

Dev::FindPattern() will return invalid pointers? in my tests it would just return zero, and i am checking for that before hooking, what would you suggest?

i did try to solve it without hooks, if i try and change the needed value back the next Update() it still causes the camera to interpolate back and forth. i can try some more but i'm skeptical i'll be able to get around that without hooking into the function to force the value back before any internal updates to the camera position can happen.

codecat commented 2 years ago

Oh sorry, I missed that, you're right. I didn't see you were checking for 0.

You might be able to find the actual interpolation time or a value whether the interpolation is currently happening. (Perhaps you could even disable it?) Either via some Dev offset or as an actual visible property.

I know for a fact this pattern won't work for the next update (I just checked it on the alpha) so perhaps it is better to find another way that doesn't require hooks. I'm always kinda anxious to sign plugins that use patching or hooking, especially if it's something that a lot of people might end up installing, because it might suddenly crash a bunch of people's games w/o any explanation why except "it's Openplanet's fault".

I'll sign it either way, if you want, but I'd recommend you put a big disclaimer on your description about it possibly breaking in future updates, or using max_game_version and manually keeping your plugin updated for each game update. So if you can find a non-Dev method of doing this, that would be preferable of course!

ZayshaaCodes commented 2 years ago

I understand completely. I was expecting some objections :P. Can I just use the current date for max_game_version? Or where do I find that for the current version? I'll gladly do that just to be safe. would you like me to resend with that change to sign it?

I was kind of expecting the next update to break it, but i figured it would just not find the address and not work. but not crash the game either. i'll include a disclaimer regardless.

and i'll keep searching for a less volitile method.

codecat commented 2 years ago

From this page about info.toml:


The metadata under the [game] tag consists of game versions. Game versions are given by the format "YYYY-MM-DD" or "YYYY-MM-DD HH-mm" with time being given in the 24-hour format. Following metadata is supported:

ZayshaaCodes commented 2 years ago

Alright, i'd found that but it was unclear if i could just use any date more recent than the current game version. that's ok. i can test it in a bit to find out.

If i were to check the game version via code to disable the hook when the version changes, then i could have it issue the disclaimer before trying to hook, in the event it failed (like a crash) it would keep itself disabled so the user could still run the game without issue. Do you think would that be a good alternative to using max_version?

ZayshaaCodes commented 2 years ago

Also, I find it interesting that bit of game logic has changed in the alpha version. Do you know if they are adding options to disable the alternate cams? if so i'll just not release this and wait.