Delay BrandInfo sending

Implement Game Join event and send Brand Info only when server
acknowledged game join, as ZizzyDizzyMC did before, else server may
generate an invalid packet error because it was still in "login" mode
and not in "playing" mode. Fix second issue in #95
This commit is contained in:
ORelio 2015-09-30 20:01:57 +02:00
parent 8bd130eb3a
commit b25a665c82
3 changed files with 19 additions and 3 deletions

View file

@ -120,9 +120,6 @@ namespace MinecraftClient
{
if (handler.Login())
{
if (!String.IsNullOrWhiteSpace(Settings.BrandInfo))
handler.SendBrandInfo(Settings.BrandInfo.Trim());
if (singlecommand)
{
handler.SendChatMessage(command);
@ -322,6 +319,16 @@ namespace MinecraftClient
client.Close();
}
/// <summary>
/// Called when a server was successfully joined
/// </summary>
public void OnGameJoined()
{
if (!String.IsNullOrWhiteSpace(Settings.BrandInfo))
handler.SendBrandInfo(Settings.BrandInfo.Trim());
}
/// <summary>
/// Received some text from the server
/// </summary>