interceptor to pass payload
@@ -81,7 +81,7 @@ type Wrapper interface {
Distance(origin, destination Coordinate) int
FlightTime(origin, destination Coordinate, speed Speed, ships ShipsInfos) (secs, fuel int)
RegisterChatCallback(func(ChatMsg))
- RegisterHTMLInterceptor(func(method string, vals url.Values, pageHTML []byte))
+ RegisterHTMLInterceptor(func(method string, params, payload url.Values, pageHTML []byte))
GetSlots() Slots
// Planet or Moon functions
@@ -671,7 +671,7 @@ type OGame struct {
client *ogameClient
logger *log.Logger
chatCallbacks []func(msg ChatMsg)
- interceptorCallbacks []func(method string, vals url.Values, pageHTML []byte)
+ interceptorCallbacks []func(method string, params, payload url.Values, pageHTML []byte)
closeChatCh chan struct{}
chatConnected int32
chatRetry *ExponentialBackoff
@@ -1275,7 +1275,7 @@ func (b *OGame) postPageContent(vals, payload url.Values) ([]byte, error) {
go func() {
for _, fn := range b.interceptorCallbacks {
- fn("POST", vals, body)
+ fn("POST", vals, payload, body)
}
}()
@@ -1336,7 +1336,7 @@ func (b *OGame) getPageContent(vals url.Values) []byte {
go func() {
for _, fn := range b.interceptorCallbacks {
- fn("GET", vals, pageHTMLBytes)
+ fn("GET", vals, nil, pageHTMLBytes)
}
}()
@@ -4251,7 +4251,7 @@ func (b *OGame) RegisterChatCallback(fn func(msg ChatMsg)) {
b.chatCallbacks = append(b.chatCallbacks, fn)
}
-func (b *OGame) RegisterHTMLInterceptor(fn func(method string, vals url.Values, pageHTML []byte)) {
+func (b *OGame) RegisterHTMLInterceptor(fn func(method string, params, payload url.Values, pageHTML []byte)) {
b.interceptorCallbacks = append(b.interceptorCallbacks, fn)
}
