diff options
| author | Anton <anton@picapica> | 2019-02-14 21:53:06 +0400 |
|---|---|---|
| committer | Anton <anton@picapica> | 2019-02-14 21:53:06 +0400 |
| commit | c1856913ef78ceffc4766cd53686c86d0c314e3f (patch) | |
| tree | 6fe61431c6d8aab6c001551bd813e359f4219694 /pica-client/skynet.cpp | |
| parent | 130f4611430a348bd482ba5c8755a6e12e0f8eda (diff) | |
| download | pica-pica-c1856913ef78ceffc4766cd53686c86d0c314e3f.tar.gz pica-pica-c1856913ef78ceffc4766cd53686c86d0c314e3f.zip | |
pica-client: sending and receiving MULTILOGIN message
Diffstat (limited to 'pica-client/skynet.cpp')
| -rw-r--r-- | pica-client/skynet.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pica-client/skynet.cpp b/pica-client/skynet.cpp index e445963..cdf63c5 100644 --- a/pica-client/skynet.cpp +++ b/pica-client/skynet.cpp @@ -55,7 +55,8 @@ SkyNet::SkyNet() c2n_established_cb, c2n_failed_cb, c2n_closed_cb, - listener_error_cb + listener_error_cb, + multilogin_cb }; PICA_client_init(&cbs); @@ -185,7 +186,12 @@ void SkyNet::nodelink_failed(PICA_c2n *c2n, int error) emit LostSelfAwareness(); } - +void SkyNet::multilogin_event(time_t timestamp, const char *addr, uint16_t port) +{ + emit StatusMsg(QString("%3 Detected new login of your account at node %1:%2") + .arg(addr).arg(port).arg(QDateTime::fromTime_t(timestamp).toString("yyyy-MM-dd hh:mm:ss")), + true); +} void SkyNet::node_status_changed(Nodes::NodeRecord nr, bool alive) { @@ -1005,3 +1011,8 @@ void SkyNet::listener_error_cb(struct PICA_listener *lst, int errorcode) { } + +void SkyNet::multilogin_cb(time_t timestamp, void *addr_bin, const char *addr_str, uint16_t port) +{ + skynet->multilogin_event(timestamp, addr_str, port); +} |
