/// <summary> /// Triggered when a new player joins the game /// </summary> /// <param name="uuid">UUID of the player</param> /// <param name="name">Name of the player</param> public void OnPlayerJoin(Guid uuid, string name) { //Ignore placeholders eg 0000tab# from TabListPlus if (!ChatBot.IsValidName(name)) { return; } if (Settings.MessageOnJoin && DateTime.Now.Ticks - lastSentTime >= TimeSpan.TicksPerSecond * 5) // Won't message when joining servers (5 second buffer) { if (Settings.SendLink) { SendText("/m " + name + " Welcome back! -sent from Minecraft Console Client; Link: " + Settings.DL_URL); } else { SendText("/m " + name + " Welcome back! -sent from Minecraft Console Client"); } lastSentTime = DateTime.Now.Ticks; // waiting at least 5 seconds between welcomes } lock (onlinePlayers) { onlinePlayers[uuid] = name; } }
/// <summary> /// Triggered when a new player joins the game /// </summary> /// <param name="uuid">UUID of the player</param> /// <param name="name">Name of the player</param> public void OnPlayerJoin(Guid uuid, string name) { //Ignore placeholders eg 0000tab# from TabListPlus if (!ChatBot.IsValidName(name)) { return; } lock (onlinePlayers) { onlinePlayers[uuid] = name; } }
/// <summary> /// Triggered when a new player joins the game /// </summary> /// <param name="uuid">UUID of the player</param> /// <param name="name">Name of the player</param> public void OnPlayerJoin(Guid uuid, string name) { //Ignore placeholders eg 0000tab# from TabListPlus if (!ChatBot.IsValidName(name)) { return; } if (Telegram.data.getTimestamp() > vars.logInTimestamp) { Telegram.data.loginData(name, "last_online", Telegram.data.getTimestamp()); OnLogin.Protect(name); } lock (onlinePlayers) { onlinePlayers[uuid] = name; } }