zafiaonline.structures package¶
Submodules¶
zafiaonline.structures.enums module¶
Enumerations for the Mafia game server.
This module defines various enums used throughout the Mafia game backend. These enums represent things like player roles, user settings, game events, chat message types, and rating systems.
Typical usage example:
from mafia.enums import Roles, RatingMode
- if user.role == Roles.SHERIFF:
investigate(user)
- if leaderboard.mode == RatingMode.TODAY:
print(f”Today’s rating is {leaderboard}”)
- class zafiaonline.structures.enums.Sex(*values)[source]¶
Bases:
IntEnumEnumeration representing the biological sex of a user.
- MEN¶
Represents a male user (value = 0).
- WOMEN¶
Represents a female user (value = 1).
- MEN = 0¶
- WOMEN = 1¶
- class zafiaonline.structures.enums.HttpsTrafficTypes(*values)[source]¶
Bases:
str,Enum- GET = 'get'¶
- POST = 'post'¶
- PUT = 'put'¶
- DELETE = 'delete'¶
- class zafiaonline.structures.enums.Languages(*values)[source]¶
Bases:
str,EnumEnumeration representing supported languages.
- UNSELECTED¶
Default value when no language is selected (value = “”).
- RUSSIAN¶
Represents the Russian language (value = “ru”).
- ENGLISH¶
Represents the English language (value = “en”).
- UNSELECTED = ''¶
- RUSSIAN = 'ru'¶
- ENGLISH = 'en'¶
- class zafiaonline.structures.enums.Roles(*values)[source]¶
Bases:
IntEnumEnumeration representing different roles in the game.
Each role has a unique integer identifier, defining a player’s function or abilities within the game.
- CIVILIAN¶
A regular player with no special abilities (1).
- DOCTOR¶
Can heal other players to protect them from elimination (2).
- SHERIFF¶
Can investigate other players to determine their roles (3).
- MAFIA¶
Works with the mafia team to eliminate civilians (4).
- LOVER¶
Forms a bond with another player; their fate is linked (5).
- TERRORIST¶
Can sacrifice themselves to eliminate another player (6).
- JOURNALIST¶
Can reveal a player’s role to the public (7).
- BODYGUARD¶
Protects a chosen player from attacks (8).
- BARMAN¶
Can disable another player’s abilities for a turn (9).
- SPY¶
Can gather information about other players’ actions (10).
- INFORMER¶
Can manipulate information or provide false leads (11).
- CIVILIAN = 1¶
- DOCTOR = 2¶
- SHERIFF = 3¶
- MAFIA = 4¶
- LOVER = 5¶
- TERRORIST = 6¶
- JOURNALIST = 7¶
- BODYGUARD = 8¶
- BARMAN = 9¶
- SPY = 10¶
- INFORMER = 11¶
- class zafiaonline.structures.enums.RatingMode(*values)[source]¶
Bases:
str,EnumEnumeration representing different rating modes for leaderboard rankings.
This enum defines the time frame for which player ratings are calculated and displayed on the leaderboard.
- ALL_TIME¶
Rankings based on all-time performance.
- TODAY¶
Rankings based on performance for the current day.
- YESTERDAY¶
Rankings based on performance for the previous day.
- ALL_TIME = 'all_time'¶
- TODAY = 'today'¶
- YESTERDAY = 'yesterday'¶
- class zafiaonline.structures.enums.RatingType(*values)[source]¶
Bases:
str,EnumEnumeration representing different types of rating categories for player rankings.
This enum defines the various metrics used to rank players in leaderboards.
- GAMES¶
Ranking based on the total number of games played.
- EXPERIENCE¶
Ranking based on the player’s accumulated experience points.
- AUTHORITY¶
Ranking based on the player’s authority level.
- WINS¶
Ranking based on the total number of wins achieved.
- GAMES = 'games'¶
- EXPERIENCE = 'experience'¶
- AUTHORITY = 'authority'¶
- WINS = 'wins'¶
- class zafiaonline.structures.enums.ActivityType(*values)[source]¶
Bases:
IntEnumEnumeration representing the activity status of a user.
This enum is used to indicate whether a user is currently online or offline.
- OFFLINE¶
Represents a user who is not currently active.
- ONLINE¶
Represents a user who is currently active and online.
- OFFLINE = 0¶
- ONLINE = 1¶
- class zafiaonline.structures.enums.RoomModelType(*values)[source]¶
Bases:
IntEnumEnumeration representing different types of room models in the game.
This enum is used to distinguish between standard rooms and matchmaking-enabled rooms.
- NOT_MATCHMAKING_MODE¶
Represents a regular game room without matchmaking.
- MATCHMAKING_MODE¶
Represents a room that uses a matchmaking system to pair players.
- NOT_MATCHMAKING_MODE = 0¶
- MATCHMAKING_MODE = 1¶
- class zafiaonline.structures.enums.ProfilePhotoType(*values)[source]¶
Bases:
str,EnumEnumeration representing the profile photo status of a user.
This enum is used to determine whether a user has uploaded a profile photo.
- NO_PHOTO¶
The user has not uploaded a profile photo.
- PHOTO_ADDED¶
The user has uploaded a profile photo.
- NO_PHOTO = '0'¶
- PHOTO_ADDED = '1'¶
- class zafiaonline.structures.enums.FriendInRoomType(*values)[source]¶
Bases:
IntEnumEnumeration representing the presence of a friend in a room.
This enum is used to indicate whether a user’s friend is currently in the same room.
- NO_FRIEND_IN_ROOM¶
No friends are present in the room.
- FRIEND_IN_ROOM¶
At least one friend is present in the room.
- NO_FRIEND_IN_ROOM = 0¶
- FRIEND_IN_ROOM = 1¶
- class zafiaonline.structures.enums.MessageType(*values)[source]¶
Bases:
IntEnumEnumeration of message types for the Mafia game chat.
Message types define the structure, color, and context of chat messages used during gameplay.
- MAIN_TEXT¶
General game message.
- USER_HAS_ENTERED¶
A user has entered the room.
- USER_HAS_LEFT¶
A user has left the room.
- GAME_HAS_STARTED¶
Game start notification.
- NIGHT_COME_MAFIA_IN_CHAT¶
Night phase begins, mafia chat opens.
- NIGHT_MAFIA_CHOOSE_VICTIM¶
Mafia selects a victim.
- DAY_COME_EVERYONE_IN_CHAT¶
Day phase begins, all players chat.
- DAY_CIVILIANS_VOTING¶
Civilians begin voting.
- VOTES_FOR¶
A vote has been cast.
- MAIN_TEXT10¶
Duplicate main text (unused).
- KILLED_PLAYER_MESSAGE¶
Message about a killed player.
- PLAYER_KILLED¶
Announcement of player killed.
- VOTES_FOR13¶
Duplicate voting message (unused).
- NOBODY_KILLED¶
No player was killed.
- GAME_FINISHED_CIVILIANS_WON¶
Game end, civilians win.
- GAME_FINISHED_MAFIA_WON¶
Game end, mafia win.
- KILLED_USER_MESSAGE¶
User has been killed.
- TERRORIST_BOMBED¶
Terrorist has exploded.
- BREAKING_NEWS_PLAYING_THE_SAME_TEAM¶
Breaking news, same team.
- BREAKING_NEWS_PLAYING_DIFFERENT_TEAMS¶
Breaking news, different teams.
- TERRORIST_BOMBED_USER_WAS_UNDER_GUARDIAN¶
Bomb blocked by guardian.
- GAME_FINISHED_IN_DRAW¶
Game ended in a draw.
- STARTED_VOTING_TO_KICK_USER¶
Kick vote initiated.
- KICK_VOTING_HAS_FINISHED¶
Kick vote concluded.
- MAIN_TEXT25¶
Duplicate main text (unused).
- VOTES_FOR26¶
Duplicate voting message (unused).
- GIVE_UP¶
Player has surrendered.
- MAIN_TEXT = 1¶
- USER_HAS_ENTERED = 2¶
- USER_HAS_LEFT = 3¶
- GAME_HAS_STARTED = 4¶
- NIGHT_COME_MAFIA_IN_CHAT = 5¶
- NIGHT_MAFIA_CHOOSE_VICTIM = 6¶
- DAY_COME_EVERYONE_IN_CHAT = 7¶
- DAY_CIVILIANS_VOTING = 8¶
- VOTES_FOR = 9¶
- MAIN_TEXT10 = 10¶
- KILLED_PLAYER_MESSAGE = 11¶
- PLAYER_KILLED = 12¶
- VOTES_FOR13 = 13¶
- NOBODY_KILLED = 14¶
- GAME_FINISHED_CIVILIANS_WON = 15¶
- GAME_FINISHED_MAFIA_WON = 16¶
- KILLED_USER_MESSAGE = 17¶
- TERRORIST_BOMBED = 18¶
- BREAKING_NEWS_PLAYING_THE_SAME_TEAM = 19¶
- BREAKING_NEWS_PLAYING_DIFFERENT_TEAMS = 20¶
- TERRORIST_BOMBED_USER_WAS_UNDER_GUARDIAN = 21¶
- GAME_FINISHED_IN_DRAW = 22¶
- STARTED_VOTING_TO_KICK_USER = 23¶
- KICK_VOTING_HAS_FINISHED = 24¶
- MAIN_TEXT25 = 25¶
- VOTES_FOR26 = 26¶
- GIVE_UP = 27¶
- class zafiaonline.structures.enums.MessageStyles(*values)[source]¶
Bases:
IntEnumEnumeration of color styles for chat messages in the Mafia game.
These styles define the appearance of chat messages based on their type. Values correspond to predefined color codes in the game’s client UI.
- NO_COLOR¶
No color applied.
- GREY_COLOR¶
Grey color style.
- BLUE_COLOR¶
Blue color style.
- RED_COLOR¶
Red color style.
- GREEN_COLOR¶
Green color style.
- PURPLE_COLOR¶
Purple color style.
- YELLOW_COLOR¶
Yellow color style.
- PINK_COLOR¶
Pink color style.
- NO_COLOR = 0¶
- GREY_COLOR = 1¶
- BLUE_COLOR = 2¶
- RED_COLOR = 3¶
- GREEN_COLOR = 4¶
- PURPLE_COLOR = 5¶
- YELLOW_COLOR = 6¶
- PINK_COLOR = 7¶
- class zafiaonline.structures.enums.MafiaLanguages(*values)[source]¶
Bases:
str,EnumEnumeration of supported language codes in the Mafia game.
These codes are used for localizing game content and messages.
- Russian¶
Russian language.
- English¶
English language.
- Russian = 'RUS'¶
- English = 'ENG'¶
- class zafiaonline.structures.enums.BuyVipMethodsIds(*values)[source]¶
Bases:
str,Enum- BuyWithGoldCoins = 'vip_account_1'¶
- BuyWithSilverCoins = 'vip_account_2'¶
- class zafiaonline.structures.enums.BuySilverCoinsMethodsIds(*values)[source]¶
Bases:
str,Enum- BuyFiveThousandCoins = 'silver_1'¶
- BuyTenThousandCoins = 'silver_2'¶
- BuyTwentyThousandCoins = 'silver_3'¶
- BuyFortyThousandCoins = 'silver_4'¶
- BuyEightyThousandCoins = 'silver_5'¶
- BuyOneHundredThousandCoins = 'silver_6'¶
- class zafiaonline.structures.enums.BuyDecorationsMethodIds(*values)[source]¶
Bases:
IntEnum- BuyOneHundredTwentyGold = 0¶
- BuyFortyFiveGold = 1¶
- BuyTwentyFiveGold = 2¶
- BuyFiveGold = 3¶
- BuyFifteenThousandSilver = 4¶
- BuyFiveThousandFiveHundredSilver = 5¶
- BuyThreeThousandSilver = 6¶
- BuySixHundredSilver = 7¶
- class zafiaonline.structures.enums.MethodGetFavourites(*values)[source]¶
Bases:
IntEnumEnumeration for methods of retrieving favourite players in the Mafia game.
Used to specify the source of a player’s favourites when making a request.
- FriendMethod¶
Retrieve favourites from the friend list.
- InviteMethod¶
Retrieve favourites from the invite list.
- FriendMethod = 0¶
- InviteMethod = 1¶
zafiaonline.structures.models module¶
Data models used across the Mafia Online game.
This module defines the core structured data types used for player profiles, rooms, server configuration, chat messages, GUI settings, and more. These models are built using msgspec.Struct for efficient (de)serialization of network packets and are tied to backend field renaming constants.
Typical usage example:
from zafiaonline.structures.models import ModelUser, ModelRoom
user = ModelUser(username=”Player123”, password=”21242424”) room = ModelRoom(room_id=”ru_96180a0e-57bd-4f4f-bf72-3e0978351761”, max_players=12)
- class zafiaonline.structures.models.ModelUser(user_id=None, updated=None, username=None, photo=None, experience=None, next_level_experience=None, previous_level_experience=None, level=None, is_vip=None, vip_updated=None, played_games=None, match_making_score=None, sex=Sex.MEN, player_role_statistics=None, wins_as_killer=None, wins_as_mafia=None, wins_as_peaceful=None, token=None, role=None, online=None, selected_language=Languages.RUSSIAN, is_in_room=None)[source]¶
Bases:
StructRepresents a user profile in the Mafia Online game.
This model contains detailed information about a user, such as their experience, level, VIP status, game statistics, and authentication token. It is used for both client display and backend communication.
- Parameters:
user_id (str | None)
updated (int | None)
username (str | None)
photo (str | None)
experience (int | None)
next_level_experience (int | None)
previous_level_experience (int | None)
level (int | None)
is_vip (int | None)
vip_updated (int | None)
played_games (int | None)
match_making_score (int | None)
sex (Sex)
player_role_statistics (dict[str, int] | None)
wins_as_killer (int | None)
wins_as_mafia (int | None)
wins_as_peaceful (int | None)
token (str | None)
role (int | None)
online (int | None)
selected_language (Languages)
is_in_room (None)
- user_id¶
Unique identifier of the user.
- Type:
str | None
- updated¶
Timestamp of the last profile update.
- Type:
int | None
- username¶
Username of the player.
- Type:
str | None
- photo¶
Profile photo identifier or URL.
- Type:
str | None
- experience¶
Total experience points.
- Type:
int | None
- next_level_experience¶
Experience needed for next level.
- Type:
int | None
- previous_level_experience¶
Experience required for previous level.
- Type:
int | None
- level¶
Current level of the user.
- Type:
int | None
- is_vip¶
Whether the user is a VIP (1) or not (0).
- Type:
int | None
- vip_updated¶
Timestamp of the last VIP update.
- Type:
int | None
- played_games¶
Total number of games played.
- Type:
int | None
- match_making_score¶
MMR or matchmaking rating.
- Type:
int | None
- player_role_statistics¶
Roles played and frequency.
- Type:
dict[str, int] | None
- wins_as_killer¶
Number of wins as killer.
- Type:
int | None
- wins_as_mafia¶
Number of wins as mafia.
- Type:
int | None
- wins_as_peaceful¶
Number of wins as peaceful player.
- Type:
int | None
- token¶
Authentication or session token.
- Type:
str | None
- role¶
Role ID in the current game, if any.
- Type:
int | None
- online¶
Whether the user is online (1) or offline (0).
- Type:
int | None
- user_id: str | None¶
- updated: int | None¶
- username: str | None¶
- photo: str | None¶
- experience: int | None¶
- next_level_experience: int | None¶
- previous_level_experience: int | None¶
- level: int | None¶
- is_vip: int | None¶
- vip_updated: int | None¶
- played_games: int | None¶
- match_making_score: int | None¶
- player_role_statistics: dict[str, int] | None¶
- wins_as_killer: int | None¶
- wins_as_mafia: int | None¶
- wins_as_peaceful: int | None¶
- token: str | None¶
- role: int | None¶
- online: int | None¶
- is_in_room: None¶
- class zafiaonline.structures.models.ModelOtherUser(user_id=None, updated=None, username=None, photo=None, experience=None, next_level_experience=None, previous_level_experience=None, level=None, is_vip=None, played_games=None, match_making_score=None, sex=Sex.MEN, player_role_statistics=None, wins_as_mafia=None, wins_as_peaceful=None, token=None, online=None, selected_language=Languages.RUSSIAN, user_account_coins=None, decorations=None)[source]¶
Bases:
StructRepresents another user’s profile in the new API format of Mafia Online.
This model is used for representing external or public-facing user data, typically in API responses where reduced or modified fields are used compared to the main ModelUser structure.
- Parameters:
user_id (str | None)
updated (int | None)
username (str | None)
photo (str | None)
experience (int | None)
next_level_experience (int | None)
previous_level_experience (int | None)
level (int | None)
is_vip (bool | None)
played_games (int | None)
match_making_score (int | None)
sex (Sex)
player_role_statistics (dict[str, int] | None)
wins_as_mafia (int | None)
wins_as_peaceful (int | None)
token (str | None)
online (bool | None)
selected_language (Languages)
user_account_coins (dict[str, int] | None)
decorations (dict | None)
- user_id¶
Unique identifier of the user.
- Type:
str | None
- updated¶
Timestamp of the last profile update.
- Type:
int | None
- username¶
Display name of the user.
- Type:
str | None
- photo¶
URL or identifier of the profile photo.
- Type:
str | None
- experience¶
Accumulated experience points.
- Type:
int | None
- next_level_experience¶
Experience required for next level.
- Type:
int | None
- previous_level_experience¶
Experience required for previous level.
- Type:
int | None
- level¶
Current user level.
- Type:
int | None
- is_vip¶
Whether the user has VIP status.
- Type:
bool | None
- played_games¶
Total number of games played.
- Type:
int | None
- match_making_score¶
Matchmaking rating (MMR).
- Type:
int | None
- player_role_statistics¶
Mapping of role names to games played.
- Type:
dict[str, int] | None
- wins_as_mafia¶
Number of wins while playing as mafia.
- Type:
int | None
- wins_as_peaceful¶
Number of wins while playing as peaceful.
- Type:
int | None
- token¶
Optional authentication or session token.
- Type:
str | None
- online¶
Online status (True if online).
- Type:
bool | None
- user_account_coins¶
Coin balances per currency type.
- Type:
dict[str, int] | None
- decorations¶
Information about visual customizations or cosmetic items.
- Type:
dict | None
- user_id: str | None¶
- updated: int | None¶
- username: str | None¶
- photo: str | None¶
- experience: int | None¶
- next_level_experience: int | None¶
- previous_level_experience: int | None¶
- level: int | None¶
- is_vip: bool | None¶
- played_games: int | None¶
- match_making_score: int | None¶
- player_role_statistics: dict[str, int] | None¶
- wins_as_mafia: int | None¶
- wins_as_peaceful: int | None¶
- token: str | None¶
- online: bool | None¶
- user_account_coins: dict[str, int] | None¶
- decorations: dict | None¶
- class zafiaonline.structures.models.ModelServerConfig(kick_user_price=None, set_room_password_min_authority=None, price_username_set=None, server_language_change_time=None, show_password_room_info_button=None)[source]¶
Bases:
StructConfiguration model for server-level game settings in Mafia Online.
This model defines server-side parameters that affect game behavior, pricing, and UI visibility for all users.
- Parameters:
kick_user_price (int | None)
set_room_password_min_authority (int | None)
price_username_set (int | None)
server_language_change_time (int | None)
show_password_room_info_button (bool | None)
- kick_user_price¶
Cost to kick a user from a room.
- Type:
int | None
- set_room_password_min_authority¶
Minimum authority level required to set a room password.
- Type:
int | None
- price_username_set¶
Price to change the user’s display name.
- Type:
int | None
- server_language_change_time¶
Minimum time between server language changes (in seconds).
- Type:
int | None
- show_password_room_info_button¶
Whether the password visibility toggle is shown in room info.
- Type:
bool | None
- kick_user_price: int | None¶
- set_room_password_min_authority: int | None¶
- price_username_set: int | None¶
- server_language_change_time: int | None¶
- show_password_room_info_button: bool | None¶
- class zafiaonline.structures.models.ModelRoom(room_id=None, min_players=None, max_players=None, min_level=None, vip_enabled=None, status=None, selected_roles=None, title=None, password=None, room_model_tupe=None)[source]¶
Bases:
StructModel representing a game room in Mafia Online.
This structure contains metadata and settings for a multiplayer room where players gather before starting a game.
- Parameters:
room_id (str | None)
min_players (int | None)
max_players (int | None)
min_level (int | None)
vip_enabled (bool | None)
status (int | None)
selected_roles (list[Roles] | None)
title (str | None)
password (str | None)
room_model_tupe (int | None)
- room_id¶
Unique identifier of the room.
- Type:
str | None
- min_players¶
Minimum number of players required to start the game.
- Type:
int | None
- max_players¶
Maximum number of players allowed in the room.
- Type:
int | None
- min_level¶
Minimum player level required to join the room.
- Type:
int | None
- vip_enabled¶
Whether the room is restricted to VIP players.
- Type:
bool | None
- status¶
Current status of the room (e.g., waiting, in-game).
- Type:
int | None
- title¶
User-defined title or name of the room.
- Type:
str | None
- password¶
Optional password required to join the room.
- Type:
str | None
- room_id: str | None¶
- min_players: int | None¶
- max_players: int | None¶
- min_level: int | None¶
- vip_enabled: bool | None¶
- status: int | None¶
- title: str | None¶
- password: str | None¶
- room_model_tupe: int | None¶
- class zafiaonline.structures.models.ModelShortUser(user_id=None, username=None, updated=None, photo=None, online=None, is_vip=None, vip_updated=None, sex=Sex.MEN)[source]¶
Bases:
StructLightweight user model for displaying minimal profile information.
Used in friend lists, search results, and other areas where full user data is unnecessary.
- Parameters:
user_id (str | None)
username (str | None)
updated (int | None)
photo (str | None)
online (int | None)
is_vip (int | None)
vip_updated (int | None)
sex (Sex)
- user_id¶
Unique identifier of the user.
- Type:
str | None
- username¶
Display name of the user.
- Type:
str | None
- updated¶
Unix timestamp of the last user data update.
- Type:
int | None
- photo¶
URL or ID of the user’s avatar image.
- Type:
str | None
- online¶
Online status flag (e.g., 1 for online, 0 for offline).
- Type:
int | None
- is_vip¶
VIP status flag (1 if VIP, 0 if not).
- Type:
int | None
- vip_updated¶
Unix timestamp when VIP status was last updated.
- Type:
int | None
- user_id: str | None¶
- username: str | None¶
- updated: int | None¶
- photo: str | None¶
- online: int | None¶
- is_vip: int | None¶
- vip_updated: int | None¶
- class zafiaonline.structures.models.ModelFriend(friend_id=None, updated=None, user=None, new_messages=None)[source]¶
Bases:
StructModel representing a friend relationship and related metadata.
Used for managing a player’s friends list and unread message tracking.
- Parameters:
friend_id (str | None)
updated (int | None)
user (ModelShortUser | None)
new_messages (int | None)
- friend_id¶
Unique identifier of the friend relationship.
- Type:
str | None
- updated¶
Unix timestamp of the last update to this relationship.
- Type:
int | None
- user¶
Short user model representing the friend.
- Type:
ModelShortUser | None
- new_messages¶
Number of unread messages from this friend.
- Type:
int | None
- friend_id: str | None¶
- updated: int | None¶
- user: ModelShortUser | None¶
- new_messages: int | None¶
- class zafiaonline.structures.models.ModelMessage(user_id=None, friend_id=None, created=None, text=None, message_style=None, accepted=None, message_type=None)[source]¶
Bases:
StructModel representing a chat message exchanged between users.
Used for storing or transmitting messages in the in-game chat system.
- Parameters:
user_id (str | None)
friend_id (str | None)
created (int | None)
text (str | None)
message_style (int | None)
accepted (int | None)
message_type (int | None)
- user_id¶
ID of the user who sent the message.
- Type:
str | None
- friend_id¶
ID of the recipient friend.
- Type:
str | None
- created¶
Unix timestamp indicating when the message was created.
- Type:
int | None
- text¶
Text content of the message.
- Type:
str | None
- message_style¶
Style/type indicator for rendering the message (e.g., font, color).
- Type:
int | None
- accepted¶
Indicates whether the message was accepted/acknowledged.
- Type:
int | None
- message_type¶
Type of message (e.g., system, player, notification).
- Type:
int | None
- user_id: str | None¶
- friend_id: str | None¶
- created: int | None¶
- text: str | None¶
- message_style: int | None¶
- accepted: int | None¶
- message_type: int | None¶
- class zafiaonline.structures.models.ModelGUI(count_authority_for_swap_icon=None)[source]¶
Bases:
StructModel representing GUI-related configuration and thresholds.
This structure holds data used by the client to render or enable graphical interface elements based on certain authority levels.
- Parameters:
count_authority_for_swap_icon (dict | None)
- count_authority_for_swap_icon¶
A mapping of authority levels to the number of times a user can swap icons or similar GUI actions.
- Type:
dict | None
- count_authority_for_swap_icon: dict | None¶
zafiaonline.structures.packet_data_keys module¶
Enums and renaming dictionaries for networking and API communication.
This module contains enum classes and key renaming mappings used for encoding and decoding messages between clients and servers in Mafia Online and Zafia Online.
Typical usage example:
from mafia.enums_and_keys import PacketDataKeys, Renaming
value = PacketDataKeys.USERNAME renamed_dict = rename_payload(data, rename_map=Renaming.USER)
- class zafiaonline.structures.packet_data_keys.PacketDataKeys(*values)[source]¶
Bases:
str,EnumEnumeration of packet data keys for client-server communication.
This class defines short string identifiers used in network packets exchanged between client and server. These compact keys help reduce payload size and improve communication efficiency.
Each enum member maps a semantic constant name to a short code, often a single letter or abbreviation, which identifies a specific action, status, user attribute, or system message in the protocol.
- ACCEPTED = 'a'¶
- ACCEPT_MESSAGES = 'ac'¶
- ACTIVE = 'ac'¶
- ACTIVITY = 'ac'¶
- ADD_CLIENT_TO_CHAT = 'acc'¶
- ADD_CLIENT_TO_DASHBOARD = 'acd'¶
- ADD_CLIENT_TO_FRIENDSHIP_LIST = 'acfl'¶
- ADD_CLIENT_TO_PRIVATE_CHAT = 'acpc'¶
- ADD_CLIENT_TO_ROOMS_LIST = 'acrl'¶
- ADD_FRIEND = 'af'¶
- ADD = 'add'¶
- ADD_PLAYER = 'ap'¶
- ADMIN_BLOCK_USER = 'abu'¶
- ADMIN_CONTROL_USER = 'acu'¶
- ADMIN = 'adm'¶
- ADMIN_KICK_USER = 'aku'¶
- ADMIN_UNBLOCK_USER = 'auu'¶
- AFFECTED_BY_ROLES = 'abr'¶
- ALIVE = 'a'¶
- APP_LANGUAGE = 'alc'¶
- ASPIRIN = 'a'¶
- BACKPACK = 'bp'¶
- BILLING_APP_PACKAGE = 'bapckg'¶
- BILLING_PRODUCT_ID = 'bpid'¶
- BILLING_PURCHASE_PENDING = 'bppndng'¶
- BILLING_PURCHASE_TOKEN = 'bptkn'¶
- BLOCKED_USERS = 'bus'¶
- BLOCK_DEVICE = 'bdv'¶
- BLOCK_IP = 'bi'¶
- BONUSES_ENABLED = 'bns'¶
- BONUS_PRICE = 'bp'¶
- BRIBE = 'b'¶
- BUY_BILLING_MARKET_ITEM = 'mrktgg'¶
- BUY_BILLING_MARKET_SUCCESS_ITEM = 'bbmrktis'¶
- BUY_MARKET_ITEM = 'bmrkti'¶
- BUY_MARKET_ITEM_SUCCESS = 'bmrktis'¶
- CHAT_MESSAGE_CREATE = 'cmc'¶
- CHECK_PLAYER_IS_IN_ROOM = 'cpir'¶
- CIVILIAN_ALIVE = 'c'¶
- CIVILIAN_ALL = 'ca'¶
- CLEAN_VOTES_HISTORY = 'cv'¶
- CLOUD_MESSAGING_TOKEN_IS_SAVED = 'cmts'¶
- COMPLAINTS = 'cmps'¶
- COMPLAINT = 'cmp'¶
- CONDOM = 'cm'¶
- CONFESSION = 'cn'¶
- CONNECTION_CHECKER_PERIOD = 'ccp'¶
- CONNECTION_INACTIVE_TIMEOUT = 'cit'¶
- CREATED = 'c'¶
- CREATE_PLAYER = 'cp'¶
- CREATOR_BLOCKED = 'crb'¶
- DATA = 'data'¶
- DAYTIME = 'd'¶
- DESCRIPTION = 'dsc'¶
- DEVICE_ID = 'd'¶
- EMAIL = 'e'¶
- EMAIL_NOT_VERIFIED = 'env'¶
- EMAIL_NOT_VERIFIED_MESSAGE_CREATE_TIMEOUT = 'envmct'¶
- ERROR_FLOOD_DETECTED = 'erfd'¶
- ERROR = 'e'¶
- ERROR_OCCUR = 'ero'¶
- EXPERIENCE = 'ex'¶
- FILE = 'f'¶
- FIRST_AID_KIT = 'f'¶
- FIRST_NAME = 'fn'¶
- FRIENDSHIP_FLAG = 'fpf'¶
- FRIENDSHIP = 'fp'¶
- FRIENDSHIP_LIST = 'frl'¶
- FRIENDSHIP_LIST_LIMIT = 'fll'¶
- FRIENDSHIP_LIST_LIMIT_FOR_VIP = 'fllfv'¶
- FRIENDSHIP_REQUESTS = 'fr'¶
- FRIENDS_IN_INVITE_LIST = 'fiil'¶
- FRIEND_IN_ROOM = 'fir'¶
- FRIEND_IS_INVITED = 'fiinvtd'¶
- FRIEND = 'ff'¶
- FRIEND_USER_OBJECT_ID = 'f'¶
- GAME_DAYTIME = 'gd'¶
- GAME_FINISHED = 'gf'¶
- GAME_STARTED = 'gsd'¶
- GAME_STATUS_IN_ROOMS_LIST = 'gsrl'¶
- GAME_STATUS = 'gs'¶
- GET_BLOCKED_USERS = 'gbus'¶
- GET_COMPLAINTS = 'gcmps'¶
- GET_FRIENDS_IN_INVITE_LIST = 'gfiil'¶
- GET_PLAYERS = 'gp'¶
- GET_RATING = 'gr'¶
- GET_SENT_FRIEND_REQUESTS_LIST = 'gsfrl'¶
- GET_USER_PROFILE = 'gup'¶
- GET_MATCH_MAKING_USERS_IN_QUEUE_INTERVAL = 'mmguiabk'¶
- GIVE_UP = 'agu'¶
- GIFT_MARKET_ITEMS = 'gmrkti'¶
- GOLD = 'g'¶
- GOOGLE_SIGN_IN = 'gsin'¶
- GOOGLE_TOKEN = 'gt'¶
- GOOGLE_USER_ID = 'gui'¶
- HIS_FRIENDSHIP_LIST_FULL = 'hflf'¶
- INFO_MESSAGE = 'imsg'¶
- INVITATION_SENDER_USERNAME = 'isun'¶
- IP_ADDRESS = 'ip'¶
- IS_BILLING_ITEM = 'ibi'¶
- IS_DAY_ACTION_USED = 'idau'¶
- IS_INVITED = 'iinvtd'¶
- IS_NIGHT_ACTION_ALTERNATIVE = 'inaa'¶
- IS_NIGHT_ACTION_USED = 'inau'¶
- IS_ONLINE = 'on'¶
- ITEM_PRICE_TEXT = 'iprct'¶
- KICK_TIMER = 'kt'¶
- KICK_USER_AUTHORITY_LESS_THAN_USER = 'kualtu'¶
- KICK_USER_GAME_STARTED = 'kugs'¶
- KICK_USER = 'ku'¶
- KICK_USER_NOT_IN_ROOM = 'kunir'¶
- KICK_USER_OBJECT_ID = 'k'¶
- KICK_USER_PRICE = 'kup'¶
- KICK_USER_RANK = 'kur'¶
- KICK_USER_STARTED = 'kus'¶
- KICK_USER_VOTE = 'kuv'¶
- LAST_NAME = 'ln'¶
- LEVEL = 'l'¶
- LIE_DETECTOR = 'l'¶
- MAFIA_ALIVE = 'm'¶
- MAFIA_ALL = 'ma'¶
- MAKE_COMPLAINT = 'mc'¶
- MATCH_MAKING_MATCH_STATUS = 'mmms'¶
- MATCH_MAKING_BASE_PLAYERS_AMOUNT = 'mmbpa'¶
- MATCH_MAKING_GET_STATUS = 'mmgsk'¶
- MATH_MAKING_ADD_USER = 'mmauk'¶
- MARKET_ITEMS = 'mrkti'¶
- MAXIMUM_PLAYERS = 'mxmp'¶
- MAX_PLAYERS = 'mxp'¶
- MESSAGES = 'ms'¶
- MESSAGE = 'm'¶
- MESSAGE_STYLE = 'mstl'¶
- MESSAGE_TYPE = 't'¶
- MESSAGE_STICKER = 'mstk'¶
- MIN_LEVEL = 'mnl'¶
- MIN_PLAYERS = 'mnp'¶
- MONEY = 'mo'¶
- NEW_CLOUD_MESSAGING_TOKEN = 'ncmt'¶
- NEW_MESSAGES = 'nm'¶
- NEXT_LEVEL_EXPERIENCE = 'nle'¶
- NOT_ENOUGH_AUTHORITY_ERROR = 'neae'¶
- NO_CHANGES = 'noch'¶
- NUM = 'n'¶
- NUM_MAFIA = 'm'¶
- NUM_PLAYERS = 'p'¶
- OBJECT_ID = 'o'¶
- PASSWORD = 'pw'¶
- PHOTO = 'ph'¶
- PLAYED_GAMES = 'pg'¶
- PLAYERS_IN_ROOM = 'pin'¶
- PLAYERS = 'pls'¶
- PLAYERS_NUM = 'pn'¶
- PLAYERS_STAT = 'ps'¶
- PLAYER = 'p'¶
- PLAYER_ROLE_STATISTICS = 'prst'¶
- PREVIOUS_LEVEL_EXPERIENCE = 'ple'¶
- PRICE_USERNAME_SET = 'pus'¶
- PRIVATE_CHAT_MESSAGE_CREATE = 'pmc'¶
- RANKS = 'r'¶
- RATING = 'rtg'¶
- RATING_MODE = 'rmd'¶
- RATING_TYPE = 'rt'¶
- RATING_USERS_LIST = 'rul'¶
- RATING_VALUE = 'rv'¶
- REASON = 'r'¶
- REMOVE_COMPLAINT = 'rcmp'¶
- REMOVE_FRIEND = 'rf'¶
- REMOVE_INVITATION_TO_ROOM = 'ritr'¶
- REMOVE = 'rm'¶
- REMOVE_MESSAGES = 'rmm'¶
- REMOVE_PHOTO = 'rph'¶
- REMOVE_PLAYER = 'rp'¶
- REMOVE_USER = 'rmu'¶
- ROLES = 'roles'¶
- ROLE_ACTION = 'ra'¶
- ROLE = 'r'¶
- ROOMS = 'rs'¶
- ROOM_CREATED = 'rcd'¶
- ROOM_CREATE = 'rc'¶
- ROOM_ENTER = 're'¶
- ROOM_MODEL_TYPE = 'rmt'¶
- ROOM_STATISTICS = 'rst'¶
- ROOM_IN_LOBBY_STATE = 'rils'¶
- ROOM = 'rr'¶
- ROOM_MESSAGE_CREATE = 'rmc'¶
- ROOM_OBJECT_ID = 'ro'¶
- ROOM_PASSWORD_IS_WRONG_ERROR = 'rpiw'¶
- ROOM_PASS = 'psw'¶
- ROOM_STATUS = 'rs'¶
- SCORE = 'sc'¶
- SCREENSHOT = 'sc'¶
- SEARCH_TEXT = 'st'¶
- SEARCH_USER = 'su'¶
- SELECTED_ROLES = 'sr'¶
- SEND_FRIEND_INVITE_TO_ROOM = 'sfitr'¶
- SERVER_CONFIG = 'scfg'¶
- SERVER_LANGUAGE_CHANGE_TIME = 'slct'¶
- SERVER_LANGUAGE = 'slc'¶
- SERVER_ROOM_TITLE_MINIMAL_LEVEL = 'srtml'¶
- SERVER_ROOM_PASSWORD_MINIMAL_LEVEL = 'srpml'¶
- SET_ROOM_PASSWORD_MIN_AUTHORITY = 'srpma'¶
- SET_PROFILE_PHOTO_MINIMAL_LEVEL = 'sppml'¶
- SET_SERVER_LANGUAGE_TIME_ERROR = 'sslte'¶
- SEX = 's'¶
- SHOW_PASSWORD_ROOM_INFO_BUTTON = 'sprib'¶
- SIGN_IN_ERROR = 'siner'¶
- SIGN_IN = 'sin'¶
- SIGN_OUT_USER = 'soutu'¶
- STATUS = 's'¶
- TEAM = 't'¶
- TEXT = 'tx'¶
- TIMER = 't'¶
- TIME = 't'¶
- TIME_SEC_REMAINING = 'tsr'¶
- TIME_UNTIL = 'tu'¶
- TITLE = 'tt'¶
- TOKEN = 't'¶
- TYPE_ERROR = 'err'¶
- TYPE = 'ty'¶
- UPDATED = 'up'¶
- UPLOAD_PHOTO = 'upp'¶
- UPLOAD_SCREENSHOT = 'ups'¶
- USED_LAST_MESSAGE = 'um'¶
- USERNAME_HAS_WRONG_SYMBOLS = 'unws'¶
- USERNAME_IS_EMPTY = 'unie'¶
- USERNAME_IS_EXISTS = 'unex'¶
- USERNAME_IS_OUT_OF_BOUNDS = 'unob'¶
- USERNAME = 'u'¶
- USERNAME_SET = 'uns'¶
- USERNAME_TRANSLIT = 'ut'¶
- USERS = 'u'¶
- USER_BLOCKED = 'ublk'¶
- USER_CHANGE_SEX = 'ucs'¶
- USER_DASHBOARD = 'uud'¶
- USER_DATA = 'ud'¶
- USER_INACTIVE_BLOCKED = 'uib'¶
- USER_IN_ANOTHER_ROOM = 'uiar'¶
- USER_IN_A_ROOM = 'uir'¶
- USER_IS_NOT_VIP = 'uinv'¶
- USER_IS_NOT_VIP_TO_INVITE_FRIENDS_IN_ROOM = 'uinvtifr'¶
- USER = 'uu'¶
- USER_KICKED = 'ukd'¶
- USER_LEVEL_NOT_ENOUGH = 'ulne'¶
- USER_NOT_IN_A_ROOM = 'unir'¶
- USER_OBJECT_ID = 'uo'¶
- USER_PROFILE = 'uup'¶
- USER_RANK_FOR_KICK = 'ur'¶
- USER_RANK = 'r'¶
- USER_RECEIVER = 'ur'¶
- USER_ROLE_ERROR = 'ure'¶
- USER_SENDER = 'us'¶
- USER_SENDER_OBJECT_ID = 'uso'¶
- USER_SET_SERVER_LANGUAGE = 'usls'¶
- USER_SET_USERNAME_ERROR = 'ueue'¶
- USER_ENERGY = 'ue'¶
- USER_SIGN_IN = 'usi'¶
- USER_USING_DOUBLE_ACCOUNT = 'uuda'¶
- VEST = 'v'¶
- VIP_ENABLED = 'venb'¶
- VIP = 'v'¶
- VIP_ACCOUNT = 'vip_account'¶
- VIP_UPDATED = 'vupd'¶
- VOTES = 'v'¶
- VOTE = 'v'¶
- WHO_WON = 'w'¶
- WINS_AS_KILLER = 'wik'¶
- WINS_AS_MAFIA = 'wim'¶
- WINS_AS_PEACEFUL = 'wip'¶
- WRONG_FILE_SIZE = 'wfs'¶
- WRONG_FILE_TYPE = 'wft'¶
- YOUR_FRIENDSHIP_LIST_FULL = 'yflf'¶
- ID = 'i'¶
- MATCH_MAKING_SCORE = 'mmscr'¶
- MATCH_MAKING_ADD_USER = 'mmauk'¶
- MATCH_MAKING_REMOVE_USER = 'mmruk'¶
- MATCH_MAKING_LIST_KEY = 'mmblk'¶
- MATCH_MAKING_USER_IN_ROOM = 'mmuir'¶
- MATCH_MAKING_BUCKET_RESPONSE_PLAYERS_AMOUNT = 'mmbpa'¶
- VOTE_PLAYER_LIST = 'vpl'¶
- PRIVATE_CHAT_LIST_MESSAGES = 'pclms'¶
- PROFILE_USER_DATA = 'pud'¶
- USER_ACCOUNT_COINS = 'uac'¶
- SILVER_COINS = 'scns'¶
- GOLD_COINS = 'gcns'¶
- DECORATIONS = 'dcrs'¶
- SAME_ROOM = 'isr'¶
- BLOCKED_USER_INFO = 'bui'¶
- DECORATION_ID = 'did'¶
- DECORATION_TYPE = 'dt'¶
- DECORAION_PARARAMETER = 'dp'¶
- USER_CURRENET_ENERGY_AMOUNT = 'ucea'¶
- USER_MAX_FREE_ENERGY_AMOUNT = 'umfea'¶
- USER_ENERGY_AMOUNT_FIRST_TIMER = 'ueaft'¶
- USER_ENERGY_AMOUNT_NEXT_TIMERS = 'ueant'¶
- CREATOR_OBJECT_ID = 'rco'¶
- VIP_REMANING_MILLISECONDS = 'vrms'¶
- DASHBOARD_USER = 'du'¶
- BACKPACK_SIZE = 'bps'¶
- BACKPACK_VIP_SIZE = 'bpsv'¶
- AVAILABLE_DECORATIONS = 'bids'¶
- ACTIVATED_DECORATIONS = 'aids'¶
- BACKPACK_ITEM_ID = 'bio'¶
- WHO_BLOCKED_USER_ID = 'wbuo'¶
- IS_USER_ID_MATCHED = 'iuoim'¶
- IS_DEVICE_ID_MATHED = 'idim'¶
- IS_IP_ADDRESS_MATCHED = 'iipam'¶
- ACTIVATED_ITEM_OBJECT_ID = 'aio'¶
- ITEM_EXPIRE_AFTER = 'iea'¶
- MARKET_PRODUCT_ID = 'mpid'¶
- MARKET_OFFER_COIN_TYPE = 'moct'¶
- MARKET_OFFER_PRICE = 'mop'¶
- MARKET_OFFER_DURATION = 'mod'¶
- MARKET_COINS_AMOUNT = 'mca'¶
- MARKET_COIN_TYPE = 'mct'¶
- PAYMENT_URL = 'puk'¶
- ITEM_PRISE_TESXT = 'iprct'¶
- BILLING_PURCHASE_ACCOUNT_ID = 'bpaid'¶
- MARKET_ITEM_DECORATION = 'mid'¶
- MARKET_ITEM_OFFERS = 'mio'¶
- PHOTO_FILENAME = 'ph'¶
- MARKET_ITEM_DECORATIONS = 'mids'¶
- MARKET_BILLING_ITEM = 'mbi'¶
- MARKET_VIP_ITEMS = 'mivs'¶
- MARKET_SILVER_COIN_ITEMS = 'misc'¶
- MARKET_OFFER_ID = 'moid'¶
- SELECTED_PARAMETERS_IDS = 'dp'¶
- CACHE_KEY = 'cchk'¶
- USER_DEFAULT_PHOTOS_IDS = 'usdphi'¶
- IS_MATCH_MAKING_ENABLED = 'is_match_making_enabled'¶
- IS_BACKPACK_ENABLED = 'is_backpack_enabled'¶
- MATCH_MAKING_MINIMUM_LEVEL = 'match_making_minimum_level'¶
- PUBLIC_CHAT_MINIMUM_LEVEL = 'public_chat_minimum_level'¶
- PLAYERS_DATA = 'data'¶
- VERSION_CODE = 'vc'¶
- MATCH_MAKING_FINDED_USERS_NUMBER = 'mmfun'¶
- PRIVATE_CHAT_LAST_MESSAGE = 'pclm'¶
- USER_GET_DEFAULT_PHOTOS = 'usgdph'¶
- USER_DEFAULT_PHOTOS = 'usdph'¶
- DASHBOARD = 'db'¶
- BACKPACK_GET = 'bpg'¶
- MARKET_BILLING_TYPE = 'mbt'¶
- MARKET_GET = 'mrktg'¶
- MARKET = 'mr'¶
- BUY_BILLING_VIP_ITEM = 'bbvi'¶
- BUY_SILVER_COINS_ITEM = 'bsci'¶
- BUY_DECORATION = 'bd'¶
- BUY_DECORATION_REQUEST = 'bdr'¶
- MATCH_MAKING_ADD_GAME = 'mmag'¶
- MATCH_MAKING_USER_ADD_GAME = 'mmcuag'¶
- MATCH_MAKING_USER_SELECT_ROLE = 'mmusr'¶
- MATCH_MAKING_COUNT_USER_SELECTED_ROLES = 'mmcusr'¶
- MATCH_MAKING_ROOM = 'mmrr'¶
- MATCH_MAKING_ROLES_COUNT = 'mmrc'¶
- class zafiaonline.structures.packet_data_keys.HttpsApiKeys(*values)[source]¶
Bases:
str,EnumEnumeration of standard HTTP API parameter keys.
This enum defines the string constants used as keys in HTTPS API requests. These keys are used to identify values such as credentials, language settings, and device identifiers during HTTP communication with the server.
- LANGUAGE¶
Key for specifying the language.
- Type:
str
- NEW_EMAIL¶
Key for submitting a new email address.
- Type:
str
- DEVICE_ID¶
Key for identifying the user’s device.
- Type:
str
- USER_OBJECT_ID¶
Key for the user’s object ID.
- Type:
str
- EMAIL¶
Key for the user’s email address.
- Type:
str
- USERNAME¶
Key for the user’s username.
- Type:
str
- PASSWORD¶
Key for the user’s password.
- Type:
str
- CURRENT_PASSWORD¶
Key for the user’s current password.
- Type:
str
- VERIFICATION_CODE¶
Key for email or account verification code.
- Type:
str
- LANGUAGE = 'lang'¶
- NEW_EMAIL = 'newEmail'¶
- DEVICE_ID = 'deviceId'¶
- USER_OBJECT_ID = 'userObjectId'¶
- EMAIL = 'email'¶
- USERNAME = 'username'¶
- PASSWORD = 'password'¶
- CURRENT_PASSWORD = 'currentPassword'¶
- VERIFICATION_CODE = 'verificationCode'¶
- class zafiaonline.structures.packet_data_keys.ZafiaApiKeys(*values)[source]¶
Bases:
str,EnumEnumeration of API parameter keys used in Zafia API requests.
This enum defines string constants representing keys commonly used in requests to the Zafia API. These keys identify user-related data, request parameters, and device information.
- USER_ID¶
Key for specifying the user identifier.
- Type:
str
- FAVORITE_ID¶
Key for specifying the favorite item identifier.
- Type:
str
- SHOW¶
Key for controlling visibility or display options.
- Type:
str
- FROM_TYPE¶
Key indicating the source or type of a request.
- Type:
str
- CHECK_ID¶
Key for an ID to be checked or verified.
- Type:
str
- USER_NICKNAME¶
Key for the user’s nickname.
- Type:
str
- CHECK_NICKNAME¶
Key for a nickname to be checked.
- Type:
str
- TYPE¶
Key for specifying the type or category.
- Type:
str
- VERSION¶
Key for the API or client version.
- Type:
str
- DEVICE_ID¶
Key for identifying the user’s device.
- Type:
str
- USER_ID = 'userId'¶
- FAVORITE_ID = 'favoriteId'¶
- SHOW = 'show'¶
- FROM_TYPE = 'fromType'¶
- CHECK_ID = 'checkId'¶
- USER_NICKNAME = 'userNickname'¶
- CHECK_NICKNAME = 'checkNickname'¶
- TYPE = 'type'¶
- VERSION = 'version'¶
- DEVICE_ID = 'deviceId'¶
- class zafiaonline.structures.packet_data_keys.Endpoints(*values)[source]¶
Bases:
str,EnumEnumeration of API endpoint paths for Mafia Online backend.
This enum defines the string constants for various HTTP API endpoints used by the Mafia Online client to interact with the backend services.
- REMOVE_ACCOUNT¶
Endpoint for deleting a user account.
- Type:
str
- PROFILE_PHOTO¶
Endpoint to fetch a user’s profile photo by user ID.
- Type:
str
- CLIENT_CONFIG¶
Endpoint for retrieving client configuration with version.
- Type:
str
- CLIENT_FEATURE_CONFIG¶
Endpoint for fetching feature configuration.
- Type:
str
- USER_SIGN_OUT¶
Endpoint for signing out the user.
- Type:
str
- USER_SIGN_UP¶
Endpoint for registering a new user.
- Type:
str
- USER_EMAIL_VERIFY¶
Endpoint to verify a user’s email.
- Type:
str
- USER_CHANGE_EMAIL¶
Endpoint for changing the user’s email address.
- Type:
str
- USER_EMAIL_VERIFICATION¶
Endpoint to request email verification code.
- Type:
str
- USER_GET¶
Endpoint to retrieve user profile data.
- Type:
str
- BACKPACK_GET¶
Endpoint to get the contents of a user’s backpack.
- Type:
str
- BACKPACK_GET_BONUS_PRICES¶
Endpoint to fetch bonus item prices in the backpack.
- Type:
str
- REMOVE_ACCOUNT = 'user/remove'¶
- PROFILE_PHOTO = 'mafia/profile_photo/{user_id}.jpg'¶
- CLIENT_CONFIG = 'mafia/clientConfig{version}.txt'¶
- CLIENT_FEATURE_CONFIG = 'client_feature_config'¶
- USER_SIGN_OUT = 'user/sign_out'¶
- USER_SIGN_UP = 'user/sign_up'¶
- USER_EMAIL_VERIFY = 'user/email/verify'¶
- USER_CHANGE_EMAIL = 'user/change/email'¶
- USER_EMAIL_VERIFICATION = 'user/email/verification'¶
- USER_GET = 'user/get'¶
- BACKPACK_GET = 'backpack/get'¶
- BACKPACK_GET_BONUS_PRICES = 'backpack/get_bonus_prices'¶
- class zafiaonline.structures.packet_data_keys.ZafiaEndpoints(*values)[source]¶
Bases:
str,EnumAPI endpoints for Zafia Online.
This enum contains shorthand identifiers used in Zafia Online’s internal API routing. Each value corresponds to a specific backend action that the client can trigger.
- CHANGE_FAVORITE_STATUS¶
Change the favorite status of a user.
- CHANGE_VISIBLE_TOP¶
Change a user’s visibility in the top list.
- CHECK_PROFILE¶
Retrieve another user’s profile data.
- GET_FAVORITES_LIST¶
Get the current user’s list of favorites.
- GET_TOP¶
Retrieve the top-ranking users.
- GET_VERIFICATIONS¶
Get verification-related data.
- CHANGE_FAVORITE_STATUS = 'cfs'¶
- CHANGE_VISIBLE_TOP = 'cvt'¶
- CHECK_PROFILE = 'cpr'¶
- GET_FAVORITES_LIST = 'gfl'¶
- GET_TOP = 'gt'¶
- GET_VERIFICATIONS = 'vf'¶
- format(*args, **kwargs)[source]¶
Formats the enum value as a string using provided keyword arguments.
This method uses the underlying enum string (self.value) as a format string and substitutes any named placeholders with values from kwargs.
- Parameters:
*args (Any) – Unused. Present for compatibility.
**kwargs (Any) – Keyword arguments to format the string.
- Returns:
Formatted string with placeholders replaced by keyword values.
- Return type:
str
- class zafiaonline.structures.packet_data_keys.Renaming(*values)[source]¶
Bases:
dict,EnumField name mappings for different object types used in the API.
This enum stores dictionaries that map verbose field names to their shortened versions used in serialization, API responses, or internal communication. Each attribute represents a context-specific renaming schema (e.g., user data, room settings, server config).
- USER¶
Mapping for user-related fields.
- USER_NEW_API¶
Mapping for extended user fields in new API version.
- SERVER_CONFIG¶
Mapping for server configuration fields.
- ROOM¶
Mapping for basic room-related fields.
- ROOM_IN_LOBBY¶
Mapping for room fields shown in lobby context.
- ROOM_IN_LOBBY_STATE¶
Mapping for additional room lobby state fields.
- SHORT_USER¶
Mapping for minimal user representations.
- FRIEND¶
Mapping for friend list entries.
- FRIENDSHIP¶
Mapping for friendship relationship data.
- MESSAGE¶
Mapping for messaging system fields.
- GUI¶
Mapping for GUI-specific identifiers.
- DECORATIONS¶
Mapping for decoration item types.
- DECORATIONS_PARAMETERS¶
Mapping for parameters of decorations.
- USER = {'accept_messages': 'ac', 'experience': 'ex', 'gold': 'g', 'is_in_room': 'rr', 'is_vip': 'v', 'level': 'l', 'match_making_score': 'mmscr', 'money': 'mo', 'next_level_experience': 'nle', 'online': 'on', 'photo': 'ph', 'played_games': 'pg', 'player_role_statistics': 'prst', 'previous_level_experience': 'ple', 'rank': 'r', 'score': 'sc', 'selected_language': 'slc', 'sex': 's', 'token': 't', 'updated': 'up', 'user_id': 'o', 'username': 'u', 'vip_updated': 'vupd', 'wins_as_killer': 'wik', 'wins_as_mafia': 'wim', 'wins_as_peaceful': 'wip'}¶
- USER_NEW_API = {'accept_messages': 'ac', 'decorations': 'dcrs', 'experience': 'ex', 'gold': 'g', 'is_vip': 'v', 'level': 'l', 'match_making_score': 'mmscr', 'money': 'mo', 'next_level_experience': 'nle', 'online': 'on', 'photo': 'ph', 'played_games': 'pg', 'player_role_statistics': 'prst', 'previous_level_experience': 'ple', 'score': 'sc', 'selected_language': 'slc', 'sex': 's', 'silver_coins': 'scns', 'token': 't', 'updated': 'up', 'user_account_coins': 'uac', 'user_id': 'o', 'username': 'u', 'vip_updated': 'vupd', 'wins_as_killer': 'wik', 'wins_as_mafia': 'wim', 'wins_as_peaceful': 'wip'}¶
- SERVER_CONFIG = {'connection_checker_period': 'ccp', 'connection_inactive_timeout': 'cit', 'kick_user_price': 'kup', 'match_making_users_in_queue_interval': 'mmguiqik', 'price_username_set': 'pus', 'room_password_minimal_level': 'srpml', 'room_title_minimal_level': 'srtml', 'server_language_change_time': 'slct', 'set_photo_minimal_level': 'sppml', 'set_room_password_min_authority': 'srpma', 'show_password_room_info_button': 'sprib'}¶
- ROOM = {'max_players': 'mxp', 'min_level': 'mnl', 'min_players': 'mnp', 'password': 'pw', 'room_id': 'o', 'room_model_type': 'rmt', 'selected_roles': 'sr', 'status': 's', 'title': 'tt', 'vip_enabled': 'venb'}¶
- CURRENET_ROOM = {'game_status': 's', 'min_level': 'mnl', 'password': 'pw', 'players_number': 'pn', 'room_id': 'o', 'same_room': 'isr', 'title': 'tt', 'vip_enabled': 'venb'}¶
- ROOM_IN_LOBBY = {'creator_id': 'rco', 'friend_in_room': 'fir', 'game_status': 's', 'invitation_sender_username': 'isun', 'invited_in_room': 'iinvtd', 'max_players': 'mxp', 'min_level': 'mnl', 'min_players': 'mnp', 'password': 'pw', 'players': 'pls', 'players_number': 'pn', 'room_id': 'o', 'room_model_type': 'rmt', 'room_status': 'rs', 'selected_roles': 'sr', 'status': 's', 'title': 'tt', 'vip_enabled': 'venb'}¶
- ROOM_IN_LOBBY_STATE = {'friend_in_room': 'fir', 'invitation_sender_username': 'isun', 'invited_in_room': 'iinvtd', 'players_in_room': 'pin', 'room_id': 'ro'}¶
- SHORT_USER = {'is_vip': 'v', 'online': 'on', 'photo': 'ph', 'sex': 's', 'updated': 'up', 'user_id': 'o', 'username': 'u', 'vip_updated': 'vupd'}¶
- FRIEND = {'friend_id': 'o', 'new_messages': 'nm', 'updated': 'up', 'user': 'uu', 'user_id': 'uo'}¶
- FRIENDSHIP = {'accepted': 'a', 'currenet_room': 'rr', 'friend_data': 'ff', 'friend_id': 'f', 'user_data': 'uu'}¶
- MESSAGE = {'accepted': 'a', 'created': 'c', 'friend_id': 'fp', 'message_style': 'mstl', 'message_type': 't', 'text': 'tx', 'user_id': 'uo'}¶
- GUI = {'count_authority_for_swap_icon': 'r'}¶
- DECORATIONS = {'photo_border': '8', 'photo_border_animation': '7', 'profile_animation': '4', 'profile_background': '6', 'profile_main_color': '5', 'username_animation': '0', 'username_background': '1', 'username_shadow': '2', 'username_text': '3'}¶
- DECORATIONS_PARAMETERS = {'alpha': '0', 'file': '2', 'speed': '3', 'value': '1'}¶
Module contents¶
- class zafiaonline.structures.PacketDataKeys(*values)[source]¶
Bases:
str,EnumEnumeration of packet data keys for client-server communication.
This class defines short string identifiers used in network packets exchanged between client and server. These compact keys help reduce payload size and improve communication efficiency.
Each enum member maps a semantic constant name to a short code, often a single letter or abbreviation, which identifies a specific action, status, user attribute, or system message in the protocol.
- ACCEPTED = 'a'¶
- ACCEPT_MESSAGES = 'ac'¶
- ACTIVE = 'ac'¶
- ACTIVITY = 'ac'¶
- ADD_CLIENT_TO_CHAT = 'acc'¶
- ADD_CLIENT_TO_DASHBOARD = 'acd'¶
- ADD_CLIENT_TO_FRIENDSHIP_LIST = 'acfl'¶
- ADD_CLIENT_TO_PRIVATE_CHAT = 'acpc'¶
- ADD_CLIENT_TO_ROOMS_LIST = 'acrl'¶
- ADD_FRIEND = 'af'¶
- ADD = 'add'¶
- ADD_PLAYER = 'ap'¶
- ADMIN_BLOCK_USER = 'abu'¶
- ADMIN_CONTROL_USER = 'acu'¶
- ADMIN = 'adm'¶
- ADMIN_KICK_USER = 'aku'¶
- ADMIN_UNBLOCK_USER = 'auu'¶
- AFFECTED_BY_ROLES = 'abr'¶
- ALIVE = 'a'¶
- APP_LANGUAGE = 'alc'¶
- ASPIRIN = 'a'¶
- BACKPACK = 'bp'¶
- BILLING_APP_PACKAGE = 'bapckg'¶
- BILLING_PRODUCT_ID = 'bpid'¶
- BILLING_PURCHASE_PENDING = 'bppndng'¶
- BILLING_PURCHASE_TOKEN = 'bptkn'¶
- BLOCKED_USERS = 'bus'¶
- BLOCK_DEVICE = 'bdv'¶
- BLOCK_IP = 'bi'¶
- BONUSES_ENABLED = 'bns'¶
- BONUS_PRICE = 'bp'¶
- BRIBE = 'b'¶
- BUY_BILLING_MARKET_ITEM = 'mrktgg'¶
- BUY_BILLING_MARKET_SUCCESS_ITEM = 'bbmrktis'¶
- BUY_MARKET_ITEM = 'bmrkti'¶
- BUY_MARKET_ITEM_SUCCESS = 'bmrktis'¶
- CHAT_MESSAGE_CREATE = 'cmc'¶
- CHECK_PLAYER_IS_IN_ROOM = 'cpir'¶
- CIVILIAN_ALIVE = 'c'¶
- CIVILIAN_ALL = 'ca'¶
- CLEAN_VOTES_HISTORY = 'cv'¶
- CLOUD_MESSAGING_TOKEN_IS_SAVED = 'cmts'¶
- COMPLAINTS = 'cmps'¶
- COMPLAINT = 'cmp'¶
- CONDOM = 'cm'¶
- CONFESSION = 'cn'¶
- CONNECTION_CHECKER_PERIOD = 'ccp'¶
- CONNECTION_INACTIVE_TIMEOUT = 'cit'¶
- CREATED = 'c'¶
- CREATE_PLAYER = 'cp'¶
- CREATOR_BLOCKED = 'crb'¶
- DATA = 'data'¶
- DAYTIME = 'd'¶
- DESCRIPTION = 'dsc'¶
- DEVICE_ID = 'd'¶
- EMAIL = 'e'¶
- EMAIL_NOT_VERIFIED = 'env'¶
- EMAIL_NOT_VERIFIED_MESSAGE_CREATE_TIMEOUT = 'envmct'¶
- ERROR_FLOOD_DETECTED = 'erfd'¶
- ERROR = 'e'¶
- ERROR_OCCUR = 'ero'¶
- EXPERIENCE = 'ex'¶
- FILE = 'f'¶
- FIRST_AID_KIT = 'f'¶
- FIRST_NAME = 'fn'¶
- FRIENDSHIP_FLAG = 'fpf'¶
- FRIENDSHIP = 'fp'¶
- FRIENDSHIP_LIST = 'frl'¶
- FRIENDSHIP_LIST_LIMIT = 'fll'¶
- FRIENDSHIP_LIST_LIMIT_FOR_VIP = 'fllfv'¶
- FRIENDSHIP_REQUESTS = 'fr'¶
- FRIENDS_IN_INVITE_LIST = 'fiil'¶
- FRIEND_IN_ROOM = 'fir'¶
- FRIEND_IS_INVITED = 'fiinvtd'¶
- FRIEND = 'ff'¶
- FRIEND_USER_OBJECT_ID = 'f'¶
- GAME_DAYTIME = 'gd'¶
- GAME_FINISHED = 'gf'¶
- GAME_STARTED = 'gsd'¶
- GAME_STATUS_IN_ROOMS_LIST = 'gsrl'¶
- GAME_STATUS = 'gs'¶
- GET_BLOCKED_USERS = 'gbus'¶
- GET_COMPLAINTS = 'gcmps'¶
- GET_FRIENDS_IN_INVITE_LIST = 'gfiil'¶
- GET_PLAYERS = 'gp'¶
- GET_RATING = 'gr'¶
- GET_SENT_FRIEND_REQUESTS_LIST = 'gsfrl'¶
- GET_USER_PROFILE = 'gup'¶
- GET_MATCH_MAKING_USERS_IN_QUEUE_INTERVAL = 'mmguiabk'¶
- GIVE_UP = 'agu'¶
- GIFT_MARKET_ITEMS = 'gmrkti'¶
- GOLD = 'g'¶
- GOOGLE_SIGN_IN = 'gsin'¶
- GOOGLE_TOKEN = 'gt'¶
- GOOGLE_USER_ID = 'gui'¶
- HIS_FRIENDSHIP_LIST_FULL = 'hflf'¶
- INFO_MESSAGE = 'imsg'¶
- INVITATION_SENDER_USERNAME = 'isun'¶
- IP_ADDRESS = 'ip'¶
- IS_BILLING_ITEM = 'ibi'¶
- IS_DAY_ACTION_USED = 'idau'¶
- IS_INVITED = 'iinvtd'¶
- IS_NIGHT_ACTION_ALTERNATIVE = 'inaa'¶
- IS_NIGHT_ACTION_USED = 'inau'¶
- IS_ONLINE = 'on'¶
- ITEM_PRICE_TEXT = 'iprct'¶
- KICK_TIMER = 'kt'¶
- KICK_USER_AUTHORITY_LESS_THAN_USER = 'kualtu'¶
- KICK_USER_GAME_STARTED = 'kugs'¶
- KICK_USER = 'ku'¶
- KICK_USER_NOT_IN_ROOM = 'kunir'¶
- KICK_USER_OBJECT_ID = 'k'¶
- KICK_USER_PRICE = 'kup'¶
- KICK_USER_RANK = 'kur'¶
- KICK_USER_STARTED = 'kus'¶
- KICK_USER_VOTE = 'kuv'¶
- LAST_NAME = 'ln'¶
- LEVEL = 'l'¶
- LIE_DETECTOR = 'l'¶
- MAFIA_ALIVE = 'm'¶
- MAFIA_ALL = 'ma'¶
- MAKE_COMPLAINT = 'mc'¶
- MATCH_MAKING_MATCH_STATUS = 'mmms'¶
- MATCH_MAKING_BASE_PLAYERS_AMOUNT = 'mmbpa'¶
- MATCH_MAKING_GET_STATUS = 'mmgsk'¶
- MATH_MAKING_ADD_USER = 'mmauk'¶
- MARKET_ITEMS = 'mrkti'¶
- MAXIMUM_PLAYERS = 'mxmp'¶
- MAX_PLAYERS = 'mxp'¶
- MESSAGES = 'ms'¶
- MESSAGE = 'm'¶
- MESSAGE_STYLE = 'mstl'¶
- MESSAGE_TYPE = 't'¶
- MESSAGE_STICKER = 'mstk'¶
- MIN_LEVEL = 'mnl'¶
- MIN_PLAYERS = 'mnp'¶
- MONEY = 'mo'¶
- NEW_CLOUD_MESSAGING_TOKEN = 'ncmt'¶
- NEW_MESSAGES = 'nm'¶
- NEXT_LEVEL_EXPERIENCE = 'nle'¶
- NOT_ENOUGH_AUTHORITY_ERROR = 'neae'¶
- NO_CHANGES = 'noch'¶
- NUM = 'n'¶
- NUM_MAFIA = 'm'¶
- NUM_PLAYERS = 'p'¶
- OBJECT_ID = 'o'¶
- PASSWORD = 'pw'¶
- PHOTO = 'ph'¶
- PLAYED_GAMES = 'pg'¶
- PLAYERS_IN_ROOM = 'pin'¶
- PLAYERS = 'pls'¶
- PLAYERS_NUM = 'pn'¶
- PLAYERS_STAT = 'ps'¶
- PLAYER = 'p'¶
- PLAYER_ROLE_STATISTICS = 'prst'¶
- PREVIOUS_LEVEL_EXPERIENCE = 'ple'¶
- PRICE_USERNAME_SET = 'pus'¶
- PRIVATE_CHAT_MESSAGE_CREATE = 'pmc'¶
- RANKS = 'r'¶
- RATING = 'rtg'¶
- RATING_MODE = 'rmd'¶
- RATING_TYPE = 'rt'¶
- RATING_USERS_LIST = 'rul'¶
- RATING_VALUE = 'rv'¶
- REASON = 'r'¶
- REMOVE_COMPLAINT = 'rcmp'¶
- REMOVE_FRIEND = 'rf'¶
- REMOVE_INVITATION_TO_ROOM = 'ritr'¶
- REMOVE = 'rm'¶
- REMOVE_MESSAGES = 'rmm'¶
- REMOVE_PHOTO = 'rph'¶
- REMOVE_PLAYER = 'rp'¶
- REMOVE_USER = 'rmu'¶
- ROLES = 'roles'¶
- ROLE_ACTION = 'ra'¶
- ROLE = 'r'¶
- ROOMS = 'rs'¶
- ROOM_CREATED = 'rcd'¶
- ROOM_CREATE = 'rc'¶
- ROOM_ENTER = 're'¶
- ROOM_MODEL_TYPE = 'rmt'¶
- ROOM_STATISTICS = 'rst'¶
- ROOM_IN_LOBBY_STATE = 'rils'¶
- ROOM = 'rr'¶
- ROOM_MESSAGE_CREATE = 'rmc'¶
- ROOM_OBJECT_ID = 'ro'¶
- ROOM_PASSWORD_IS_WRONG_ERROR = 'rpiw'¶
- ROOM_PASS = 'psw'¶
- ROOM_STATUS = 'rs'¶
- SCORE = 'sc'¶
- SCREENSHOT = 'sc'¶
- SEARCH_TEXT = 'st'¶
- SEARCH_USER = 'su'¶
- SELECTED_ROLES = 'sr'¶
- SEND_FRIEND_INVITE_TO_ROOM = 'sfitr'¶
- SERVER_CONFIG = 'scfg'¶
- SERVER_LANGUAGE_CHANGE_TIME = 'slct'¶
- SERVER_LANGUAGE = 'slc'¶
- SERVER_ROOM_TITLE_MINIMAL_LEVEL = 'srtml'¶
- SERVER_ROOM_PASSWORD_MINIMAL_LEVEL = 'srpml'¶
- SET_ROOM_PASSWORD_MIN_AUTHORITY = 'srpma'¶
- SET_PROFILE_PHOTO_MINIMAL_LEVEL = 'sppml'¶
- SET_SERVER_LANGUAGE_TIME_ERROR = 'sslte'¶
- SEX = 's'¶
- SHOW_PASSWORD_ROOM_INFO_BUTTON = 'sprib'¶
- SIGN_IN_ERROR = 'siner'¶
- SIGN_IN = 'sin'¶
- SIGN_OUT_USER = 'soutu'¶
- STATUS = 's'¶
- TEAM = 't'¶
- TEXT = 'tx'¶
- TIMER = 't'¶
- TIME = 't'¶
- TIME_SEC_REMAINING = 'tsr'¶
- TIME_UNTIL = 'tu'¶
- TITLE = 'tt'¶
- TOKEN = 't'¶
- TYPE_ERROR = 'err'¶
- TYPE = 'ty'¶
- UPDATED = 'up'¶
- UPLOAD_PHOTO = 'upp'¶
- UPLOAD_SCREENSHOT = 'ups'¶
- USED_LAST_MESSAGE = 'um'¶
- USERNAME_HAS_WRONG_SYMBOLS = 'unws'¶
- USERNAME_IS_EMPTY = 'unie'¶
- USERNAME_IS_EXISTS = 'unex'¶
- USERNAME_IS_OUT_OF_BOUNDS = 'unob'¶
- USERNAME = 'u'¶
- USERNAME_SET = 'uns'¶
- USERNAME_TRANSLIT = 'ut'¶
- USERS = 'u'¶
- USER_BLOCKED = 'ublk'¶
- USER_CHANGE_SEX = 'ucs'¶
- USER_DASHBOARD = 'uud'¶
- USER_DATA = 'ud'¶
- USER_INACTIVE_BLOCKED = 'uib'¶
- USER_IN_ANOTHER_ROOM = 'uiar'¶
- USER_IN_A_ROOM = 'uir'¶
- USER_IS_NOT_VIP = 'uinv'¶
- USER_IS_NOT_VIP_TO_INVITE_FRIENDS_IN_ROOM = 'uinvtifr'¶
- USER = 'uu'¶
- USER_KICKED = 'ukd'¶
- USER_LEVEL_NOT_ENOUGH = 'ulne'¶
- USER_NOT_IN_A_ROOM = 'unir'¶
- USER_OBJECT_ID = 'uo'¶
- USER_PROFILE = 'uup'¶
- USER_RANK_FOR_KICK = 'ur'¶
- USER_RANK = 'r'¶
- USER_RECEIVER = 'ur'¶
- USER_ROLE_ERROR = 'ure'¶
- USER_SENDER = 'us'¶
- USER_SENDER_OBJECT_ID = 'uso'¶
- USER_SET_SERVER_LANGUAGE = 'usls'¶
- USER_SET_USERNAME_ERROR = 'ueue'¶
- USER_ENERGY = 'ue'¶
- USER_SIGN_IN = 'usi'¶
- USER_USING_DOUBLE_ACCOUNT = 'uuda'¶
- VEST = 'v'¶
- VIP_ENABLED = 'venb'¶
- VIP = 'v'¶
- VIP_ACCOUNT = 'vip_account'¶
- VIP_UPDATED = 'vupd'¶
- VOTES = 'v'¶
- VOTE = 'v'¶
- WHO_WON = 'w'¶
- WINS_AS_KILLER = 'wik'¶
- WINS_AS_MAFIA = 'wim'¶
- WINS_AS_PEACEFUL = 'wip'¶
- WRONG_FILE_SIZE = 'wfs'¶
- WRONG_FILE_TYPE = 'wft'¶
- YOUR_FRIENDSHIP_LIST_FULL = 'yflf'¶
- ID = 'i'¶
- MATCH_MAKING_SCORE = 'mmscr'¶
- MATCH_MAKING_ADD_USER = 'mmauk'¶
- MATCH_MAKING_REMOVE_USER = 'mmruk'¶
- MATCH_MAKING_LIST_KEY = 'mmblk'¶
- MATCH_MAKING_USER_IN_ROOM = 'mmuir'¶
- MATCH_MAKING_BUCKET_RESPONSE_PLAYERS_AMOUNT = 'mmbpa'¶
- VOTE_PLAYER_LIST = 'vpl'¶
- PRIVATE_CHAT_LIST_MESSAGES = 'pclms'¶
- PROFILE_USER_DATA = 'pud'¶
- USER_ACCOUNT_COINS = 'uac'¶
- SILVER_COINS = 'scns'¶
- GOLD_COINS = 'gcns'¶
- DECORATIONS = 'dcrs'¶
- SAME_ROOM = 'isr'¶
- BLOCKED_USER_INFO = 'bui'¶
- DECORATION_ID = 'did'¶
- DECORATION_TYPE = 'dt'¶
- DECORAION_PARARAMETER = 'dp'¶
- USER_CURRENET_ENERGY_AMOUNT = 'ucea'¶
- USER_MAX_FREE_ENERGY_AMOUNT = 'umfea'¶
- USER_ENERGY_AMOUNT_FIRST_TIMER = 'ueaft'¶
- USER_ENERGY_AMOUNT_NEXT_TIMERS = 'ueant'¶
- CREATOR_OBJECT_ID = 'rco'¶
- VIP_REMANING_MILLISECONDS = 'vrms'¶
- DASHBOARD_USER = 'du'¶
- BACKPACK_SIZE = 'bps'¶
- BACKPACK_VIP_SIZE = 'bpsv'¶
- AVAILABLE_DECORATIONS = 'bids'¶
- ACTIVATED_DECORATIONS = 'aids'¶
- BACKPACK_ITEM_ID = 'bio'¶
- WHO_BLOCKED_USER_ID = 'wbuo'¶
- IS_USER_ID_MATCHED = 'iuoim'¶
- IS_DEVICE_ID_MATHED = 'idim'¶
- IS_IP_ADDRESS_MATCHED = 'iipam'¶
- ACTIVATED_ITEM_OBJECT_ID = 'aio'¶
- ITEM_EXPIRE_AFTER = 'iea'¶
- MARKET_PRODUCT_ID = 'mpid'¶
- MARKET_OFFER_COIN_TYPE = 'moct'¶
- MARKET_OFFER_PRICE = 'mop'¶
- MARKET_OFFER_DURATION = 'mod'¶
- MARKET_COINS_AMOUNT = 'mca'¶
- MARKET_COIN_TYPE = 'mct'¶
- PAYMENT_URL = 'puk'¶
- ITEM_PRISE_TESXT = 'iprct'¶
- BILLING_PURCHASE_ACCOUNT_ID = 'bpaid'¶
- MARKET_ITEM_DECORATION = 'mid'¶
- MARKET_ITEM_OFFERS = 'mio'¶
- PHOTO_FILENAME = 'ph'¶
- MARKET_ITEM_DECORATIONS = 'mids'¶
- MARKET_BILLING_ITEM = 'mbi'¶
- MARKET_VIP_ITEMS = 'mivs'¶
- MARKET_SILVER_COIN_ITEMS = 'misc'¶
- MARKET_OFFER_ID = 'moid'¶
- SELECTED_PARAMETERS_IDS = 'dp'¶
- CACHE_KEY = 'cchk'¶
- USER_DEFAULT_PHOTOS_IDS = 'usdphi'¶
- IS_MATCH_MAKING_ENABLED = 'is_match_making_enabled'¶
- IS_BACKPACK_ENABLED = 'is_backpack_enabled'¶
- MATCH_MAKING_MINIMUM_LEVEL = 'match_making_minimum_level'¶
- PUBLIC_CHAT_MINIMUM_LEVEL = 'public_chat_minimum_level'¶
- PLAYERS_DATA = 'data'¶
- VERSION_CODE = 'vc'¶
- MATCH_MAKING_FINDED_USERS_NUMBER = 'mmfun'¶
- PRIVATE_CHAT_LAST_MESSAGE = 'pclm'¶
- USER_GET_DEFAULT_PHOTOS = 'usgdph'¶
- USER_DEFAULT_PHOTOS = 'usdph'¶
- DASHBOARD = 'db'¶
- BACKPACK_GET = 'bpg'¶
- MARKET_BILLING_TYPE = 'mbt'¶
- MARKET_GET = 'mrktg'¶
- MARKET = 'mr'¶
- BUY_BILLING_VIP_ITEM = 'bbvi'¶
- BUY_SILVER_COINS_ITEM = 'bsci'¶
- BUY_DECORATION = 'bd'¶
- BUY_DECORATION_REQUEST = 'bdr'¶
- MATCH_MAKING_ADD_GAME = 'mmag'¶
- MATCH_MAKING_USER_ADD_GAME = 'mmcuag'¶
- MATCH_MAKING_USER_SELECT_ROLE = 'mmusr'¶
- MATCH_MAKING_COUNT_USER_SELECTED_ROLES = 'mmcusr'¶
- MATCH_MAKING_ROOM = 'mmrr'¶
- MATCH_MAKING_ROLES_COUNT = 'mmrc'¶
- class zafiaonline.structures.HttpsApiKeys(*values)[source]¶
Bases:
str,EnumEnumeration of standard HTTP API parameter keys.
This enum defines the string constants used as keys in HTTPS API requests. These keys are used to identify values such as credentials, language settings, and device identifiers during HTTP communication with the server.
- LANGUAGE¶
Key for specifying the language.
- Type:
str
- NEW_EMAIL¶
Key for submitting a new email address.
- Type:
str
- DEVICE_ID¶
Key for identifying the user’s device.
- Type:
str
- USER_OBJECT_ID¶
Key for the user’s object ID.
- Type:
str
- EMAIL¶
Key for the user’s email address.
- Type:
str
- USERNAME¶
Key for the user’s username.
- Type:
str
- PASSWORD¶
Key for the user’s password.
- Type:
str
- CURRENT_PASSWORD¶
Key for the user’s current password.
- Type:
str
- VERIFICATION_CODE¶
Key for email or account verification code.
- Type:
str
- LANGUAGE = 'lang'¶
- NEW_EMAIL = 'newEmail'¶
- DEVICE_ID = 'deviceId'¶
- USER_OBJECT_ID = 'userObjectId'¶
- EMAIL = 'email'¶
- USERNAME = 'username'¶
- PASSWORD = 'password'¶
- CURRENT_PASSWORD = 'currentPassword'¶
- VERIFICATION_CODE = 'verificationCode'¶
- class zafiaonline.structures.ZafiaApiKeys(*values)[source]¶
Bases:
str,EnumEnumeration of API parameter keys used in Zafia API requests.
This enum defines string constants representing keys commonly used in requests to the Zafia API. These keys identify user-related data, request parameters, and device information.
- USER_ID¶
Key for specifying the user identifier.
- Type:
str
- FAVORITE_ID¶
Key for specifying the favorite item identifier.
- Type:
str
- SHOW¶
Key for controlling visibility or display options.
- Type:
str
- FROM_TYPE¶
Key indicating the source or type of a request.
- Type:
str
- CHECK_ID¶
Key for an ID to be checked or verified.
- Type:
str
- USER_NICKNAME¶
Key for the user’s nickname.
- Type:
str
- CHECK_NICKNAME¶
Key for a nickname to be checked.
- Type:
str
- TYPE¶
Key for specifying the type or category.
- Type:
str
- VERSION¶
Key for the API or client version.
- Type:
str
- DEVICE_ID¶
Key for identifying the user’s device.
- Type:
str
- USER_ID = 'userId'¶
- FAVORITE_ID = 'favoriteId'¶
- SHOW = 'show'¶
- FROM_TYPE = 'fromType'¶
- CHECK_ID = 'checkId'¶
- USER_NICKNAME = 'userNickname'¶
- CHECK_NICKNAME = 'checkNickname'¶
- TYPE = 'type'¶
- VERSION = 'version'¶
- DEVICE_ID = 'deviceId'¶
- class zafiaonline.structures.Endpoints(*values)[source]¶
Bases:
str,EnumEnumeration of API endpoint paths for Mafia Online backend.
This enum defines the string constants for various HTTP API endpoints used by the Mafia Online client to interact with the backend services.
- REMOVE_ACCOUNT¶
Endpoint for deleting a user account.
- Type:
str
- PROFILE_PHOTO¶
Endpoint to fetch a user’s profile photo by user ID.
- Type:
str
- CLIENT_CONFIG¶
Endpoint for retrieving client configuration with version.
- Type:
str
- CLIENT_FEATURE_CONFIG¶
Endpoint for fetching feature configuration.
- Type:
str
- USER_SIGN_OUT¶
Endpoint for signing out the user.
- Type:
str
- USER_SIGN_UP¶
Endpoint for registering a new user.
- Type:
str
- USER_EMAIL_VERIFY¶
Endpoint to verify a user’s email.
- Type:
str
- USER_CHANGE_EMAIL¶
Endpoint for changing the user’s email address.
- Type:
str
- USER_EMAIL_VERIFICATION¶
Endpoint to request email verification code.
- Type:
str
- USER_GET¶
Endpoint to retrieve user profile data.
- Type:
str
- BACKPACK_GET¶
Endpoint to get the contents of a user’s backpack.
- Type:
str
- BACKPACK_GET_BONUS_PRICES¶
Endpoint to fetch bonus item prices in the backpack.
- Type:
str
- REMOVE_ACCOUNT = 'user/remove'¶
- PROFILE_PHOTO = 'mafia/profile_photo/{user_id}.jpg'¶
- CLIENT_CONFIG = 'mafia/clientConfig{version}.txt'¶
- CLIENT_FEATURE_CONFIG = 'client_feature_config'¶
- USER_SIGN_OUT = 'user/sign_out'¶
- USER_SIGN_UP = 'user/sign_up'¶
- USER_EMAIL_VERIFY = 'user/email/verify'¶
- USER_CHANGE_EMAIL = 'user/change/email'¶
- USER_EMAIL_VERIFICATION = 'user/email/verification'¶
- USER_GET = 'user/get'¶
- BACKPACK_GET = 'backpack/get'¶
- BACKPACK_GET_BONUS_PRICES = 'backpack/get_bonus_prices'¶
- class zafiaonline.structures.ZafiaEndpoints(*values)[source]¶
Bases:
str,EnumAPI endpoints for Zafia Online.
This enum contains shorthand identifiers used in Zafia Online’s internal API routing. Each value corresponds to a specific backend action that the client can trigger.
- CHANGE_FAVORITE_STATUS¶
Change the favorite status of a user.
- CHANGE_VISIBLE_TOP¶
Change a user’s visibility in the top list.
- CHECK_PROFILE¶
Retrieve another user’s profile data.
- GET_FAVORITES_LIST¶
Get the current user’s list of favorites.
- GET_TOP¶
Retrieve the top-ranking users.
- GET_VERIFICATIONS¶
Get verification-related data.
- format(*args, **kwargs)[source]¶
Formats the enum value as a string using provided keyword arguments.
This method uses the underlying enum string (self.value) as a format string and substitutes any named placeholders with values from kwargs.
- Parameters:
*args (Any) – Unused. Present for compatibility.
**kwargs (Any) – Keyword arguments to format the string.
- Returns:
Formatted string with placeholders replaced by keyword values.
- Return type:
str
- CHANGE_FAVORITE_STATUS = 'cfs'¶
- CHANGE_VISIBLE_TOP = 'cvt'¶
- CHECK_PROFILE = 'cpr'¶
- GET_FAVORITES_LIST = 'gfl'¶
- GET_TOP = 'gt'¶
- GET_VERIFICATIONS = 'vf'¶
- class zafiaonline.structures.Renaming(*values)[source]¶
Bases:
dict,EnumField name mappings for different object types used in the API.
This enum stores dictionaries that map verbose field names to their shortened versions used in serialization, API responses, or internal communication. Each attribute represents a context-specific renaming schema (e.g., user data, room settings, server config).
- USER¶
Mapping for user-related fields.
- USER_NEW_API¶
Mapping for extended user fields in new API version.
- SERVER_CONFIG¶
Mapping for server configuration fields.
- ROOM¶
Mapping for basic room-related fields.
- ROOM_IN_LOBBY¶
Mapping for room fields shown in lobby context.
- ROOM_IN_LOBBY_STATE¶
Mapping for additional room lobby state fields.
- SHORT_USER¶
Mapping for minimal user representations.
- FRIEND¶
Mapping for friend list entries.
- FRIENDSHIP¶
Mapping for friendship relationship data.
- MESSAGE¶
Mapping for messaging system fields.
- GUI¶
Mapping for GUI-specific identifiers.
- DECORATIONS¶
Mapping for decoration item types.
- DECORATIONS_PARAMETERS¶
Mapping for parameters of decorations.
- USER = {'accept_messages': 'ac', 'experience': 'ex', 'gold': 'g', 'is_in_room': 'rr', 'is_vip': 'v', 'level': 'l', 'match_making_score': 'mmscr', 'money': 'mo', 'next_level_experience': 'nle', 'online': 'on', 'photo': 'ph', 'played_games': 'pg', 'player_role_statistics': 'prst', 'previous_level_experience': 'ple', 'rank': 'r', 'score': 'sc', 'selected_language': 'slc', 'sex': 's', 'token': 't', 'updated': 'up', 'user_id': 'o', 'username': 'u', 'vip_updated': 'vupd', 'wins_as_killer': 'wik', 'wins_as_mafia': 'wim', 'wins_as_peaceful': 'wip'}¶
- USER_NEW_API = {'accept_messages': 'ac', 'decorations': 'dcrs', 'experience': 'ex', 'gold': 'g', 'is_vip': 'v', 'level': 'l', 'match_making_score': 'mmscr', 'money': 'mo', 'next_level_experience': 'nle', 'online': 'on', 'photo': 'ph', 'played_games': 'pg', 'player_role_statistics': 'prst', 'previous_level_experience': 'ple', 'score': 'sc', 'selected_language': 'slc', 'sex': 's', 'silver_coins': 'scns', 'token': 't', 'updated': 'up', 'user_account_coins': 'uac', 'user_id': 'o', 'username': 'u', 'vip_updated': 'vupd', 'wins_as_killer': 'wik', 'wins_as_mafia': 'wim', 'wins_as_peaceful': 'wip'}¶
- SERVER_CONFIG = {'connection_checker_period': 'ccp', 'connection_inactive_timeout': 'cit', 'kick_user_price': 'kup', 'match_making_users_in_queue_interval': 'mmguiqik', 'price_username_set': 'pus', 'room_password_minimal_level': 'srpml', 'room_title_minimal_level': 'srtml', 'server_language_change_time': 'slct', 'set_photo_minimal_level': 'sppml', 'set_room_password_min_authority': 'srpma', 'show_password_room_info_button': 'sprib'}¶
- ROOM = {'max_players': 'mxp', 'min_level': 'mnl', 'min_players': 'mnp', 'password': 'pw', 'room_id': 'o', 'room_model_type': 'rmt', 'selected_roles': 'sr', 'status': 's', 'title': 'tt', 'vip_enabled': 'venb'}¶
- CURRENET_ROOM = {'game_status': 's', 'min_level': 'mnl', 'password': 'pw', 'players_number': 'pn', 'room_id': 'o', 'same_room': 'isr', 'title': 'tt', 'vip_enabled': 'venb'}¶
- ROOM_IN_LOBBY = {'creator_id': 'rco', 'friend_in_room': 'fir', 'game_status': 's', 'invitation_sender_username': 'isun', 'invited_in_room': 'iinvtd', 'max_players': 'mxp', 'min_level': 'mnl', 'min_players': 'mnp', 'password': 'pw', 'players': 'pls', 'players_number': 'pn', 'room_id': 'o', 'room_model_type': 'rmt', 'room_status': 'rs', 'selected_roles': 'sr', 'status': 's', 'title': 'tt', 'vip_enabled': 'venb'}¶
- ROOM_IN_LOBBY_STATE = {'friend_in_room': 'fir', 'invitation_sender_username': 'isun', 'invited_in_room': 'iinvtd', 'players_in_room': 'pin', 'room_id': 'ro'}¶
- SHORT_USER = {'is_vip': 'v', 'online': 'on', 'photo': 'ph', 'sex': 's', 'updated': 'up', 'user_id': 'o', 'username': 'u', 'vip_updated': 'vupd'}¶
- FRIEND = {'friend_id': 'o', 'new_messages': 'nm', 'updated': 'up', 'user': 'uu', 'user_id': 'uo'}¶
- FRIENDSHIP = {'accepted': 'a', 'currenet_room': 'rr', 'friend_data': 'ff', 'friend_id': 'f', 'user_data': 'uu'}¶
- MESSAGE = {'accepted': 'a', 'created': 'c', 'friend_id': 'fp', 'message_style': 'mstl', 'message_type': 't', 'text': 'tx', 'user_id': 'uo'}¶
- GUI = {'count_authority_for_swap_icon': 'r'}¶
- DECORATIONS = {'photo_border': '8', 'photo_border_animation': '7', 'profile_animation': '4', 'profile_background': '6', 'profile_main_color': '5', 'username_animation': '0', 'username_background': '1', 'username_shadow': '2', 'username_text': '3'}¶
- DECORATIONS_PARAMETERS = {'alpha': '0', 'file': '2', 'speed': '3', 'value': '1'}¶
- class zafiaonline.structures.Sex(*values)[source]¶
Bases:
IntEnumEnumeration representing the biological sex of a user.
- MEN¶
Represents a male user (value = 0).
- WOMEN¶
Represents a female user (value = 1).
- MEN = 0¶
- WOMEN = 1¶
- class zafiaonline.structures.Languages(*values)[source]¶
Bases:
str,EnumEnumeration representing supported languages.
- UNSELECTED¶
Default value when no language is selected (value = “”).
- RUSSIAN¶
Represents the Russian language (value = “ru”).
- ENGLISH¶
Represents the English language (value = “en”).
- UNSELECTED = ''¶
- RUSSIAN = 'ru'¶
- ENGLISH = 'en'¶
- class zafiaonline.structures.Roles(*values)[source]¶
Bases:
IntEnumEnumeration representing different roles in the game.
Each role has a unique integer identifier, defining a player’s function or abilities within the game.
- CIVILIAN¶
A regular player with no special abilities (1).
- DOCTOR¶
Can heal other players to protect them from elimination (2).
- SHERIFF¶
Can investigate other players to determine their roles (3).
- MAFIA¶
Works with the mafia team to eliminate civilians (4).
- LOVER¶
Forms a bond with another player; their fate is linked (5).
- TERRORIST¶
Can sacrifice themselves to eliminate another player (6).
- JOURNALIST¶
Can reveal a player’s role to the public (7).
- BODYGUARD¶
Protects a chosen player from attacks (8).
- BARMAN¶
Can disable another player’s abilities for a turn (9).
- SPY¶
Can gather information about other players’ actions (10).
- INFORMER¶
Can manipulate information or provide false leads (11).
- CIVILIAN = 1¶
- DOCTOR = 2¶
- SHERIFF = 3¶
- MAFIA = 4¶
- LOVER = 5¶
- TERRORIST = 6¶
- JOURNALIST = 7¶
- BODYGUARD = 8¶
- BARMAN = 9¶
- SPY = 10¶
- INFORMER = 11¶
- class zafiaonline.structures.RatingMode(*values)[source]¶
Bases:
str,EnumEnumeration representing different rating modes for leaderboard rankings.
This enum defines the time frame for which player ratings are calculated and displayed on the leaderboard.
- ALL_TIME¶
Rankings based on all-time performance.
- TODAY¶
Rankings based on performance for the current day.
- YESTERDAY¶
Rankings based on performance for the previous day.
- ALL_TIME = 'all_time'¶
- TODAY = 'today'¶
- YESTERDAY = 'yesterday'¶
- class zafiaonline.structures.RatingType(*values)[source]¶
Bases:
str,EnumEnumeration representing different types of rating categories for player rankings.
This enum defines the various metrics used to rank players in leaderboards.
- GAMES¶
Ranking based on the total number of games played.
- EXPERIENCE¶
Ranking based on the player’s accumulated experience points.
- AUTHORITY¶
Ranking based on the player’s authority level.
- WINS¶
Ranking based on the total number of wins achieved.
- GAMES = 'games'¶
- EXPERIENCE = 'experience'¶
- AUTHORITY = 'authority'¶
- WINS = 'wins'¶
- class zafiaonline.structures.ActivityType(*values)[source]¶
Bases:
IntEnumEnumeration representing the activity status of a user.
This enum is used to indicate whether a user is currently online or offline.
- OFFLINE¶
Represents a user who is not currently active.
- ONLINE¶
Represents a user who is currently active and online.
- OFFLINE = 0¶
- ONLINE = 1¶
- class zafiaonline.structures.RoomModelType(*values)[source]¶
Bases:
IntEnumEnumeration representing different types of room models in the game.
This enum is used to distinguish between standard rooms and matchmaking-enabled rooms.
- NOT_MATCHMAKING_MODE¶
Represents a regular game room without matchmaking.
- MATCHMAKING_MODE¶
Represents a room that uses a matchmaking system to pair players.
- NOT_MATCHMAKING_MODE = 0¶
- MATCHMAKING_MODE = 1¶
- class zafiaonline.structures.ProfilePhotoType(*values)[source]¶
Bases:
str,EnumEnumeration representing the profile photo status of a user.
This enum is used to determine whether a user has uploaded a profile photo.
- NO_PHOTO¶
The user has not uploaded a profile photo.
- PHOTO_ADDED¶
The user has uploaded a profile photo.
- NO_PHOTO = '0'¶
- PHOTO_ADDED = '1'¶
- class zafiaonline.structures.FriendInRoomType(*values)[source]¶
Bases:
IntEnumEnumeration representing the presence of a friend in a room.
This enum is used to indicate whether a user’s friend is currently in the same room.
- NO_FRIEND_IN_ROOM¶
No friends are present in the room.
- FRIEND_IN_ROOM¶
At least one friend is present in the room.
- NO_FRIEND_IN_ROOM = 0¶
- FRIEND_IN_ROOM = 1¶
- class zafiaonline.structures.MessageType(*values)[source]¶
Bases:
IntEnumEnumeration of message types for the Mafia game chat.
Message types define the structure, color, and context of chat messages used during gameplay.
- MAIN_TEXT¶
General game message.
- USER_HAS_ENTERED¶
A user has entered the room.
- USER_HAS_LEFT¶
A user has left the room.
- GAME_HAS_STARTED¶
Game start notification.
- NIGHT_COME_MAFIA_IN_CHAT¶
Night phase begins, mafia chat opens.
- NIGHT_MAFIA_CHOOSE_VICTIM¶
Mafia selects a victim.
- DAY_COME_EVERYONE_IN_CHAT¶
Day phase begins, all players chat.
- DAY_CIVILIANS_VOTING¶
Civilians begin voting.
- VOTES_FOR¶
A vote has been cast.
- MAIN_TEXT10¶
Duplicate main text (unused).
- KILLED_PLAYER_MESSAGE¶
Message about a killed player.
- PLAYER_KILLED¶
Announcement of player killed.
- VOTES_FOR13¶
Duplicate voting message (unused).
- NOBODY_KILLED¶
No player was killed.
- GAME_FINISHED_CIVILIANS_WON¶
Game end, civilians win.
- GAME_FINISHED_MAFIA_WON¶
Game end, mafia win.
- KILLED_USER_MESSAGE¶
User has been killed.
- TERRORIST_BOMBED¶
Terrorist has exploded.
- BREAKING_NEWS_PLAYING_THE_SAME_TEAM¶
Breaking news, same team.
- BREAKING_NEWS_PLAYING_DIFFERENT_TEAMS¶
Breaking news, different teams.
- TERRORIST_BOMBED_USER_WAS_UNDER_GUARDIAN¶
Bomb blocked by guardian.
- GAME_FINISHED_IN_DRAW¶
Game ended in a draw.
- STARTED_VOTING_TO_KICK_USER¶
Kick vote initiated.
- KICK_VOTING_HAS_FINISHED¶
Kick vote concluded.
- MAIN_TEXT25¶
Duplicate main text (unused).
- VOTES_FOR26¶
Duplicate voting message (unused).
- GIVE_UP¶
Player has surrendered.
- MAIN_TEXT = 1¶
- USER_HAS_ENTERED = 2¶
- USER_HAS_LEFT = 3¶
- GAME_HAS_STARTED = 4¶
- NIGHT_COME_MAFIA_IN_CHAT = 5¶
- NIGHT_MAFIA_CHOOSE_VICTIM = 6¶
- DAY_COME_EVERYONE_IN_CHAT = 7¶
- DAY_CIVILIANS_VOTING = 8¶
- VOTES_FOR = 9¶
- MAIN_TEXT10 = 10¶
- KILLED_PLAYER_MESSAGE = 11¶
- PLAYER_KILLED = 12¶
- VOTES_FOR13 = 13¶
- NOBODY_KILLED = 14¶
- GAME_FINISHED_CIVILIANS_WON = 15¶
- GAME_FINISHED_MAFIA_WON = 16¶
- KILLED_USER_MESSAGE = 17¶
- TERRORIST_BOMBED = 18¶
- BREAKING_NEWS_PLAYING_THE_SAME_TEAM = 19¶
- BREAKING_NEWS_PLAYING_DIFFERENT_TEAMS = 20¶
- TERRORIST_BOMBED_USER_WAS_UNDER_GUARDIAN = 21¶
- GAME_FINISHED_IN_DRAW = 22¶
- STARTED_VOTING_TO_KICK_USER = 23¶
- KICK_VOTING_HAS_FINISHED = 24¶
- MAIN_TEXT25 = 25¶
- VOTES_FOR26 = 26¶
- GIVE_UP = 27¶
- class zafiaonline.structures.MessageStyles(*values)[source]¶
Bases:
IntEnumEnumeration of color styles for chat messages in the Mafia game.
These styles define the appearance of chat messages based on their type. Values correspond to predefined color codes in the game’s client UI.
- NO_COLOR¶
No color applied.
- GREY_COLOR¶
Grey color style.
- BLUE_COLOR¶
Blue color style.
- RED_COLOR¶
Red color style.
- GREEN_COLOR¶
Green color style.
- PURPLE_COLOR¶
Purple color style.
- YELLOW_COLOR¶
Yellow color style.
- PINK_COLOR¶
Pink color style.
- NO_COLOR = 0¶
- GREY_COLOR = 1¶
- BLUE_COLOR = 2¶
- RED_COLOR = 3¶
- GREEN_COLOR = 4¶
- PURPLE_COLOR = 5¶
- YELLOW_COLOR = 6¶
- PINK_COLOR = 7¶
- class zafiaonline.structures.MafiaLanguages(*values)[source]¶
Bases:
str,EnumEnumeration of supported language codes in the Mafia game.
These codes are used for localizing game content and messages.
- Russian¶
Russian language.
- English¶
English language.
- Russian = 'RUS'¶
- English = 'ENG'¶
- class zafiaonline.structures.MethodGetFavourites(*values)[source]¶
Bases:
IntEnumEnumeration for methods of retrieving favourite players in the Mafia game.
Used to specify the source of a player’s favourites when making a request.
- FriendMethod¶
Retrieve favourites from the friend list.
- InviteMethod¶
Retrieve favourites from the invite list.
- FriendMethod = 0¶
- InviteMethod = 1¶
- class zafiaonline.structures.ModelUser(user_id=None, updated=None, username=None, photo=None, experience=None, next_level_experience=None, previous_level_experience=None, level=None, is_vip=None, vip_updated=None, played_games=None, match_making_score=None, sex=Sex.MEN, player_role_statistics=None, wins_as_killer=None, wins_as_mafia=None, wins_as_peaceful=None, token=None, role=None, online=None, selected_language=Languages.RUSSIAN, is_in_room=None)[source]¶
Bases:
StructRepresents a user profile in the Mafia Online game.
This model contains detailed information about a user, such as their experience, level, VIP status, game statistics, and authentication token. It is used for both client display and backend communication.
- Parameters:
user_id (str | None)
updated (int | None)
username (str | None)
photo (str | None)
experience (int | None)
next_level_experience (int | None)
previous_level_experience (int | None)
level (int | None)
is_vip (int | None)
vip_updated (int | None)
played_games (int | None)
match_making_score (int | None)
sex (Sex)
player_role_statistics (dict[str, int] | None)
wins_as_killer (int | None)
wins_as_mafia (int | None)
wins_as_peaceful (int | None)
token (str | None)
role (int | None)
online (int | None)
selected_language (Languages)
is_in_room (None)
- user_id¶
Unique identifier of the user.
- Type:
str | None
- updated¶
Timestamp of the last profile update.
- Type:
int | None
- username¶
Username of the player.
- Type:
str | None
- photo¶
Profile photo identifier or URL.
- Type:
str | None
- experience¶
Total experience points.
- Type:
int | None
- next_level_experience¶
Experience needed for next level.
- Type:
int | None
- previous_level_experience¶
Experience required for previous level.
- Type:
int | None
- level¶
Current level of the user.
- Type:
int | None
- is_vip¶
Whether the user is a VIP (1) or not (0).
- Type:
int | None
- vip_updated¶
Timestamp of the last VIP update.
- Type:
int | None
- played_games¶
Total number of games played.
- Type:
int | None
- match_making_score¶
MMR or matchmaking rating.
- Type:
int | None
- player_role_statistics¶
Roles played and frequency.
- Type:
dict[str, int] | None
- wins_as_killer¶
Number of wins as killer.
- Type:
int | None
- wins_as_mafia¶
Number of wins as mafia.
- Type:
int | None
- wins_as_peaceful¶
Number of wins as peaceful player.
- Type:
int | None
- token¶
Authentication or session token.
- Type:
str | None
- role¶
Role ID in the current game, if any.
- Type:
int | None
- online¶
Whether the user is online (1) or offline (0).
- Type:
int | None
- experience: int | None¶
- is_in_room: None¶
- is_vip: int | None¶
- level: int | None¶
- match_making_score: int | None¶
- next_level_experience: int | None¶
- online: int | None¶
- photo: str | None¶
- played_games: int | None¶
- player_role_statistics: dict[str, int] | None¶
- previous_level_experience: int | None¶
- role: int | None¶
- token: str | None¶
- updated: int | None¶
- user_id: str | None¶
- username: str | None¶
- vip_updated: int | None¶
- wins_as_killer: int | None¶
- wins_as_mafia: int | None¶
- wins_as_peaceful: int | None¶
- class zafiaonline.structures.ModelOtherUser(user_id=None, updated=None, username=None, photo=None, experience=None, next_level_experience=None, previous_level_experience=None, level=None, is_vip=None, played_games=None, match_making_score=None, sex=Sex.MEN, player_role_statistics=None, wins_as_mafia=None, wins_as_peaceful=None, token=None, online=None, selected_language=Languages.RUSSIAN, user_account_coins=None, decorations=None)[source]¶
Bases:
StructRepresents another user’s profile in the new API format of Mafia Online.
This model is used for representing external or public-facing user data, typically in API responses where reduced or modified fields are used compared to the main ModelUser structure.
- Parameters:
user_id (str | None)
updated (int | None)
username (str | None)
photo (str | None)
experience (int | None)
next_level_experience (int | None)
previous_level_experience (int | None)
level (int | None)
is_vip (bool | None)
played_games (int | None)
match_making_score (int | None)
sex (Sex)
player_role_statistics (dict[str, int] | None)
wins_as_mafia (int | None)
wins_as_peaceful (int | None)
token (str | None)
online (bool | None)
selected_language (Languages)
user_account_coins (dict[str, int] | None)
decorations (dict | None)
- user_id¶
Unique identifier of the user.
- Type:
str | None
- updated¶
Timestamp of the last profile update.
- Type:
int | None
- username¶
Display name of the user.
- Type:
str | None
- photo¶
URL or identifier of the profile photo.
- Type:
str | None
- experience¶
Accumulated experience points.
- Type:
int | None
- next_level_experience¶
Experience required for next level.
- Type:
int | None
- previous_level_experience¶
Experience required for previous level.
- Type:
int | None
- level¶
Current user level.
- Type:
int | None
- is_vip¶
Whether the user has VIP status.
- Type:
bool | None
- played_games¶
Total number of games played.
- Type:
int | None
- match_making_score¶
Matchmaking rating (MMR).
- Type:
int | None
- player_role_statistics¶
Mapping of role names to games played.
- Type:
dict[str, int] | None
- wins_as_mafia¶
Number of wins while playing as mafia.
- Type:
int | None
- wins_as_peaceful¶
Number of wins while playing as peaceful.
- Type:
int | None
- token¶
Optional authentication or session token.
- Type:
str | None
- online¶
Online status (True if online).
- Type:
bool | None
- user_account_coins¶
Coin balances per currency type.
- Type:
dict[str, int] | None
- decorations¶
Information about visual customizations or cosmetic items.
- Type:
dict | None
- decorations: dict | None¶
- experience: int | None¶
- is_vip: bool | None¶
- level: int | None¶
- match_making_score: int | None¶
- next_level_experience: int | None¶
- online: bool | None¶
- photo: str | None¶
- played_games: int | None¶
- player_role_statistics: dict[str, int] | None¶
- previous_level_experience: int | None¶
- token: str | None¶
- updated: int | None¶
- user_account_coins: dict[str, int] | None¶
- user_id: str | None¶
- username: str | None¶
- wins_as_mafia: int | None¶
- wins_as_peaceful: int | None¶
- class zafiaonline.structures.ModelServerConfig(kick_user_price=None, set_room_password_min_authority=None, price_username_set=None, server_language_change_time=None, show_password_room_info_button=None)[source]¶
Bases:
StructConfiguration model for server-level game settings in Mafia Online.
This model defines server-side parameters that affect game behavior, pricing, and UI visibility for all users.
- Parameters:
kick_user_price (int | None)
set_room_password_min_authority (int | None)
price_username_set (int | None)
server_language_change_time (int | None)
show_password_room_info_button (bool | None)
- kick_user_price¶
Cost to kick a user from a room.
- Type:
int | None
- set_room_password_min_authority¶
Minimum authority level required to set a room password.
- Type:
int | None
- price_username_set¶
Price to change the user’s display name.
- Type:
int | None
- server_language_change_time¶
Minimum time between server language changes (in seconds).
- Type:
int | None
- show_password_room_info_button¶
Whether the password visibility toggle is shown in room info.
- Type:
bool | None
- kick_user_price: int | None¶
- price_username_set: int | None¶
- server_language_change_time: int | None¶
- set_room_password_min_authority: int | None¶
- show_password_room_info_button: bool | None¶
- class zafiaonline.structures.ModelRoom(room_id=None, min_players=None, max_players=None, min_level=None, vip_enabled=None, status=None, selected_roles=None, title=None, password=None, room_model_tupe=None)[source]¶
Bases:
StructModel representing a game room in Mafia Online.
This structure contains metadata and settings for a multiplayer room where players gather before starting a game.
- Parameters:
room_id (str | None)
min_players (int | None)
max_players (int | None)
min_level (int | None)
vip_enabled (bool | None)
status (int | None)
selected_roles (list[Roles] | None)
title (str | None)
password (str | None)
room_model_tupe (int | None)
- room_id¶
Unique identifier of the room.
- Type:
str | None
- min_players¶
Minimum number of players required to start the game.
- Type:
int | None
- max_players¶
Maximum number of players allowed in the room.
- Type:
int | None
- min_level¶
Minimum player level required to join the room.
- Type:
int | None
- vip_enabled¶
Whether the room is restricted to VIP players.
- Type:
bool | None
- status¶
Current status of the room (e.g., waiting, in-game).
- Type:
int | None
- title¶
User-defined title or name of the room.
- Type:
str | None
- password¶
Optional password required to join the room.
- Type:
str | None
- max_players: int | None¶
- min_level: int | None¶
- min_players: int | None¶
- password: str | None¶
- room_id: str | None¶
- room_model_tupe: int | None¶
- status: int | None¶
- title: str | None¶
- vip_enabled: bool | None¶
- class zafiaonline.structures.ModelShortUser(user_id=None, username=None, updated=None, photo=None, online=None, is_vip=None, vip_updated=None, sex=Sex.MEN)[source]¶
Bases:
StructLightweight user model for displaying minimal profile information.
Used in friend lists, search results, and other areas where full user data is unnecessary.
- Parameters:
user_id (str | None)
username (str | None)
updated (int | None)
photo (str | None)
online (int | None)
is_vip (int | None)
vip_updated (int | None)
sex (Sex)
- user_id¶
Unique identifier of the user.
- Type:
str | None
- username¶
Display name of the user.
- Type:
str | None
- updated¶
Unix timestamp of the last user data update.
- Type:
int | None
- photo¶
URL or ID of the user’s avatar image.
- Type:
str | None
- online¶
Online status flag (e.g., 1 for online, 0 for offline).
- Type:
int | None
- is_vip¶
VIP status flag (1 if VIP, 0 if not).
- Type:
int | None
- vip_updated¶
Unix timestamp when VIP status was last updated.
- Type:
int | None
- is_vip: int | None¶
- online: int | None¶
- photo: str | None¶
- updated: int | None¶
- user_id: str | None¶
- username: str | None¶
- vip_updated: int | None¶
- class zafiaonline.structures.ModelFriend(friend_id=None, updated=None, user=None, new_messages=None)[source]¶
Bases:
StructModel representing a friend relationship and related metadata.
Used for managing a player’s friends list and unread message tracking.
- Parameters:
friend_id (str | None)
updated (int | None)
user (ModelShortUser | None)
new_messages (int | None)
- friend_id¶
Unique identifier of the friend relationship.
- Type:
str | None
- updated¶
Unix timestamp of the last update to this relationship.
- Type:
int | None
- user¶
Short user model representing the friend.
- Type:
ModelShortUser | None
- new_messages¶
Number of unread messages from this friend.
- Type:
int | None
- friend_id: str | None¶
- new_messages: int | None¶
- updated: int | None¶
- user: ModelShortUser | None¶
- class zafiaonline.structures.ModelMessage(user_id=None, friend_id=None, created=None, text=None, message_style=None, accepted=None, message_type=None)[source]¶
Bases:
StructModel representing a chat message exchanged between users.
Used for storing or transmitting messages in the in-game chat system.
- Parameters:
user_id (str | None)
friend_id (str | None)
created (int | None)
text (str | None)
message_style (int | None)
accepted (int | None)
message_type (int | None)
- user_id¶
ID of the user who sent the message.
- Type:
str | None
- friend_id¶
ID of the recipient friend.
- Type:
str | None
- created¶
Unix timestamp indicating when the message was created.
- Type:
int | None
- text¶
Text content of the message.
- Type:
str | None
- message_style¶
Style/type indicator for rendering the message (e.g., font, color).
- Type:
int | None
- accepted¶
Indicates whether the message was accepted/acknowledged.
- Type:
int | None
- message_type¶
Type of message (e.g., system, player, notification).
- Type:
int | None
- accepted: int | None¶
- created: int | None¶
- friend_id: str | None¶
- message_style: int | None¶
- message_type: int | None¶
- text: str | None¶
- user_id: str | None¶
- class zafiaonline.structures.ModelGUI(count_authority_for_swap_icon=None)[source]¶
Bases:
StructModel representing GUI-related configuration and thresholds.
This structure holds data used by the client to render or enable graphical interface elements based on certain authority levels.
- Parameters:
count_authority_for_swap_icon (dict | None)
- count_authority_for_swap_icon¶
A mapping of authority levels to the number of times a user can swap icons or similar GUI actions.
- Type:
dict | None
- count_authority_for_swap_icon: dict | None¶