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

Ping, nmdc: Error: connection closed: Âû çàáàíåíû íà ýòîì õàáå. #118

Open
Kcchouette opened this issue May 2, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Kcchouette
Copy link
Contributor

Kcchouette commented May 2, 2020

$ dcping ping "dchub://dc.krasmediafiles.ru:411" --encoding "CP1252"
2020/05/02 14:27:49 connection closed: Âû çàáàíåíû íà ýòîì õàáå.:

 [*] Íèê: _rangeban_
 [*] Äèàïàçîí IP: 163.0.0.0 - 163.255.255.255
 [*] Ïðè÷èíà: Ñïàì!
 [*] Âðåìÿ: Íàâñåãäà

{"name":"","addr":["dchub://dc.krasmediafiles.ru:411"],"soft":{"name":"Verlihub","vers":"1.1.0.3","ext":["NoHello","NoGetINFO","TLS","UserIP2","TTHSearch","ZPipe","HubINFO","BotList","MCTo","FailOver","HubTopic","OpPlus","NickRule","SearchRule","UserCommand"]},"users":0,"status":"error"}
Error: connection closed: Âû çàáàíåíû íà ýòîì õàáå.:

 [*] Íèê: _rangeban_
 [*] Äèàïàçîí IP: 163.0.0.0 - 163.255.255.255
 [*] Ïðè÷èíà: Ñïàì!
 [*] Âðåìÿ: Íàâñåãäà

dcping v0.26.0
It seems like a range ip that is banned, maybe can you deal with that?

@RoLex
Copy link

RoLex commented Jun 5, 2020

how can a pinger deal with bans? it is not possible. it is your job to speak with hub owner and ask to unban your ip range.

@Kcchouette
Copy link
Contributor Author

Kcchouette commented Jun 5, 2020

@RoLex apart same question can be asked (how can I deal with hub owner if my ip range is ban?), here the goal is to avoid to have a python error and catch somewhat the ban option with custom dcping error code

@RoLex
Copy link

RoLex commented Jun 5, 2020

pinger is not aware of ban, there is also no special nmdc (atleast) protocol command that tells about ban and the reason. what pinger have done here is that it got suddenly disconnected (before receiving $hubinfo) from the hub and what it shows to you is the last message it received before disconnect. in nmdc it is possible to detect "bad password", "nick taken" or "redirected", but not "you are banned". the only solution here would be to pick known keywords from last message. that is exactly why dcping shows you this message, so your script can continue working with given text.

btw, there is no python present.

@dennwc
Copy link
Collaborator

dennwc commented Oct 27, 2020

I agree with @Kcchouette, even though there are no code indicating the ban, the pinger should properly deal with it and fake the "banned" error message.

We already have a few hub-specific workarounds like this in the code, adding one more special case is not a big deal. From what I can see, the last message contains _rangeban_, which can be used to easily detect it.

Re: python, there is no Python in the project, but I know Kcc uses dcping with a python wrapper by parsing the JSON from the pinger.

@dennwc dennwc self-assigned this Oct 27, 2020
@dennwc dennwc added this to the Pinger milestone Oct 27, 2020
@dennwc dennwc added the enhancement New feature or request label Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants