Fix last commit which broke login.

This commit is contained in:
UnknownShadow200 2016-08-17 12:15:01 +10:00
parent dd79254796
commit 9f204057a5
2 changed files with 8 additions and 8 deletions

View File

@ -33,12 +33,12 @@ namespace MCGalaxy {
int length = p.socket.EndReceive(result); int length = p.socket.EndReceive(result);
if (length == 0) { p.Disconnect(); return; } if (length == 0) { p.Disconnect(); return; }
byte[] allData = new byte[p.buffer.Length + length]; byte[] allData = new byte[p.leftBuffer.Length + length];
Buffer.BlockCopy(p.buffer, 0, allData, 0, p.buffer.Length); Buffer.BlockCopy(p.leftBuffer, 0, allData, 0, p.leftBuffer.Length);
Buffer.BlockCopy(p.tempbuffer, 0, allData, p.buffer.Length, length); Buffer.BlockCopy(p.tempbuffer, 0, allData, p.leftBuffer.Length, length);
p.buffer = p.ProcessReceived(allData); p.leftBuffer = p.ProcessReceived(allData);
if (p.dontmindme && p.buffer.Length == 0) { if (p.dontmindme && p.leftBuffer.Length == 0) {
Server.s.Log("Disconnected"); Server.s.Log("Disconnected");
p.socket.Close(); p.socket.Close();
p.disconnected = true; p.disconnected = true;
@ -299,8 +299,8 @@ namespace MCGalaxy {
void SendMapMotd(bool ignoreLevelMotd) { void SendMapMotd(bool ignoreLevelMotd) {
byte[] packet = Packet.MakeMotd(this, ignoreLevelMotd); byte[] packet = Packet.MakeMotd(this, ignoreLevelMotd);
if (OnSendMOTD != null) OnSendMOTD(this, buffer); if (OnSendMOTD != null) OnSendMOTD(this, packet);
SendRaw(buffer); SendRaw(packet);
} }
public void SendMap(Level oldLevel) { SendRawMap(oldLevel, level); } public void SendMap(Level oldLevel) { SendRawMap(oldLevel, level); }

View File

@ -75,7 +75,7 @@ namespace MCGalaxy {
public string BrushName = "normal", DefaultBrushArgs = ""; public string BrushName = "normal", DefaultBrushArgs = "";
public string afkMessage; public string afkMessage;
byte[] buffer = new byte[0]; byte[] leftBuffer = new byte[0];
byte[] tempbuffer = new byte[0xFF]; byte[] tempbuffer = new byte[0xFF];
public bool disconnected = false; public bool disconnected = false;