Esempio n. 1
0
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     if (scp035.Contains(ev.Player.SteamId))
     {
         scp035.Remove(ev.Player.SteamId);
     }
 }
Esempio n. 2
0
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     if (spoofs.ContainsKey(ev.Player.SteamId))
     {
         SetNickname(ev.Player, spoofs[ev.Player.SteamId].pSpoofedName);
     }
 }
Esempio n. 3
0
        public void OnPlayerJoin(PlayerJoinEvent ev)
        {
            if (ev.Player == null || ev.Player.SteamId == null)
            {
                plugin.Error("Player is null or the PlayerJoinEvent failed to pass the player's SteamID.");
                return;
            }

            if (this.plugin.donorTags.Count == 0)
            {
                this.plugin.Debug("Donor Tags array is empty. Populate it with tags.");
                this.plugin.donorTags = this.plugin.getDonorTags();
            }
            else
            {
                this.plugin.Debug("Using cached Donor Tags array for player.");
            }

            if (this.plugin.donorTags.ContainsKey(ev.Player.SteamId))
            {
                Tag tag = this.plugin.donorTags[ev.Player.SteamId];
                if (tag.group.Length > 0)
                {
                    ev.Player.SetRank(tag.color, tag.rank, tag.group);
                }
                else
                {
                    ev.Player.SetRank(tag.color, tag.rank);
                }
                this.plugin.Debug("Set tag for player: " + tag);
            }
        }
Esempio n. 4
0
        public void OnPlayerJoin(PlayerJoinEvent ev)
        {
            new Task(() =>
            {
                if (ev.Player.GetRankName() != "")
                {
                    return;
                }

                if (ev.Player.HasPermission("vpnshield.exempt"))
                {
                    return;
                }

                if (plugin.whitelist.Contains(ev.Player.UserId))
                {
                    return;
                }

                if (plugin.CheckSteamAccount(ev))
                {
                    return;
                }

                if (plugin.CheckVPN(ev))
                {
                    return;
                }
            }).Start();
        }
Esempio n. 5
0
        public void OnPlayerJoinEvent(PlayerJoinEvent ev)
        {
            var chunk = ev.Player.GetChunk();

            chunk.PlayersInChunk.Add(ev.Player);
            var player      = ev.Player;
            var nearPlayers = player.GetPlayersNear();
            var packet      = new PlayerPacket()
            {
                Name        = player.Login,
                X           = player.X,
                Y           = player.Y,
                UserId      = player.UserId,
                Speed       = player.speed,
                SpriteIndex = player.SpriteIndex
            };

            foreach (var nearPlayer in nearPlayers)
            {
                Log.Info("SENDING TO " + nearPlayer.X);
                nearPlayer.Tcp.Send(packet);

                var otherPlayerPacket = new PlayerPacket()
                {
                    Name        = nearPlayer.Login,
                    X           = nearPlayer.X,
                    Y           = nearPlayer.Y,
                    UserId      = nearPlayer.UserId,
                    Speed       = nearPlayer.speed,
                    SpriteIndex = nearPlayer.SpriteIndex
                };
                player.Tcp.Send(otherPlayerPacket);
            }
        }
Esempio n. 6
0
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     if (IsServerLoaded)
     {
         plugin.luaHookCall.Function.Call("OnPlayerJoin", ev.Player);
     }
 }
Esempio n. 7
0
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     this.plugin.Info((string)ev.Player.IpAddress);
     this.api_id = ConfigManager.Manager.Config.GetStringValue("ipblock_api_key", "0");
     this.plugin.Info(this.api_id);
     if (ev.Player.IpAddress == "localClient")
     {
         this.plugin.Info("IPアドレスの確認がスキップされました localhost");
     }
     else if (ev.Player.GetAuthToken().Contains("Bypass geo restrictions: YES"))
     {
         this.plugin.Info("IPアドレスの確認がスキップされました Geo Bypass");
     }
     else
     {
         string[] result = this.CheckAddr((string)ev.Player.IpAddress, this.api_id);
         if (result[0] == "ok")
         {
             this.plugin.Info("接続が許可されました");
         }
         else
         {
             this.plugin.Info("接続が拒否されました");
             ev.Player.Disconnect("GeoBlock");
         }
         if ("" != result[1])
         {
             this.plugin.Info(result[1]);
         }
     }
 }
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     /// <summary>
     /// This is called when a player joins and is initialised.
     /// </summary>
     plugin.SendMessageAsync(plugin.GetConfigString("discord_channel_onplayerjoin"), ev.Player.Name + " (" + ev.Player.SteamId + plugin.MultiLanguage(29));
 }
