Skip to content

schola.core.unreal_connections.UnrealConnection

class schola.core.unreal_connections.UnrealConnection(url, port) : Bases: object

Abstract Base Class for a gRPC based connection to Unreal Engine.

Parameters: : - url (str) – The url to connect to

  • port (int) – The port on that URL to connect to

url : The URL to connect to

Type: : str

port : The port on the URL to connect to

Type: : int

channel : The channel connecting to Unreal Engine on the chosen address

Type: : grpc.Channel

Methods

__init__(url, port)
close()Close the Unreal Connection.
connect_stubs(*stubs)Connects the gRPC stubs to the Unreal Engine channel
get_open_port(url)Get an open port on the given URL
start()Open the Connection to Unreal Engine.

Attributes

addressReturns the address of the connection
is_activeReturns whether the connection is active or not

__init__(url, port) : Parameters: : - url (str)

property address*: str* : Returns the address of the connection

Returns: : The address of the connection

Return type: : str

close() : Close the Unreal Connection. Method must be safe to call multiple times.

Return type: : None

connect_stubs(*stubs) : Connects the gRPC stubs to the Unreal Engine channel

Parameters: : *stubs (List*[“grpc.Stub”]*) – The gRPC stubs to connect to the Unreal Engine channel

Return type: : List[grpc.Stub]

get_open_port(url) : Get an open port on the given URL

Parameters: : url (str) – The URL to get an open port on

Returns: : - socket.socket – A socket object bound to the open port

  • int – The open port

Return type: : Tuple[socket, int]

property is_active*: bool* : Returns whether the connection is active or not

Returns: : Whether the connection is active or not

Return type: : bool

start() : Open the Connection to Unreal Engine.

Return type: : None