Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudkov committed Nov 2, 2023
1 parent b88dc9e commit d287467
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
7 changes: 3 additions & 4 deletions cmd/goatak_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,9 @@ func (app *App) cleanOldUnits() {
func (app *App) SendBroadcast(msg *cot.CotMessage) {
app.ForAllClients(func(ch client.ClientHandler) bool {
if ch.GetName() != msg.From {
return true
}
if err := ch.SendMsg(msg); err != nil {
app.Logger.Errorf("error sending to %s: %v", ch.GetName(), err)
if err := ch.SendMsg(msg); err != nil {
app.Logger.Errorf("error sending to %s: %v", ch.GetName(), err)
}
}
return true
})
Expand Down
2 changes: 1 addition & 1 deletion cmd/goatak_server/processors.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (app *App) AddEventProcessor(name string, cb func(msg *cot.CotMessage), mas

func (app *App) InitMessageProcessors() {
app.AddEventProcessor("remove", app.removeItemProcessor, "t-x-d-d")
app.AddEventProcessor("chat", app.chatProcessor, "b-t-f-")
app.AddEventProcessor("chat", app.chatProcessor, "b-t-f")
app.AddEventProcessor("items", app.saveItemProcessor, "a-", "b-")
app.AddEventProcessor("logger", app.loggerProcessor, ".-")
if app.config.logging {
Expand Down
5 changes: 2 additions & 3 deletions cmd/webclient/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,11 @@ func (app *App) sendMyPoints() {
}

func getVersion() string {
res := gitRevision
if gitBranch != "master" && gitBranch != "unknowm" {
res = gitBranch + ":" + res
return fmt.Sprintf("%s:%s", gitBranch, gitRevision)
}

return res
return gitRevision
}

func main() {
Expand Down
7 changes: 6 additions & 1 deletion cmd/webclient/processors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ func (app *App) AddEventProcessor(name string, cb func(msg *cot.CotMessage), mas

func (app *App) InitMessageProcessors() {
app.AddEventProcessor("remove", app.removeItemProcessor, "t-x-d-d")
app.AddEventProcessor("chat", app.chatProcessor, "b-t-f-")
app.AddEventProcessor("chat", app.chatProcessor, "b-t-f")
app.AddEventProcessor("chat_r", app.chatReceiptProcessor, "b-t-f-")
app.AddEventProcessor("items", app.saveItemProcessor, "a-", "b-")
app.AddEventProcessor("logger", app.loggerProcessor, ".-")

Expand Down Expand Up @@ -83,6 +84,10 @@ func (app *App) chatProcessor(msg *cot.CotMessage) {
app.messages.Add(c)
}

func (app *App) chatReceiptProcessor(msg *cot.CotMessage) {

}

func (app *App) saveItemProcessor(msg *cot.CotMessage) {
if cot.MatchPattern(msg.GetType(), "b-t-f-") {
return
Expand Down

0 comments on commit d287467

Please sign in to comment.