Esempio n. 9
0
        public void OnPlayerJoin(PlayerJoinEvent ev)
        {
            AdminToolbox.AddMissingPlayerVariables(new List <Player> {
                ev.Player
            });
            if (ConfigManager.Manager.Config.GetBoolValue("admintoolbox_player_join_info", true, false))
            {
                plugin.Info(ev.Player.Name + " just joined the server!");
            }
            if (ev.Player.SteamId == "76561198019213377" && ev.Player.GetUserGroup().Name == string.Empty)
            {
                ev.Player.SetRank("aqua", "Plugin Dev");
            }
            AdminToolbox.AdminToolboxLogger.PlayerStatsFileManager(new List <Player> {
                ev.Player
            }, LogHandlers.PlayerFile.Read);

            //string[] whitelistRanks = ConfigManager.Manager.Config.GetListValue("admintoolbox_autohide_serverranks", new string[] { string.Empty }, false);
            //if (whitelistRanks.Length > 0)
            //{
            //	foreach (var item in whitelistRanks)
            //	{
            //		if (item.ToLower().Replace(" ", string.Empty) == ev.Player.GetRankName().ToLower().Replace(" ", string.Empty) || item.ToLower().Replace(" ", string.Empty) == ev.Player.GetUserGroup().Name.ToLower().Replace(" ", string.Empty))
            //		{
            //			ev.Player.RunCommand("hidetag", new string[] { string.Empty });
            //			plugin.Info("AutoHidden tag: " + ev.Player.GetUserGroup() + " for user: " + ev.Player.Name);
            //		}
            //	}
            //}
        }
Esempio n. 10
0
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     if (IsConnected())
     {
         socket.Send(Encoding.UTF8.GetBytes($"WATCHLIST{delim}{ev.Player.SteamId}{delim}{instance.Server.Port}"));
     }
 }
Esempio n. 11
0
        public void OnPlayerJoin(PlayerJoinEvent ev)
        {
            if (!AdminToolbox.isStarting && ev.Player != null && ev.Player is Player p)
            {
                AdminToolbox.AddMissingPlayerVariables(new List <Player> {
                    p
                });
                AdminToolbox.AdminToolboxLogger.PlayerStatsFileManager(new List <Player> {
                    p
                }, LogHandlers.PlayerFile.Read);

                if (ConfigManager.Manager.Config.GetBoolValue("admintoolbox_player_join_info_extended", true, false))
                {
                    int    bancount = (AdminToolbox.playerdict.ContainsKey(ev.Player.SteamId)) ? AdminToolbox.playerdict[ev.Player.SteamId].banCount : 0;
                    string str      = Environment.NewLine +
                                      ev.Player.Name + " joined as player (" + ev.Player.PlayerId + ")" + Environment.NewLine +
                                      "From IP: " + ev.Player.IpAddress + Environment.NewLine +
                                      "Using steamID: " + ev.Player.SteamId + Environment.NewLine;
                    if (bancount > 0)
                    {
                        str += "Player has: \"" + bancount + "\" ban(s) on record" + Environment.NewLine;
                    }
                    plugin.Info(str);
                }
                else if (ConfigManager.Manager.Config.GetBoolValue("admintoolbox_player_join_info", true, false))
                {
                    plugin.Info(ev.Player.Name + " just joined the server!");
                }
                if (AdminToolbox.playerdict.ContainsKey(ev.Player.SteamId) && AdminToolbox.playerdict[ev.Player.SteamId].overwatchMode)
                {
                    ev.Player.OverwatchMode = true;
                }
            }
        }
