Wishlist: Remember IP on disconnect/connect

Topics: Admin Tool, Developers
Jan 20, 2012 at 7:46 PM
Edited Jan 20, 2012 at 7:48 PM

Hi,

If I disconnect and reconnect, IPs are lost and I have to wait for PunkBuster to feed them to me again.

Is it possible to have BF3Rcon.NET remember the IPs, so when I reconnect, the IPs are ready in the LoggedOn event?

 

Thanks

:)

Mojo

Coordinator
Jan 20, 2012 at 7:53 PM
Edited Jan 20, 2012 at 7:53 PM

Would it be preferred to have the IPs be received before the LoggedOn event is raised and the synchronous LogOn returns?

Jan 20, 2012 at 8:22 PM

Hi Timiz0r, :)

Well ... if you by "received before the LoggedOn event" means waiting for the pb_sv_plist to finish, then there's two problems:

1) When you fire the "pb_sv_plist" in your library (line 1053), PunkBuster doesn't send the list at all - nothing happens. In the LoggedOn event, I made a timer of 1 second and then called the pb_sv_plist command again - and now your library receives the list fine. So since your libaray doesn't get the list itself (maybe a problem with my server ... I dunno), it will never reach the LoggedOn event.

2) Second problem is, that the pb_sv_plist can take like 5-6 seconds to finish and that would be a long time for the user to wait for the program to be ready.

I thought of when a user joins (or pb_sv_plist return a result), then the name and IP could be storred in a dictionary. When you disconnect and reconnect, then in the LoggedOn event it seams like you already fetched the player list ... so before the LoggedOn event fires, the player list should be matched up against the dictionary and the IP's filled out. 

:)

Mojo 

Coordinator
Jan 21, 2012 at 1:31 AM

Keeping old IP data would be inconsistent functionality, since the IPs wouldn't be there the first connect and be there on other reconnects. Also, the data still wouldn't be guaranteed to be available because players can join before reconnecting. I'd like to minimize inconsistency because it makes it hard for developers to predict behavior.

However, I have another possible solution. When trying to get the IP of a Player, I could have the IPAddress getter wait until the IP has been received, then return it. That's the best solution I can think of at the moment, in terms of performance and efficiency.

Jan 21, 2012 at 10:52 AM

Hi Timiz0r,

I wasn't clear .. sry :) ... well I didn't want it to store a history of previous IPs. Problem is that in an iOS app, when the user sends the app to the background, I disconnect the rcon - 5 seconds later the user brings the app back to the foreground and I reconnect ... and now BF3Rcon.NET needs to retrieve a new list of IPs ... even though it knew it 5 seconds ago. I use IPs to show user flag and on disconnect and reconnect I want to show the flag instantly and not have to wait for PunkBuster.

So my idea was that BF3Rcon.NET should keep a ip-string-list of current players IPs. After a disconnect/reconnect, the playerlist should be matched to the  ip-string-list - and where it matches it should fill in the IPs. All this before LoggedOn event.

Just an idea. :)

Coordinator
Jan 21, 2012 at 12:57 PM

As I said, I won't be storing old IPs for those kinds of inconsistencies, but you could easily enable this yourself by commenting out

PunkBusterIPDictionary.Clear();

from the Reset method of RconClient.

Jan 21, 2012 at 1:51 PM

Will do - thanks. :)