Forum

> > CS2D > General > [Question] Server on Linux
Forums overviewCS2D overviewGeneral overviewLog in to reply

English [Question] Server on Linux

19 replies
To the start Previous 1 Next To the start

old [Question] Server on Linux

mrc
User Off Offline

Quote
Hi all,
I believe everyone here already knows the CS2D.com.br
Server, and they ask me why the server sometimes is
on and sometimes is off... Thats why I'm here...
I'm using the dediserver2.4 on Linux without graphic
interface, my sponsor (alphimedia) is the hoster and he
connect remotly to the server in USA to open the cs2d
server... But the servers just stay online when he is
"connected remotly" in the server, when he log-out the
server shutdown... Then I want to know how to let the
server online without remote acess connected!
If someone help, there will be more than 1 server and
they will be 24/7! So, please help who can...

Thx...

old Re: [Question] Server on Linux

DC
Admin Off Offline

Quote
google for init / init.d
you have to put a script in your init.d folder (or another init folder depending on the runlevel of the server) which automatically starts your cs2d application.

old Re: [Question] Server on Linux

Lee
Moderator Off Offline

Quote
screen -S dedi

a remote screen with PID.dedi will be created

type in python /dirOfServer/server.pyc (remember to set the permisions)

type in ctrl + a + d

that's how we had our server stay up 24/7

also, remember the kill command can be your friend ^^, make sure you reboot your system every so often tho.

ps: what core are your running? Fedora, CentOS?

old Re: [Question] Server on Linux

mrc
User Off Offline

Quote
leegao has written
screen -S dedi

a remote screen with PID.dedi will be created

type in python /dirOfServer/server.pyc (remember to set the permisions)

type in ctrl + a + d

that's how we had our server stay up 24/7

also, remember the kill command can be your friend ^^, make sure you reboot your system every so often tho.

ps: what core are your running? Fedora, CentOS?

screen dont work because this linux dont have graphic interface... It works 100% by manual commands (codes)...

old Re: [Question] Server on Linux

HW
User Off Offline

Quote
The screen command is just an abstract idea of getting several sessions within a single terminal, it has nothing to do with graphics at all (it doesn't come preinstalled with most distributions, though). But you are right, you don't necessarily need screen to do this stuff.
You also don't need to set any rights for the script if you explicitly say python filename.

old Re: [Question] Server on Linux

Lee
Moderator Off Offline

Quote
the server.pyc actually executes a few dependencies also in the directory. So yes, technically the server.pyc will run, it can't execute the rest of its dependencies without giving weapons.pyc or the like permisions first. (Especially if you're not running the service as root, for security reasons)

old Re: [Question] Server on Linux

Guest

Quote
@marcio, the cs2dedi server doesnt have a graphical user interface (GUI). and how HW said screen doesnt have one either.

@leegao: i think you have to start python in the folder where the cs2dedi server is, because (yes) it has to load all the other .pyc files (udp, weapons and map).

i simply created a cs2d account with the root account using yast.
uploaded all the needed files and folders (cs2d#1, cs2d#2 etc) per ftp. logged into the cs2d account per ssh using putty. then i started a screen session, started for every server a new 'window'. changed to the cs2dedi folders (cs2d#1, cs2d#2 etc) for every 'window'.
and then just used the command:
python server.pyc > log.log
which will also pipe the output into the log.log file. (sorry there is no logging function availabel yet).

this works perfectly fine for me and from time to time i restart the servers to keep the logfiles small.

btw. you may have noticed that the weapons file a simple .py file is, which means you can see and change the source code there. so if you want to make any weapons stronger or weaker just open the .py file with a simple text editor and you can change the damage of the different weapons.

unfortunately speed, frequency and all the other values wont affect the game because they're applied on the client side.

old Re: [Question] Server on Linux

Lee
Moderator Off Offline

Quote
hey error, can you show us how you handled the client-server interaction within your code? I believe it would be the handler() function in your code.

old Re: [Question] Server on Linux

Guest

Quote
@Marcio: well, i thought by the time people would find out anyway, but now you know it. Good Luck

@leegao: for questions about the source of the cs2dedi, i'd like to talk about it per email. If you want to, i'll contact you.
but believe me, the source of the cs2dedi is probably even worse than the cs2d b 0.1.0.0 source code (no multithreading, no MVC architecture, barely any comments)
you might wanna consider to contact TMK aswell, since he got the source of the next cs2dedi server.

old Re: [Question] Server on Linux

Lee
Moderator Off Offline

Quote
3rr0r has written
@Marcio: well, i thought by the time people would find out anyway, but now you know it. Good Luck

@leegao: for questions about the source of the cs2dedi, i'd like to talk about it per email. If you want to, i'll contact you.
but believe me, the source of the cs2dedi is probably even worse than the cs2d b 0.1.0.0 source code (no multithreading, no MVC architecture, barely any comments)
you might wanna consider to contact TMK aswell, since he got the source of the next cs2dedi server.


hehe, don't worry, I'm a farely unorganized coder myself ^^, anyways, I've sent a PM to you on cs2dg.rox.pl and I've already decompiled portions of the code to study. So far the networking seems farely straightforward, open up a udp connection, bind it, and listen for commands. But a few parts of the code seems to be missing after decompilation so I would love to take a look at the original code

ps: My email's at - Email address (only visible with login) -, or you can just contact me via cs2dg.rox.pl (PM xD, since ur almost never on :P)

pss: AJ says thnx

old Re: [Question] Server on Linux

mrc
User Off Offline

Quote
Hehe, I did it!
And the server is running with the Counter-Strike 1.6 weapons damage, I made the calcules for the weapons, and
they are super realistic, the people liked! Thanks all for the help, and if the dediserver with restart round release,
please tell me!

If someone want the "cs1.6 weapons damage" for the
cs2dedi I can send it!

edit2:
can someone tell me how to ban the "domain"?
77.180.
212.244.
85.144.
I want to ban all ips with this prefix...
he is hack and change the ip all the time to hack the server!
How do I to put in the banlist.txt?
edited 4×, last 18.04.08 03:28:37 pm

old Re: [Question] Server on Linux

Guest

Quote
Marcio has written
And the server is running with the Counter-Strike 1.6 weapons damage, I made the calcules for the weapons, and
they are super realistic


CS 1.6 have Hitboxes

CS 1.6 = Realistic?

old Re: [Question] Server on Linux

mrc
User Off Offline

Quote
Flying Lizard has written
@Marcio
you do know that when you block those IP ranges, thousands of players wont be able to join your servers?

Yes, but ban the same player 1x per minute sucks...
and I still want to know how to ban the domain...
edited 1×, last 18.04.08 07:38:32 pm

old Re: [Question] Server on Linux

Lee
Moderator Off Offline

Quote
look in the bb_udp.py code, for the first 2 function add a conditional statement to check if the first 3 digits are numbers or string (exception-caching should do the work here) if not, return the ip as is, else, continue with the rest of the code.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview