mirror of
https://github.com/cryptonote-social/csminer.git
synced 2024-10-26 05:57:11 +03:00
function for printing a single chat
This commit is contained in:
parent
4867187bcd
commit
02a96cc890
9
miner.go
9
miner.go
@ -160,7 +160,7 @@ func Mine(c *MinerConfig) error {
|
|||||||
u = client.UNAUTHENTICATED_USER_STRING + " (sent by you)"
|
u = client.UNAUTHENTICATED_USER_STRING + " (sent by you)"
|
||||||
crylog.Warn("Sending chat without authentication. Provide -wallet string with your user login to authenticate.")
|
crylog.Warn("Sending chat without authentication. Provide -wallet string with your user login to authenticate.")
|
||||||
}
|
}
|
||||||
crylog.Info("\n\n[", u, "] (", time.Now().Truncate(time.Second), ")\n", chatMsg, "\n")
|
printChat(u, time.Now().Unix(), chatMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ func printStatsPeriodically() {
|
|||||||
for c := chat.NextChatReceived(); c != nil; c = chat.NextChatReceived() {
|
for c := chat.NextChatReceived(); c != nil; c = chat.NextChatReceived() {
|
||||||
_, ok := chatsSent[c.ID]
|
_, ok := chatsSent[c.ID]
|
||||||
if !ok {
|
if !ok {
|
||||||
crylog.Info("\n\n[", c.Username, "] (", time.Unix(c.Timestamp, 0), ")\n", c.Message, "\n")
|
printChat(c.Username, c.Timestamp, c.Message)
|
||||||
} else {
|
} else {
|
||||||
crylog.Info("queued chat successfully sent")
|
crylog.Info("queued chat successfully sent")
|
||||||
}
|
}
|
||||||
@ -256,6 +256,11 @@ func printStatsPeriodically() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func printChat(unm string, ts int64, msg string) {
|
||||||
|
date := time.Unix(ts, 0).Format(time.RFC1123)
|
||||||
|
crylog.Info("\n\n[", unm, "] (", date, ")\n", msg, "\n")
|
||||||
|
}
|
||||||
|
|
||||||
func monitorMachineState(ch chan MachineState) {
|
func monitorMachineState(ch chan MachineState) {
|
||||||
for state := range ch {
|
for state := range ch {
|
||||||
switch state {
|
switch state {
|
||||||
|
Loading…
Reference in New Issue
Block a user