Skip to content

Commit 75ce42f

Browse files
authored
Revert "Rename council" (#427)
1 parent 16e1b97 commit 75ce42f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+173
-9558
lines changed

cmd/koolo/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import (
99
"runtime/debug"
1010

1111
sloggger "github.com/hectorgimenez/koolo/cmd/koolo/log"
12+
koolo "github.com/hectorgimenez/koolo/internal"
1213
"github.com/hectorgimenez/koolo/internal/config"
1314
"github.com/hectorgimenez/koolo/internal/event"
1415
"github.com/hectorgimenez/koolo/internal/helper"
1516
"github.com/hectorgimenez/koolo/internal/helper/winproc"
1617
"github.com/hectorgimenez/koolo/internal/remote/discord"
1718
"github.com/hectorgimenez/koolo/internal/remote/telegram"
1819
"github.com/hectorgimenez/koolo/internal/server"
19-
"github.com/hectorgimenez/koolo/internal/v2/bot"
2020
"github.com/inkeliz/gowebview"
2121
"golang.org/x/sync/errgroup"
2222
)
@@ -52,8 +52,8 @@ func main() {
5252
winproc.SetProcessDpiAware.Call() // Set DPI awareness to be able to read the correct scale and show the window correctly
5353

5454
eventListener := event.NewListener(logger)
55-
//manager := koolo.NewSupervisorManager(logger, eventListener)
56-
manager := bot.NewSupervisorManager(logger, eventListener)
55+
manager := koolo.NewSupervisorManager(logger, eventListener)
56+
5757
srv, err := server.New(logger, manager)
5858
if err != nil {
5959
log.Fatalf("Error starting local server: %s", err.Error())

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ require (
88
github.com/bwmarrin/discordgo v0.28.1
99
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
1010
github.com/gorilla/websocket v1.5.3
11-
github.com/hectorgimenez/d2go v0.0.0-20240816162330-5a01fd3214eb
11+
github.com/hectorgimenez/d2go v0.0.0-20240810110236-8e6728494046
1212
github.com/inkeliz/gowebview v1.0.1
1313
github.com/inkeliz/w32 v1.0.2
1414
github.com/lxn/win v0.0.0-20210218163916-a377121e959e
1515
github.com/otiai10/copy v1.14.0
16-
golang.org/x/sync v0.8.0
17-
golang.org/x/sys v0.24.0
16+
golang.org/x/sync v0.7.0
17+
golang.org/x/sys v0.22.0
1818
gopkg.in/yaml.v3 v3.0.1
1919
)
2020

go.sum

+12-6
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@ github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1/go.mod h1:A2S0CWkNylc2
1717
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
1818
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
1919
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
20-
github.com/hectorgimenez/d2go v0.0.0-20240816162330-5a01fd3214eb h1:RBoRZULEPpT8+i7zw1U+A5WFARTXJajBXUyg8L7CgqU=
21-
github.com/hectorgimenez/d2go v0.0.0-20240816162330-5a01fd3214eb/go.mod h1:EOVayMaK8D13wsZiZ6n8AK3+Qflm1wHZsCqnzlVIci0=
20+
github.com/hectorgimenez/d2go v0.0.0-20240705125326-9d801c51dfb4 h1:RZshwZXAq6RIlFqf5UKFRgk8yFO5Tznfmye68SEQ/3o=
21+
github.com/hectorgimenez/d2go v0.0.0-20240705125326-9d801c51dfb4/go.mod h1:haet+1Z13euImIuyXR6IAFmJ2P4eaAqe5m3gEPjT1e8=
22+
github.com/hectorgimenez/d2go v0.0.0-20240801152822-67692abea333 h1:XmzQpvZ/Md0w/a/jXU+JbHrYCWEsGuwXpvSYdx4I5wA=
23+
github.com/hectorgimenez/d2go v0.0.0-20240801152822-67692abea333/go.mod h1:haet+1Z13euImIuyXR6IAFmJ2P4eaAqe5m3gEPjT1e8=
24+
github.com/hectorgimenez/d2go v0.0.0-20240805144806-938bfeb753b7 h1:xoY0NXV7R5pOXr4vuw0PZr1UI1AB7fzoq7qKzNdbnYQ=
25+
github.com/hectorgimenez/d2go v0.0.0-20240805144806-938bfeb753b7/go.mod h1:haet+1Z13euImIuyXR6IAFmJ2P4eaAqe5m3gEPjT1e8=
26+
github.com/hectorgimenez/d2go v0.0.0-20240810110236-8e6728494046 h1:va3llh8JReMziJ0x2WOaoq9kQ1b9xesST9ti0dAgce0=
27+
github.com/hectorgimenez/d2go v0.0.0-20240810110236-8e6728494046/go.mod h1:haet+1Z13euImIuyXR6IAFmJ2P4eaAqe5m3gEPjT1e8=
2228
github.com/inkeliz/gowebview v1.0.1 h1:4gpLE2qt4kV3DB+xHkHKUeLLiGPN5Xw3or9A3hVqYyA=
2329
github.com/inkeliz/gowebview v1.0.1/go.mod h1:4SNjXp/fogE11MwvJD67kMBmSObY2BBqinEgH8+8eM8=
2430
github.com/inkeliz/w32 v1.0.2 h1:Es8Bmw9ApOY0PVRpGs7wsqIKdK5C3xBkP5TOATfVmtU=
@@ -42,16 +48,16 @@ golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
4248
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
4349
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
4450
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
45-
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
46-
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
51+
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
52+
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
4753
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
4854
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
4955
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
5056
golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
5157
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
5258
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
53-
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
54-
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
59+
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
60+
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
5561
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
5662
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
5763
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

internal/config/runs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const (
1010
SummonerRun Run = "summoner"
1111
DurielRun Run = "duriel"
1212
MephistoRun Run = "mephisto"
13-
TravincalRun Run = "travincal"
13+
CouncilRun Run = "council"
1414
EldritchRun Run = "eldritch"
1515
PindleskinRun Run = "pindleskin"
1616
NihlathakRun Run = "nihlathak"
@@ -40,7 +40,7 @@ var AvailableRuns = map[Run]interface{}{
4040
SummonerRun: nil,
4141
DurielRun: nil,
4242
MephistoRun: nil,
43-
TravincalRun: nil,
43+
CouncilRun: nil,
4444
EldritchRun: nil,
4545
PindleskinRun: nil,
4646
NihlathakRun: nil,

internal/event/event.go

+138
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ package event
33
import (
44
"image"
55
"time"
6+
7+
"github.com/hectorgimenez/d2go/pkg/data"
8+
)
9+
10+
const (
11+
FinishedOK FinishReason = "ok"
12+
FinishedDied FinishReason = "death"
13+
FinishedChicken FinishReason = "chicken"
14+
FinishedMercChicken FinishReason = "merc chicken"
15+
FinishedError FinishReason = "error"
16+
17+
InteractionTypeEntrance InteractionType = "entrance"
18+
InteractionTypeNPC InteractionType = "npc"
19+
InteractionTypeObject InteractionType = "object"
620
)
721

822
type FinishReason string
@@ -54,3 +68,127 @@ func Text(supervisor string, message string) BaseEvent {
5468
supervisor: supervisor,
5569
}
5670
}
71+
72+
type UsedPotionEvent struct {
73+
BaseEvent
74+
PotionType data.PotionType
75+
OnMerc bool
76+
}
77+
78+
func UsedPotion(be BaseEvent, pt data.PotionType, onMerc bool) UsedPotionEvent {
79+
return UsedPotionEvent{
80+
BaseEvent: be,
81+
PotionType: pt,
82+
OnMerc: onMerc,
83+
}
84+
}
85+
86+
type GameCreatedEvent struct {
87+
BaseEvent
88+
Name string
89+
Password string
90+
}
91+
92+
func GameCreated(be BaseEvent, name string, password string) GameCreatedEvent {
93+
return GameCreatedEvent{
94+
BaseEvent: be,
95+
Name: name,
96+
Password: password,
97+
}
98+
}
99+
100+
type GameFinishedEvent struct {
101+
BaseEvent
102+
Reason FinishReason
103+
}
104+
105+
func GameFinished(be BaseEvent, reason FinishReason) GameFinishedEvent {
106+
return GameFinishedEvent{
107+
BaseEvent: be,
108+
Reason: reason,
109+
}
110+
}
111+
112+
type RunFinishedEvent struct {
113+
BaseEvent
114+
RunName string
115+
Reason FinishReason
116+
}
117+
118+
func RunFinished(be BaseEvent, runName string, reason FinishReason) RunFinishedEvent {
119+
return RunFinishedEvent{
120+
BaseEvent: be,
121+
RunName: runName,
122+
Reason: reason,
123+
}
124+
}
125+
126+
type ItemStashedEvent struct {
127+
BaseEvent
128+
Item data.Drop
129+
}
130+
131+
func ItemStashed(be BaseEvent, drop data.Drop) ItemStashedEvent {
132+
return ItemStashedEvent{
133+
BaseEvent: be,
134+
Item: drop,
135+
}
136+
}
137+
138+
type RunStartedEvent struct {
139+
BaseEvent
140+
RunName string
141+
}
142+
143+
func RunStarted(be BaseEvent, runName string) RunStartedEvent {
144+
return RunStartedEvent{
145+
BaseEvent: be,
146+
RunName: runName,
147+
}
148+
}
149+
150+
type CompanionLeaderAttackEvent struct {
151+
BaseEvent
152+
TargetUnitID data.UnitID
153+
}
154+
155+
func CompanionLeaderAttack(be BaseEvent, targetUnitID data.UnitID) CompanionLeaderAttackEvent {
156+
return CompanionLeaderAttackEvent{
157+
BaseEvent: be,
158+
TargetUnitID: targetUnitID,
159+
}
160+
}
161+
162+
type CompanionRequestedTPEvent struct {
163+
BaseEvent
164+
}
165+
166+
func CompanionRequestedTP(be BaseEvent) CompanionRequestedTPEvent {
167+
return CompanionRequestedTPEvent{BaseEvent: be}
168+
}
169+
170+
type InteractedToEvent struct {
171+
BaseEvent
172+
ID int
173+
InteractionType InteractionType
174+
}
175+
176+
func InteractedTo(be BaseEvent, id int, it InteractionType) InteractedToEvent {
177+
return InteractedToEvent{
178+
BaseEvent: be,
179+
ID: id,
180+
InteractionType: it,
181+
}
182+
}
183+
184+
type GamePausedEvent struct {
185+
BaseEvent
186+
Paused bool
187+
}
188+
189+
func GamePaused(be BaseEvent, paused bool) GamePausedEvent {
190+
return GamePausedEvent{
191+
BaseEvent: be,
192+
Paused: paused,
193+
}
194+
}

internal/event/events.go

-141
This file was deleted.

0 commit comments

Comments
 (0)