Added uuid to message_id, and uiid params in command message reply
This commit is contained in:
23
README.md
23
README.md
@@ -3,15 +3,16 @@ A tool for testing xmpp servers load
|
||||
|
||||
## Environment variables
|
||||
|
||||
| Variable | Required | Default Value | Description |
|
||||
| ------------------------------------------------- | -------- | --------------------------------- | ---------------------------------------------- |
|
||||
| **Credentials:** |
|
||||
| |
|
||||
| CREDENTIALS_FILE_LOCATION | NO | input.json | Database username |
|
||||
| |
|
||||
| **GeneralOptions:** |
|
||||
| |
|
||||
| PRESENCE_STATUS_DELAY | NO | 120000000000 - 2 mins | Delay for online presence message loop |
|
||||
| COMMAND_REPLY_DELAY | NO | 10 sec | Delay for online presence message loop |
|
||||
| |
|
||||
| Variable | Required | Default Value | Description |
|
||||
| ------------------------------------------------- | -------- | --------------------------------- | -----------------------------------------------------------|
|
||||
| **Credentials:** |
|
||||
| |
|
||||
| CREDENTIALS_FILE_LOCATION | NO | input.json | Database username |
|
||||
| |
|
||||
| **GeneralOptions:** |
|
||||
| |
|
||||
| PRESENCE_STATUS_DELAY | NO | 2 min | Delay for online presence message loop |
|
||||
| COMMAND_REPLY_DELAY | NO | 10 sec | Delay for command message reply |
|
||||
| EXECUTE_SIGLE_STATUS_MESSAGE | NO | false | Send one presence stanza message for clients and terminate|
|
||||
| |
|
||||
|
||||
|
||||
1
go.mod
1
go.mod
@@ -6,6 +6,7 @@ require gosrc.io/xmpp v0.5.1
|
||||
|
||||
require (
|
||||
github.com/google/uuid v1.1.1 // indirect
|
||||
github.com/twinj/uuid v1.0.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 // indirect
|
||||
nhooyr.io/websocket v1.6.5 // indirect
|
||||
)
|
||||
|
||||
2
go.sum
2
go.sum
@@ -57,6 +57,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/twinj/uuid v1.0.0 h1:fzz7COZnDrXGTAOHGuUGYd6sG+JMq+AoE7+Jlu0przk=
|
||||
github.com/twinj/uuid v1.0.0/go.mod h1:mMgcE1RHFUFqe5AfiwlINXisXfDGro23fWdPUfOMjRY=
|
||||
github.com/twitchyliquid64/golang-asm v0.0.0-20190126203739-365674df15fc/go.mod h1:NoCfSFWosfqMqmmD7hApkirIK9ozpHjxRnRxs1l413A=
|
||||
go.coder.com/go-tools v0.0.0-20190317003359-0c6a35b74a16/go.mod h1:iKV5yK9t+J5nG9O3uF6KYdPEz3dyfMyB15MN1rbQ8Qw=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/twinj/uuid"
|
||||
appConfig "github.com/xmpploadtesting/config"
|
||||
"gosrc.io/xmpp"
|
||||
"gosrc.io/xmpp/stanza"
|
||||
@@ -278,9 +279,11 @@ func handleMessage(s xmpp.Sender, p stanza.Packet) {
|
||||
log.Printf("<%v> unable to unmarshal Command Meassage: %v", msg.To, msg.Body)
|
||||
}
|
||||
if len(commandMessageResponse.Responses) > 0 || len(commandMessage.Commands) > 0 {
|
||||
commandMessageResponse.Responses[0].UUID = commandMessage.Commands[0].UUID
|
||||
messageIDUUID := uuid.NewV4().String()
|
||||
commandMessageUUID := uuid.NewV4().String()
|
||||
commandMessageResponse.Responses[0].UUID = commandMessageUUID
|
||||
commandMessageResponse.PlayerID = commandMessage.Commands[0].Params.PlayerID
|
||||
commandMessageResponse.MessageID = commandMessage.MessageID
|
||||
commandMessageResponse.MessageID = messageIDUUID
|
||||
|
||||
} else {
|
||||
log.Printf("<%v> There are no commands inside command message : %v", msg.To, commandMessage)
|
||||
Reference in New Issue
Block a user