def __init__(self, client: protos.Command.ClientType, hostname: str): self.channel = grpc.insecure_channel(f'{hostname}:{DEFAULT_PORT}') self.stub = grpc_stubs.StateServerStub(self.channel) self.client_type = client initial_state = PhysicsState( None, self.stub.get_physical_state( iter([Request(ident=Request.NOOP, client=self.client_type)]))) self._caching_physics_engine = physics.PhysicsEngine(initial_state) self._time_of_next_network_update = 0.0
def __init__(self, client: protos.Command.ClientType, hostname: str): self.channel = grpc.insecure_channel(f'{hostname}:{DEFAULT_PORT}') self.stub = grpc_stubs.StateServerStub(self.channel) self.client_type = client