Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: BFBC2 Obtaining player scores  (Read 546 times)

Offline pedjas

  • Jr. Member
  • **
  • Posts: 24
BFBC2 Obtaining player scores
« on: September 22, 2015, 12:10:17 AM »
Code: [Select]
from b3.parsers.frostbite.util import PlayerInfoBlock
...

        pib = PlayerInfoBlock(self.console.write(('admin.listPlayers', 'all')))
        for p in pib:
            playerlist = self.console.clients.getByMagic(p['name'])
            client = playerlist[0]
            client.setvar(self, 'score', int(p['score']) )

I am no expert coder but this way of obtaining player score and making it usable does not seem very efficient. It has to send a lengthy rcon request every time.

Is there any more efficient or more natural approach to this? What am I missing?
« Last Edit: September 23, 2015, 09:16:51 AM by pedjas »

 


Rate this page +1 at Google Search