The online racing simulator
Console Dedicated Host TEST4
(16 posts, closed, started )
Console Dedicated Host TEST4
Hello Hosters,

Here is the fourth test of the long requested console based dedicated host. The third test was done privately and has been running for some time on our own hosts. I can't remember any complaints, so I might as well release this one. I have not been working on this since January, so it's a bit hard to remember the changes, but I think these are the main things.

- There is more protection against hackers and more logging in the joining process. Network debug is enabled by default.

- When a player joins or leaves, some status information is output to the console, including which track is selected, a list of the connected user names and the time and date. You can also get one of those status messages any time by pressing ENTER without typing anything.

- It does not allow you to race with a skin that has not been uploaded to LFS World. This avoids some annoying issues. Some people do not like this change, but I still can't see a real problem with it. If you use a skin that is not uploaded, you will join the spectators and told that your skin was not found at LFS World.

NOTE : You can input text, but it is invisible while you type. This is to totally separate stdin and stdout which I believe can be quite helpful. I don't know much about this kind of thing but I think you can get your input from where you want and send the output where you want.

HOW TO USE : Save DCon.exe into a DEDI folder then you can run it as usual with a command line or a setup.cfg file.
Attached files
DCon_TEST4.zip - 363.2 KB - 382 views
Tested a bit, looks good

While connecting to host, I saw msgs in logs:

Mar 19 20:57:43 Accept : 192.168.0.32
Mar 19 20:57:43 Received 53 : 192.168.0.32
Mar 19 20:57:43 Host Auth : 192.168.0.32
Mar 19 20:57:43 Received 21 : 192.168.0.32
Mar 19 20:57:43 Send Track : 192.168.0.32
Mar 19 20:57:47 Received 13 : 192.168.0.32

What does 53,21,13 mean? (some packet IDs?)


Also I'd like to suggest one more thing on skins. Calculate checksum of skin to prevent different skins on LFSW and LFS. If your car doesnt have same skin as on LFSW then to warn you/spectate or smth, if checksums are not equal for other players then simply to redownload skin.
Sounds cool, especially hack protection. Will update CG servers later tonight when empty.

All other 0.6E serv(ers)ices (like [AA]) will follow when the test suffix disappears.
may be a decent update at most. but some people will still prefer to have there skins kept private. i'm all for the protection of hackers as you mention above. you also agree that people may not like the skin update regarding the force spec if the skin is not uploaded to lfsw but don't we as s2 users have the right to keep our skins private? i would suggest making it possible for a user to choose to have his skin downloadable or not. meaning it is uploaded to lfsw but the uploader can pick weather or not it can be downloaded into skin_x or skin_y folder. this is just my thoughts on it.
Quote from DANIEL-CRO :What does 53,21,13 mean? (some packet IDs?)

They are packet sizes. EDIT : In fact they are the number of bytes received from TCP using a call to recv. So it's not necessarily the size of individual complete packets, but usually will be a size byte followed by a packet whose size is a multiple of 4. I just did that so if someone mysteriously found another way through the joining process, then at least we'd know the size of the packets they used. The additional hacker protection in this one should eliminate users with zero user id or invalid user name after they have connected. That is if they can somehow get through the connection process, although I could not see how that was possible.

Quote from DANIEL-CRO :Also I'd like to suggest one more thing on skins. Calculate checksum of skin to prevent different skins on LFSW and LFS. If your car doesnt have same skin as on LFSW then to warn you/spectate or smth, if checksums are not equal for other players then simply to redownload skin.

There is (always has been) a file date check, so that if a skin is updated, then it will be re-downloaded.

Quote from 240sxdaniel89 :may be a decent update at most. but some people will still prefer to have there skins kept private. i'm all for the protection of hackers as you mention above. you also agree that people may not like the skin update regarding the force spec if the skin is not uploaded to lfsw but don't we as s2 users have the right to keep our skins private? i would suggest making it possible for a user to choose to have his skin downloadable or not. meaning it is uploaded to lfsw but the uploader can pick weather or not it can be downloaded into skin_x or skin_y folder. this is just my thoughts on it.

Well, the first thing I would say it does defy the purpose of a skin, which is to make your car look a certain way. But anyway, for those who want to look a certain way in their replays but do not want other people to have access to that skin, they can do something about that. Instead of what they would do in the past (which was to let everyone see a white car and some error messages) they could create a low res version of their skin and upload that. They could be a bit creative about it instead of just annoying people as they did in the past.
Thx for DEDI update...

