set a default clientversion of 0.11

This commit is contained in:
mappu 2016-11-29 20:07:19 +13:00
parent f2abf8893c
commit 9eb9cf0726
2 changed files with 11 additions and 4 deletions

View File

@ -17,6 +17,12 @@ type HubConnectionOptions struct {
func (this *HubConnectionOptions) prepareConnection() *HubConnection { func (this *HubConnectionOptions) prepareConnection() *HubConnection {
if this.Self.ClientTag == "" { if this.Self.ClientTag == "" {
this.Self.ClientTag = DEFAULT_CLIENT_TAG 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{ hc := HubConnection{

View File

@ -9,10 +9,11 @@ import (
) )
const ( const (
DEFAULT_CLIENT_TAG string = "libnmdc.go" DEFAULT_CLIENT_TAG string = "libnmdc.go"
DEFAULT_HUB_NAME string = "(unknown)" DEFAULT_CLIENT_VERSION string = "0.11"
SEND_KEEPALIVE_EVERY time.Duration = 29 * time.Second DEFAULT_HUB_NAME string = "(unknown)"
AUTO_RECONNECT_AFTER time.Duration = 30 * time.Second SEND_KEEPALIVE_EVERY time.Duration = 29 * time.Second
AUTO_RECONNECT_AFTER time.Duration = 30 * time.Second
) )
var rx_protocolMessage *regexp.Regexp var rx_protocolMessage *regexp.Regexp