Code Monkey home page Code Monkey logo

xechat-idea's Introduction

XEChat-Idea

Version 1.6.0-beta1

基于Netty的IDEA即时聊天插件:让你能够在IDEA里实现聊天、下棋、斗地主!(理论上支持JetBrains全系列开发工具🙂)

项目介绍

主要功能:

  • 即时聊天
  • 游戏对战
  • 待探索...

目前已实现:

  • 五子棋(支持2人联机、人机对战,内置"人工制杖")
  • 斗地主(支持2~3人联机、人机对战)
  • 阅读(作者 @MINIPuffer ,感谢PR😊)
  • 天气查询(基于和风天气,作者 @猎隼丶止戈 ,感谢PR😊)

了解更多...

项目结构

.
├── LICENSE
├── README.md
├── xechat-commons //公共模块
│   ├── pom.xml
│   └── src
├── xechat-plugin //IDEA插件端
│   ├── build.gradle
│   ├── gradle
│   ├── gradle.properties
│   ├── gradlew
│   ├── gradlew.bat
│   ├── settings.gradle
│   └── src
└── xechat-server //服务端
    ├── pom.xml
    └── src

项目环境

服务端 & 公共模块

  • JDK8
  • Maven 3.6.x

IDEA 插件端

  • JDK11
  • Gradle 6.x

项目开发

运行 & 部署

提醒:公共模块需优先打包

# 进入公共模块根目录
cd xechat-commons
# 打包到本地仓库
mvn install

服务端

创建或调整日志目录 src/main/resources/logback.xml

<property name="ROOT_LOG_PATH" value="/var/log/xechat-server"/>

运行

直接运行主方法 XEChatServer.java

部署

# 进入服务端根目录
cd xechat-server
# 打包
mvn package
# 启动服务端
java -jar target/xechat-server-xxx.jar

启动参数:

  • 设置端口-p {端口号}
  • 设置敏感词文件-swfile {文件路径}
  • 设置和风天气 api key-weather {和风api key}

参考示例:

java -jar target/xechat-server-xxx.jar -p 1024 -swfile /Users/anlingyi/local/test/words.txt -weather {和风天气api key}

敏感词相关配置参考

和风天气相关配置参考

IDEA插件端

修改IDEA版本

修改 build.gradle 配置文件,将 IDEA 版本号改为你想使用的版本(仅限开发调试阶段)

intellij {
    version '2021.2'
}

本地运行

Tasks > intellij > runIde

image.png

插件部署

提醒:修改服务端地址

进入到 cn.xeblog.plugin.client.XEChatClient ,修改以下变量值

    private static final String HOST = "localhost"; // 服务端IP
    private static final int PORT = 1024; // 服务端端口

打包

Tasks > build > assemble

image.png

打包完成后的文件 build/distributions/xechat-plugin-xxx.zip

安装

IDEA > Preferences > Plugins

image.png

选择打包后的文件安装 build/distributions/xechat-plugin-xxx.zip

安装体验

添加插件库 Plugins > 设置按钮 > Manage Plugin Repositories...

http://plugins.xeblog.cn

image.png

搜索 “xechat” 安装

image.png

如有条件,还请自行部署服务端。

Docker运行

感谢 @猎隼丶止戈 对此部分做的贡献 😊

镜像地址:https://hub.docker.com/r/anlingyi/xechat-server/tags

docker-compose.yml

version: '3'
services:
  xechat:
    image: anlingyi/xechat-server:{Version}
    container_name: xechat-server
    restart: always
    ports:
      - 1024:1024
    environment:
      - PARAMS=-p 1024 -swfile /xechat/sensitive-words.txt -weather {和风天气api key}
    volumes:
      - /xechat/logs:/var/log/xechat-server
      - /xechat/sensitive-words.txt:/xechat/sensitive-words.txt

公开你的鱼塘

如果你想公开你的鱼塘,请编辑项目中的 server_list.json 文件,添加上你的鱼塘信息,然后提交PR到这里,待我们审核通过后即可。

    {
        "name": "xxx", //鱼塘名
        "ip": "127.0.0.1", //你的服务器IP或域名
        "port": 1024 //端口号
    }

学习交流

感谢 @鹿儿岛 提供的QQ交流群 😊

如果大家对这个项目感兴趣,欢迎加入我们的交流群🎉

  • QQ群:754126966

xechat-idea's People

Contributors

anlingyi avatar nn200433 avatar minipuffer avatar

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.