Perfect Heist 2
 Ce sujet a été épinglé, cela doit être important
[GUIDE] How to host your own dedicated server!
If you want to play on your own dedicated server instead of hosting a session in-game, here is a quick guide on how to setup a dedicated server on Linux!

There also is a community-created docker image that should make things easier: https://github.com/murzart/PerfectHeist2

Add the following to a StartServer.sh file:
echo Updating game... login anonymous steamcmd +force_install_dir /home/dev1/ph2sv +app_update 1964150 +quit echo Starting server... cd /home/dev1/ph2sv/PerfectHeist2/Binaries/Linux /home/dev1/ph2sv/PerfectHeist2/Binaries/Linux/PerfectHeist2Server NewYorkCity -Port=7777 -QueryPort=27017

If you host multiple server instances on the same machine, make sure every instance has its own port and queryPort!

You can replace "NewYorkCity" with "HugeBank", "Classic_Heist_Big", "CasinoHeist", and "Bank4" !

In /home/dev1/ph2sv/PerfectHeist2/Saved/Config/LinuxServer you also find a Game.ini file where you can configure the server, here you can see all settings:
[Server] name="Server Name" ; how many bots will play against a single player if no other human players are online bots=2 ; password settings pw = false pws = "TOPSECRET" [Advanced] ; class selection time picktime=20 ; if spectators are allowed spectators=false infiniteCopRespawns = false ; minimum amount of money robbers have to steal minimumStolenAmount = 30000 ; percentage of players forced into the cop team as long as "ignoreTeamLimits" is false copPercentage = 30 ; if true, players can join any team they want no matter how many players are already in there ignoreTeamLimits = false ; if true, cops cant be fired if they hit NPCs while in a firefight against a robber combatfireProtected = false ; if true, cops are only allowed to kill robbers that already performed suspicous actions noRandomKills = false ; if true, cops only die and no longer get fired after killing NPCs copRespawnAfterNpcKill = false ; amount of saved money robbers gain when a cop kills an NPC CopNpcsKillReward = 0 ; overtime settings, duration in secs overtime = false overtimeduration = 60 ; roundtime in seconds roundtime = 300 ; robber respawns per round RobberRespawns = 0 ; if true, cops can kill NPCs without consequences copsCantBeFired = false ; if true, steam users with bans are blocked, but it might lead to connection issues of innocent players if Steam servers are down SteamTickets = false ; allow third person allowTP = false ; if true, sprinting costs stamina sprintingStamina = false ; if true, noone can sprint noSprinting = false ; if true, prevent team damage from bullets NoTeamDamage = false ; use your SteamID64 to kick players without a vote in-game ServerOwnerID = 123456789 MaxPlayers = 16 ; path of a downloaded custom map ; map in the .sh file needs to be changed to CustomMap WorkshopFolderFullPath="C:/map/1234567" ; needs to be set to the SteamID of the used custom map WorkshopMapID=1234567
Dernière modification de yeswecamp_DEV; 9 nov. 2022 à 8h28
< >
Affichage des commentaires 1 à 15 sur 97
Does the dedicated server need a GPU? Everytime I start it says it needs vulkan drivers
Also, what ports does the server need open? I need a range to setup port forwarding
yeswecamp_DEV  [dév.] 9 mai 2022 à 8h20 
HustleMan a écrit :
Does the dedicated server need a GPU? Everytime I start it says it needs vulkan drivers

Are you using the start.sh I posted here? the "PerfectHeist2Server" doesnt need a GPU
yeswecamp_DEV  [dév.] 9 mai 2022 à 8h20 
HustleMan a écrit :
Also, what ports does the server need open? I need a range to setup port forwarding

make sure your server allows connections through those ports:
UDP 27017 Query port for Steam's server browser (= -QueryPort)
UDP 7777 Game client port (= -Port)
UDP 7778 Raw UDP socket port (always Game client port +1)

Try forwarding those for UDP+TCP, and the ports next to them as well since Steam sometimes uses them as well
Thanks for the response!

There are a couple of things I wanna update/add in the guide above:

- Make sure you're using a server with about 4GB of RAM (1GB doesn't work). Also, this guide is for Ubuntu

- Install steamcmd using the instructions in the following link: https://developer.valvesoftware.com/wiki/SteamCMD

- Use this command to install PH2 server. You can also use this same command to update the PH2 server.
steamcmd +force_install_dir ~/ph2sv +login anonymous +app_update 1964150 +quit

- After you install PH2 server, you may need to copy steamclient.so to your ~/.steam folder if your server complains that it cannot connect to the Steam API. Otherwise, you will not be able to find your server in the Server Browser menu:
# Run this you're using a x64 OS mkdir ~/.steam/sdk64 cp ~/ph2sv/linux64/steamclient.so ~/.steam/sdk64/. # I don't know how to install for 32-bit OS. # ~/ph2sv/steamclient.so is the 32-bit steam client, # but I'm not sure which folder to copy it to mkdir ~/.steam/sdk cp ~/ph2sv/steamclient.so ~/.steam/sdk/.

