frost package¶
Subpackages¶
- frost.client package
- frost.ext package
- frost.server package
Module contents¶
-
class
frost.FrostServer(file: str)¶ Bases:
frost.server.socketio.base_server.BaseServerThe Frost server.
- Parameters
file (str) – The
__file__of the file this is imported in
-
on_user_connect(conn: socket.socket, addr: Tuple[str, int]) → None¶ Handles the connection of a client and executes tasks accordingly.
- Parameters
conn ('socket.socket') – The client’s connection
addr (Tuple[str, int]) – The user’s IP address and port
-
run(ip: str = '127.0.0.1', port: int = 5555) → None¶ Runs the FrostServer.
- Parameters
ip (str, optional) – The IP for the server to bind to, defaults to ‘127.0.0.1’
port (int, optional) – The port for the server to bind to, defaults to 5555
-
class
frost.FrostClient(ip: str = '127.0.0.1', port: int = 5555)¶ Bases:
frost.client.socketio.base_client.BaseClientThe Frost Client.
- Parameters
ip (str, optional) – The IP address of the server to connect to, defaults to ‘127.0.0.1’
port (int, optional) – The port of the server to connect to, defaults to 5555
-
connect() → None¶ Connect to the server and begin listening for events.
-
create_room(room_name: str, token: str, id_: str) → None¶ Create a new room in a server.
- Parameters
room_name (str) – The name of the room to create
token (str) – The user’s token, auto filled by
frost.client.auth.get_auth()id (str) – The user’s ID, auto filled by
frost.client.auth.get_auth()
-
get_invite_code(room_id: int, token: str, id_: str) → None¶ Get the invite code of a room in a server.
- Parameters
room_id (int) – The ID of the room to get an invite code from
token (str) – The user’s token, auto filled by
frost.client.auth.get_auth()id (str) – The user’s ID, auto filled by
frost.client.auth.get_auth()
-
get_joined_rooms(token: str, id_: str) → None¶ Get all the joined rooms of the currently logged in user.
- Parameters
token (str) – The user’s token, auto filled by
frost.client.auth.get_auth()id (str) – The user’s ID, auto filled by
frost.client.auth.get_auth()
-
get_room_members(room_id: int, token: str, id_: str) → None¶ Get all the members of a specific room.
- Parameters
room_id (int) – The ID of the room to get the members of
token (str) – The user’s token, auto filled by
frost.client.auth.get_auth()id (str) – The user’s ID, auto filled by
frost.client.auth.get_auth()
-
get_room_msgs(room_id: int, token: str, id_: str) → None¶ Get all messages from a specific room in a server.
- Parameters
room_id (int) – The ID of the room to get the messages from
token (str) – The user’s token, auto filled by
frost.client.auth.get_auth()id (str) – The user’s ID, auto filled by
frost.client.auth.get_auth()
-
join_room(invite_code: str, token: str, id_: str) → None¶ Join a room in a server with an invite code.
- Parameters
invite_code (str) – The invite code the room to join
token (str) – The user’s token, auto filled by
frost.client.auth.get_auth()id (str) – The user’s ID, auto filled by
frost.client.auth.get_auth()
-
leave_room(room_id: int, token: str, id_: str) → None¶ Leave a joined room in a server.
- Parameters
room_id (int) – The ID of the room to leave
token (str) – The user’s token, auto filled by
frost.client.auth.get_auth()id (str) – The user’s ID, auto filled by
frost.client.auth.get_auth()
-
login(username: str, password: str) → None¶ Login to the server.
- Parameters
username (str) – The username of the account
password (str) – The password of the account
-
register(username: str, password: str) → None¶ Register an account on the server.
- Parameters
username (str) – The desired username of the account
password (str) – The desired password of the account
-
send_msg(room_id: int, msg: str, token: str, id_: str) → None¶ Send a message to other users on a server in a specific room.
- Parameters
room_id (int) – The ID of the room to send the message to
msg (str) – The desired message to send
token (str) – The user’s token, auto filled by
frost.client.auth.get_auth()id (str) – The user’s ID, auto filled by
frost.client.auth.get_auth()
-
class
frost.Cog¶ Bases:
objectChildren of this class and its methods are automatically routed and then handled by
frost.ext.handler.Handler. Private methods of the children are ignored and not routed. All children methods are automatically run as static methods.- Raises
DirectCogInstanceError – If this class is directly instantiated. This class can only be subclassed.