Digital Paint Discussion Board
Development => General Development => Topic started by: mRokita on March 20, 2014, 06:30:33 AM
-
Hey!
Can somebody post the ASCII codes of paintball special characters (paintball splats, bold letters etc.)?
-
You can write numbers from 0 to 255 yourself, those numbers correspond to screen shown on funname name selection.
However there are few more things you need to do to decode/encode name correctly, like colors and bold/etc, check source of serverbrowser for this.
-
I think this is what you are looking for. This is a Java version of the standard serverbrowser function.
public String strip_garbage (String str) {
String newStr = null;
char[] char_map = {
'\0', '-', '-', '-', '_', '*', 't', '.', 'N', '-', '\n', '#', '.', '>', '*', '*',
'[', ']', '@', '@', '@', '@', '@', '@', '<', '>', '.', '-', '*', '-', '-', '-',
' ', '!', '\"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', '<',
'(', '=', ')', '^', '!', 'O', 'U', 'I', 'C', 'C', 'R', '#', '?', '>', '*', '*',
'[', ']', '@', '@', '@', '@', '@', '@', '<', '>', '*', 'X', '*', '-', '-', '-',
' ', '!', '\"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', '<'
};
if (str != null) {
char[] c = str.toCharArray();
for (int i = 0; i < c.length; i++) {
int number = (int) c[i];
switch (number) {
case 136: // color
i++;
break;
case 135: // italic
case 134: // underline
case 133: // endformat
break;
default:
newStr = newStr + char_map[number];
}
}
}
return newStr;
}
-
thx Payl :)
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚„‰Š‹ŚŤŽŹ‘’“”•–—™š›śťžźˇ˘Ł¤Ą¦§¨©Ş«¬®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢß˙ŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<<=>@i@@@?>@@[]@@@@@@<>@x@---!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_<'ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~<
†-underline
‡-italic
-color
-
The original serverbrowser's function can be found here (in C):
http://paintball2.cvs.sourceforge.net/viewvc/paintball2/serverbrowser/serverbrowser.cpp?view=markup