internal bool InvokeNetGreetPlayer(int who) { GreetPlayerEventArgs args = new GreetPlayerEventArgs { Who = who }; this.NetGreetPlayer.Invoke(args); return(args.Handled); }
private static void OnGreet(GreetPlayerEventArgs args) { if (TShock.Players[args.Who] != null) { if (config.AutoStartEnabled) if (TShock.Utils.ActivePlayers() == 1) { Tools.ReloadConfig(true); var day = config.BossToggles["day"]; var night = config.BossToggles["night"]; var special = config.BossToggles["special"]; Tools.bossesToggled = true; Timers.StartBosses(day, night, special, true); } } }
public void onGreetPlayer(GreetPlayerEventArgs e) { try { dPlayers[e.Who] = new dPlayer(e.Who); } catch { } }
private void OnGreet(GreetPlayerEventArgs args) { if (TShock.Players[args.Who] == null) return; if (!TShock.Players[args.Who].IsLoggedIn) return; int id = TShock.Players[args.Who].User.ID; if (!indexid.ContainsKey(args.Who)) indexid.Add(args.Who, id); if (players.ContainsKey(id)) { if (!players[id].hasGreeted) { players[id].Greet(args.Who); } players[id].pastGreet = true; } }
void OnGreetPlayer(GreetPlayerEventArgs e) { if (!IrcClient.IsConnected) Connect(); else { TSPlayer tsplr = TShock.Players[e.Who]; if (!String.IsNullOrEmpty(Config.ServerJoinMessageFormat)) SendMessage(Config.Channel, String.Format(Config.ServerJoinMessageFormat, tsplr.Name)); if (!String.IsNullOrEmpty(Config.ServerJoinAdminMessageFormat)) SendMessage(Config.AdminChannel, String.Format(Config.ServerJoinAdminMessageFormat, tsplr.Name, tsplr.IP)); } }
internal bool InvokeNetGreetPlayer(int who) { GreetPlayerEventArgs args = new GreetPlayerEventArgs { Who = who }; this.NetGreetPlayer.Invoke(args); return args.Handled; }
internal void OnGreetPlayer(GreetPlayerEventArgs args) { lock (C3Players) C3Players.Add(new C3Player(args.Who)); if(C3Config.ShowWelcomeMessage) TShock.Players[args.Who].SendMessage("This server is running C3Mod, created by Twitchy. C3Mod is now open source.", Color.Cyan); }
private static void OnGreet(GreetPlayerEventArgs args) { if (TShock.Players[args.Who] != null) { if (config.AutoStartEnabled && TShock.Utils.ActivePlayers() == 1) { Tools.ReloadConfig(true); var day = config.BossToggles[BattleType.Day]; var night = config.BossToggles[BattleType.Night]; var special = config.BossToggles[BattleType.Special]; Tools.bossesToggled = true; Timers.StartBosses(day, night, special, true); TShock.Log.ConsoleInfo("[AutoBoss+] Timer started: Autostart"); } } }
private void OnGreet(GreetPlayerEventArgs args) { BHPlayers.Add(new BHPlayer(args.Who)); var player = TShock.Players[args.Who]; var RecPlayer = BHPlayers.AddToList(new BHPlayer(args.Who)); }
public void OnGreetPlayer( GreetPlayerEventArgs e) { lock (HPlayers) HPlayers.Add(new HPlayer(e.Who, new Vector2(TShock.Players[e.Who].TileX, TShock.Players[e.Who].TileY))); }
/// <summary> /// Handles greet events. /// </summary> /// <param name="args"></param> private void OnGreet(GreetPlayerEventArgs args) { if (!TShock.Config.DisableUUIDLogin) { if (TShock.Players[args.Who].IsLoggedIn) PostLogin(new TShockAPI.Hooks.PlayerPostLoginEventArgs(TShock.Players[args.Who])); else { var player = new TrPlayer("~^" + TShock.Players[args.Who].Name, 0, DateTime.UtcNow.ToString("G"), DateTime.UtcNow.ToString("G"), 0) {index = args.Who, online = true}; Tools.Players.Add(player); } } else { var player = new TrPlayer("~^" + TShock.Players[args.Who].Name, 0, DateTime.UtcNow.ToString("G"), DateTime.UtcNow.ToString("G"), 0) {index = args.Who, online = true}; Tools.Players.Add(player); } }
private static void GreetPlayer(GreetPlayerEventArgs args) { if (TShock.Players[args.Who] == null) return; if (PlayerKilling.ContainsKey(TShock.Players[args.Who])) PlayerKilling.Remove(TShock.Players[args.Who]); PlayerKilling.Add(TShock.Players[args.Who], null); TimeCache[args.Who] = 0; SentDamageCache[args.Who] = new Dictionary<KillType, int> { {KillType.Mob, 0}, {KillType.Boss, 0}, {KillType.Player, 0} }; RecvDamageCache[args.Who] = 0; }
public void OnGreetPlayer(GreetPlayerEventArgs e) { Players[e.Who] = new Player(e.Who); }
public void OnGreetPlayer(GreetPlayerEventArgs e) { try { Players[e.Who] = new mPlayer(e.Who); if (Players[e.Who].TSPlayer.Group.HasPermission("msguse")) { string name = TShock.Players[e.Who].Name; int count = GetUnreadEmailsByName(name); TShock.Players[e.Who].SendMessage("You have " + count + " unread messages.", Color.Yellow); } } catch { } }
private void OnGreetPlayer(GreetPlayerEventArgs args) { if (TShock.Players[args.Who].IsLoggedIn) { OnPlayerPostLogin(new PlayerPostLoginEventArgs(TShock.Players[args.Who])); } }
public void OnGreetPlayer(GreetPlayerEventArgs args) { lock (Players) Players.Add(new Player(args.Who)); }
public void OnGreet(GreetPlayerEventArgs args) { if (sTools.GetPlayer(args.Who) == null) { sTools.splayers.Add(new sPlayer(args.Who)); if (!TShock.Config.DisableUUIDLogin) if (TShock.Players[args.Who].IsLoggedIn) PostLogin(new TShockAPI.Hooks.PlayerPostLoginEventArgs(TShock.Players[args.Who])); } }
private void OnGreet(GreetPlayerEventArgs args) { lock (players) { players[args.Who] = new RegionPlayer(TShock.Players[args.Who], regions); } }
/// <summary> /// NetGreetPlayer callback. /// </summary> /// <param name="args"></param> private void OnNetGreetPlayer(GreetPlayerEventArgs args) { lock (this.m_AddonsLock) { this.m_Addons.ForEach(a => { var ret = a.Value.InvokeEvent("NetGreetPlayer", args); if (ret != null && ret.Length >= 1) { bool result; if (bool.TryParse(ret[0].ToString(), out result) && result) args.Handled = true; } }); } }
/// <summary>OnGreetPlayer - Fired when a player is greeted by the server. Handles things like the MOTD, join messages, etc.</summary> /// <param name="args">args - The GreetPlayerEventArgs object.</param> private void OnGreetPlayer(GreetPlayerEventArgs args) { var player = Players[args.Who]; if (player == null) { args.Handled = true; return; } player.LoginMS = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; if (Config.EnableGeoIP && TShock.Geo != null) { Log.Info("{0} ({1}) from '{2}' group from '{3}' joined. ({4}/{5})", player.Name, player.IP, player.Group.Name, player.Country, TShock.Utils.ActivePlayers(), TShock.Config.MaxSlots); if (!player.SilentJoinInProgress) Utils.Broadcast(string.Format("{0} ({1}) has joined.", player.Name, player.Country), Color.Yellow); } else { Log.Info("{0} ({1}) from '{2}' group joined. ({3}/{4})", player.Name, player.IP, player.Group.Name, TShock.Utils.ActivePlayers(), TShock.Config.MaxSlots); if (!player.SilentJoinInProgress) Utils.Broadcast(player.Name + " has joined.", Color.Yellow); } if (Config.DisplayIPToAdmins) Utils.SendLogs(string.Format("{0} has joined. IP: {1}", player.Name, player.IP), Color.Blue); Utils.ShowFileToUser(player, "motd.txt"); string pvpMode = Config.PvPMode.ToLowerInvariant(); if (pvpMode == "always") { player.TPlayer.hostile = true; player.SendData(PacketTypes.TogglePvp, "", player.Index); TSPlayer.All.SendData(PacketTypes.TogglePvp, "", player.Index); } if (!player.IsLoggedIn) { if (Main.ServerSideCharacter) { player.SendErrorMessage( player.IgnoreActionsForInventory = String.Format("Server side characters is enabled! Please {0}register or {0}login to play!", Commands.Specifier)); player.LoginHarassed = true; } else if (Config.RequireLogin) { player.SendErrorMessage("Please {0}register or {0}login to play!", Commands.Specifier); player.LoginHarassed = true; } } player.LastNetPosition = new Vector2(Main.spawnTileX * 16f, Main.spawnTileY * 16f); if (Config.RememberLeavePos && (RememberedPos.GetLeavePos(player.Name, player.IP) != Vector2.Zero) && !player.LoginHarassed) { player.RPPending = 3; player.SendInfoMessage("You will be teleported to your last known location..."); } args.Handled = true; }
private static void OnGreetPlayer(GreetPlayerEventArgs args) { lock (PvPplayer) PvPplayer.Add(new Player(args.Who)); }
public void OnGreet(GreetPlayerEventArgs args) { if (TShock.Players[args.Who] == null) return; if (globalbuffs.Count > 0) TShock.Players[args.Who].SendInfoMessage("This server has the following global permabuffs active: {0}", string.Join(", ", globalbuffs.Select(p => Main.buffName[p]))); if (!hasAnnounced.ContainsKey(args.Who)) hasAnnounced.Add(args.Who, new List<string>()); if (!TShock.Players[args.Who].IsLoggedIn) return; int id = TShock.Players[args.Who].User.ID; if (!permas.ContainsKey(id)) { if (loadDBInfo(id)) { if (permas[id].bufflist.Count > 0) TShock.Players[args.Who].SendInfoMessage("Your permabuffs from your previous session ({0}) are still active!", string.Join(", ", permas[id].bufflist.Select(p => TShock.Utils.GetBuffName(p)))); } else createDBInfo(TShock.Players[args.Who].User.ID); } else { //loadDBInfo(args.Who); if (permas[id].bufflist.Count > 0) TShock.Players[args.Who].SendInfoMessage("Your permabuffs from your previous session ({0}) are still active!", string.Join(", ", permas[id].bufflist.Select(p => TShock.Utils.GetBuffName(p)))); } }
private void OnJoin(GreetPlayerEventArgs e) { if (TShock.Players[e.Who] != null) { UpdateList(e.Who); } }
private void OnGreetPlayer(GreetPlayerEventArgs e) { if (getConfig.motd_enabled && TShock.Players[e.Who] != null) { ShowMOTD(TShock.Players[e.Who]); } }
///<summary> /// This event happens every time player really joins the server. ///</summary> ///<param name="args">Containing event data.</param> private void OnNetGreet(GreetPlayerEventArgs args) { var tsplr = TShock.Players[args.Who]; string tsplr_name = tsplr.Name; string tsplr_user_name = tsplr.User.Name; if (iSettings.AKC_List.Contains(this.GetPlayerFlag(tsplr)) & (!iSettings.AKC_White_List.Contains(tsplr_name))) { TShock.Utils.Kick(tsplr, "You have been kicked because of region limit", true); ConsoleLOG("User: "******" Country Code: " + this.GetPlayerFlag(tsplr) + " Reason: Was kick because of region limit"); } else { //TODO Try to use this "args.Player.RealPlayer" if (!this.myPlayersData.ContainsKey(tsplr.Index)) { this.myPlayersData.Add(tsplr.Index, this.GetPlayerFlag(tsplr)); } else { this.myPlayersData[tsplr.Index] = this.GetPlayerFlag(tsplr); } } }
public void OnGreet(GreetPlayerEventArgs args) { lock (Players) Players[args.Who] = new AFKPlayer(args.Who); }
public void OnGreetPlayer(GreetPlayerEventArgs e) { lock (EBPlayers) EBPlayers.Add(new EBPlayer(e.Who)); }
public void OnJoin(GreetPlayerEventArgs args) { Players.Add(new Mplayer(args.Who)); var player = TShock.Players[args.Who]; var Mplayer = Utils.GetPlayers(args.Who); var readTableIP = SQLEditor.ReadColumn("muteList", "IP", new List<SqlValue>()); if (readTableIP.Contains(player.IP)) { Mplayer.muted = true; Mplayer.muteTime = -1; foreach (TSPlayer tsplr in TShock.Players) { if ((tsplr.Group.HasPermission(Permissions.mute)) || (tsplr.Group.Name == "superadmin")) { tsplr.SendInfoMessage("A player that is on the perma-mute list is about to enter the server, and has been muted."); } } } else { Mplayer.muteTime = -1; Mplayer.muted = false; } }
public void OnGreetPlayer(GreetPlayerEventArgs args) { lock (WarpplatePlugin.Players) { WarpplatePlugin.Players.Add(new WarpplatePlugin.Player(args.Who)); } }