Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Kart-Public
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
KartKrew
Kart-Public
Commits
6e33b528
Commit
6e33b528
authored
Apr 07, 2021
by
Sal
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'discord-invite-fix' into 'master'
DRPC: Wait for join secret to be ready See merge request
!248
parents
977917e6
3f150fbe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
discord.c
src/discord.c
+15
-20
No files found.
src/discord.c
View file @
6e33b528
...
...
@@ -341,15 +341,14 @@ static void DRPC_GotServerIP(UINT32 address)
{
const
unsigned
char
*
p
=
(
const
unsigned
char
*
)
&
address
;
sprintf
(
self_ip
,
"%u.%u.%u.%u:%u"
,
p
[
0
],
p
[
1
],
p
[
2
],
p
[
3
],
current_port
);
DRPC_UpdatePresence
();
}
/*--------------------------------------------------
static const char *DRPC_GetServerIP(void)
Retrieves the IP address of the server that you're
connected to. Will attempt to use
curl
for getting your
own IP address
, if it's not yours
.
connected to. Will attempt to use
STUN
for getting your
own IP address.
--------------------------------------------------*/
static
const
char
*
DRPC_GetServerIP
(
void
)
{
...
...
@@ -442,6 +441,19 @@ void DRPC_UpdatePresence(void)
// Server info
if
(
netgame
)
{
if
(
cv_advertise
.
value
)
{
discordPresence
.
state
=
"Public"
;
}
else
{
discordPresence
.
state
=
"Private"
;
}
discordPresence
.
partyId
=
server_context
;
// Thanks, whoever gave us Mumble support, for implementing the EXACT thing Discord wanted for this field!
discordPresence
.
partySize
=
D_NumPlayers
();
// Players in server
discordPresence
.
partyMax
=
discordInfo
.
maxPlayers
;
// Max players
if
(
DRPC_InvitesAreAllowed
()
==
true
)
{
const
char
*
join
;
...
...
@@ -455,24 +467,7 @@ void DRPC_UpdatePresence(void)
joinSecretSet
=
true
;
}
else
{
return
;
}
}
if
(
cv_advertise
.
value
)
{
discordPresence
.
state
=
"Public"
;
}
else
{
discordPresence
.
state
=
"Private"
;
}
discordPresence
.
partyId
=
server_context
;
// Thanks, whoever gave us Mumble support, for implementing the EXACT thing Discord wanted for this field!
discordPresence
.
partySize
=
D_NumPlayers
();
// Players in server
discordPresence
.
partyMax
=
discordInfo
.
maxPlayers
;
// Max players
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment