Skip to content

Commit

Permalink
Revert "Rename council" (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
artosimonyan authored Aug 17, 2024
1 parent 16e1b97 commit 75ce42f
Show file tree
Hide file tree
Showing 100 changed files with 173 additions and 9,558 deletions.
6 changes: 3 additions & 3 deletions cmd/koolo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (
"runtime/debug"

sloggger "github.com/hectorgimenez/koolo/cmd/koolo/log"
koolo "github.com/hectorgimenez/koolo/internal"
"github.com/hectorgimenez/koolo/internal/config"
"github.com/hectorgimenez/koolo/internal/event"
"github.com/hectorgimenez/koolo/internal/helper"
"github.com/hectorgimenez/koolo/internal/helper/winproc"
"github.com/hectorgimenez/koolo/internal/remote/discord"
"github.com/hectorgimenez/koolo/internal/remote/telegram"
"github.com/hectorgimenez/koolo/internal/server"
"github.com/hectorgimenez/koolo/internal/v2/bot"
"github.com/inkeliz/gowebview"
"golang.org/x/sync/errgroup"
)
Expand Down Expand Up @@ -52,8 +52,8 @@ func main() {
winproc.SetProcessDpiAware.Call() // Set DPI awareness to be able to read the correct scale and show the window correctly

eventListener := event.NewListener(logger)
//manager := koolo.NewSupervisorManager(logger, eventListener)
manager := bot.NewSupervisorManager(logger, eventListener)
manager := koolo.NewSupervisorManager(logger, eventListener)

srv, err := server.New(logger, manager)
if err != nil {
log.Fatalf("Error starting local server: %s", err.Error())
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ require (
github.com/bwmarrin/discordgo v0.28.1
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
github.com/gorilla/websocket v1.5.3
github.com/hectorgimenez/d2go v0.0.0-20240816162330-5a01fd3214eb
github.com/hectorgimenez/d2go v0.0.0-20240810110236-8e6728494046
github.com/inkeliz/gowebview v1.0.1
github.com/inkeliz/w32 v1.0.2
github.com/lxn/win v0.0.0-20210218163916-a377121e959e
github.com/otiai10/copy v1.14.0
golang.org/x/sync v0.8.0
golang.org/x/sys v0.24.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.22.0
gopkg.in/yaml.v3 v3.0.1
)

Expand Down
18 changes: 12 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1/go.mod h1:A2S0CWkNylc2
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hectorgimenez/d2go v0.0.0-20240816162330-5a01fd3214eb h1:RBoRZULEPpT8+i7zw1U+A5WFARTXJajBXUyg8L7CgqU=
github.com/hectorgimenez/d2go v0.0.0-20240816162330-5a01fd3214eb/go.mod h1:EOVayMaK8D13wsZiZ6n8AK3+Qflm1wHZsCqnzlVIci0=
github.com/hectorgimenez/d2go v0.0.0-20240705125326-9d801c51dfb4 h1:RZshwZXAq6RIlFqf5UKFRgk8yFO5Tznfmye68SEQ/3o=
github.com/hectorgimenez/d2go v0.0.0-20240705125326-9d801c51dfb4/go.mod h1:haet+1Z13euImIuyXR6IAFmJ2P4eaAqe5m3gEPjT1e8=
github.com/hectorgimenez/d2go v0.0.0-20240801152822-67692abea333 h1:XmzQpvZ/Md0w/a/jXU+JbHrYCWEsGuwXpvSYdx4I5wA=
github.com/hectorgimenez/d2go v0.0.0-20240801152822-67692abea333/go.mod h1:haet+1Z13euImIuyXR6IAFmJ2P4eaAqe5m3gEPjT1e8=
github.com/hectorgimenez/d2go v0.0.0-20240805144806-938bfeb753b7 h1:xoY0NXV7R5pOXr4vuw0PZr1UI1AB7fzoq7qKzNdbnYQ=
github.com/hectorgimenez/d2go v0.0.0-20240805144806-938bfeb753b7/go.mod h1:haet+1Z13euImIuyXR6IAFmJ2P4eaAqe5m3gEPjT1e8=
github.com/hectorgimenez/d2go v0.0.0-20240810110236-8e6728494046 h1:va3llh8JReMziJ0x2WOaoq9kQ1b9xesST9ti0dAgce0=
github.com/hectorgimenez/d2go v0.0.0-20240810110236-8e6728494046/go.mod h1:haet+1Z13euImIuyXR6IAFmJ2P4eaAqe5m3gEPjT1e8=
github.com/inkeliz/gowebview v1.0.1 h1:4gpLE2qt4kV3DB+xHkHKUeLLiGPN5Xw3or9A3hVqYyA=
github.com/inkeliz/gowebview v1.0.1/go.mod h1:4SNjXp/fogE11MwvJD67kMBmSObY2BBqinEgH8+8eM8=
github.com/inkeliz/w32 v1.0.2 h1:Es8Bmw9ApOY0PVRpGs7wsqIKdK5C3xBkP5TOATfVmtU=
Expand All @@ -42,16 +48,16 @@ golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
4 changes: 2 additions & 2 deletions internal/config/runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const (
SummonerRun Run = "summoner"
DurielRun Run = "duriel"
MephistoRun Run = "mephisto"
TravincalRun Run = "travincal"
CouncilRun Run = "council"
EldritchRun Run = "eldritch"
PindleskinRun Run = "pindleskin"
NihlathakRun Run = "nihlathak"
Expand Down Expand Up @@ -40,7 +40,7 @@ var AvailableRuns = map[Run]interface{}{
SummonerRun: nil,
DurielRun: nil,
MephistoRun: nil,
TravincalRun: nil,
CouncilRun: nil,
EldritchRun: nil,
PindleskinRun: nil,
NihlathakRun: nil,
Expand Down
138 changes: 138 additions & 0 deletions internal/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ package event
import (
"image"
"time"

"github.com/hectorgimenez/d2go/pkg/data"
)

const (
FinishedOK FinishReason = "ok"
FinishedDied FinishReason = "death"
FinishedChicken FinishReason = "chicken"
FinishedMercChicken FinishReason = "merc chicken"
FinishedError FinishReason = "error"

InteractionTypeEntrance InteractionType = "entrance"
InteractionTypeNPC InteractionType = "npc"
InteractionTypeObject InteractionType = "object"
)

type FinishReason string
Expand Down Expand Up @@ -54,3 +68,127 @@ func Text(supervisor string, message string) BaseEvent {
supervisor: supervisor,
}
}

type UsedPotionEvent struct {
BaseEvent
PotionType data.PotionType
OnMerc bool
}

func UsedPotion(be BaseEvent, pt data.PotionType, onMerc bool) UsedPotionEvent {
return UsedPotionEvent{
BaseEvent: be,
PotionType: pt,
OnMerc: onMerc,
}
}

type GameCreatedEvent struct {
BaseEvent
Name string
Password string
}

func GameCreated(be BaseEvent, name string, password string) GameCreatedEvent {
return GameCreatedEvent{
BaseEvent: be,
Name: name,
Password: password,
}
}

type GameFinishedEvent struct {
BaseEvent
Reason FinishReason
}

func GameFinished(be BaseEvent, reason FinishReason) GameFinishedEvent {
return GameFinishedEvent{
BaseEvent: be,
Reason: reason,
}
}

type RunFinishedEvent struct {
BaseEvent
RunName string
Reason FinishReason
}

func RunFinished(be BaseEvent, runName string, reason FinishReason) RunFinishedEvent {
return RunFinishedEvent{
BaseEvent: be,
RunName: runName,
Reason: reason,
}
}

type ItemStashedEvent struct {
BaseEvent
Item data.Drop
}

func ItemStashed(be BaseEvent, drop data.Drop) ItemStashedEvent {
return ItemStashedEvent{
BaseEvent: be,
Item: drop,
}
}

type RunStartedEvent struct {
BaseEvent
RunName string
}

func RunStarted(be BaseEvent, runName string) RunStartedEvent {
return RunStartedEvent{
BaseEvent: be,
RunName: runName,
}
}

type CompanionLeaderAttackEvent struct {
BaseEvent
TargetUnitID data.UnitID
}

func CompanionLeaderAttack(be BaseEvent, targetUnitID data.UnitID) CompanionLeaderAttackEvent {
return CompanionLeaderAttackEvent{
BaseEvent: be,
TargetUnitID: targetUnitID,
}
}

type CompanionRequestedTPEvent struct {
BaseEvent
}

func CompanionRequestedTP(be BaseEvent) CompanionRequestedTPEvent {
return CompanionRequestedTPEvent{BaseEvent: be}
}

type InteractedToEvent struct {
BaseEvent
ID int
InteractionType InteractionType
}

func InteractedTo(be BaseEvent, id int, it InteractionType) InteractedToEvent {
return InteractedToEvent{
BaseEvent: be,
ID: id,
InteractionType: it,
}
}

type GamePausedEvent struct {
BaseEvent
Paused bool
}

func GamePaused(be BaseEvent, paused bool) GamePausedEvent {
return GamePausedEvent{
BaseEvent: be,
Paused: paused,
}
}
141 changes: 0 additions & 141 deletions internal/event/events.go

This file was deleted.

Loading

0 comments on commit 75ce42f

Please sign in to comment.