Giter VIP home page Giter VIP logo

agent-discord-bot's People

Contributors

gretmn102 avatar

Stargazers

 avatar

Watchers

 avatar

agent-discord-bot's Issues

feat(bottle-game): add this game

Бумеранг:

  • Человек пишет команду .бутылочка, автоматически подключаясь к пати
  • Чтобы игра началась нужно допустим минимум 4 человека, которые за минуту должны подключиться. Ещё трое или более подключаются
  • Начинается игра. Тот, кто создал игру, начинает "крутить бутылочку", т.е. жмёт на кнопку;
  • Рандомно выбирается один из остальных троих человек, и бот пишет что-то типа "Игрок 1" (тот, кто крутанул) "поцелуйте командой .поцелуй игрока 3 (или 2 или 4, смотря что выпадет);
  • Игрок отправил команду верному человеку, то есть игроку 3, то Игроку 3 приходится нажимать на кнопку, то есть перешло право хода, теперь он крутит бутылочку. ЕСЛИ игрок 1 использует команду на другого игрока, то бот должен как-то наругаться на игрока и выгнать его из игры или что-то можно придумать);
  • игра продолжается допустим 3-5 хода, чтобы не затягивать и создавать заново если хочется;

К полу игроков привязываться не надо, так смешнее, а для усложнения можно подумать что-то вроде игры на вылет, тот кто поцеловал - вылетает

fix: server failed to acknowledge more than 5 heartbeats - connection is zombie

изображение

Last seen

The last time such an error was observed was in 2022. I may have accidentally fixed it at some point (see possible causes). Perhaps we should close the issue.

Reproduction

???

Possible causes {#posible-causes}

This can happen because of an exception in MailboxProccessor: when .PostAndReply is called, it waits for a response. If an exception occurs in MailboxProccessor before that, .PostAndReply will continue to wait indefinitely.

The following code can be used to prove this:

module AsyncLearning =
    open System.Threading.Tasks

    let awaiti (t: Task) =
        t.GetAwaiter().GetResult()

    type Msg =
        | Inc of AsyncReplyChannel<int>
        | GetCounter of AsyncReplyChannel<int>

    let reduce msg state =
        match msg with
        | Inc ->
            let counter = state + 1
            if counter > 1 then
                System.Threading.Tasks.Task.Run(fun x ->
                    failwithf "counter > 1"
                )
                |> awaiti

            counter

        | GetCounter r ->
            r.Reply state
            state

    let counter =
        let initState = 0

        MailboxProcessor.Start(fun mail ->
            let rec loop state =
                async {
                    let! msg = mail.Receive()
                    let state =
                        try
                            reduce msg state
                        with e ->
                            printfn "%A" e
                            state

                    return! loop state
                }
            loop initState
        )

    counter.PostAndReply (fun r -> Inc r)

    ()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.