Giter Club home page Giter Club logo

im_server's Introduction

IM_Server

初始化

  • 运行程序时,服务端会自动初始化一系列比如数据库以及socket:

image

登录注册

  1. 登录:登录时会校验密码密文以及账号
  2. 注册:存储密码的密文
这里只是实现了用户名判重,没给用户设置标识号。

聊天

  1. 单聊:需要双方上线才可以接收到信息。一方不在线的时候会将接收到的信息存入离线消息记录表。

image

  1. 群聊:遍历在线的客户端广播信息。

image

emmm单聊功能只要曾经登录过的客户端,就算当时客户端已经关闭,仍然视作在线。所以消息记录只是存在数据库但是没有读取显示....

加好友

  • 输入对方用户名进行添加
emm没有写实现好友请求的...

数据库

  1. 基本表名:

image

其中的chat_log_user会在用户选择单聊的时候自动创建。 user2为用户信息表。 offline_msg存储的是离线消息的基本信息。 friends存储了好友对的信息。

  1. 部分数据展示: 聊天记录:

image

好友对:

image

历史记录:

image

用户信息:

image

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.