Allowing chars
Allowing chars
Hey.
I just got a couple of questions.
Is it safe to allow characters like æøå and & in the chat?
If so, where in the code is this written?
Thanks,
~BobKare
I just got a couple of questions.
Is it safe to allow characters like æøå and & in the chat?
If so, where in the code is this written?
Thanks,
~BobKare
Re: Allowing chars
You will not be able to allow such characters, because Minecraft client does not support extended ASCII or Unicode.
Re: Allowing chars
I believe those are not accepted by the client software, fCraft would be able to handle them, but I'm not sure if the Notchian clients will. Most of the time, unknown characters will choke the client causing a horrible, slow death, I wouldn't experiment with strange characters on public servers if I were you.
if you really want to push this through, look for the function "ContainsValidCharacters" or "IsValidName" or something similar, it'll eventually lead you to where the characters are evaluated.
if you really want to push this through, look for the function "ContainsValidCharacters" or "IsValidName" or something similar, it'll eventually lead you to where the characters are evaluated.
A = {x ∈ P(U) | x ∉ x}
Mods:
- /Su - Allows players to temporarily become a different rank
- /Snap - Like /Line but only draws straight or diagonal lines.
- pre-0.630 skip/none block
- boblol0909
- SupOP
- Offline
- Posts: 314
- Joined: June 24th, 2011, 10:27 pm
Re: Allowing chars
If a message ends with & and no number after it I believe it will crash every client that receives it.
Re: Allowing chars
You dont need to worry about message contents if you use Player.Message(). fCraft will take care of line-wrapping and potential crashing for you. Output sanitizing and wrapping is done in fCraft.LineWrapper class (fCraft/Networking/LineWrapper.cs)
Re: Allowing chars
How do we get all these to work Frag?
My past attempts always return with a '?'
My past attempts always return with a '?'
You cannot use certain BBCodes: [img].
- Intertoothh
- Trustee
- Offline
- Posts: 1149
- Joined: May 24th, 2011, 5:51 am
Re: Allowing chars
fragmer wrote:You will not be able to allow such characters, because Minecraft client does not support extended ASCII or Unicode.
McLaughlinKid wrote:You put roar on everything don't you?
Re: Allowing chars
I saw that on some servers, that can be done... Don't know how.Jonty800 wrote:How do we get all these to work Frag?
My past attempts always return with a '?'
Re: Allowing chars
Yeah, mcforge has this, and it is possible.
Fragmer told me a way about half a year ago, but I've totally forgotten.
Fragmer told me a way about half a year ago, but I've totally forgotten.
You cannot use certain BBCodes: [img].
Re: Allowing chars
Minecraft client is capable of showing most code page 437 characters, but the client is not capable of typing any of them in. Minecraft is still unable to show any Unicode. There used to be some random client crash issues if, for example, a line of text contains no printable characters. I never bothered figuring out exact conditions that cause such client crashes.
If you'd like to modify the set of characters that fCraft allows in the output, you'll have to dive into LineWrapper.cs
If you'd like to modify the set of characters that fCraft allows in the output, you'll have to dive into LineWrapper.cs
Re: Allowing chars
Thanks for the help Fragmer.
I made some changes to the LineWrapper, and I used a simple rawMessage = rawMessage.Replace("(smile)", encoding.GetString(chars)); to replace text with the byte. But I can't seem to get the emotes to come up on the chat feed, they're blank. The bytes definitely get sent because they can be copied from console and appear as an emote when pasted into the WoM chat bar (but obviously don't send when pressing enter because minecraft doesnt support them).
Is there some sort of hidden check that replaces invalid bytes with ' ' ?
Do you have any suggestions on how I can fix this problem?
I made some changes to the LineWrapper, and I used a simple rawMessage = rawMessage.Replace("(smile)", encoding.GetString(chars)); to replace text with the byte. But I can't seem to get the emotes to come up on the chat feed, they're blank. The bytes definitely get sent because they can be copied from console and appear as an emote when pasted into the WoM chat bar (but obviously don't send when pressing enter because minecraft doesnt support them).
Is there some sort of hidden check that replaces invalid bytes with ' ' ?
Do you have any suggestions on how I can fix this problem?
You cannot use certain BBCodes: [img].
Re: Allowing chars
Like I said, the client is very buggy when it comes to showing those non-standard characters. You may have to experiment a bit to get them to work. Maybe they have to be preceded by some code? I seem to vaguely recall those nonprintable characters requiring the null ('\0' or (char)0) somewhere in the string.
Re: Allowing chars
Ahh memories.
I figured this out, if anyone would like a tutorial, feel free to PM me.
I figured this out, if anyone would like a tutorial, feel free to PM me.
You cannot use certain BBCodes: [img].
Re: Allowing chars
fragmer, suggestion: Use those fancy box drawing chars to create awesome/retro menus.
A = {x ∈ P(U) | x ∉ x}
Mods:
- /Su - Allows players to temporarily become a different rank
- /Snap - Like /Line but only draws straight or diagonal lines.
- pre-0.630 skip/none block