You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
package jin
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"server/call"
|
|
|
|
|
"server/config"
|
|
|
|
|
"server/modules/web/providers/base"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Sub struct {
|
|
|
|
|
Base *base.Base
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewSub(base *base.Base) {
|
|
|
|
|
base.Sub = &Sub{Base: base}
|
|
|
|
|
base.SubInitRouter = PG
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *Sub) Init() {
|
|
|
|
|
API = APITest
|
|
|
|
|
AgentMap = AgentMapTest
|
|
|
|
|
if config.GetBase().Release {
|
|
|
|
|
API = APIRlease
|
|
|
|
|
AgentMap = AgentMapRelease
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *Sub) EnterGame() string {
|
|
|
|
|
token := s.Base.EnterGameReq.Token
|
|
|
|
|
providerID := s.Base.EnterGameReq.ProviderID
|
|
|
|
|
gameID := s.Base.EnterGameReq.GameID
|
|
|
|
|
game := call.GetGameListByByID(providerID, gameID)
|
|
|
|
|
if game == nil {
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
format := "%v/%v/index.html?oid=%v&oa=%v&op=%v&sid=1&l=en&g=%v&ce=INR"
|
|
|
|
|
if !config.GetBase().Release {
|
|
|
|
|
format += "&isdbg=hxdebug"
|
|
|
|
|
}
|
|
|
|
|
url := fmt.Sprintf(format,
|
|
|
|
|
API, game.GameCode, AgentMap.MchId, AgentMap.Key, call.GetProviderUserToken(token), game.GameCode)
|
|
|
|
|
return url
|
|
|
|
|
}
|