forked from github-mirrorer/quake-kube
Adapt code to urban terror
This commit is contained in:
@ -4,16 +4,16 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/criticalstack/quake-kube/pkg/extensions"
|
||||
"net/url"
|
||||
// "net/url"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
quakeclient "github.com/criticalstack/quake-kube/internal/quake/client"
|
||||
"github.com/criticalstack/quake-kube/internal/quake/content"
|
||||
// "github.com/criticalstack/quake-kube/internal/quake/content"
|
||||
quakeserver "github.com/criticalstack/quake-kube/internal/quake/server"
|
||||
httputil "github.com/criticalstack/quake-kube/internal/util/net/http"
|
||||
// httputil "github.com/criticalstack/quake-kube/internal/util/net/http"
|
||||
"github.com/criticalstack/quake-kube/public"
|
||||
)
|
||||
|
||||
@ -37,22 +37,22 @@ func NewCommand() *cobra.Command {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
csurl, err := url.Parse(opts.ContentServer)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// csurl, err := url.Parse(opts.ContentServer)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
if !opts.AcceptEula {
|
||||
fmt.Println(quakeserver.Q3DemoEULA)
|
||||
return errors.New("You must agree to the EULA to continue")
|
||||
}
|
||||
if err := httputil.GetUntil(opts.ContentServer, ctx.Done()); err != nil {
|
||||
return err
|
||||
}
|
||||
// if err := httputil.GetUntil(opts.ContentServer, ctx.Done()); err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
||||
// TODO(chrism): only download what is in map config
|
||||
if err := content.CopyAssets(csurl, opts.AssetsDir); err != nil {
|
||||
return err
|
||||
}
|
||||
// if err := content.CopyAssets(csurl, opts.AssetsDir); err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
||||
go func() {
|
||||
s := quakeserver.Server{
|
||||
|
||||
Reference in New Issue
Block a user