Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
skylivex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
astronomy
skylivex
Commits
bd7ecd37
Commit
bd7ecd37
authored
Mar 28, 2013
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support to manage userlist on the protocol side
parent
04de2912
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
5 deletions
+87
-5
SkyliveX.js
gui/SkyliveX.js
+17
-0
maingui.html
gui/maingui.html
+21
-2
skproto.cpp
plugins/skproto.cpp
+47
-1
ipcmsg.h
src/ipcmsg.h
+2
-1
webwin.cpp
src/webwin.cpp
+0
-1
No files found.
gui/SkyliveX.js
View file @
bd7ecd37
...
...
@@ -29,9 +29,26 @@ skyliveClass.prototype.publicReceived = function(user, msg){
}
}
};
skyliveClass
.
prototype
.
userlistChange
=
function
(
action
,
u
){
if
(
typeof
(
userlist_change
)
==
"function"
)
{
userlist_change
(
action
,
u
);
}
else
{
switch
(
action
)
{
case
"new"
:
break
;
case
"add"
:
break
;
case
"del"
:
break
;
}
}
};
SkyliveXPage
=
new
skyliveClass
();
SkyliveX
.
changeContent
.
connect
(
SkyliveXPage
.
changeContent
);
SkyliveX
.
notify
.
connect
(
SkyliveXPage
.
notify
);
SkyliveX
.
alertmsg
.
connect
(
SkyliveXPage
.
msgalert
);
SkyliveX
.
public_received
.
connect
(
SkyliveXPage
.
publicReceived
);
SkyliveX
.
userlist_change
.
connect
(
SkyliveXPage
.
userlistChange
);
gui/maingui.html
View file @
bd7ecd37
...
...
@@ -75,7 +75,7 @@
</div>
<div
id=
"livearea"
>
<img
src=
"http://live1.skylive.name/tele1/live640.jpg"
></img>
<img
id=
"liveimg"
src=
"http://live1.skylive.name/tele1/live640.jpg"
></img>
</div>
<div
id=
"telescope"
>
...
...
@@ -83,7 +83,7 @@
</div>
<div
id=
"numteleselect"
>
<select
name=
"numtele"
onChange=
"SkyliveX.change_telescope(this.options[this.selectedIndex].value
);"
>
<select
id=
"telsel"
name=
"numtele"
onChange=
"SkyliveX.change_telescope(this.options[this.selectedIndex].value); updateLiveImage(
);"
>
<option
selected
>
1
</option>
<option>
2
</option>
<option>
3
</option>
...
...
@@ -92,9 +92,28 @@
</select>
</div>
<script
type=
"text/javascript"
>
function
showLiveImage
(
img
)
{
if
(
img
.
complete
)
{
document
.
getElementById
(
"liveimg"
).
src
=
img
.
src
;
}
else
{
setTimeout
(
function
(){
showLiveImage
(
img
);},
250
);
}
}
function
updateLiveImage
()
{
var
tele
=
document
.
getElementById
(
"numtele"
).
options
[
document
.
getElementById
(
"numtele"
).
selectedIndex
].
value
;
var
newImage
=
new
Image
();
newImage
.
src
=
"http://live1.skylive.name/tele"
+
tele
+
"live640.jpg?"
+
new
Date
().
getTime
();
}
document
.
addEventListener
(
'DOMContentLoaded'
,
function
(){
SkyliveX
.
open_window
(
"chatgui.html"
,
false
);
setTimeout
(
function
()
{
SkyliveX
.
resizeWin
(
636
,
420
);
},
500
);
setInterval
(
updateLiveImage
,
5000
);
});
</script>
</body>
...
...
plugins/skproto.cpp
View file @
bd7ecd37
...
...
@@ -39,7 +39,7 @@
#include <QTcpSocket>
#include <QByteArray>
#include <QtNetwork>
#include <QChar>
void
SkyliveProtocol
::
startPlugin
()
{
...
...
@@ -158,9 +158,55 @@ void SkyliveProtocol::processPackets()
else
if
(
pkt
.
cmd
==
"STATUS"
)
{
}
else
if
(
pkt
.
cmd
==
"CLIST"
)
{
SKMessage
pmsg
(
"userlist"
);
QList
<
QString
>
paramlist
=
pkt
.
params
.
split
(
PARAM_SEPARATOR
);
QList
<
QString
>
admins
;
QList
<
QString
>
enableds
;
QList
<
QString
>
users
;
for
(
int
i
=
0
;
i
<
paramlist
.
size
();
i
++
)
{
if
(
paramlist
[
i
].
length
()
>
2
)
{
if
(
paramlist
[
i
].
startsWith
(
"!"
))
admins
.
append
(
paramlist
[
i
].
remove
(
0
,
1
));
else
if
(
paramlist
[
i
].
startsWith
(
"@"
))
enableds
.
append
(
paramlist
[
i
].
remove
(
0
,
1
));
else
users
.
append
(
paramlist
[
i
].
remove
(
0
,
1
));
}
}
pmsg
.
listparams
.
insert
(
"admins"
,
admins
);
pmsg
.
listparams
.
insert
(
"enableds"
,
enableds
);
pmsg
.
listparams
.
insert
(
"users"
,
users
);
pmsg
.
parameters
.
insert
(
"type"
,
"all"
);
sendMessage
(
pmsg
);
}
else
if
(
pkt
.
cmd
==
"ULIST"
)
{
SKMessage
pmsg
(
"userlist"
);
QList
<
QString
>
paramlist
=
pkt
.
params
.
split
(
PARAM_SEPARATOR
);
if
(
paramlist
[
0
].
length
()
>
2
)
{
if
(
paramlist
[
1
]
==
"IN"
)
pmsg
.
parameters
.
insert
(
"type"
,
"in"
);
else
pmsg
.
parameters
.
insert
(
"type"
,
"out"
);
if
(
paramlist
[
0
].
startsWith
(
"!"
))
pmsg
.
parameters
.
insert
(
"usertype"
,
"admin"
);
else
if
(
paramlist
[
0
].
startsWith
(
"@"
))
pmsg
.
parameters
.
insert
(
"usertype"
,
"enabled"
);
else
pmsg
.
parameters
.
insert
(
"usertype"
,
"user"
);
pmsg
.
parameters
.
insert
(
"user"
,
paramlist
[
0
].
remove
(
0
,
1
));
sendMessage
(
pmsg
);
}
}
else
if
(
pkt
.
cmd
==
"ENABLE"
)
...
...
src/ipcmsg.h
View file @
bd7ecd37
...
...
@@ -44,7 +44,7 @@
#include <QTime>
#include <QHash>
#include <QString>
#include <QList>
// Forward declarations
class
SkylivexWin
;
...
...
@@ -68,6 +68,7 @@ class SKMessage
QString
handle
;
// the message type
SkylivexWin
*
webwin
;
// sometime we need to transport a qobject representing a WebView
QHash
<
QString
,
QString
>
parameters
;
// mixed parameters in form of hash
QHash
<
QString
,
QList
<
QString
>
>
listparams
;
// mixed parameters lists, when needed
SKMessage
(
QString
s
,
QString
h
,
QHash
<
QString
,
QString
>
p
);
SKMessage
(
QString
h
,
QHash
<
QString
,
QString
>
p
);
...
...
src/webwin.cpp
View file @
bd7ecd37
...
...
@@ -273,7 +273,6 @@ SkylivexWin::SkylivexWin(QString &htmlfile)
registerHandler
((
QString
)
"notify"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_notify
);
registerHandler
((
QString
)
"publicchatrcv"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_chatreceived
);
}
SkylivexWin
::
SkylivexWin
()
...
...
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