Quote from Scawen :- It does not allow you to race with a skin that has not been uploaded to LFS World. This avoids some annoying issues. Some people do not like this change, but I still can't see a real problem with it. If you use a skin that is not uploaded, you will join the spectators and told that your skin was not found at LFS World.

Nice.
I'll post this here as i see there are some differences in the way host works(for example skins and connecting packets).

Yesterday when i was doing some tests with an Insim. I noticed that even when you are in the pits, you are still sending MCI packets (X and Y position values were 0, didn't have enough time to check the others). Is this neccesary? I know that the 'player' slot is still there unless you go to spectators, but if you are in pits, i believe there's no need to send more MCI info, so i guess this will make the bandwidth work a bit better as well if it gets removed.
Quote from Scawen :
There is (always has been) a file date check, so that if a skin is updated, then it will be re-downloaded.

The reason I'm suggesting this is, we had couple of times people asking to upload their skin and uploader would then change skin to some pink/ ... stuff For driver using that skin it would appear normal (as he requested to be uploaded), but everyone else would see pink skin
That's their own fault. Only demo-ers would need others to upload a skin which in the forum (at least) isn't permitted. Licenced users have plenty of skin upload slots, and buying more is extremely cheap.
i have server + insim mod
when i send

<?php 
/reinit
?>


from game to server - server is crashing in SIGSEGV

<?php 
сигнатура проблемы
:
APPCRASH
DCon
.exe
0.0.0.0 
app timestamp
:    50c22758
module name
:    DCon.exe
module ver
:    0.0.0.0
module crash timestamp
:    50c22758
Exeption code
:    c0000005
Address
:    000345cf
?>


I noticed that admins can have not uploaded skin to LFSW

Also other problem I encountered is that sometimes console input completly frezze when sending messages too fast using SendMessage() to consoles HWND. I know that this isn't right way to do it, but I'm lazy
Quote from denis-takumi :i have server + insim mod
when i send

<?php 
/reinit
?>


from game to server - server is crashing in SIGSEGV

I've tried to reproduce this in the latest version and also the same exe you used, but no crash. With a single admin connected I typed /reinit - can you reproduce this every time or just sometimes?.

Quote from DANIEL-CRO :I noticed that admins can have not uploaded skin to LFSW

I couldn't reproduce this either. I tried host and admins joining race with a non-uploaded skin and they were spectated.

Quote from DANIEL-CRO :Also other problem I encountered is that sometimes console input completly frezze when sending messages too fast using SendMessage() to consoles HWND. I know that this isn't right way to do it, but I'm lazy

I've got something to try for this, probably will release another test DCon in a day or two, also with a couple of fixes for these minor bugs you reported.
https://www.lfsforum.net/showt ... php?p=1768629#post1768629

The plan is to fix any remaining issues over a few days and release the result on the main site as the official version of the dedicated host.
Quote from Scawen :
I couldn't reproduce this either. I tried host and admins joining race with a non-uploaded skin and they were spectated.

Neither I can reproduce it now, I remember that I was connected as admin and joined race and got message Your skin was not found..., but no spec. After this I reconnected with no admin, and it was spectating me... weird


This code seems to frezze it imediately, and DEDI stop responding if I endlessly send "/reinit", but no crash.

#define SERVER_WINDOW_NAME "xxx - 0.6E"

HWND LFS;
void PostString(char *a)
{
int i=0;
char pr=0;
for(i=0;i<strlen(a);i++)
{
if(pr==a[i])
SendMessage(LFS, WM_CHAR, 0 , 0);
SendMessage(LFS, WM_CHAR, a[i] , 0);
pr=a[i];
}
SendMessage(LFS, WM_CHAR, 13, 0);
}
int main()
{
LFS = FindWindow(0 ,TEXT(SERVER_WINDOW_NAME));
for(;;Sleep(1))
{
if(!IsWindow(LFS)) break;
PostString("/cars xfg");
}
}

Quote from DANIEL-CRO :
This code seems to frezze it imediately, and DEDI stop responding if I endlessly send "/reinit", but no crash.

I can't reproduce this on Windows nor WINE no matter how fast I send the keys. Once the server processes the message queue, it resumes normal operation as far as I can tell...
Using a version of Daniel's code I was able to reproduce something that looked like a freeze followed by a definite crash, a stack overflow in the _kbhit function. I found out the _kbhit and _getch functions called a lot of Windows functions to replicate the old style conio functions. So I've simplified it, now just using GetStdHandle once then GetNumberOfConsoleInputEvents every frame and ReadConsoleInput whenever there are any to read. Seems to work smoothly now.
This thread is closed

Console Dedicated Host TEST4
(16 posts, closed, started )
FGED GREDG RDFGDR GSFDG