0

I'm a sole developer using Unity and my own Perforce server, and I'm having an issue using the built-in Perforce integration with Unity specifically on my Macbook Pro.

The built-in integration works flawlessly on my Windows 10 desktop, but on my Macbook Pro I get an error in Unity when I try to connect to my server.

Client 'MastersProject_Laptop' can only be used from host 'PierceMac.local'.

PierceMac.local being the hostname of my computer and MastersProject_Laptop being the p4v workspace. The issue is, despite what Unity thinks, that IS the correct hostname. I checked using "hostname" in the terminal. Furthermore, if I change the workspace hostname in p4v, p4v throws the same error. This suggests that it an issue with Unity, but I can't figure out what I'm doing wrong.

Unity version 2017.3.0f3

p4v version P4V/MACOSX1011X86_64/2017.3/1601999

MacOS version 10.13.2

1 Answers1

1

If it's possible to run a p4 info command via the Unity plugin, that'll tell you what it thinks the hostname is. (Most Perforce clients call this "Server information" or something like that -- I couldn't find enough documentation on the p4 Unity plugin to figure out if it exposes that concept.) That would assist with debugging.

Assuming that the Unity environment is somehow preventing the p4 client library from finding the right hostname, you might be able to fix it by setting P4HOST:

p4 set P4HOST=PierceMac.local

That should override whatever the client is auto-detecting.

Samwise
  • 68,105
  • 3
  • 30
  • 44
  • I can run p4 from the terminal but as far as I know, Unity can't. I did run p4 info to verify that my host is in fact "PierceMac.local". No luck `p4 info` lists my host and name as `Client name: PierceMac Client host: PierceMac.local` I ran `p4 set P4HOST=PierceMac.local` just to make sure and there's no change. Perhaps this is a Unity-specific bug? – McBrideMusings Jan 18 '18 at 23:18
  • If all else fails, you can delete the Host field from the client spec, which will disable the client host checking. (Just be careful not to use the same client from more than one host; the Host field is the only safeguard against that.) – Samwise Jan 18 '18 at 23:53