Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to unban? #2

Open
jonas9105 opened this issue Feb 16, 2017 · 9 comments
Open

How to unban? #2

jonas9105 opened this issue Feb 16, 2017 · 9 comments
Labels

Comments

@jonas9105
Copy link

How to unban someone again?

@C0nw0nk
Copy link
Owner

C0nw0nk commented Feb 18, 2017

!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
Copy link
Owner

C0nw0nk commented Feb 18, 2017

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
Copy link

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
Copy link
Owner

C0nw0nk commented Aug 20, 2017

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
Copy link

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

@Ukushino
Copy link

Ukushino commented Nov 14, 2017

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><STEAM_0:0:46960450><>" 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><STEAM_0:0:46960450><>" 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
Copy link
Owner

C0nw0nk commented Nov 14, 2017

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

@Ukushino
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants