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

Cannot connect to channels when their name ends with an underscore #27

Open
ItsBrando opened this issue May 8, 2018 · 8 comments
Open
Labels

Comments

@ItsBrando
Copy link

ItsBrando commented May 8, 2018

I cant connect to my twitch account to read my chat, i can connect to other ones just not mine, im not sure if its because of the two underscores in my name or what.
Account- ItsBrando__

@Hotrian
Copy link
Owner

Hotrian commented May 8, 2018

Yeah, I would guess that it may be due to your username’s format. It’s been quite a while since I worked on OVRTC so I’m not sure. That said, I’m also not sure when I can patch this, but I’ll look into it regardless.

@ItsBrando
Copy link
Author

Oh don’t worry about it I changed my name on twitch thanks anyways though :)

@joseph-allen
Copy link

sounds like a simple string conversion in the right place might do it, if you point me to the file I can give it a go @Hotrian

@Hotrian
Copy link
Owner

Hotrian commented Dec 29, 2018

@joseph-allen this one handles the actual Twitch procedures but may not be the one causing issues with the trailing underscore.

@joseph-allen
Copy link

i think this is the submission not the chat itself?
same as issue 29

@Hotrian
Copy link
Owner

Hotrian commented Dec 30, 2018

#29 was caused by Unity not being able to draw certain characters afaict. I never finished figuring out what was causing the issue with the trailing underscore as no one else ever brought it up, and @ItsBrando changed his Twitch name so it didn't seem to be an issue for anyone anymore (although I acknowledge there could be other users who have experienced this issue but never took the time to bring it to my attention).

@Hotrian Hotrian changed the title Cant Connect To Account Cannot connect to channels when their name ends with an underscore Jun 26, 2020
@Hotrian Hotrian added the Bug label Jun 26, 2020
@agwosdz
Copy link

agwosdz commented Aug 22, 2020

I have the same issue with my channel. Channel has two underscores in name, and will not connect.

Issue lies in the TwitchChatTester.cs. Seems like this routine splits the string by "" to capitalize the first letter. This doesn't work for channel names with "__" in it, since it cannot capitalize ""

public static string ChannelFirstLetterToUpper(string str)
{
if (str == null)
return null;

    var endsWith_ = str.EndsWith("_");
    if (endsWith_) str = str.Substring(0, str.Length - 1);

    if (str.Length <= 1) return str.ToUpper();
    var pieces = str.Split('_');
    var st = "";
    for (var i = 0; i < pieces.Length; i++)
    {
        st += char.ToUpper(pieces[i][0]) + pieces[i].Substring(1);
        if (i < pieces.Length - 1)
            st += "_";
    }
    if (endsWith_) st += "_";
    return st;
}

@Hotrian
Copy link
Owner

Hotrian commented Sep 6, 2020

Thanks for bringing that up @agwosdz, I'll look into this as soon as I can.

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

No branches or pull requests

4 participants