Git Product home page Git Product logo

telemarket-skittle-alley's Introduction

Telemarket-skittle-alley

在线小游戏集合。

使用webflux、vue。

如何开发

在开发环境下可以分别单独启动前端项目和后端项目。也可以将前端合并到后端项目一起运行。需要安装node 8以上以执行前端资源编译。

cd src/main/front
npm install

1.分别单独启动

后端服务执行main方法即可

前端项目需要

cd src/main/front
npm run start

访问 http://localhost:8080/index.html 即可,此时后端请求会被代理

2. 合并启动

执行mvn process-resources后正常启动后端项目即可

请注意:第一次使用ide启动或者前端资源发生变动后,都需要执行前端资源生成。 手动执行方式为到src/main/front下执行npm i && npm run build(前端资源编译)然后复制distresources目录下

比较推荐使用第一种方式开发,前端服务处于开发模式,修改能够快速地反馈。

游戏列表

你画我猜

可以使用完整的游戏过程。

词汇的表在 sql/data.sql

也可以运行时自行提交

如果运行过程无法正确地进行游戏状态迁移(具体表现为倒计时结束后无响应,无法开始等等),请确认IDE在编译过程中执行了aspectj的编译(手动跑下 mvn aspectj:compile 也行)。

telemarket-skittle-alley's People

Contributors

csdbianhua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dongxl123

telemarket-skittle-alley's Issues

sendto的逻辑如何实现的呢?

`@Override
    public Mono<Void> handle(WebSocketSession session) {
        Mono<Void> flux = session.receive()
                .doOnNext(msg -> handleTextMessage(session, msg))
                .doOnError(throwable -> log.error("[DrawGuess]WebSocket error", throwable))
                .doOnTerminate(() -> afterConnectionClosed(session))
                .then();
        Mono<Void> send = session.send(processor.filter(model -> model.isMatch(session.getId()))
                .map(model -> {
                    if (log.isDebugEnabled()) {
                        log.debug("[Websocket] msg: {} , to: {}", model.content, session.getId());
                    }
                    return session.textMessage(model.getContent());
                }));
        return Flux.merge(flux,
                send,
                afterConnectionEstablished(session).doOnNext(sink::next)
        ).then();
    }`

这段代码请教一下,sendto是如何实现的呢?
我的理解,需要找到当前msg的toId,在在线session的id集合中匹配,找到id相同的session,然后通过该session的send方法发送出去。

代码中的逻辑,感觉相反,遍历所有的消息,如果消息中有toId和当前session一致则发送,如果不一致就丢弃这条消息?

不知道我的理解对吗,如果实现在线给某个用户私聊信息呢

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.