Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
JennaHuntsman
XDG Integration
Commits
b46b0724
Commit
b46b0724
authored
2 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Fixes
parent
3509c647
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/cmake/DiscordSDK.cmake
+1
-1
1 addition, 1 deletion
indra/cmake/DiscordSDK.cmake
indra/newview/aldiscordmanager.cpp
+18
-9
18 additions, 9 deletions
indra/newview/aldiscordmanager.cpp
indra/newview/aldiscordmanager.h
+4
-0
4 additions, 0 deletions
indra/newview/aldiscordmanager.h
with
23 additions
and
10 deletions
indra/cmake/DiscordSDK.cmake
+
1
−
1
View file @
b46b0724
...
@@ -33,7 +33,7 @@ if (USE_DISCORD)
...
@@ -33,7 +33,7 @@ if (USE_DISCORD)
endif
(
STANDALONE
)
endif
(
STANDALONE
)
if
(
DEFINED ENV{DISCORD_CLIENTID}
)
if
(
DEFINED ENV{DISCORD_CLIENTID}
)
set
(
DISCORD_CLIENTID $ENV{
SENTRY_DSN
} CACHE STRING
"Discord Client ID"
FORCE
)
set
(
DISCORD_CLIENTID $ENV{
DISCORD_CLIENTID
} CACHE STRING
"Discord Client ID"
FORCE
)
else
()
else
()
set
(
DISCORD_CLIENTID
""
CACHE STRING
"Discord Client ID"
)
set
(
DISCORD_CLIENTID
""
CACHE STRING
"Discord Client ID"
)
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
indra/newview/aldiscordmanager.cpp
+
18
−
9
View file @
b46b0724
...
@@ -119,10 +119,12 @@ void ALDiscordManager::init()
...
@@ -119,10 +119,12 @@ void ALDiscordManager::init()
});
});
LLEventPumps
::
instance
().
obtain
(
"mainloop"
).
listen
(
"ALDiscordManager"
,
boost
::
bind
(
&
ALDiscordManager
::
update
,
this
,
_1
));
LLEventPumps
::
instance
().
obtain
(
"mainloop"
).
listen
(
"ALDiscordManager"
,
boost
::
bind
(
&
ALDiscordManager
::
update
,
this
,
_1
));
mRegionChangeConnection
=
gAgent
.
addRegionChangedCallback
(
boost
::
bind
(
&
ALDiscordManager
::
onRegionChange
,
this
));
}
}
void
ALDiscordManager
::
shutdown
()
void
ALDiscordManager
::
shutdown
()
{
{
mRegionChangeConnection
.
disconnect
();
LLEventPumps
::
instance
().
obtain
(
"mainloop"
).
stopListening
(
"ALDiscordManager"
);
LLEventPumps
::
instance
().
obtain
(
"mainloop"
).
stopListening
(
"ALDiscordManager"
);
mDiscord
.
reset
();
mDiscord
.
reset
();
}
}
...
@@ -145,9 +147,25 @@ bool ALDiscordManager::update(const LLSD&)
...
@@ -145,9 +147,25 @@ bool ALDiscordManager::update(const LLSD&)
void
ALDiscordManager
::
onLoginCompleted
()
void
ALDiscordManager
::
onLoginCompleted
()
{
{
mLoggedInTime
=
LLDate
::
now
().
secondsSinceEpoch
();
mLoggedInTime
=
LLDate
::
now
().
secondsSinceEpoch
();
onRegionChange
();
updateActivity
();
updateActivity
();
}
}
void
ALDiscordManager
::
onRegionChange
()
{
if
(
gAgent
.
getRegionHost
()
!=
mCurrentHost
)
{
LLMessageSystem
*
msg
=
gMessageSystem
;
msg
->
newMessageFast
(
_PREHASH_RequestRegionInfo
);
msg
->
nextBlockFast
(
_PREHASH_AgentData
);
msg
->
addUUIDFast
(
_PREHASH_AgentID
,
gAgent
.
getID
());
msg
->
addUUIDFast
(
_PREHASH_SessionID
,
gAgent
.
getSessionID
());
gAgent
.
sendReliableMessage
();
mCurrentHost
=
gAgent
.
getRegionHost
();
}
}
void
ALDiscordManager
::
updateActivity
()
void
ALDiscordManager
::
updateActivity
()
{
{
LLViewerRegion
*
region
=
gAgent
.
getRegion
();
LLViewerRegion
*
region
=
gAgent
.
getRegion
();
...
@@ -216,15 +234,6 @@ void ALDiscordManager::updateActivity()
...
@@ -216,15 +234,6 @@ void ALDiscordManager::updateActivity()
{
{
activity
.
GetParty
().
GetSize
().
SetMaxSize
(
max_agents
);
activity
.
GetParty
().
GetSize
().
SetMaxSize
(
max_agents
);
}
}
else
{
LLMessageSystem
*
msg
=
gMessageSystem
;
msg
->
newMessageFast
(
_PREHASH_RequestRegionInfo
);
msg
->
nextBlockFast
(
_PREHASH_AgentData
);
msg
->
addUUIDFast
(
_PREHASH_AgentID
,
gAgent
.
getID
());
msg
->
addUUIDFast
(
_PREHASH_SessionID
,
gAgent
.
getSessionID
());
gAgent
.
sendReliableMessage
();
}
activity
.
GetParty
().
SetId
(
regionId
.
c_str
());
activity
.
GetParty
().
SetId
(
regionId
.
c_str
());
activity
.
GetParty
().
SetPrivacy
(
discord
::
ActivityPartyPrivacy
::
Public
);
activity
.
GetParty
().
SetPrivacy
(
discord
::
ActivityPartyPrivacy
::
Public
);
...
...
This diff is collapsed.
Click to expand it.
indra/newview/aldiscordmanager.h
+
4
−
0
View file @
b46b0724
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#define AL_DISCORDMANAGER_H
#define AL_DISCORDMANAGER_H
#include
"llsingleton.h"
#include
"llsingleton.h"
#include
"llhost.h"
#include
"discord.h"
#include
"discord.h"
...
@@ -45,9 +46,12 @@ class ALDiscordManager final
...
@@ -45,9 +46,12 @@ class ALDiscordManager final
private
:
private
:
void
onLoginCompleted
();
void
onLoginCompleted
();
void
onRegionChange
();
void
updateActivity
();
void
updateActivity
();
boost
::
signals2
::
connection
mRegionChangeConnection
;
std
::
unique_ptr
<
discord
::
Core
>
mDiscord
;
std
::
unique_ptr
<
discord
::
Core
>
mDiscord
;
LLHost
mCurrentHost
;
F64
mLoggedInTime
=
0.0
;
F64
mLoggedInTime
=
0.0
;
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment