marceldev89 / BattleNET

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

commands are sent twice #29

Closed Alia5 closed 11 years ago

Alia5 commented 11 years ago

say -1 is sent twice :(

Alia5 commented 11 years ago

BattleNET_client.exe -host 127.0.0.1 -port 2302 -password XXXXXXXXXX -command "say -1 something"

Alia5 commented 11 years ago

nervermind, its a problem with wine...

marceldev89 commented 11 years ago

If you fixed it somehow with wine please do tell how. There are a few more with issues like that.

Alia5 commented 11 years ago

in a shellscript...

BattleNET_client.exe blabla sleep 2 kill $(pidof BattleNET_client.exe)

Quick and dirty, but works surprisingly well!

It seems like when logging out the command gets sent again in wine

also fixed the problem the console is not closing... didn't look at your code since c# isn't for me

Alia5 commented 11 years ago

only works for say though :(

marceldev89 commented 11 years ago

Can you try it with native mono (from your distribution repository and not for wine, i.e. aptitude install mono)?

Alia5 commented 11 years ago

WARNING: The runtime version supported by this application is unavailable. Using default runtime: v1.1.4322

\ (BattleNET_client.exe:19193): WARNING **: Missing method System.Console::set_OutputEncoding(Encoding) in assembly /usr/lib/mono/1.0/mscorlib.dll, referenced in assembly /home/arma/.wine/drive_c/Program Files/bec/BattleNET_client.exe

Unhandled Exception: System.MissingMethodException: Method not found: 'System.Console.set_OutputEncoding'.

marceldev89 commented 11 years ago

Hmm never seen that but I guess Linux/mono doesn't support that. ^^

Alia5 commented 11 years ago

I assume battleNet requires .net 4.0? mono only has support till 3.5 didn't try to compile experimental versions though

marceldev89 commented 11 years ago

hmm not sure, it worked fine for me when I ran the server on linux. I was running Debian testing though.

Alia5 commented 11 years ago

Yeah testing Versions if Debian have newer versions of mono... Using stable i should try to compile them then!

marceldev89 commented 11 years ago

Hmm building BattleNET with .NET 3.5 doesn't show any errors, you could try that instead. That would be a lot easier than compiling mono. ^^

Alia5 commented 11 years ago

Yeah sure! Compiling mono wouldn't be a problem... It's the time that I do not have, sadly :( Will try tomorrow tough

marceldev89 commented 11 years ago

If this is still a problem, check what happens with wireshark. Also I'm starting to think that it might be an encoding issue except I'm not sure why. :smile:

joaomcarlos commented 11 years ago

Hey Marcel, this is a problem for me. I sometimes get reports of ppl with this problem. I have it myself from time to time. Example, send global message and it goes twice.

marceldev89 commented 11 years ago

And this is all on linux environments?

marceldev89 commented 11 years ago

I don't have this issue at all on a windows environment though.

http://pastebin.com/Y2mBT6w8

marceldev89 commented 11 years ago

Hmm actually, I have 1 duplicate line and 1 missing line in total.

joaomcarlos commented 11 years ago

All my clients run windows, even tho my tool uses mono and is fully compatible with linux and macosx i have only tested it on my laptop and none of my clients use anything other than Windows.

Maybe I can send you a version of the tool so you can see it happening.

marceldev89 commented 11 years ago

Haha, I believe you. :smile:

marceldev89 commented 11 years ago

Anyway, the only reason that this can happen is that the server takes longer than 2 seconds to respond. So if you guys feel like experimenting a bit, try increasing the value at BattleNET/BattlEyeClient.cs line 322.

joaomcarlos commented 11 years ago

Increased it to 15sec, will test it :D

marceldev89 commented 11 years ago

Any results?

joaomcarlos commented 11 years ago

Hey Marcel, sorry to keep you in the dark, but I still am not 100% sure it fixes the problem. In local testing it did. 2 other users also show improvement, but, 7 others havent replied to me yet.

I assume it does fix the problem.

marceldev89 commented 11 years ago

Well if this is a confirmed fix then I'll have an idea on how to fix it.

Not sure when though, but I'll get to it. :smile:

marceldev89 commented 11 years ago

Actually, what's the load on the servers when this problem starts to happen?

DomiStyle commented 11 years ago

5 seconds did it for me. Was also a problem with messages being received multiple times not only being sent multiple times. 15 seconds was atleast too long for DaRT as I do my own command resend.

joaomcarlos commented 11 years ago

It seems that the extra delay fixes the problem yes. From all that I have sent the version to, not one had it still showing.

marceldev89 commented 11 years ago

Ok, I'll take a proper look at it soonish. Maybe implement some dynamic system for the timeouts and such taking the average server response time as a figure for the time based values.

DomiStyle commented 11 years ago

Was planning to do something similar in DaRT so users can adjust the timeout value by themself. Making it automatic is probably even better though. Using 5 seconds works fine till then.

KG7854 commented 11 years ago

Hi guys, When I request the "players" command I receive the players list twice (all the time), and the first time I send out a global message it also gets sent twice. After the first global message is sent twice it then works as it should, sending out messages only once but the players list still receives twice no matter what. I tried to change the value from 2 to15 in BattleNET/BattlEyeClient.cs line 322 and that didn't make any difference. I am running the server and developing on windows 7 machines x64

any help would be appreciated.

marceldev89 commented 11 years ago

Hum, it's fairly reasonable to assume that BattlEye isn't the same as it was 5 months ago (when I last updated battlenet).

If there isn't someone with a fix in the next few days then I'll start doing some debugging work during the weekend. :smile:

KG7854 commented 11 years ago

Thanks, looking forward to it, let me know if you need any help with testing, etc.

marceldev89 commented 11 years ago

Ah, forgot about it.. I'll try to do it this weekend. :smile:

marceldev89 commented 11 years ago

Alright, updated the develop branch. Please build it, test it and let me know.

Couldn't reproduce the players command being sent twice though, so it might or might not be fixed. :smile:

KG7854 commented 11 years ago

Thanks ziellos, that fixed the double first global message sent problem. The players list still gets sent twice, but if you don't have time its ok, My program just grabs the last player update command data anyways. But it would be cool to figure out how to fix this because I'm not sure if sending/receiving the players command twice will lag the server or not.... When I send the players command it takes a second or two then I receive the players data twice instantly, not sure if this helps you figure it out or not. If you have a guess where it could be I could try to mess with the code and maybe fix it, lol

Thanks again

marceldev89 commented 11 years ago

Hmm, did you also test the 'players' command with the RCon client that comes with the library? And also with BERcon?

KG7854 commented 11 years ago

Sorry I have been busy, I will do that and report back.

marceldev89 commented 11 years ago

No worries, and thank you. :smile:

KG7854 commented 11 years ago

I have tested both the above mentioned clients and they both work, it just must be something on my side.

marceldev89 commented 11 years ago

Alright. I'll close this one for now. :smile: