Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2P game networking through Steam Datagram Relay #384

Open
wants to merge 90 commits into
base: master
Choose a base branch
from
Open

Conversation

velzie
Copy link
Collaborator

@velzie velzie commented Jul 27, 2024

No description provided.

velzie and others added 30 commits April 15, 2024 17:15
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
@velzie velzie linked an issue Sep 4, 2024 that may be closed by this pull request
@velzie velzie marked this pull request as ready for review October 3, 2024 15:16
@velzie velzie requested a review from pollend October 3, 2024 15:16
Comment on lines +1148 to +1151
int i, num_max;
unsigned line_height;
int xoffset, yoffset = 0;
struct shader_s *pic;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to reuse variables?

Comment on lines +178 to +211
static void SV_P2P_NewConnection( void *self, struct steam_evt_pkt_s *evt )
{
struct p2p_new_connection_evt_s *p2p = &evt->p2p_new_connection;

// find a free slot
int free = -1;
for( int i = 0; i < MAX_INCOMING_CONNECTIONS; i++ ) {
if( !svs.incomingp2p[i].active ) {
free = i;
break;
}
}
if( free == -1 ) {
Com_Printf( "No free slot for P2P connection\n" );
return;
}
printf("New %i P2P connection from %llu\n", free, p2p->steamID);

incoming_t *inc = &svs.incomingp2p[free];
netadr_t address;
NET_InitAddress( &address, NA_SDR );
address.address.steamid = p2p->steamID;

inc->active = true;
inc->time = svs.realtime;
inc->address = address;

inc->socket.address = address;
inc->socket.type = SOCKET_SDR;
inc->socket.handle = p2p->handle;
inc->socket.server = true;
inc->socket.open = true;
inc->socket.connected = true;
}
Copy link
Collaborator

@pollend pollend Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fomatting is a bit funny. maybe change it to all to space or tabs looks.

Comment on lines +12 to +13
template <typename T>
static inline void write_packet( PipeType fd, const T *response, uint32_t size )
Copy link
Collaborator

@pollend pollend Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template might not be necessary? can you use a void pointer the type is not used for the body of the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Add Steam Data Relay
2 participants