- Optional: If you're using the .sh script in the original post, replace
steamcmd +force_install_dir /home/dev1/ph2sv +app_update 1964150 +quit
with
steamcmd +force_install_dir ~/ph2sv +login anonymous +app_update 1964150 +quit
Dernière modification de HustleMan; 9 mai 2022 à 15h19
yeswecamp_DEV  [dév.] 9 mai 2022 à 14h25 
HustleMan a écrit :
Thanks for the response!

There are a couple of things I wanna update/add in the guide above:

- Make sure you're using a server with about 4GB of RAM (1GB doesn't work)

- Install steamcmd using the instructions in the following link: https://developer.valvesoftware.com/wiki/SteamCMD

- Use this command to install PH2 server. You can also use this same command to update the PH2 server.
# replace /home/usernamehere/ with your own user's home folder (/home/ubuntu) # you can try using the path ~/ph2sv instead steamcmd +force_install_dir /home/usernamehere/ph2sv +login anonymous +app_update 1964150 +quit

- After you install PH2 server, you may need to copy steamclient.so to your ~/.steam folder if your server complains that it cannot connect to the Steam API. Otherwise, you will not be able to find your server in the Server Browser menu:
mkdir ~/.steam/sdk64 # Run this you're using a x64 OS cp ~/ph2sv/linux64/steamclient.so ~/.steam/sdk64/. # Run this if you're using a 32-bit OS cp ~/ph2sv/steamclient.so ~/.steam/sdk64/.

Thank you so much for compiling the guide, will work on integrating it into mine!
Also, one more question: can you run commands on the server like /kick /ban /changemap? Is there a way to run these commands in-game remotely, like if I were playing on my server?
Dernière modification de HustleMan; 9 mai 2022 à 14h41
yeswecamp_DEV  [dév.] 9 mai 2022 à 14h42 
HustleMan a écrit :
Also, one more question: can you run commands on the server like /kick /ban /changemap? Is there a way to run these commands in-game remotely, like if I were playing on my server?

No, currently not, unfortunately!
Thank you so much for answering my questions!

Just one more though haha: does the roundtime parameter in Game.ini actually work? I've set it to 220 seconds and in-game the round timer is actually 5 minutes. Here's my Game.ini file
[Server] Name=~ Best Server NA ~ bots=0 [Advanced] minimumStolenAmount=50000 copPercentage=30 combatfireProtected=true overtime=true overtimeduration=60 roundtime=220

When hosting a game thru the actual game itself (self-hosted), I can set the timer to 220 in the Advanced Options menu itself and it works fine, but I can't seem to change this value on the dedicated server
Dernière modification de HustleMan; 9 mai 2022 à 16h10
yeswecamp_DEV  [dév.] 9 mai 2022 à 16h22 
HustleMan a écrit :
Thank you so much for answering my questions!

Just one more though haha: does the roundtime parameter in Game.ini actually work? I've set it to 220 seconds and in-game the round timer is actually 5 minutes. Here's my Game.ini file
[Server] Name=~ Best Server NA ~ bots=0 [Advanced] minimumStolenAmount=50000 copPercentage=30 combatfireProtected=true overtime=true overtimeduration=60 roundtime=220

When hosting a game thru the actual game itself (self-hosted), I can set the timer to 220 in the Advanced Options menu itself and it works fine, but I can't seem to change this value on the dedicated server

Hi, thank for letting me know there is indeed a bug related to loading the server settings that I will fix in the next update, some settings might not be applied correctly when setting the "overtime" parameter. Since it is enabled by default, I would advise you to just use

[Server] Name=~ Best Server NA ~ bots=0 [Advanced] minimumStolenAmount=50000 copPercentage=30 combatfireProtected=true overtimeduration=60 roundtime=220

which in theory should prevent the bug and set the round time to your desired length!
How can I set the maximum player number on the dedi?
yeswecamp_DEV  [dév.] 13 mai 2022 à 12h01 
daddy O a écrit :
How can I set the maximum player number on the dedi?

Currently there is no setting for it, but I will add one in the next updates!
Thanks, that would be great. What are the names of the other maps (for the server command line parameter)? And can we host Workshop maps on a dedi?
yeswecamp_DEV  [dév.] 15 mai 2022 à 9h19 
daddy O a écrit :
Thanks, that would be great. What are the names of the other maps (for the server command line parameter)? And can we host Workshop maps on a dedi?

Workshop maps are currently not available on dedicated servers but I am working on it, the internal map names are "HugeBank", "Classic_Heist_Big", and "CasinoHeist"
Hello,
maybe I found here help? I want to install a "Perfect Heist 2 Dedicated Server" on Ubuntu.

- SteamCMD is correct installed
- User is ph2ds
- Change in User
- Install he Server and found it in /home/ph2ds

But there isn't an folder named "LinuxServer" and I didn't found the "Game.ini", what I did wrong pls.
< >
Affichage des commentaires 1 à 15 sur 97
Par page : 1530 50