marceldev89 / BattleNET

BattlEye Protocol Library and Client
GNU Lesser General Public License v3.0
76 stars 44 forks source link

Getting User's IP #31

Closed robertripoll closed 10 years ago

robertripoll commented 10 years ago

Hi:

Is there a way to get a User's IP when this users logs in or something? Or it should be ok if I call the function BattlEyeClient.SendCommand(BattlEyeCommand.Players)? But if I do the last, how would I get the text? With a StreamReader?

Lots of thanks for your tool, UngarMax.

marceldev89 commented 10 years ago

If I recall correctly, BattlEyeClient.SendCommand() returns an int (command id) which you can catch in the receive event where you can parse the output.

See https://github.com/ziellos2k/BattleNET/blob/master/BattleNET%20client/Program.cs#L122-L125.

robertripoll commented 10 years ago

Hi:

I already found out :P, but thanks anyway for your help. Also, I don't know why the RCon Times out while someone joins the Server or disconnects from the Server... I tried to handle the Connections and Disconnections (making some Regex Matches with args.Message), but the tool times out when someone's connects to the DayZ Server...

Is that a bug or maybe it's my fault?

Regards.

marceldev89 commented 10 years ago

You should probably use the develop branch. Also take a look at https://github.com/ziellos2k/BattleNET/issues/29. :smile:

If that doesn't solve then it's most probably on your end.

robertripoll commented 10 years ago

Hi:

I think I'm using the Develop Branch. I tried to base my tool in your code (https://github.com/ziellos2k/BattleNET/tree/master/BattleNET%20client). When I comment in my lines (leaving only the Console.WriteLine thingy), I can get the "connected" messages and the tool doesn't time out and such, but when I comment out my lines of code (in the MessageRecieved event), it times out when recieving "connected"/"disconnected" type messages...

You can take a look at my code right here to try to see what's wrong: https://github.com/UngarMax/DayZServer_Tool/tree/master

Thanks for your tool and thanks in advance!

marceldev89 commented 10 years ago

Yeah no clue, it's been ages since I touched the library. I've skimmed over your code but couldn't find anything odd.

So basically, if the BERcon tool from BattlEye and my client (without modifications) work fine then it's your code that's causing it to fail. If you're sure that the library is the problem then make a new issue with reproduction steps and a server for me to test on. ^^

robertripoll commented 10 years ago

Hi:

I'll try to see what's wrong with my code, because I think it's my fault. Closing issue.

Thanks again!