namespace Minecraft.Server.FourKit.Event.Player; using Minecraft.Server.FourKit.Enums; using Minecraft.Server.FourKit.Net; /// /// Stores details for players attempting to log in. /// public class PlayerLoginEvent : Event, Cancellable { private string name; private InetSocketAddress ipAddress; //bukkit uses InetAddress but we expose port also private ulong onlineXuid; private ulong offlineXuid; private bool changedXuidValues; private LoginType loginType; private bool _cancelled; internal PlayerLoginEvent(string name, InetSocketAddress ipAddress, LoginType type, ulong onlineXuid, ulong offlineXuid) : base() { this.name = name; this.ipAddress = ipAddress; this.onlineXuid = onlineXuid; this.offlineXuid = offlineXuid; this.changedXuidValues = false; this.loginType = type; } public LoginType getLoginType() => loginType; /// /// Experimental. Gets the online XUID (Xbox User ID), used for guests (splitscreen users). /// /// The online XUID value. public ulong getOnlineXuid() => onlineXuid; /// /// Experimental. Sets the online XUID (Xbox User ID). Marks XUID values as changed. /// /// The new online XUID value. public void setOnlineXuid(ulong newXuid) { this.onlineXuid = newXuid; this.changedXuidValues = true; } /// /// Experimental. Gets the offline XUID (Xbox User ID), which is the main XUID used by the client. /// /// The offline XUID value. public ulong getOfflineXuid() => offlineXuid; /// /// Experimental. Sets the offline XUID (Xbox User ID). Marks XUID values as changed. /// /// The new offline XUID value. public void setOfflineXuid(ulong newXuid) { this.offlineXuid = newXuid; this.changedXuidValues = true; } /// /// Experimental. Returns true if either XUID value has been changed via setters. /// /// True if XUID values have been changed; otherwise, false. public bool hasChangedXuidValues() => changedXuidValues; /// /// Gets the player's name. /// /// The player's name. public string getName() => name; /// /// Gets the player IP address. /// /// The IP address. public InetSocketAddress getAddress() => ipAddress; /// public bool isCancelled() => _cancelled; /// public void setCancelled(bool cancel) => _cancelled = cancel; }