mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
- Now scripts can also be written in C# - C# scripts can access ChatBot API - Add more methods in ChatBot API - Add an example of C# script file - Coding style fixes: method names ucfirst
60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace MinecraftClient.Protocol
|
|
{
|
|
/// <summary>
|
|
/// Interface for the MinecraftCom Handler.
|
|
/// It defines some callbacks that the MinecraftCom handler must have.
|
|
/// It allows the protocol handler to abstract from the other parts of the program.
|
|
/// </summary>
|
|
|
|
public interface IMinecraftComHandler
|
|
{
|
|
/* The MinecraftCom Hanler must
|
|
* provide these getters */
|
|
|
|
int GetServerPort();
|
|
string GetServerHost();
|
|
string GetUsername();
|
|
string GetUserUUID();
|
|
string GetSessionID();
|
|
string[] GetOnlinePlayers();
|
|
|
|
/// <summary>
|
|
/// This method is called when the protocol handler receives a chat message
|
|
/// </summary>
|
|
|
|
void OnTextReceived(string text);
|
|
|
|
/// <summary>
|
|
/// This method is called when a new player joins the game
|
|
/// </summary>
|
|
/// <param name="uuid">UUID of the player</param>
|
|
/// <param name="name">Name of the player</param>
|
|
|
|
void OnPlayerJoin(Guid uuid, string name);
|
|
|
|
/// <summary>
|
|
/// This method is called when a player has left the game
|
|
/// </summary>
|
|
/// <param name="uuid">UUID of the player</param>
|
|
|
|
void OnPlayerLeave(Guid uuid);
|
|
|
|
/// <summary>
|
|
/// This method is called when the connection has been lost
|
|
/// </summary>
|
|
|
|
void OnConnectionLost(ChatBot.DisconnectReason reason, string message);
|
|
|
|
/// <summary>
|
|
/// Called ~10 times per second (10 ticks per second)
|
|
/// Useful for updating bots in other parts of the program
|
|
/// </summary>
|
|
|
|
void OnUpdate();
|
|
}
|
|
}
|