astra1dev / AUnlocker

🔓Unlock Among Us: cosmetics, account, chat and more!🎉
GNU General Public License v3.0
30 stars 2 forks source link

chat messages auto-sending #25

Closed Cube-from-Blender closed 1 week ago

Cube-from-Blender commented 2 weeks ago

Randomly when im chatting, it auto-sends i have no idea why this happens, if you could fix this bug it would help not make me look like an idiot, thanks

im playing on the latest version of AUnlocker on the latest update

astra1dev commented 2 weeks ago

I have had this issue myself. However, resolving this might require some more testing. If you have any more details on when and why this occurs exactly, please let me know.

Cube-from-Blender commented 2 weeks ago

i think it's because of this image

astra1dev commented 2 weeks ago

Possible. Could you try setting ChatPatches in the file [your-among-us-location]/BepInEx/AUnlocker.cfg to false? @Cube-from-Blender

Cube-from-Blender commented 2 weeks ago

@astra1dev i decided to do that, and it doesn't auto-send anymore, so its definetly one of the Chat Patches

astra1dev commented 2 weeks ago

Alright thank you. I will do some more testing on what exactly is causing this and then publish a new version with the fix and maybe some new features. Have a nice day 😄

astra1dev commented 2 weeks ago

I found the bug and will fix it in the next update.

for anyone interested, the issue is that in ChatPatches.cs the characters: newline (\n) and carriage return (\r) are not forbidden

public static bool Prefix(TextBoxTMP __instance, char i, ref bool __result)
    {
        if (AUnlocker.PatchChat.Value)
        { 
            __result = !(i == '\b');    // this caused the OP's issue, 
                                        // checks for \r and \n will be added next update 
            return false;
        }
        else return true;
    }
astra1dev commented 1 week ago

Closing as v1.1.7 fixes this.

redphantom1000 commented 1 week ago

So return symbols can no longer be typed in chat? Nice. I had this issue when using aunlocker on TOHE lobbies and being unable to use commands witbout clicking the send button instead of enter. Temporarily resolved by turning off chat patches

astra1dev commented 1 week ago

Yes, with v1.1.7 you should be able to use tohe commands with ChatPatches enabled

redphantom1000 commented 1 week ago

Thanks