Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
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
Alchemy Viewer
Alchemy Viewer
Commits
00b2b60a
Commit
00b2b60a
authored
9 years ago
by
Rider Linden
Browse files
Options
Downloads
Patches
Plain Diff
Region debug console to coroutines.
parent
e9257f03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/llfloaterregiondebugconsole.cpp
+50
-0
50 additions, 0 deletions
indra/newview/llfloaterregiondebugconsole.cpp
indra/newview/llfloaterregiondebugconsole.h
+5
-1
5 additions, 1 deletion
indra/newview/llfloaterregiondebugconsole.h
with
55 additions
and
1 deletion
indra/newview/llfloaterregiondebugconsole.cpp
+
50
−
0
View file @
00b2b60a
...
...
@@ -35,6 +35,7 @@
#include
"lllineeditor.h"
#include
"lltexteditor.h"
#include
"llviewerregion.h"
#include
"llcorehttputil.h"
// Two versions of the sim console API are supported.
//
...
...
@@ -68,6 +69,7 @@ namespace
const
std
::
string
CONSOLE_NOT_SUPPORTED
(
"This region does not support the simulator console."
);
#if 0
// This responder handles the initial response. Unless error() is called
// we assume that the simulator has received our request. Error will be
// called if this request times out.
...
...
@@ -119,6 +121,7 @@ namespace
public:
LLTextEditor * mOutput;
};
#endif
// This handles responses for console commands sent via the asynchronous
// API.
...
...
@@ -202,26 +205,73 @@ void LLFloaterRegionDebugConsole::onInput(LLUICtrl* ctrl, const LLSD& param)
}
else
{
#if 1
LLSD
postData
=
LLSD
(
input
->
getText
());
LLCoreHttpUtil
::
HttpCoroutineAdapter
::
callbackHttpPost
(
url
,
postData
,
boost
::
bind
(
&
LLFloaterRegionDebugConsole
::
onConsoleSuccess
,
this
,
_1
),
boost
::
bind
(
&
LLFloaterRegionDebugConsole
::
onConsoleError
,
this
,
_1
));
#else
// Using SimConsole (deprecated)
LLHTTPClient
::
post
(
url
,
LLSD
(
input
->
getText
()),
new
ConsoleResponder
(
mOutput
));
#endif
}
}
else
{
#if 1
LLSD
postData
=
LLSD
(
input
->
getText
());
LLCoreHttpUtil
::
HttpCoroutineAdapter
::
callbackHttpPost
(
url
,
postData
,
NULL
,
boost
::
bind
(
&
LLFloaterRegionDebugConsole
::
onAsyncConsoleError
,
this
,
_1
));
#else
// Using SimConsoleAsync
LLHTTPClient
::
post
(
url
,
LLSD
(
input
->
getText
()),
new
AsyncConsoleResponder
);
#endif
}
mOutput
->
appendText
(
text
,
false
);
input
->
clear
();
}
void
LLFloaterRegionDebugConsole
::
onAsyncConsoleError
(
LLSD
result
)
{
LL_WARNS
(
"Console"
)
<<
UNABLE_TO_SEND_COMMAND
<<
LL_ENDL
;
sConsoleReplySignal
(
UNABLE_TO_SEND_COMMAND
);
}
void
LLFloaterRegionDebugConsole
::
onConsoleError
(
LLSD
result
)
{
LL_WARNS
(
"Console"
)
<<
UNABLE_TO_SEND_COMMAND
<<
LL_ENDL
;
if
(
mOutput
)
{
mOutput
->
appendText
(
UNABLE_TO_SEND_COMMAND
+
PROMPT
,
false
);
}
}
void
LLFloaterRegionDebugConsole
::
onConsoleSuccess
(
LLSD
result
)
{
if
(
mOutput
)
{
LLSD
response
=
result
;
if
(
response
.
isMap
()
&&
response
.
has
(
LLCoreHttpUtil
::
HttpCoroutineAdapter
::
HTTP_RESULTS_CONTENT
))
{
response
=
response
[
LLCoreHttpUtil
::
HttpCoroutineAdapter
::
HTTP_RESULTS_CONTENT
];
}
mOutput
->
appendText
(
response
.
asString
()
+
PROMPT
,
false
);
}
}
void
LLFloaterRegionDebugConsole
::
onReplyReceived
(
const
std
::
string
&
output
)
{
mOutput
->
appendText
(
output
+
PROMPT
,
false
);
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llfloaterregiondebugconsole.h
+
5
−
1
View file @
00b2b60a
...
...
@@ -38,7 +38,7 @@ class LLTextEditor;
typedef
boost
::
signals2
::
signal
<
void
(
const
std
::
string
&
output
)
>
console_reply_signal_t
;
class
LLFloaterRegionDebugConsole
:
public
LLFloater
,
public
LLHTTPClient
::
Responder
class
LLFloaterRegionDebugConsole
:
public
LLFloater
{
public:
LLFloaterRegionDebugConsole
(
LLSD
const
&
key
);
...
...
@@ -56,6 +56,10 @@ class LLFloaterRegionDebugConsole : public LLFloater, public LLHTTPClient::Respo
private:
void
onReplyReceived
(
const
std
::
string
&
output
);
void
onAsyncConsoleError
(
LLSD
result
);
void
onConsoleError
(
LLSD
result
);
void
onConsoleSuccess
(
LLSD
result
);
boost
::
signals2
::
connection
mReplySignalConnection
;
};
...
...
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