Jump to content

P4API.Net Use P4CONFIG for Connection

p4api.net p4config api

  • Please log in to reply
1 reply to this topic

#1 yothsoggoth



  • Members
  • Pip
  • 2 posts

Posted 21 September 2019 - 11:21 AM

Using the P4API.Net, it seems like the only way to open a connection is to create a Server object which requires the address and details of the server.

I'm using a setup that heavily relies on using P4CONFIG to define the current server/client/etc. setup to use to make it easy to switch between projects by simply updating the P4CONFIG each time.

Is there any way to achieve this with the API without having to manually process P4CONFIG?

#2 Sambwise


    Advanced Member

  • Members
  • PipPipPip
  • 1120 posts

Posted 21 September 2019 - 07:26 PM

Most of the APIs will inherit the P4CONFIG settings by default, and also have some way to read the environment separately from setting up a connection (e.g. in the C++ API you have the Enviro object which encapsulates P4CONFIG/registry/environment settings, and a new connection automatically populates itself with that data), but I can't find anything in the P4API.Net docs that corresponds to an Enviro.

What if you create a Server object with an empty string as the port -- maybe it'll populate itself with a default from the environment?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users