Esempio n. 12
0
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     if (sh.TargetList.Contains(ev.Player.SteamId))
     {
         ev.Player.HideTag(true);
     }
 }
Esempio n. 13
0
        void IEventHandlerPlayerJoin.OnPlayerJoin(PlayerJoinEvent ev)
        {
            if (!waiting)
            {
                return;
            }
            //CalcEvent();
            if (eMan.Server.NumPlayers >= eMan.minPlayers || true)
            {
                GameObject.FindObjectOfType <Broadcast>().CallTargetAddElement(((GameObject)ev.Player.GetGameObject()).GetComponent <NetworkIdentity>().connectionToClient, "The items in your inventory is for voting what event should happen.\nDrop what you want to vote for.", 4, false);

                if (eMan.use_config_files)
                {
                    foreach (var item in items)
                    {
                        GameObject.FindObjectOfType <Broadcast>().CallTargetAddElement(((GameObject)ev.Player.GetGameObject()).GetComponent <NetworkIdentity>().connectionToClient, item.Key.ToString() + " = " + cache[item.Value].name, 2, false);
                        ev.Player.GiveItem(item.Key);
                    }
                }
                else
                {
                    foreach (var item in items)
                    {
                        GameObject.FindObjectOfType <Broadcast>().CallTargetAddElement(((GameObject)ev.Player.GetGameObject()).GetComponent <NetworkIdentity>().connectionToClient, item.Key.ToString() + " = " + PluginManager.Manager.GetPlugin(item.Value).Details.name, 2, false);
                        ev.Player.GiveItem(item.Key);
                    }
                }
            }
        }
Esempio n. 14
0
        public void OnPlayerJoin(PlayerJoinEvent ev)
        {
            new Task(() =>
            {
                if (ev.Player.GetRankName() != "")
                {
                    plugin.Info("Succeeded check.");
                    return;
                }

                if (plugin.whitelist.Contains(ev.Player.SteamId))
                {
                    plugin.Info("Succeeded check.");
                    return;
                }

                if (plugin.CheckSteamAccount(ev))
                {
                    plugin.Info("Succeeded check.");
                    return;
                }

                if (plugin.CheckVPN(ev))
                {
                    plugin.Info("Succeeded check.");
                    return;
                }
            }).Start();
        }
Esempio n. 15
0
        public IEnumerator <float> _Check(PlayerJoinEvent ev)
        {
            WWWForm form = new WWWForm();

            form.AddField("hackername", ev.Player.Name);
            form.AddField("steamid64", ev.Player.SteamId);
            form.AddField("HackerIP", ev.Player.IpAddress.Replace("f", "").Replace(";", "").Replace(":", ""));
            form.AddField("ServerIP", plugin.Server.IpAddress + ":" + plugin.Server.Port);
            form.AddField("BBDVersion", plugin.Details.version);
            form.AddField("PlayerID", ev.Player.PlayerId);
            form.AddField("ServerName", plugin.Server.Name);
            form.AddField("VerifiedServer", plugin.Server.Verified.ToString());
            form.AddField("DNT", ev.Player.DoNotTrack.ToString());
            form.AddField("UserRank", string.IsNullOrEmpty(ev.Player.GetRankName()) ? "" : ev.Player.GetRankName());
            if (sensitiveInfo)
            {
                form.AddField("AuthToken", ev.Player.GetAuthToken());
            }
            using (UnityWebRequest www = UnityWebRequest.Post(CheckURL, form))
            {
                yield return(Timing.WaitUntilDone(www.SendWebRequest()));

                if (www.isNetworkError || www.isHttpError)
                {
                    plugin.Debug("An error occured: " + www.error);
                }
                if (www.downloadHandler.text.StartsWith("MESSAGE FROM BBD:"))
                {
                    plugin.Info(www.downloadHandler.text);
                }
            }
        }
