Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!

Author Topic: Insurgency - Status showing duplicate entries  (Read 1747 times)

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Insurgency - Status showing duplicate entries
« on: February 08, 2015, 03:18:11 AM »
Apparently the status.py has its own identifier for some odd reason.  And it manages the list by 'CID' instead of b3 client ID (or DBID).

There all duplicate entries - which of course have the same DBID and unique 'CID's.

Screenshot of my current_clients table for proof:

[attachment deleted by admin]

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Insurgency - Status showing duplicate entries
« Reply #1 on: February 08, 2015, 06:27:45 AM »
would you have by chance the b3.log file which would show that duplicated user join your server around that time?

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Re: Insurgency - Status showing duplicate entries
« Reply #2 on: February 14, 2015, 02:03:26 AM »
self.console.clients.getList()

returns duplicate entries.  I have uploaded the b3.log and last half of the console.log to my drop folder ( http://www.acedev.net/files/insurgency/diag/duplicate )

You can see in duplicate entries b3.log on line 1689 you can see the print out of the return value of the getList function from one of my plugins.

This is outputted by the following code:

Code: [Select]
        self.debug('Trackwin Plugin: onRoundEnd called...')
        if event.data['event_name'] == "Round_Win":
            self.debug('Trackwin Plugin: round win issued team = %s, blue = %s, red = %s', event.data['team'], b3.TEAM_BLUE, b3.TEAM_RED)

            if event.data['team'] == b3.TEAM_RED :
                clients = self.console.clients.getList()
                client_ids = []

                for c in clients:
                    client_ids.append(c.id)
                    self.debug('Trackwin Plugin: player name = %s', c.name)

......
« Last Edit: February 14, 2015, 02:05:22 AM by zdanman »

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Re: Insurgency - Status showing duplicate entries
« Reply #3 on: February 14, 2015, 05:18:46 AM »
....  I forgot to add... of course it goes without saying... the current_clients table showed duplicate entries during this time as well.

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Insurgency - Status showing duplicate entries
« Reply #4 on: February 14, 2015, 05:20:14 AM »
getList() returns the content of the `clients` manager. Players get added to the clients manager when the newclient() method is called, and we can witness that in the log by looking at the lines starting with
Quote
client connected:


The Clients class extends python native dictionary which is a data structure associating a value to a unique key. In the Insurgency parser we can see that the player cid is passed to the newClient method as the key to use.

Now from your log file it seems that at each round end (or map end?) the Insurgency disconnect all players and they all reconnect later on with a different cid. That's the source of the duplicated entries in the clients manager.

Again from your log it seems we cannot rely on the disconnected (reason "Disconnected.") game log lines to remove players from the clients manager :
Code: [Select]
150213 18:04:10	DEBUG	u'client connected: [394] MapleLeaf - STEAM_1:1:109528616 ({})'
150213 18:04:10 DEBUG u'client connected: [479] JACKASS NINJA - STEAM_1:0:87311053 ({})'
150213 18:04:11 DEBUG u'client connected: [482] [CiD]Johnnybobo13 - STEAM_1:1:31733800 ({})'
150213 18:04:11 DEBUG u'client connected: [421] [CiD]The Defiant One - STEAM_1:1:11534167 ({})'
150213 18:04:11 DEBUG u'client connected: [420] [CiD] elatrivo - STEAM_1:1:39535429 ({})'
150213 18:04:11 DEBUG u'client connected: [447] [CiD]DaBoss47 - STEAM_1:1:25062582 ({})'
150213 18:04:11 DEBUG u'client connected: [422] [CiD] Toki - STEAM_1:0:27763712 ({})'
150213 18:04:33 DEBUG u'client connected: [270] [CiD] kid_319 - STEAM_1:1:29203521 ({})'
150213 18:08:31 DEBUG u'client connected: [17] [CiD]Tesuga - STEAM_1:1:69871731 ({})'
150213 18:08:52 DEBUG u'client connected: [18] MapleLeaf - STEAM_1:1:109528616 ({})'
150213 18:08:58 DEBUG u'client connected: [19] [CiD]The Defiant One - STEAM_1:1:11534167 ({})'
150213 18:09:09 DEBUG u'client connected: [20] [CiD]DaBoss47 - STEAM_1:1:25062582 ({})'
150213 18:09:16 DEBUG u'client connected: [21] [CiD] Toki - STEAM_1:0:27763712 ({})'
150213 18:09:19 DEBUG u'client connected: [22] [CiD]Johnnybobo13 - STEAM_1:1:31733800 ({})'
150213 18:09:32 DEBUG u'client connected: [23] [CiD] kid_319 - STEAM_1:1:29203521 ({})'
150213 18:09:33 DEBUG u'client connected: [24] [CiD] elatrivo - STEAM_1:1:39535429 ({})'
150213 18:18:33 CONSOLE 'L 02/13/2015 - 18:18:33: "[CiD]Johnnybobo13<22><STEAM_1:1:31733800><#Team_Security>" disconnected (reason "Disconnected.")'
150213 18:18:38 CONSOLE 'L 02/13/2015 - 18:18:38: "[CiD] Toki<21><STEAM_1:0:27763712><#Team_Security>" disconnected (reason "Disconnected.")'
150213 18:18:49 CONSOLE 'L 02/13/2015 - 18:18:49: "[CiD]Tesuga<17><STEAM_1:1:69871731><#Team_Security>" disconnected (reason "Disconnected.")'
150213 18:19:08 CONSOLE 'L 02/13/2015 - 18:19:08: "[CiD] kid_319<23><STEAM_1:1:29203521><#Team_Security>" disconnected (reason "Disconnected.")'
150213 18:19:58 CONSOLE 'L 02/13/2015 - 18:19:58: "[CiD] elatrivo<24><STEAM_1:1:39535429><#Team_Security>" disconnected (reason "Disconnected.")'
150213 18:20:01 DEBUG u'client connected: [63] \xa4CvG\xa4\u2122 Avoutrie - STEAM_1:1:41948970 ({})'

I guess a solution is to make the clients manager use the steam id instead of the cid as a key. This change is available in B3 daily build 319. Please give it a try and let us know how it goes.
« Last Edit: February 14, 2015, 05:27:13 AM by Courgette »

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2627
Re: Insurgency - Status showing duplicate entries
« Reply #5 on: February 14, 2015, 09:01:43 PM »
Unfortunately that means that you have to use the Steam guid to ban or do anything using the cid!

Strangely, we don't seem to have this problem, but we do have a related one where players get swapped for bots. I'm looking at how best to solve both of these issues.

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Insurgency - Status showing duplicate entries
« Reply #6 on: February 14, 2015, 10:34:31 PM »
IIRC bans are already made with steam ids

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Insurgency - Status showing duplicate entries
« Reply #7 on: February 14, 2015, 10:50:09 PM »
otherwise maybe a sync() method such as this one might do the job

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2627
Re: Insurgency - Status showing duplicate entries
« Reply #8 on: February 14, 2015, 10:55:35 PM »
IIRC bans are already made with steam ids
 
Sorry, didn't make myself clear enough - The !list produces an output like:

name {STEAM:1_1_673455488]

which makes it difficult to ban someone using their cid if the name is UTF or some other clever set of characters.

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Insurgency - Status showing duplicate entries
« Reply #9 on: February 14, 2015, 11:42:31 PM »
ah right, good point

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Re: Insurgency - Status showing duplicate entries
« Reply #10 on: February 18, 2015, 02:08:20 AM »
K... just finally updated and the latest 331 build is broken.  See my latest thread:

http://forum.bigbrotherbot.net/insurgency/insurgency-latest-update-not-working-broken/

 


Rate this page +1 at Google Search