From 9eb9cf07263092356f86d04216b886ab4bcfdc43 Mon Sep 17 00:00:00 2001 From: mappu Date: Tue, 29 Nov 2016 20:07:19 +1300 Subject: [PATCH] set a default clientversion of 0.11 --- HubConnectionOptions.go | 6 ++++++ libnmdc.go | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/HubConnectionOptions.go b/HubConnectionOptions.go index f24e668..0cee9bd 100644 --- a/HubConnectionOptions.go +++ b/HubConnectionOptions.go @@ -17,6 +17,12 @@ type HubConnectionOptions struct { func (this *HubConnectionOptions) prepareConnection() *HubConnection { if this.Self.ClientTag == "" { this.Self.ClientTag = DEFAULT_CLIENT_TAG + this.Self.ClientVersion = DEFAULT_CLIENT_VERSION + } + + // Shouldn't be blank either + if this.Self.ClientVersion == "" { + this.Self.ClientVersion = "0" } hc := HubConnection{ diff --git a/libnmdc.go b/libnmdc.go index ee75c58..48709a2 100644 --- a/libnmdc.go +++ b/libnmdc.go @@ -9,10 +9,11 @@ import ( ) const ( - DEFAULT_CLIENT_TAG string = "libnmdc.go" - DEFAULT_HUB_NAME string = "(unknown)" - SEND_KEEPALIVE_EVERY time.Duration = 29 * time.Second - AUTO_RECONNECT_AFTER time.Duration = 30 * time.Second + DEFAULT_CLIENT_TAG string = "libnmdc.go" + DEFAULT_CLIENT_VERSION string = "0.11" + DEFAULT_HUB_NAME string = "(unknown)" + SEND_KEEPALIVE_EVERY time.Duration = 29 * time.Second + AUTO_RECONNECT_AFTER time.Duration = 30 * time.Second ) var rx_protocolMessage *regexp.Regexp