English Join Process Tasks

6 replies
Goto Page
To the start Previous 1 Next To the start
03.07.21 08:12:12 pm
Up
Mami Tomoe
User
Offline Off
Hello, what is the task order for the join process of a player?

This is how much I currently know:

> Name and other data
> U.S.G.N. verification
> Transfer List
> cs2d lua hook connect
> Spray transfer
> cs2d lua hook join

I would be grateful if anyone can assist me in completing the list.
fish
04.07.21 09:09:11 am
Up
The Dark Shadow
User
Offline Off
Like that?
> name; <type_$>
> ip; <type_i>
> port; <type_s>
> usgnid; <type_l>
> usgnname; <type_$>
> usgncountry; <type_$>
> usgnmode; <type_i>
> steamid; <type_l>
> steamname; <type_$>
> steamcountry;<type_$>
> steamos; <type_i>
...and 1000+ more. Do you want all others? Everything that the server requests? Or what exactly you want? Can you explain it more fluently?
edited 1×, last 04.07.21 09:41:14 am
04.07.21 09:44:34 am
Up
Mami Tomoe
User
Offline Off
Similar to what I said.

The order of which the data types are being sent from the client to the server plus when the hooks are called.
fish
27.07.21 07:29:35 pm
Up
DC
Admin
Offline Off
Sorry for the late response. The join process is quite ugly and complex and I really don't like looking into its code...

Here's a rough list of steps (server side):

• send/receive/check auth code stuff (a poor verification that it's a real client)
• send basic data (name, pw, cl version, USGN, Steam, some settings, ...). This is also the step where joining players are declined by the server e.g. because there's no space or the password is missing/wrong
• optional: U.S.G.N. login verification
• map checksum check and optional map- & file transfer
• post file transfer checks, send additional data (server settings and all other server data e.g. dynamic objects, projectiles, hostages, spraylogos etc.), invoke cs2d lua hook connect hook
• when client confirms that the map was loaded and all data was received: invoke cs2d lua hook join hook

The cs2d lua hook connect is only executed with the very last step (when all data is sent or better: scheduled to be sent).
If a player fails to connect beforehand, no hook is invoked as far as I see. So actually the hook description seems to be a bit misleading. It's still true however that the player did not yet receive/process all required data to fully join (but all data was sent to the player).
I corrected the documentation of that hook.

The cs2d lua hook join hook is called directly after the cs2d lua hook connect hook. The only difference is that the player then already confirmed that it received all data and loaded the map. In real world scenarios there shouldn't be much time between the invocation of both hooks because both are invoked only after file transfers (which take the most time when joining a server). If the client is slow however and takes long to load the server data and/or the map there might be a bigger delay.

Spray transfer
I'm not 100% sure but it looks like spraylogo data propagation happens asynchronously and that not all other players instantly receive spray logo data of new players when those connect. Instead this probably happens over time with a short delay.

Spraylogos are always transferred as gray scale images and have just 32x32 pixels. That's exactly 32x32=1024 bytes. They are sent with (lossless) compression though so actual transfer size should be a bit smaller in most cases.
edited 2×, last 27.07.21 08:03:05 pm
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
27.07.21 07:35:24 pm
Up
Mami Tomoe
User
Offline Off
I see, then shouldn't there be a cs2d lua hook connect_attempt hook?
A hook that always gets called when a player begins a connection attempt.

This would be good because the leave hooks always get called, while the join hooks only get called on a successful connection.
fish
27.07.21 07:37:48 pm
Up
DC
Admin
Offline Off
It would be better, yes.
I will put it on the list.

edit: added usgn verification step and some spraylogo details to the above posts.
edited 1×, last 27.07.21 08:03:50 pm
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
27.07.21 08:08:21 pm
Up
Mami Tomoe
User
Offline Off
Thank you!
fish
To the start Previous 1 Next To the start