コード例 #1
0
        /// <summary>
        /// Bans the user for the specified reason and duration
        /// </summary>
        /// <param name="reason"></param>
        /// <param name="duration"></param>
        public void Ban(string reason, TimeSpan duration = default(TimeSpan))
        {
            // Check already banned
            if (IsBanned)
            {
                return;
            }

            // Set to banned
            ServerAdministrator.AddBlacklist(player.Id);
            // TODO: PT_InGame_LoginBan?
        }
コード例 #2
0
        /// <summary>
        /// Bans the user for the specified reason and duration
        /// </summary>
        /// <param name="id"></param>
        /// <param name="reason"></param>
        /// <param name="duration"></param>
        public void Ban(string id, string reason, TimeSpan duration = default(TimeSpan))
        {
            // Check if already banned
            if (IsBanned(id))
            {
                return;
            }

            // Ban and kick user
            ServerAdministrator.AddBlacklist(int.Parse(id));
            //if (IsConnected)
            //{
            //    player.RPCOthers(EPacketType.PT_InGame_LoginBan); // TODO: Needed?
            //    player.RPCOthers(EPacketType.PT_InGame_AddBlackList); // TODO: Needed?
            //    Kick(reason);
            // }
        }
コード例 #3
0
    void RPC_S2C_AddBlackList(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int id = stream.Read <int>();

        ServerAdministrator.AddBlacklist(id);
    }