Skip to content

Commit

Permalink
number of lines for the list command.
Browse files Browse the repository at this point in the history
  • Loading branch information
schwarzlichtbezirk committed Sep 26, 2024
1 parent 4e021d2 commit 8bc0f31
Show file tree
Hide file tree
Showing 41 changed files with 166 additions and 124 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Slots games server. Provides functionality for Megajack, Novomatic, NetEnt, BetS

# How to build from sources

*Note: you can download the compiled binaries for Windows at [release](https://github.com/slotopol/server/releases/latest) section, or build docker image by [dockerfile](https://github.com/slotopol/server/blob/main/Dockerfile).*

1. Install [Golang](https://go.dev/dl/) of last version.
2. Clone project and download dependencies.
3. Build project with script at `task` directory.
Expand Down Expand Up @@ -37,7 +39,7 @@ Then web-service can be started:
slot_win_x64 web
```

You can get the list of all provided games by command:
The list of all provided games can be obtained by command:

```cmd
slot_win_x64 list --all
Expand Down Expand Up @@ -71,10 +73,10 @@ First of all you can get a list of games supported by server. This call can be w
curl -X GET localhost:8080/gamelist
```

Response has array with available algorithms descriptions. Each structure has a list of games aliases, that shares one algorithm. Field `rtplist` has the list of reels with predefined RTP. There is example of structure with info:
Response has array with available algorithms descriptions. Each structure has a list of games aliases, that shares one algorithm. Field `rtp` has the list of reels with predefined RTP. There is example of structure with info:

```json
{"aliases":[{"id":"trolls","name":"Trolls"},{"id":"excalibur","name":"Excalibur"},{"id":"pandorasbox","name":"Pandora's Box"},{"id":"wildwitches","name":"Wild Witches"}],"provider":"NetEnt","scrnx":5,"scrny":3,"rtplist":[87.788791,89.230191,93.903358,95.183523,96.6485,98.193276,110.298257,91.925079,93.061471,101.929305]}
{"aliases":[{"id":"trolls","name":"Trolls"},{"id":"excalibur","name":"Excalibur"},{"id":"pandorasbox","name":"Pandora's Box"},{"id":"wildwitches","name":"Wild Witches"}],"provider":"NetEnt","sx":5,"sy":3,"ln":20,"rtp":[87.788791,89.230191,93.903358,95.183523,96.6485,98.193276,110.298257,91.925079,93.061471,101.929305]}
```

`/ping`, `/servinfo` and `/memusage`, `/signis`, `/sendcode`, `/activate`, `/signup` and `/signin` endpoints also does not expects authorization.
Expand Down
14 changes: 8 additions & 6 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@ var listCmd = &cobra.Command{
alg++
for _, ga := range gi.Aliases {
var rtpinfo string
if fRTP && len(gi.RtpList) > 0 {
var rtpstr = make([]string, len(gi.RtpList))
for i, rtp := range gi.RtpList {
if fRTP && len(gi.RTP) > 0 {
var rtpstr = make([]string, len(gi.RTP))
for i, rtp := range gi.RTP {
rtpstr[i] = fmt.Sprintf("%.2f", rtp)
}
rtpinfo = ", RTP: " + strings.Join(rtpstr, ", ")
}
if gi.ScrnY > 0 {
gamelist[i] = fmt.Sprintf("'%s' %s %dx%d videoslot%s", ga.Name, gi.Provider, gi.ScrnX, gi.ScrnY, rtpinfo)
if gi.LN > 100 {
gamelist[i] = fmt.Sprintf("'%s' %s %dx%d videoslot, %d ways%s", ga.Name, gi.Provider, gi.SX, gi.SY, gi.LN, rtpinfo)
} else if gi.SY > 0 {
gamelist[i] = fmt.Sprintf("'%s' %s %dx%d videoslot, %d lines%s", ga.Name, gi.Provider, gi.SX, gi.SY, gi.LN, rtpinfo)
} else {
gamelist[i] = fmt.Sprintf("'%s' %s %d spots lottery%s", ga.Name, gi.Provider, gi.ScrnX, rtpinfo)
gamelist[i] = fmt.Sprintf("'%s' %s %d spots lottery%s", ga.Name, gi.Provider, gi.SX, rtpinfo)
}
i++
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func init() {

for _, gi := range links.GameList {
for _, ga := range gi.Aliases {
scanflags.Bool(ga.ID, false, fmt.Sprintf("'%s' %s %dx%d videoslot", ga.Name, gi.Provider, gi.ScrnX, gi.ScrnY))
scanflags.Bool(ga.ID, false, fmt.Sprintf("'%s' %s %dx%d videoslot", ga.Name, gi.Provider, gi.SX, gi.SY))
}
}
for _, setter := range links.FlagsSetters {
Expand Down
7 changes: 4 additions & 3 deletions config/links/2millionbc_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "2millionbc", Name: "2 Million B.C."},
},
Provider: "BetSoft",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 30,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/alwayshot_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "alwayshot", Name: "Always Hot"},
},
Provider: "Novomatic",
ScrnX: 3,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 3,
SY: 3,
LN: 5,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/americankeno_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "americankeno", Name: "American Keno"},
},
Provider: "Aristocrat",
ScrnX: 80,
ScrnY: 0,
RtpList: []float64{89.250235},
SX: 80,
SY: 0,
LN: 0,
RTP: []float64{89.250235},
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/arabiannights_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "arabiannights", Name: "Arabian Nights"},
},
Provider: "NetEnt",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 10,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/atthemovies_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "atthemovies", Name: "At the Movies"},
},
Provider: "BetSoft",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 25,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/bananasgobahamas_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "bananasgobahamas", Name: "Bananas Go Bahamas"},
},
Provider: "Novomatic",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 10,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/beetlemania_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ func init() {
{ID: "hottarget", Name: "Hot Target"},
},
Provider: "Novomatic",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 10,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/captainstreasure_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "captainstreasure", Name: "Captain's Treasure"},
},
Provider: "Playtech",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 9,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/champagne_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "champagne", Name: "Champagne"},
},
Provider: "Megajack",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 21,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/chicago_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "chicago", Name: "Chicago"},
},
Provider: "Novomatic",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 20,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/columbus_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ func init() {
{ID: "marcopolo", Name: "Marco Polo"},
},
Provider: "Novomatic",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 10,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/copsnrobbers_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "copsnrobbers", Name: "Cops'n'Robbers"},
},
Provider: "Play'n GO",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 9,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/deserttreasure_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "deserttreasure", Name: "Desert Treasure"},
},
Provider: "Playtech",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 9,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/diamonddogs_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ func init() {
{ID: "voodoovibes", Name: "Voodoo Vibes"},
},
Provider: "NetEnt",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 25,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/dolphinspearl_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ func init() {
{ID: "unicornmagic", Name: "Unicorn Magic"},
},
Provider: "Novomatic",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 10,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/firejoker_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "firejoker", Name: "Fire Joker"},
},
Provider: "Play'n GO",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 5,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/firekeno_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "firekeno", Name: "Fire Keno"},
},
Provider: "Slotopol",
ScrnX: 80,
ScrnY: 0,
RtpList: []float64{92.028857},
SX: 80,
SY: 0,
LN: 0,
RTP: []float64{92.028857},
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/fortuneteller_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "fortuneteller", Name: "Fortune Teller"},
},
Provider: "Play'n GO",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 20,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/goldentour_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "goldentour", Name: "Golden Tour"},
},
Provider: "Playtech",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 5,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/greatblue_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ func init() {
{ID: "irishluck", Name: "Irish Luck"}, // see: https://freeslotshub.com/playtech/irish-luck/
},
Provider: "Playtech",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 30,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/indiandreaming_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "indiandreaming", Name: "Indian Dreaming"},
},
Provider: "Aristocrat",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 243,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/jewels4all_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "jewels4all", Name: "Jewels 4 All"},
},
Provider: "Novomatic",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ChanceMap),
SX: 5,
SY: 3,
LN: 10,
RTP: MakeRtpList(slot.ChanceMap),
}
GameList = append(GameList, gi)

Expand Down
7 changes: 4 additions & 3 deletions config/links/jewels_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func init() {
{ID: "jewels", Name: "Jewels"},
},
Provider: "Novomatic",
ScrnX: 5,
ScrnY: 3,
RtpList: MakeRtpList(slot.ReelsMap),
SX: 5,
SY: 3,
LN: 10,
RTP: MakeRtpList(slot.ReelsMap),
}
GameList = append(GameList, gi)

Expand Down
Loading

0 comments on commit 8bc0f31

Please sign in to comment.