C0nw0nk / Garrys-Mod-Family-Sharing

Prevent players bypassing existing bans on Garrys Mod Servers via steam family sharing / shared accounts or buying a new GMod. Banned messages and banning lengths configurable with lots of extra useful custom features such as a ban tracker / tracking. This script is guaranteed to make players regret receiving a ban from your server in GarrysMod / GarryMod / Garry'sMod / Garry's Mod / G Mod / G-Mod familysharing alts / alternative are a thing of the past. familysharing / familyshared checks / checker / checked / checking. lua script addon addons
http://www.networkflare.com/
Other
34 stars 12 forks source link

How to unban? #2

Open jonas9105 opened 7 years ago

jonas9105 commented 7 years ago

How to unban someone again?

C0nw0nk commented 7 years ago

!unban STEAMID via ingame chat box another method is ulx unban via console or open !menu (ULX menu ingame) and unban their steamid there.

If it is a shared account you unban but their main owners steam account is still banned. Then you have a choice. Get both the steamid's of the the shared account and owner account and Unban both manually.

I was at some point going to add to my ban hook. https://github.com/C0nw0nk/Garrys-Mod-Family-Sharing/blob/master/garrysmod/lua/autorun/familysharing.lua#L176

if string.lower(commandName) == "ulx unban" then
--code to communicate with steamapi and if the steamid is a family shared id then unban the owners steamid too.
end
C0nw0nk commented 7 years ago

I put this together quickly that should solve your problem and let you unban both family shared and owners accounts at the same time.

https://github.com/C0nw0nk/Garrys-Mod-Family-Sharing/blob/master/garrysmod/lua/autorun/familysharing.lua#L176

Add this code inside that function.

if ply:query(string.lower(commandName)) and string.lower(commandName) == "ulx unban" then
        --Split up the command into sections.
        local admin = translated_args[1]
        local target = translated_args[2]
        local time = translated_args[3]
        local offence = translated_args[4]

        --Send request to the SteamDEV API with the SteamID64 of the player we are unbanning.
        http.Fetch(
        string.format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=%s&format=json&steamid=%s&appid_playing=4000",
            APIKey,
            util.SteamIDTo64(target)
        ),

        function(body)
            --Put the http response into a table.
            local body = util.JSONToTable(body)

            --If the response does not contain the following table items.
            if not body or not body.response or not body.response.lender_steamid then
                error(string.format("FamilySharing: Invalid Steam API response for %s | %s\n", util.SteamIDTo64(target), target))
            end

            --Set the lender to be the lender in our body response table.
            local lender = body.response.lender_steamid
            --If the lender is not 0 (Would contain SteamID64). Lender will only ever == 0 if the account owns the game.
            if lender ~= "0" then
                --Lets unban the owners account too.
                local lenderSteamID = util.SteamIDFrom64(lender)
                RunConsoleCommand("ulx", "unban", lenderSteamID, admin)
                --ULib.unban(lenderSteamID, admin) --unban steamid and set the admin who unbanned them
            end
        end,

        function(code)
            error(string.format("FamilySharing: Failed API call for %s | %s (Error: %s)\n", util.SteamIDTo64(target), target, code))
        end
        )
end

Let me know if that works and if you can unban both shared and normal accounts with ingame chatbox !unban STEAMID, via console ulx unban and the ingame !menu unban. If it does work for you I will push the code to the main repo as a update.

(Anyone else with this same problem and the above code fixes your issue post a comment here letting me know and i will put this in a update on the Github repo.)

Ukushino commented 7 years ago

Hey, I made experiments and I was banned from my server. Superadmins tried to unban me with ULX but the server is noot responding in my side. I tried to restart Gmod/Steam but I can connect anymore in my server.

Banned by ip ? I used the rcon with the console and I was added to the ban list :(

Any suggestions dude ?

C0nw0nk commented 7 years ago

If you tested and banned yourself and your own IP is banned by accident then run in your server console.

removeip 1.2.3.4
writeip

And that will unban your IP address also removing it automatically from the banned_ip.cfg file

Another method is to remove the exec banned_ip.cfg from your config file but this will make IP banning not permanent. (Changing map for example IP address bans would not be passed onto the next map) https://github.com/C0nw0nk/Garrys-Mod-Family-Sharing#optional-

Ukushino commented 7 years ago

Thank you ! It seems to worked. Have a good day and thank you for your support

Ukushino commented 6 years ago

Hey Dude, sorry for making a new post like that. I was banned (accidentally of course again) cause I attempt to enter a bad password to rcon... Do I need to reboot the server after these commands ?

in removeip 1.2.3.4 I must insert my public ip or my local ip (IPV4) ? Too many useless questions but that remain essential... Sorry again for that.

Here's are the logs:

Banning xx.xx.xx.xx for rcon hacking attempts L 11/14/2017 - 01:23:49: Addip: "Caldryk - Brokk (Ukushino)<29><>" was kicked and banned by IP "permanently" by "Console" (IP "xx.xx.xx.xx") L 11/14/2017 - 01:23:49: "Caldryk - Brokk (Ukushino)<29><>" disconnected (reason "Added to banned list") ServerLog: [FAdmin] 1 CL TP Caldryk Stavanger (STEAM_0:0:46960450) Disconnected L 11/14/2017 - 01:23:49: [FAdmin] 1 CL TP Caldryk Stavanger (STEAM_0:0:46960450) Disconnected Dropped Caldryk - Brokk (Ukushino) from server (Added to banned list) Disconnect: Added to banned list. Disconnect: Added to banned list.

C0nw0nk commented 6 years ago

Run the commands to remove your IP then change the map no need for server restart changing the map should be enough.

Ukushino commented 6 years ago

Thank gods, It worked, sorry again for this bad post, I will save this hint in a notepad to remember in the future ! Thanks again

sharkbait246 commented 4 years ago

Do you guys know how to unban yourself in sketchful.io?