Jump to content
ziellos2k

BattleNET - C# library and client for the BattlEye protocol

Recommended Posts

Greetings,

First of all, thank you for the work on the Battlenet project. I am using your library and have a question. I am randomly getting the following error in my application:


System.ObjectDisposedException was unhandled
Message=Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
Source=System
ObjectName=System.Net.Sockets.Socket
StackTrace:
at System.Net.Sockets.Socket.get_Available()
at BattleNET.BattlEyeClient.<Receive>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

I noticed it last night especially during a time when I have 20-40 players on the server.

Any idea what might be causing this?

Thank you,

Keith

Edited by Splinter_2K

Share this post


Link to post
Share on other sites

Greetings,

First of all, thank you for the work on the Battlenet project. I am using your library and have a question. I am randomly getting the following error in my application:


System.ObjectDisposedException was unhandled
Message=Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
Source=System
ObjectName=System.Net.Sockets.Socket
StackTrace:
at System.Net.Sockets.Socket.get_Available()
at BattleNET.BattlEyeClient.<Receive>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

I noticed it last night especially during a time when I have 20-40 players on the server.

Any idea what might be causing this?

Thank you,

Keith

I can confirm this crash, had it a few times too.

Share this post


Link to post
Share on other sites

Hey,

Another question from me; does the library support sending UTF-8 messages too? I'm getting complaints by users that they cannot send admin messages in Russian. The letters echo back as "???????".

Share this post


Link to post
Share on other sites

Hey,

Another question from me; does the library support sending UTF-8 messages too? I'm getting complaints by users that they cannot send admin messages in Russian. The letters echo back as "???????".

Not sure, back in early dec 2012 I've added UTF-8 support but I guess that only worked for receiving. Not sure.

EDIT: You can try changing this to UTF-8 but it could possibly break the entire thing, no idea. ^_^

Edited by ziellos2k

Share this post


Link to post
Share on other sites

The users that are reporting the ??? Are they Russian? I ran into an issue with users who did have the language support needed for the language being sent.

Share this post


Link to post
Share on other sites

Well receiving seemed to work if I recall correctly.

Yes receiving works fine.

The users that are reporting the ??? Are they Russian? I ran into an issue with users who did have the language support needed for the language being sent.

"I'm getting complaints by users that they cannot send admin messages in Russian." Yeah they're Russion alright ;)

Edited by Wotuu

Share this post


Link to post
Share on other sites

Receiving Russian text from in-game works fine. Sending Russian text to the game does not work, but I don't think that that's possible in that case.

Share this post


Link to post
Share on other sites

I wonder if you could convert it prior to sending, then on receipt convert it back. I would test some conversions from of the online tools, but something a little friendlier to bnet might work.

http://stackoverflow.com/questions/497782/how-to-convert-a-string-from-utf8-to-ascii-single-byte-in-c

Edited by thevisad

Share this post


Link to post
Share on other sites

I tried taking a look at if I could fix the issue, but I'm probably wasting my time as the lib creator could do it much quicker than I could xd.

Share this post


Link to post
Share on other sites

Ok, that's not going to work it seems. The console doesn't really work well with Cyrillic according to others. If I send UTF8 encoded strings the entire connection fails. Converting UTF8 to ASCII didn't seem to work either. You might want to ask DomiStyle if he knows anything, iirc he asked for UTF8 support.

Share this post


Link to post
Share on other sites

Is anyone else having trouble with BattlEye sometimes sending mangled player lists or individual players?

I sometimes get something like this for a player's name:

freddiem1304 32 f99e962bf9dc2f075e0a3979bde0b523(OK) Viktorr

I'm pretty sure there's nothing wrong with my string splitting, it looks to me like it forgets a /n now and then.

Share this post


Link to post
Share on other sites

That seems like a BattlEye issue to me. But I'll take a look soon, just set up a server again so at least I can test without asking others for rcon access. :lol:

Share this post


Link to post
Share on other sites

I assumed it would be, I also occasionally get 2 player lists merged into one, my god it's annoying.

Share this post


Link to post
Share on other sites

I assumed it would be, I also occasionally get 2 player lists merged into one, my god it's annoying.

That I have noticed too, but I really think this is a Battleye issue. Same as with the ban lists, you occasionally get a screwed up one.

Share this post


Link to post
Share on other sites

Is anyone else having trouble with BattlEye sometimes sending mangled player lists or individual players?

I sometimes get something like this for a player's name:

freddiem1304 32 f99e962bf9dc2f075e0a3979bde0b523(OK) Viktorr

I'm pretty sure there's nothing wrong with my string splitting, it looks to me like it forgets a /n now and then.

You can easily fix this by parsing your ban/player list and checking it for problems.

For example check if the GUID has a length of 32 as you would expect it.

Check if the IP is a IP and the ban duration is a number or perm.

Or check if the line starts with something it can't.

If it does just request it again and repeat the same procedure.

That's what DaRT does and so far I didn't see a single mangled list.

Share this post


Link to post
Share on other sites

New version coming next week(ish). :lol:

Edited by ziellos2k
  • Like 1

Share this post


Link to post
Share on other sites

Version 1.3 is available now! Grab it from http://ziellos2k.net/battlenet/ or the github page, whatever floats your boat. :lol:

v1.3

* Client now has DNS support

* BattlEyeLoginCredentials.Host changed from string to IPAddress

* Increased timeout check sleep a bit (1 second)

* Increased time before a packet gets resend (2 seconds)

* Proper UTF8 support

* The usual bugfixes and cleanups

  • Like 1

Share this post


Link to post
Share on other sites

Greetings,

I'm using the latest version of the BattleNET library and for some reason getting a lot of timeouts and disconnects. Last night, just for troubleshooting, I ran the BERCON tool at the same time, to see if I saw the same disconnects. I did not.

I have my own custom application that I developed. However, I tested with the BattleNET sample client and saw the same timeout issues.

Any ideas what might be going on?

Thanks,

Splinter

Edited by Splinter_2K

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×