mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Don't use fixed char, fixes runtime issues on some versions of mono (https://bugzilla.xamarin.com/show_bug.cgi?id=60625)
This commit is contained in:
parent
76f5192d16
commit
76dfe1aab1
@ -34,7 +34,7 @@ namespace MCGalaxy.Blocks.Extended {
|
||||
|
||||
string message = Messages.Rows[last]["Message"].ToString().Trim();
|
||||
message = message.Replace("\\'", "\'");
|
||||
message.Cp437ToUnicodeInPlace();
|
||||
message = message.Cp437ToUnicode();
|
||||
message = message.Replace("@p", p.name);
|
||||
|
||||
if (message != p.prevMsg || (alwaysRepeat || ServerConfig.RepeatMBs)) {
|
||||
|
@ -34,7 +34,7 @@ namespace MCGalaxy.Blocks.Extended {
|
||||
|
||||
DataRow row = Portals.Rows[last];
|
||||
string map = row["ExitMap"].ToString();
|
||||
map.Cp437ToUnicodeInPlace();
|
||||
map = map.Cp437ToUnicode();
|
||||
|
||||
if (p.level.name != map) {
|
||||
Level curLevel = p.level;
|
||||
|
@ -110,7 +110,7 @@ namespace MCGalaxy.DB {
|
||||
data.LastLogin = ParseDate(row[ColumnLastLogin]);
|
||||
|
||||
data.Title = row[ColumnTitle].ToString().Trim();
|
||||
data.Title.Cp437ToUnicodeInPlace();
|
||||
data.Title = data.Title.Cp437ToUnicode();
|
||||
data.TitleColor = ParseColor(row[ColumnTColor]);
|
||||
data.Color = ParseColor(row[ColumnColor]);
|
||||
|
||||
|
@ -59,25 +59,6 @@ namespace MCGalaxy {
|
||||
c[i] = UnicodeToCp437(str[i]);
|
||||
return new String(c);
|
||||
}
|
||||
|
||||
/// <summary> Modifies the characters of a string consisting of code page 437 indices into unicode. </summary>
|
||||
public unsafe static void Cp437ToUnicodeInPlace(this string str) {
|
||||
fixed (char* ptr = str) {
|
||||
for (int i = 0; i < str.Length; i++) {
|
||||
ptr[i] = Cp437ToUnicode(ptr[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Modifies the characters of a unicode string into code page 437 indices. </summary>
|
||||
/// <remarks> Unicode characters not in code page 437 are replaced with '?'. </remarks>
|
||||
public static unsafe void UnicodeToCp437InPlace(this string str) {
|
||||
fixed (char* ptr = str) {
|
||||
for (int i = 0; i < str.Length; i++) {
|
||||
ptr[i] = UnicodeToCp437(ptr[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary> Converts a code page 437 indice into unicode. </summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user