Jump to content

CnCNet server systemd (Auto Start Service)


mohsen9010

Recommended Posts

This is a solution to become a CnCNet host server in linux servers that have systemd for service control (Debian, Ubuntu, CentOS...):

Do it as a root or add 'sudo' before every command:
 

useradd -m cncnet

wget -c https://downloads.cncnet.org/cncnet-server-core.tgz -O - | tar xz -C /home/cncnet

chown cncnet:cncnet /home/cncnet/cncnet-server-core

wget -O /etc/systemd/system/cncnet.service https://files.catbox.moe/dz1q2i.service

# Change 'my new name server' to your own server name

sed -i 's/My cool server/my new name server/g' /etc/systemd/system/cncnet.service

systemctl daemon-reload

systemctl enable cncnet.service

systemctl start cncnet.service

Make a service is better than crontab for auto start solution!

This topic is related to https://forums.cncnet.org/topic/6325-how-to-host-a-cncnet-server/

 

cncnet.txt

Edited by mohsen9010
Update for new version of cncnet (no need mono)
  • Like 1
Link to comment
Share on other sites

11 hours ago, sadspider said:

Nice solution!How does the CnCnet servers work in general?  I only play RA1.  https://cncnet.org/status 

I have spun up a VPS and got it going (Sadspider's server) 

However how do I connect to it or is it just used by default?

 

I'm not sure about RA1 game, but already for Tiberian Sun was a way to choose a tunnel server. But for now this is only automatically choose.

In this topic FunkyFr3sh say:

Quote

Note: Servers are chosen automatically by CnCNet and are only used in case 2 players fail to establish a Peer-To-Peer connection.

I think it could be better to people can choose a tunnel server.

Edited by mohsen9010
  • Like 1
Link to comment
Share on other sites

14 hours ago, mohsen9010 said:

I'm not sure about RA1 game, but already for Tiberian Sun was a way to choose a tunnel server. But for now this is only automatically choose.

In this topic FunkyFr3sh say:

I think it could be better to people can choose a tunnel server.

Totally.  A tunnel server would be far superior than p2p.  There are so many games where all it takes is a bad conn between 2 players to lag everybody out.

Also being able to select a server would increase incentives for more people to host them.  I know they have official servers with high capacity already but why not utilise them fully?

Link to comment
Share on other sites

years ago it used to be like this, everyone could choose a server when they hosted a game but that didn't work out too well.

Imagine someone from Germany hosted a game (he would choose a server in Germany obviously), now 2 players from Australia join his game. What happens now is that Australia1 has to send the data to the German server, then the German server needs to send the data back to Australia2 and you end up with a round trip time of 800ms, it's going to be unplayable... The games can't handle more than 400ms latency.

Back then I tried to solve the problem by adding country flags to the game rooms to ensure players know that the server is too far away from them, I also tried to show warning messages to ensure they know that the game won't be playable like this, but everyone ignored it. The only way to make such a setup working is to hide games hosted on servers with too big distance, but that's a terrible solution (we can't really separate our small community like this..).

 

As a comparison, with our current setup there is no problem at all with 1 player from Germany and 2 players from Australia. The round trip time will be 400ms only since that's the time from Germany to Australia while the 2 players from Australia will connect directly to each other with just 50ms latency rather than 800ms as explained in the example above.

 

Link to comment
Share on other sites

23 hours ago, FunkyFr3sh said:

years ago it used to be like this, everyone could choose a server when they hosted a game but that didn't work out too well.

Imagine someone from Germany hosted a game (he would choose a server in Germany obviously), now 2 players from Australia join his game. What happens now is that Australia1 has to send the data to the German server, then the German server needs to send the data back to Australia2 and you end up with a round trip time of 800ms, it's going to be unplayable... The games can't handle more than 400ms latency.

Back then I tried to solve the problem by adding country flags to the game rooms to ensure players know that the server is too far away from them, I also tried to show warning messages to ensure they know that the game won't be playable like this, but everyone ignored it. The only way to make such a setup working is to hide games hosted on servers with too big distance, but that's a terrible solution (we can't really separate our small community like this..).

 

As a comparison, with our current setup there is no problem at all with 1 player from Germany and 2 players from Australia. The round trip time will be 400ms only since that's the time from Germany to Australia while the 2 players from Australia will connect directly to each other with just 50ms latency rather than 800ms as explained in the example above.

 

Thanks.

 

I guess servers would only make sense for a higher player count to justify having regions, i.e EU, NA, ASIA etc.   My reasoning was that if they connected to a server then it didn't matter so much if you had 8 players from say... UK, Germany, Australia, North America etc.  As they will connect to one central server.  But I suppose with p2p they will connect to one host anyways.  It's just that it's a shame when you have a few players with good internet and it just takes 2 other people, like UK and Russia to have a bad connection that will lag everybody.

It is amazing the work you have done to revive this game.  I used to play on xwis all the time back in the day and the CnCnet client is something really amazing.  

Where do you see the future of CnCnet?  Also what is the best way to help contribute the project and community?

Link to comment
Share on other sites

On 5/18/2019 at 7:53 PM, FunkyFr3sh said:

years ago it used to be like this, everyone could choose a server when they hosted a game but that didn't work out too well.

Imagine someone from Germany hosted a game (he would choose a server in Germany obviously), now 2 players from Australia join his game. What happens now is that Australia1 has to send the data to the German server, then the German server needs to send the data back to Australia2 and you end up with a round trip time of 800ms, it's going to be unplayable... The games can't handle more than 400ms latency.

Back then I tried to solve the problem by adding country flags to the game rooms to ensure players know that the server is too far away from them, I also tried to show warning messages to ensure they know that the game won't be playable like this, but everyone ignored it. The only way to make such a setup working is to hide games hosted on servers with too big distance, but that's a terrible solution (we can't really separate our small community like this..). 

  

As a comparison, with our current setup there is no problem at all with 1 player from Germany and 2 players from Australia. The round trip time will be 400ms only since that's the time from Germany to Australia while the 2 players from Australia will connect directly to each other with just 50ms latency rather than 800ms as explained in the example above. 

  

Be better to show ping instead of country flags of tunnel servers. (like Valve servers)

I think instead of main tunneling, We should have combination of p2p and main tunneling.

What is that?

That mean just one player that have bad connections can choose a tunnel server to connect other people p2p (but by the tunnel server).

Every client can choose a tunnel server to be main host or connect to other games.

It's like a VPN for a client... .And every client can choose a p2p tunnel server or direct connection.

We tested this way already and it's a good idea for bad connection people.

Edited by peylight
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...