fix wrong command in /zone confirm message, read strings as unicode

This commit is contained in:
UnknownShadow200 2017-02-13 18:23:20 +11:00
parent 663d75a179
commit fb652663c6
4 changed files with 4 additions and 7 deletions

View File

@ -42,13 +42,13 @@ namespace MCGalaxy.Commands {
Player.Message(p, "Place a block where you would like to check for zones.");
p.MakeSelection(1, null, CheckZone);
} else if (args[0].CaselessEq("add")) {
if (!CheckAdd(p, args, "zone map")) return;
if (!CheckAdd(p, args, "zone add")) return;
Player.Message(p, "Place two blocks to determine the edges.");
Player.Message(p, "Zone for: &b" + args[1] + ".");
p.MakeSelection(2, args[1], AddZone);
} else if (args[0].CaselessEq("map")) {
if (!CheckAdd(p, args, "zone add")) return;
if (!CheckAdd(p, args, "zone map")) return;
ZoneAll(p.level, args[1]);
Player.Message(p, "Added zone for &b" + args[1]);

View File

@ -61,7 +61,7 @@ namespace MCGalaxy {
byte code = data[i + offset];
if( length == 0 && !(code == 0x00 || code == 0x20))
length = i + 1;
characters[i] = (char)code;
characters[i] = ((char)code).Cp437ToUnicode();
}
return new String(characters, 0, length);
}

View File

@ -500,7 +500,6 @@ namespace MCGalaxy {
if (!loggedIn) return;
byte continued = packet[1];
string text = NetUtils.ReadString(packet, 2);
text.Cp437ToUnicodeInPlace();
LastAction = DateTime.UtcNow;
if (FilterChat(ref text, continued)) return;
@ -524,8 +523,7 @@ namespace MCGalaxy {
SendMessage("Your vote for &5" + text.ToLower().Capitalize() + " %Shas been placed. Thanks!");
Server.lava.map.ChatLevelOps(name + " voted for &5" + text.ToLower().Capitalize() + "%S.");
return;
}
else {
} else {
SendMessage("&cYou already voted!");
return;
}

View File

@ -16,7 +16,6 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using MCGalaxy.Commands.World;
using MCGalaxy.Games;
using MCGalaxy.SQL;