English [RELEASE] Custom CS2D Server a0.1

79 replies
Goto Page
To the start Previous 1 2 3 4 Next To the start
31.10.10 06:19:03 pm
Up
kNedLiik
User
Offline Off
Night Till Death me too ...
IMG:http://i52.tinypic.com/14nk75z.png
IMG:http://img263.imageshack.us/img263/3100/userbar828775.gif
31.10.10 08:45:01 pm
Up
Jermuk
User
Offline Off
@ Everyone who can't start this server:
This is the source code and you have to compile it. Don't ask here until you can tell me exactly errors. And just btw: This is a alpha version. The version for noobs will come out when the server reaches the beta status.
01.11.10 02:18:55 am
Up
FlooD
GAME BANNED
Offline Off
here's my latest stuff + binaries (as of 10/31/10) WITH lag compensation:
http://www.mediafire.com/?i70yv7q058d9jj3
edited 2×, last 01.11.10 04:21:46 am
:(){ :|:& };: http://github.com/floood
01.11.10 11:25:44 am
Up
Jermuk
User
Offline Off
Ok, the newest version with exe is out.
With a working lag compensation!
01.11.10 08:22:24 pm
Up
FlooD
GAME BANNED
Offline Off
is it just me or is server.cfg useless...
:(){ :|:& };: http://github.com/floood
01.11.10 08:53:21 pm
Up
kNedLiik
User
Offline Off
Wow I can make server with it now ! nice one Jermuk and FlooD . When It will be playable cause now it is saying This is alpha version ! Don't play at it!
IMG:http://i52.tinypic.com/14nk75z.png
IMG:http://img263.imageshack.us/img263/3100/userbar828775.gif
01.11.10 09:07:04 pm
Up
Lee
Moderator
Offline Off
FlooD has written:
is it just me or is server.cfg useless...


is it? I only took a look at the interface and it seems that if you don't specify a value for a certain field, it defaults to the values that were coded into the server.
02.11.10 12:15:35 am
Up
FlooD
GAME BANNED
Offline Off
btw jermuk's code for main.c screws up the fps cuz the sleep function is inside an else loop

idk whether he did this accidentally or not

question:
Code:
1
if (FD_ISSET(readsocket, &descriptor))

that means if a packet is received?
:(){ :|:& };: http://github.com/floood
02.11.10 01:18:57 am
Up
SANTER
User
Offline Off
how can i do work this ? with what cs2d and where put it into of what ?

im very confused o.O
03.11.10 04:18:47 pm
Up
Jermuk
User
Offline Off
FlooD has written:
btw jermuk's code for main.c screws up the fps cuz the sleep function is inside an else loop

idk whether he did this accidentally or not

question:
Code:
1
if (FD_ISSET(readsocket, &descriptor))

that means if a packet is received?


1) Fixed with new version
2) yes

@All:
New version out! Added now leegoa's rcon_pw and my non-working drop.
03.11.10 10:35:47 pm
Up
FlooD
GAME BANNED
Offline Off
so currently the server can process only one packet per frame??

maybe that's why it lags when i set fps to 50 and start jamming keys in cs2d.

if i am wrong then just ignore what i write below

my idea:

current loop:
(stuff repeated every frame, including updatebuffer)
if (received packet)
....(packet stuff)
(sleep)
// one loop corresponds to one frame

loop for multiple packets per frame:
if (received packet)
....(packet stuff)
else
....(stuff repeated every frame)
....(sleep)
// one cycle of the else statement corresponds to one frame
:(){ :|:& };: http://github.com/floood
04.11.10 02:25:58 am
Up
Lee
Moderator
Offline Off
@Flood: The server blocks until a packet is received, so the else control can never be reached unless we explicitly ask the socket to timeout (this will cause players with high latency to randomly drop the connection with the server). If I remember correctly, a lot of other servers use socket selector to emulate pseudo concurrency for handling traffic. (A selector that returns a queue of pointers for read descriptors, write descriptors, and exceptions)
04.11.10 03:40:03 am
Up
FlooD
GAME BANNED
Offline Off
o.O
i tried it and the else control does get reached... i know because of !fps
:(){ :|:& };: http://github.com/floood
04.11.10 04:53:47 am
Up
Lee
Moderator
Offline Off
FlooD has written:
o.O
i tried it and the else control does get reached... i know because of !fps


are we actually using a nonblocking server?

Meh, I guess that makes sense seeing as we're handling multiple connections at the same time.
04.11.10 05:09:52 am
Up
FlooD
GAME BANNED
Offline Off
excuse me for my stupidity, but what is blocking?
my guess: delaying the processing of packets???
:(){ :|:& };: http://github.com/floood
04.11.10 12:20:51 pm
Up
-Skull_
User
Offline Off
I think it is disabling packet sending. But wait for lee reply.
IMG:http://i714.photobucket.com/albums/ww144/Skull_xr6/forum/sksig.png
04.11.10 12:52:31 pm
Up
DannyDeth
User
Offline Off
This seems to be a decent project So im going to try it out. I am no n00b when it comes to C either, my speciality is in sockets programming, so if you need help, I'm the man I'll get the source and see what it is like, it looks very interesting.
04.11.10 02:39:18 pm
Up
Jermuk
User
Offline Off
Well, we can use threads, but with them we have to rewrite many parts.
And I think we are using a non-blocking server (timeout is 0 (zero; not NULL)).

@DannyDeth:
If you want to help us, just contact me.
04.11.10 04:04:20 pm
Up
Lee
Moderator
Offline Off
Jermuk has written:
Well, we can use threads, but with them we have to rewrite many parts.
And I think we are using a non-blocking server (timeout is 0 (zero; not NULL)).


We don't necessarily need to write a dispatch in order to achieve concurrency, a proven technique to achieve concurrency within small timeouts can be written with the select() on the socket's IO descriptors (which apparently we're already using, God I need to read the source code more often)

http://www.codeproject.com/KB/IP/ScalableClientServer.aspx#premain3

At a higher level:
Code:
1
2
3
4
5
6
7
8
9
Socket server
fd_set {read, write, error} = select(server.fileDescriptor)
if server in read:
     // Handles incoming packets
     // Timeout
else if server in write:
     // Send out packets
else if error != 0:
     // Handle exceptions - Bad stream, send request for reconfirmation


Note that select does not block, so we can add in state updates before or after the selector.

Also, it's possible to implement a queue in order to process outgoing items. This way we can make sure that a socket is ready for writing as well as keeping track of corrupted packets (AKA, we requeue items that have not had a confirmation packet sent back to the server yet), this might be a necessity when we have live servers with lots of people playing. If I remember correctly from a profiler on the pre0104 server, we experienced less than 1% packet loss with fewer than 6 people while as high as 7% packet loss with over 12 people, the latter is very significant if we don't resend corrupted data.
04.11.10 05:47:58 pm
Up
Jermuk
User
Offline Off
@Lee Goa:
Yeah, I already thought about that. But at the beginning I was bored from this low level stuff and I wanted to start the server. Then I forgot it. And to tell the truth: My experience is not enough for such complicated socket handling (thats my first project with sockets). But if you want to implement it, i won't stop you
And btw the link is C++
To the start Previous 1 2 3 4 Next To the start