This several months i've been looking for networking framework beside UNet that easy to understand and easy to setup but powerful. I've come to Forge Networking after looking around. But it still lack of documentation. I've been waste many hours to understand how it works but i still can't create an easy lobby system.
Then i've come to TNET, Tasharen Networking that amazed me very much. I can create a lobby system in under 6 hours included reading the documentation that well written. And many more features that impressed me, that i will write it later.
So, how can i create my own server using VPS. First, download TNET package and unpacked it. Inside you will find TNServer.zip. Extract it inside your root project.
- Copy TNServer.exe to your VPS, in this case i use ubuntu in my vps.
- Install mono: apt-get install mono-complete
- Install nohup:
apt-get install nohup(this application will let you run program in the background while you close the session).
- Then run:
nohup mono TNServer.exe -name "myserver" -tcp 5127 -udp 5128 -udpLobby 5129 -service > cent.out 2> cen.err < /dev/null &This will run TNServer and threat it as a service.
You can see the log output at file cent.out
If your server running successfully you will have game server at port 5127(tcp), 5128(udp), 5129 (lobby).
Then you will need to open your port and allow connection. To do this just run:
iptables -A INPUT -p tcp --dport 5127 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp --dport 5128 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp --dport 5129 -m state --stateNEW,ESTABLISHED -j ACCEPT
You can see running listening port:
netstat -ntlp list all open tcp port
netstat -nulp list all open udc port
That's all now you will have your own server using TNET. Good job for tasharen developer. You only have tiny server file and can handle networking seamlessly. KUDOS!
Here is the asset store link: