コード例 #1
0
 private void BanReload(CommandArgs args)
 {
     try {
         NetworkBans.GetBannedPlayers().Clear();
         NetworkBans.Load();
         Reference.Tell(args.sender.networkPlayer, "Ban table reloaded with " + NetworkBans.GetBannedPlayers().Count + " entries.");
     }
     catch (Exception e)
     {
         Console.WriteLine("Error! " + e.Message);
     }
 }
コード例 #2
0
ファイル: NetworkHandler.cs プロジェクト: Horsuna/server
    public void joinNetworkUser(string name, string nickname, string clan, string steamId, int status, NetworkPlayer player)
    {
        if (NetworkBans.isBanned(steamId))
        {
            Logger.LogBan("Banned player requested join: " + name + " (" + steamId + ")");
            NetworkTools.kick(player, "You are banned! Reason: " + NetworkBans.GetBannedPlayers()[steamId].Reason + " - www.zombieland.ml");
        }

        foreach (NetworkUser user in NetworkUserList.users)
        {
            if (user.id.Equals(steamId))
            {
                Logger.LogSecurity(user.id, user.name, "Multiple login detected! Dropping clients! (" + name + " - " + steamId + ")");
                NetworkUserList.users.Remove(user);
                Network.CloseConnection(player, true);
                Network.CloseConnection(user.player, true);
                return;
            }
        }

        if (player != Network.player || !ServerSettings.dedicated)
        {
            Logger.LogConnection(name + " Connected. Clan: " + clan + " ID: " + steamId + " Status: " + status + " IP: " + player.ipAddress);

            if ((status == 21) && (!isInWhitelist(steamId)))
            {
                Logger.LogSecurity(steamId, name, "Tried connect with GOLD client");
                NetworkTools.kick(player, "GOLD members disabled...\nRequest whitelist: www.zombieland.ml");

                return;
            }

            // TODO: check reputaion!

            /*string repuString = Savedata.loadReputation(steamId);
             * int reputation = 0;
             * if (repuString != string.Empty)
             * {
             *      reputation = int.Parse(repuString);
             * }*/

            status = 0;
            if (UserList.getPermission(steamId) > 0)
            {
                status = 21;
            }

            StartCoroutine("GetRepuAndLogin", new object[] { name, nickname, clan, steamId, status, 0, player });
            //base.StartCoroutine(this.liscence(name, steamId, status, player));
        }
    }