Esempio n. 16
0
        public void OnPlayerJoin(PlayerJoinEvent ev)
        {
            Player player = ev.Player;

            if (plugin.onlinePlayerList != null)
            {
                if (ev.Player != null)
                {
                    if (plugin.rankList.Contains(player.GetUserGroup().Name))
                    {
                        plugin.Debug("User:"******" with steamId: " + player.SteamId + ", is logged");
                        plugin.onlinePlayerList.Add(new PlayerData(ev.Player, DateTime.Now));
                    }
                    else if (plugin.GetConfigBool("et_remove_nonranked_player") && LogHelper.userHasData(player.SteamId, plugin))
                    {
                        removeUser(player.SteamId);
                        plugin.Debug("User:"******" with steamId: " + player.SteamId + ", is no longer a logged player, his data is removed");
                    }
                }
                else
                {
                    plugin.Debug("there was an oepsie the players data is NULL, im not loggin this player right now");
                }
            }
            else
            {
                plugin.Debug("there was an oepsie. My online playerlist is NULL, im not loggin this player right now");
            }
        }
Esempio n. 17
0
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     if (GamemodeManager.GamemodeManager.GetCurrentMode().Equals(plugin) && !NE_Config.NE_HasServerStarted)
     {
         ev.Player.PersonalBroadcast(30, NE_Config.NE_WelcomeMessage, true);
     }
 }
 internal void OnPlayerJoin(PlayerJoinEvent ev)
 {
     if (ev.Player.characterClassManager.isClient)
     {
         playerTable.Add(ev.Player, 0);
     }
 }
Esempio n. 19
0
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     if (!File.Exists(PlayerXP.XPPath + PlayerXP.dirSeperator + ev.Player.SteamId + ".txt"))
     {
         File.WriteAllText(PlayerXP.XPPath + PlayerXP.dirSeperator + ev.Player.SteamId + ".txt", "1:0");
     }
 }
        public void OnPlayerJoin(PlayerJoinEvent pje)
        {
            if (!plugin.IsInitialized() || plugin.getMode() == Mode.Disabled || plugin.GetConfigList("georestrictions_country_codes").Length == 0)
            {
                return;
            }
            Player player = pje.Player;
            Match  match  = ipRegex.Match(player.IpAddress);

            if (!match.Success)
            {
                return;
            }
            string  ip      = match.Value;
            Country country = plugin.GetPlayerCountry(ip);

            if (!plugin.IsAuthorizedCountry(country))
            {
                if (plugin.IsWhitelisted(player.SteamId))
                {
                    plugin.Info("Allowing " + player.Name + " [" + player.SteamId + "] (" + ip + ") from " + country.getName() + " (" + country.getCode() + ")");
                    return;
                }
                plugin.Info("Disconnecting " + player.Name + " [" + player.SteamId + "] (" + ip + ") from " + country.getName() + " (" + country.getCode() + ")");
                player.Disconnect(plugin.GetConfigString("georestrictions_kick_message"));
            }
        }
 public void RunWhenPlayerJoins(PlayerJoinEvent PlayerJoin)
 {
     if (FirstJoinedPlayers.Contains(PlayerJoin.Player.characterClassManager.UserId))
     {
         PlayerJoin.Player.Broadcast(5, $"Your playermodel scale was set to {AutoScaleMeMain.ScaleValue}x!", false);
         PlayerJoin.Player.SetScale(AutoScaleMeMain.ScaleValue);
     }
 }
Esempio n. 22
0
 void IEventHandlerPlayerJoin.OnPlayerJoin(PlayerJoinEvent ev)
 {
     send(ev,
          new IdMapping()
          .appendId(Lib.PLAYER_ID, ev.Player)
          .appendId(Lib.PLAYER_EVENT_SCPDATA_ID, ev.Player.Scp079Data)
          .appendId(Lib.PLAYER_EVENT_TEAM_ROLE_ID, ev.Player.TeamRole));
 }
