Compare commits
1 Commits
main
...
change-log
| Author | SHA1 | Date | |
|---|---|---|---|
| c33b5c5df5 |
@@ -175,7 +175,7 @@ func Init() {
|
|||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
statusMesageDelay := int64(rand.Intn(appConfig.AppConfig.GeneralOptions.CommandReplyDelay))
|
statusMesageDelay := int64(rand.Intn(appConfig.AppConfig.GeneralOptions.CommandReplyDelay))
|
||||||
log.Printf("DELAYING FOR: %v", statusMesageDelay*1000000000)
|
log.Printf("Delaying client connection for: %v secconds", statusMesageDelay)
|
||||||
// Delay For two seccond to allow all clients to connect
|
// Delay For two seccond to allow all clients to connect
|
||||||
time.Sleep(time.Duration(statusMesageDelay * 1000000000))
|
time.Sleep(time.Duration(statusMesageDelay * 1000000000))
|
||||||
|
|
||||||
@@ -197,8 +197,6 @@ func Init() {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
}
|
}
|
||||||
// // Delay For two seccond to allow all clients to connect
|
|
||||||
// time.Sleep(time.Duration(2000000000))
|
|
||||||
// Wait untill all client connections are open sucessfuly
|
// Wait untill all client connections are open sucessfuly
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
@@ -208,7 +206,7 @@ func Init() {
|
|||||||
func SendOnlinePresenceStanza(client *xmpp.Client, jid string) error {
|
func SendOnlinePresenceStanza(client *xmpp.Client, jid string) error {
|
||||||
|
|
||||||
statusMesageDelay := int64(rand.Intn(appConfig.AppConfig.GeneralOptions.CommandReplyDelay))
|
statusMesageDelay := int64(rand.Intn(appConfig.AppConfig.GeneralOptions.CommandReplyDelay))
|
||||||
log.Printf("DELAYING FOR: %v", statusMesageDelay*1000000000)
|
log.Printf("Delaying online stanza presence message for: %v, secconds", statusMesageDelay*1000000000)
|
||||||
// Delay For two seccond to allow all clients to connect
|
// Delay For two seccond to allow all clients to connect
|
||||||
time.Sleep(time.Duration(statusMesageDelay * 1000000000))
|
time.Sleep(time.Duration(statusMesageDelay * 1000000000))
|
||||||
|
|
||||||
@@ -279,11 +277,11 @@ func handleMessage(s xmpp.Sender, p stanza.Packet) {
|
|||||||
log.Printf("<%v> unable to unmarshal Command Meassage: %v", msg.To, msg.Body)
|
log.Printf("<%v> unable to unmarshal Command Meassage: %v", msg.To, msg.Body)
|
||||||
}
|
}
|
||||||
if len(commandMessageResponse.Responses) > 0 || len(commandMessage.Commands) > 0 {
|
if len(commandMessageResponse.Responses) > 0 || len(commandMessage.Commands) > 0 {
|
||||||
messageIDUUID := uuid.NewV4().String()
|
// messageIDUUID := uuid.NewV4().String()
|
||||||
commandMessageUUID := uuid.NewV4().String()
|
commandMessageUUID := uuid.NewV4().String()
|
||||||
commandMessageResponse.Responses[0].UUID = commandMessageUUID
|
commandMessageResponse.Responses[0].UUID = commandMessageUUID
|
||||||
commandMessageResponse.PlayerID = commandMessage.Commands[0].Params.PlayerID
|
commandMessageResponse.PlayerID = commandMessage.Commands[0].Params.PlayerID
|
||||||
commandMessageResponse.MessageID = messageIDUUID
|
commandMessageResponse.MessageID = commandMessage.MessageID
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
log.Printf("<%v> There are no commands inside command message : %v", msg.To, commandMessage)
|
log.Printf("<%v> There are no commands inside command message : %v", msg.To, commandMessage)
|
||||||
|
|||||||
Reference in New Issue
Block a user