2014-05-31 01:59:03 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using MinecraftClient.Crypto;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.Protocol
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Interface for the Minecraft protocol handler.
|
|
|
|
|
|
/// A protocol handler is used to communicate with the Minecraft server.
|
|
|
|
|
|
/// This interface allows to abstract from the underlying minecraft version in other parts of the program.
|
|
|
|
|
|
/// The protocol handler will take care of parsing and building the appropriate network packets.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
2015-06-19 19:40:18 +02:00
|
|
|
|
public interface IMinecraftCom : IDisposable, IAutoComplete
|
2014-05-31 01:59:03 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Start the login procedure once connected to the server
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>True if login was successful</returns>
|
|
|
|
|
|
|
|
|
|
|
|
bool Login();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Disconnect from the server
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="message">Reason</param>
|
|
|
|
|
|
|
|
|
|
|
|
void Disconnect();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Send a chat message or command to the server
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="message">Text to send</param>
|
|
|
|
|
|
/// <returns>True if successfully sent</returns>
|
|
|
|
|
|
|
|
|
|
|
|
bool SendChatMessage(string message);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Allow to respawn after death
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>True if packet successfully sent</returns>
|
|
|
|
|
|
|
|
|
|
|
|
bool SendRespawnPacket();
|
2015-09-29 14:00:44 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Tell the server what client is being used to connect to the server
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="brandInfo">Client string describing the client</param>
|
|
|
|
|
|
/// <returns>True if brand info was successfully sent</returns>
|
|
|
|
|
|
|
|
|
|
|
|
bool SendBrandInfo(string brandInfo);
|
2014-05-31 01:59:03 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|