OpenVRTwitchChat icon indicating copy to clipboard operation
OpenVRTwitchChat copied to clipboard

Cannot connect to channels when their name ends with an underscore

Open ItsBrando opened this issue 6 years ago • 8 comments

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__

ItsBrando avatar May 08 '18 18:05 ItsBrando

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.

Hotrian avatar May 08 '18 20:05 Hotrian

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

ItsBrando avatar May 09 '18 13:05 ItsBrando

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

joseph-allen avatar Dec 29 '18 14:12 joseph-allen

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

Hotrian avatar Dec 29 '18 15:12 Hotrian

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

joseph-allen avatar Dec 29 '18 17:12 joseph-allen

#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 avatar Dec 30 '18 00:12 Hotrian

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;
}

agwosdz avatar Aug 22 '20 20:08 agwosdz

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

Hotrian avatar Sep 06 '20 18:09 Hotrian