Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TIbiaDataDocsV3.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ type GuildsOverviewResponseV3 struct {
// @Produce json
// @Param world path string true "The world" default(all) extensions(x-example=Antica)
// @Param category path string true "The category" default(experience) Enums(achievements, axefighting, charmpoints, clubfighting, distancefighting, experience, fishing, fistfighting, goshnarstaint, loyaltypoints, magiclevel, shielding, swordfighting, dromescore, bosspoints) extensions(x-example=fishing)
// @Param vocation path string true "The vocation" default(all) Enums(all, knights, paladins, sorcerers, druids) extensions(x-example=knights)
// @Param vocation path string true "The vocation" default(all) Enums(all, knights, paladins, sorcerers, druids, monks) extensions(x-example=knights)
// @Param page path int true "The current page" default(1) minimum(1) extensions(x-example=1)
// @Success 200 {object} HighscoresResponseV3
// @Router /v3/highscores/{world}/{category}/{vocation}/{page} [get]
Expand Down
3 changes: 3 additions & 0 deletions src/TibiaDataUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ func TibiaDataVocationValidator(vocation string) (string, string) {
case "druid", "druids":
vocationid = "5"
vocation = "druids"
case "monk", "monks":
vocationid = "6"
vocation = "monks"
default:
vocationid = "0"
vocation = "all"
Expand Down
3 changes: 3 additions & 0 deletions src/TibiaDataUtils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ func TestTibiaDataVocationValidator(t *testing.T) {
x, y = TibiaDataVocationValidator("druid")
assert.Equal(x, "druids")
assert.Equal(y, "5")
x, y = TibiaDataVocationValidator("monk")
assert.Equal(x, "monks")
assert.Equal(y, "6")
x, y = TibiaDataVocationValidator("")
assert.Equal(x, "all")
assert.Equal(y, "0")
Expand Down
20 changes: 11 additions & 9 deletions src/TibiaSpellsSpell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ func TestFindPerson(t *testing.T) {
assert.True(spell.HasSpellInformation)
assert.NotNil(spell.SpellInformation)
assert.Equal("exiva 'name'", spell.SpellInformation.Formula)
assert.Equal(4, len(spell.SpellInformation.Vocation))
assert.Equal(5, len(spell.SpellInformation.Vocation))
assert.Equal("Druid", spell.SpellInformation.Vocation[0])
assert.Equal("Knight", spell.SpellInformation.Vocation[1])
assert.Equal("Paladin", spell.SpellInformation.Vocation[2])
assert.Equal("Sorcerer", spell.SpellInformation.Vocation[3])
assert.Equal("Monk", spell.SpellInformation.Vocation[2])
assert.Equal("Paladin", spell.SpellInformation.Vocation[3])
assert.Equal("Sorcerer", spell.SpellInformation.Vocation[4])
assert.False(spell.SpellInformation.GroupAttack)
assert.False(spell.SpellInformation.GroupHealing)
assert.True(spell.SpellInformation.GroupSupport)
Expand All @@ -52,9 +53,9 @@ func TestFindPerson(t *testing.T) {
assert.Equal(8, spell.SpellInformation.Level)
assert.Equal(20, spell.SpellInformation.Mana)
assert.Equal(80, spell.SpellInformation.Price)
assert.Equal(12, len(spell.SpellInformation.City))
assert.Equal(13, len(spell.SpellInformation.City))
assert.Equal("Ab'Dendriel", spell.SpellInformation.City[0])
assert.Equal("Yalahar", spell.SpellInformation.City[11])
assert.Equal("Yalahar", spell.SpellInformation.City[12])
assert.False(spell.SpellInformation.Premium)
assert.False(spell.HasRuneInformation)
}
Expand Down Expand Up @@ -85,9 +86,10 @@ func TestHeavyMagicMissileRune(t *testing.T) {
assert.True(spell.HasSpellInformation)
assert.NotNil(spell.SpellInformation)
assert.Equal("adori vis", spell.SpellInformation.Formula)
assert.Equal(2, len(spell.SpellInformation.Vocation))
assert.Equal(3, len(spell.SpellInformation.Vocation))
assert.Equal("Druid", spell.SpellInformation.Vocation[0])
assert.Equal("Sorcerer", spell.SpellInformation.Vocation[1])
assert.Equal("Monk", spell.SpellInformation.Vocation[1])
assert.Equal("Sorcerer", spell.SpellInformation.Vocation[2])
assert.False(spell.SpellInformation.GroupAttack)
assert.False(spell.SpellInformation.GroupHealing)
assert.True(spell.SpellInformation.GroupSupport)
Expand All @@ -107,7 +109,7 @@ func TestHeavyMagicMissileRune(t *testing.T) {
assert.True(spell.HasRuneInformation)
assert.Equal(4, len(spell.RuneInformation.Vocation))
assert.Equal("Druid", spell.RuneInformation.Vocation[0])
assert.Equal("Knight", spell.RuneInformation.Vocation[1])
assert.Equal("Monk", spell.RuneInformation.Vocation[1])
assert.Equal("Paladin", spell.RuneInformation.Vocation[2])
assert.Equal("Sorcerer", spell.RuneInformation.Vocation[3])
assert.True(spell.RuneInformation.GroupAttack)
Expand Down Expand Up @@ -230,7 +232,7 @@ func TestCurePoisonRune(t *testing.T) {
assert.True(spell.HasSpellInformation)
assert.NotNil(spell.SpellInformation)
assert.Equal("adana pox", spell.SpellInformation.Formula)
assert.Equal(1, len(spell.SpellInformation.Vocation))
assert.Equal(2, len(spell.SpellInformation.Vocation))
assert.False(spell.SpellInformation.GroupAttack)
assert.False(spell.SpellInformation.GroupHealing)
assert.True(spell.SpellInformation.GroupSupport)
Expand Down
48 changes: 48 additions & 0 deletions src/TibiaWorldsWorld_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,51 @@ func TestWorldOceanis(t *testing.T) {
assert.Empty(world.TournamentWorldType)
assert.Equal(0, len(world.OnlinePlayers))
}

func TestWorldTesta(t *testing.T) {
file, err := static.TestFiles.Open("testdata/worlds/world/Testa.html")
if err != nil {
t.Fatalf("file opening error: %s", err)
}
defer file.Close()

data, err := io.ReadAll(file)
if err != nil {
t.Fatalf("File reading error: %s", err)
}

worldJson, err := TibiaWorldsWorldImpl("Testa", string(data), "")
if err != nil {
t.Fatal(err)
}

assert := assert.New(t)
world := worldJson.World

assert.Equal("Testa", world.Name)
assert.Equal("online", world.Status)
assert.Equal(87, world.PlayersOnline)
assert.Equal(781, world.RecordPlayers)
assert.Equal("2012-12-04T15:42:47Z", world.RecordDate)
assert.Equal("2013-01", world.CreationDate)
assert.Equal("Europe", world.Location)
assert.Equal("Optional PvP", world.PvpType)
assert.False(world.PremiumOnly)
assert.Equal("regular", world.TransferType)
assert.Equal(0, len(world.WorldsQuestTitles))
assert.True(world.BattleyeProtected)
assert.Equal("release", world.BattleyeDate)
assert.Equal("regular", world.GameWorldType)
assert.Empty(world.TournamentWorldType)
assert.Equal(87, len(world.OnlinePlayers))

firstPlayer := world.OnlinePlayers[0]
assert.Equal("Alius Harg E1", firstPlayer.Name)
assert.Equal(8, firstPlayer.Level)
assert.Equal("Monk", firstPlayer.Vocation)

thirdPlayer := world.OnlinePlayers[2]
assert.Equal("Andris Hun paladin E1", thirdPlayer.Name)
assert.Equal(23, thirdPlayer.Level)
assert.Equal("Exalted Monk", thirdPlayer.Vocation)
}
1,386 changes: 682 additions & 704 deletions src/static/testdata/spells/spell/Convince Creature Rune.html

Large diffs are not rendered by default.

1,386 changes: 682 additions & 704 deletions src/static/testdata/spells/spell/Cure Poison Rune.html

Large diffs are not rendered by default.

Loading