players.dictionary module

Provides helper class to store player instances.

class players.dictionary.PlayerDictionary(*args, **kwargs)[source]

Bases: EntityDictionary

Helper class used to store player instances.

__init__(factory=<class 'players.engines.orangebox.cstrike.Player'>, *args, **kwargs)[source]

Initializes the dictionary.

Parameters:
  • factory (callable) –

    Factory class or function used to create missing instances. Set to None to disable this feature.

    Factory signature: index, *args, **kwargs

  • args (tuple) – Arguments passed to the factory class or function.

  • kwargs (dict) – Keyword arguments passed to the factory class or function.

from_userid(userid)[source]

Returns a player instance from a userid.

Parameters:

userid (int) – The userid.

Return type:

Player