CubeCoders / AMP

Issue tracking and documentation for AMP
https://cubecoders.com/AMP
207 stars 38 forks source link

BattlEyeRCON broken in Generic #779

Closed Greelan closed 1 year ago

Greelan commented 1 year ago

Bug Report

System Information

I confirm:

Symptoms

Putting this issue here so it does not get lost.

Even since the fix in 2.4.0.8 to address SourceRCON/TelnetRCON not working after a server restart (see https://github.com/CubeCoders/AMP/issues/672), BattlEyeRCON has been broken in Generic.

As noted in the comments in the other issue (with for example an Arma3 generic instance):

This is the only issue preventing the finalisation of the Arma3 generic template, as well as DayZ and Arma Reforger.

Reproduction

See above.

PhonicUK commented 1 year ago

Can I get a link for the WIP ARMA3 config?

Greelan commented 1 year ago

https://github.com/CubeCoders/AMPTemplates/pull/203

PhonicUK commented 1 year ago

I've found out what's up. The coded ARMA3 module waits 15 seconds before making the first connection attempt. I left a comment saying "Due to a bug in ARMA, connecting too early will cause subsequent attempts to fail.".

Additionally, RCONConnectDelaySeconds wasn't implemented. This affects the delay before the first attempt to connect to RCON. This is now implemented and I've edited my local version of the config to wait the same 15 seconds.

There's a problem somewhere with the password not being set correctly. If I manually set the password internally to be correct then generic with this change connected just fine.

image

IceOfWraith commented 1 year ago

We covered the last thing in Discord.

I'm curious though... Is that not implemented in other RCON modes? I would have assumed putting it in before meant putting it in for all.

PhonicUK commented 1 year ago

The RCON logic is shared across all protocols. The 'wait this long before trying again' delay was implemented and working fine, but the 'wait this long before even trying the first attempt' delay was not implemented, so I've now implemented that. For ARMA/other BE apps I recommend a delay of 15 seconds.

PhonicUK commented 1 year ago

I've also added PersistRandomPassword as a setting which if set, won't cycle the password every single start. Instead it'll generate a random password once and leave it so long as the value is empty to start with. The password is also now stored encrypted.

PhonicUK commented 1 year ago

Tested in CI with the above linked configuration, only tweak is setting RCONConnectDelaySeconds to 15.

southnode commented 1 year ago

Reopening due to issue being persistent in 2.4.1.2 mainline and 2.4.1.4 CI. Adding to 2.4 LTS milestone.

Greelan commented 1 year ago

It was fixed at one stage, and has now reverted.

It is particularly a problem on Windows (at least on Linux the RCON connects and is functional, although after some time it also seems to stop working).

Windows is a mess. As I commented in discord, either:

IceOfWraith commented 1 year ago

I've verified that once RCon connects in Windows it does NOT allow console input like Greelan says above. Here's the debug logging if it helps:

[20:04:32] [Core:IceOfWraith Debug] : Task Starting Arma 3... () ended: Finished
RCon admin #0 (127.0.0.1:56848) logged in
[20:04:46] [API:IceOfWraith Activity] : Sent to console: `#monitords 1`
IceOfWraith commented 1 year ago

And the mods issue is verified as well. Followed the guide he's started here for the list of mods to use. https://gist.github.com/Greelan/92e4a2261366a8b303c4263402d0ca9c#loading

MrSmits commented 1 year ago

Running in to this myself now too... AMP v2.4.1.2, built 21/12/2022 17:54 Windows 2019 Standard

[14:03:05] [ErrorReporter:smits Error] : Unhandled Exception: This will be automatically reported to the AMP developers.
[14:03:05] [ErrorReporter:smits Error] : [Error] --- Begin Exception Data ---
[Error] OS: Windows (x86_64/HyperV)
[Error] Module: GenericModule, Version: AMP 2.4.1.2
[Error] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Error] Instance ID: 7bf3dcc8-2937-4c5d-8645-0f5970a7868f
[Error] ObjectDisposedException
[Error] [0] (ObjectDisposedException) : Cannot access a disposed object.
Object name: 'System.Net.Sockets.UdpClient'.
[Error]    at Net.Sockets.UdpClient.EndSend(IAsyncResult asyncResult)
   at RCONPlugin.BattlEyeClient.<SendPacket>()
   at RCONPlugin.BattlEyeClient.<Login>()
   at GenericModule.GenericApp.<SetupRCON>()
[Error] --- End Exception Data ---
Greelan commented 1 year ago

Closing this as it is now generally functional.