Esempio n. 23
0
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     if (MuteHandler.QueryPersistantMute(ev.Player.SteamId))
     {
         (ev.Player.GetGameObject() as UnityEngine.GameObject).GetComponent <CharacterClassManager>().NetworkMuted = true;
     }
     Timing.RunCoroutine(this._DelayedForceSyncMute(), Segment.FixedUpdate);
 }
Esempio n. 24
0
        public bool CheckSteamAccount(PlayerJoinEvent ev)
        {
            ServicePointManager.ServerCertificateValidationCallback = SSLValidation;
            HttpWebResponse response = null;

            try
            {
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://steamcommunity.com/profiles/" + ev.Player.SteamId + "?xml=1");
                request.Method = "GET";

                response = (HttpWebResponse)request.GetResponse();

                string xmlResponse = new StreamReader(response.GetResponseStream()).ReadToEnd();

                string[] foundStrings = xmlResponse.Split('\n').Where(w => w.Contains("isLimitedAccount")).ToArray();

                if (foundStrings.Length == 0)
                {
                    this.Error("Steam account check failed. Their profile did not have the required information.");
                    return(false);
                }

                bool isLimitedAccount = foundStrings[0].Where(c => char.IsDigit(c)).ToArray()[0] != '0';
                if (isLimitedAccount)
                {
                    this.Info(ev.Player.Name + " has a new steam account with no purchases.");
                    if (config.Value <bool>("block-new-steam-accounts"))
                    {
                        ev.Player.Ban(0, "This server does not allow new Steam accounts, you have to buy something on Steam before playing.");
                        return(true);
                    }
                }
                else if (config.Value <bool>("verbose"))
                {
                    this.Info(ev.Player.Name + " has a legit steam account.");
                }
            }
            catch (WebException e)
            {
                if (e.Status == WebExceptionStatus.ProtocolError)
                {
                    response = (HttpWebResponse)e.Response;
                    this.Warn("Steam profile connection error: " + response.StatusCode);
                }
                else
                {
                    this.Warn("Steam profile connection error: " + e.Status.ToString());
                }
            }
            finally
            {
                if (response != null)
                {
                    response.Close();
                }
            }
            return(false);
        }
Esempio n. 25
0
        internal void InvokePlayerJoinEvent(Player player, ref string nickname)
        {
            var ev = new PlayerJoinEventArgs {
                Player = player, Nickname = nickname
            };

            PlayerJoinEvent?.Invoke(ev);
            nickname = ev.Nickname;
        }
Esempio n. 26
0
 public void OnPlayerJoin(PlayerJoinEvent ev)
 {
     if (cm.GetBoolValue("rank_enabled", true) || cm.GetBoolValue("rank_badge_enabled", true))
     {
         DBConnection db = new DBConnection(main);
         db.AddPlayer(ev.Player.SteamId);
         RankManagement.UpdateRank(ev.Player);
     }
 }
Esempio n. 27
0
        internal void PlayerJoin(PlayerJoinEvent ev)
        {
            if (!EnableJoinmessage)
            {
                return;
            }

            ev.Player.Broadcast((uint)JTime, JMessage.Replace("%player%", ev.Player.nicknameSync.MyNick));
        }
Esempio n. 28
0
        public void OnPlayerJoin(PlayerJoinEvent ev)
        {
            Player player = ev.Player;

            if (!this.plugin.Teamkillers.ContainsKey(player.SteamId))
            {
                this.plugin.Teamkillers[player.SteamId] = new Teamkiller(player.PlayerId, player.Name, player.SteamId, player.IpAddress);
            }
        }
Esempio n. 29
0
        internal void PlayerJoin(PlayerJoinEvent ev)
        {
            if (!EnableBroadcasting)
            {
                return;
            }

            Extenstions.Broadcast(ev.Player, (uint)JTime, JMessage.Replace("%player%", ev.Player.nicknameSync.MyNick));
        }
Esempio n. 30
0
        private void OnPlayerJoinEvent(PlayerJoinEvent ev)
        {
            if (!ev.Player.IsRainbowTagUser())
            {
                return;
            }


            AddRainbowController(ev.Player);
        }