Infinity.UserTable¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when a user in the user table becomes available, i.e. |
|
This signal is emitted when a user is added to the user table and has the |
|
This signal is emitted when |
|
This signal is emitted when a user in the user table became unavailable, i.e. |
|
This signal is emitted when a user is removed from the user table and had the |
|
This signal is emitted when |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Infinity.UserTable(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Infinity.UserTable
is an opaque data type. You should only access it via the public API functions.- classmethod new()¶
- Returns:
- Return type:
Creates a new, empty user table.
- add_user(user)¶
- Parameters:
user (
Infinity.User
) – AInfinity.User
not already contained in self.
Inserts user into self.
- foreach_local_user(func, *user_data)¶
- Parameters:
func (
Infinity.UserTableForeachUserFunc
) – The function to call for each user.user_data (
object
orNone
) – User data to pass to the function.
Calls the given function for each local user in the user_table. A local user is a user that has the
Infinity.UserFlags.LOCAL
flag set and that has not statusInfinity.UserStatus.UNAVAILABLE
. You should not add or remove users while this function is being executed.
- foreach_user(func, *user_data)¶
- Parameters:
func (
Infinity.UserTableForeachUserFunc
) – The function to call for each user.user_data (
object
orNone
) – User data to pass to the function.
Calls the given function for each user in the user_table. You should not add or remove users while this function is being executed.
- lookup_user_by_id(id)¶
- Parameters:
id (
int
) – User ID to lookup.- Returns:
A
Infinity.User
, orNone
.- Return type:
Returns the
Infinity.User
with the given User ID in self.
- lookup_user_by_name(name)¶
- Parameters:
name (
str
) – User name to lookup.- Returns:
A
Infinity.User
, orNone
.- Return type:
Returns an
Infinity.User
with the given name if there is one.
- remove_user(user)¶
- Parameters:
user (
Infinity.User
) – AInfinity.User
contained in table.
Removes user from uesr_table.
- do_add_available_user(user) virtual¶
- Parameters:
user (
Infinity.User
) –
- do_add_local_user(user) virtual¶
- Parameters:
user (
Infinity.User
) –
- do_add_user(user) virtual¶
- Parameters:
user (
Infinity.User
) – AInfinity.User
not already contained in user_table.
Inserts user into user_table.
- do_remove_available_user(user) virtual¶
- Parameters:
user (
Infinity.User
) –
- do_remove_local_user(user) virtual¶
- Parameters:
user (
Infinity.User
) –
- do_remove_user(user) virtual¶
- Parameters:
user (
Infinity.User
) – AInfinity.User
contained in table.
Removes user from uesr_table.
Signal Details¶
- Infinity.UserTable.signals.add_available_user(user_table, user)¶
- Signal Name:
add-available-user
- Flags:
- Parameters:
user_table (
Infinity.UserTable
) – The object which received the signaluser (
Infinity.User
) – TheInfinity.User
that became available.
This signal is emitted when a user in the user table becomes available, i.e. its status is not
Infinity.UserStatus.UNAVAILABLE
. The signal is also emitted when a new user is added to the user table who is available, in addition toInfinity.UserTable
::add-user
and possiblyInfinity.UserTable
::add-local-user
.
- Infinity.UserTable.signals.add_local_user(user_table, user)¶
- Signal Name:
add-local-user
- Flags:
- Parameters:
user_table (
Infinity.UserTable
) – The object which received the signaluser (
Infinity.User
) – TheInfinity.User
that has set as local
This signal is emitted when a user is added to the user table and has the
Infinity.UserFlags.LOCAL
flag set. In this case,Infinity.UserTable
::add-user
is emitted as well.This signal is also emitted when an existing user receives the
Infinity.UserFlags.LOCAL
flag. This occurs when a user rejoins locally after leaving the session (possibly having theInfinity.UserFlags.LOCAL
flag removed during their absence).Infinity.UserTable
::add-user
is not emitted in this case.
- Infinity.UserTable.signals.add_user(user_table, user)¶
- Signal Name:
add-user
- Flags:
- Parameters:
user_table (
Infinity.UserTable
) – The object which received the signaluser (
Infinity.User
) – TheInfinity.User
that has been added into self
This signal is emitted when
Infinity.UserTable.add_user
() is called. Note that this does not happen if user rejoins the session and has already been added to user_table previously.Infinity.UserTable
::add-local-user
may also be emitted at this point if user has theInfinity.UserFlags.LOCAL
flag set.
- Infinity.UserTable.signals.remove_available_user(user_table, user)¶
- Signal Name:
remove-available-user
- Flags:
- Parameters:
user_table (
Infinity.UserTable
) – The object which received the signaluser (
Infinity.User
) – TheInfinity.User
that became unavailable.
This signal is emitted when a user in the user table became unavailable, i.e. its status has changed to
Infinity.UserStatus.UNAVAILABLE
. The signal is also emitted when a user who was available has been removed from the user table, in addition toInfinity.UserTable
::remove-user
and possiblyInfinity.UserTable
::remove-local-user
.
- Infinity.UserTable.signals.remove_local_user(user_table, user)¶
- Signal Name:
remove-local-user
- Flags:
- Parameters:
user_table (
Infinity.UserTable
) – The object which received the signaluser (
Infinity.User
) – TheInfinity.User
that is no longer local
This signal is emitted when a user is removed from the user table and had the
Infinity.UserFlags.LOCAL
flag set. In this case,Infinity.UserTable
::remove-user
is emitted as well.This signal is also emitted when user loses the
Infinity.UserFlags.LOCAL
flag. This occurs when the local user leaves the session.Infinity.UserTable
::remove-user
is not emitted and the status of user is set toInfinity.UserStatus.UNAVAILABLE
.
- Infinity.UserTable.signals.remove_user(user_table, user)¶
- Signal Name:
remove-user
- Flags:
- Parameters:
user_table (
Infinity.UserTable
) – The object which received the signaluser (
Infinity.User
) – TheInfinity.User
that has been removed from self
This signal is emitted when
Infinity.UserTable.remove_user
() is called. This does not usually happen, as users leaving a session do not get removed from the table.Infinity.UserTable
::remove-local-user
may also be emitted at this point if user has theInfinity.UserFlags.LOCAL
flag set.