# kc-battle-status-plugin

> pomelo-status-plugin ====================

Latest version **1.0.4** (published 2014-12-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install kc-battle-status-plugin
pnpm add kc-battle-status-plugin
yarn add kc-battle-status-plugin
bun add kc-battle-status-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2014-12-29 |
| First published | 2014-12-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | sundebing |

## Links

- npm: https://www.npmjs.com/package/kc-battle-status-plugin
- npm.io page: https://npm.io/package/kc-battle-status-plugin

## Dependencies (2)

- [redis](https://npm.io/package/redis.md) 0.10.0
- [pomelo-logger](https://npm.io/package/pomelo-logger.md) 0.1.5

## Recent versions

- 1.0.4 (latest) — 2014-12-29
- 1.0.3 — 2014-12-27
- 1.0.2 — 2014-12-27
- 1.0.1 — 2014-12-26
- 1.0.0 — 2014-12-26

## README

pomelo-status-plugin
====================

pomelo-status-plugin is a plugin for pomelo, it can be used in pomelo(>=0.6).

pomelo-status-plugin provides global status service for pomelo, which uses persistent storage to save users information.

##Installation

```
npm install pomelo-status-plugin
```

##Usage

```
var status = require('pomelo-status-plugin');

app.use(status, {status: {
  host: '127.0.0.1',
  port: 6379
}});

```

##API

###getSidsByUid(uid, cb)
get frontend server id by user id
####Arguments
+ uid - user id
+ cb - callback function

####Return
+ err - error
+ list - array of frontend server ids

###pushByUids(uids, route, msg, cb)
####Arguments
+ uids - array of user ids
+ route - route string
+ msg - messages would be sent to clients
+ cb - callback function

####Return
+ err - error
+ fails - array of failed to send user ids

##Notice

status plugin use redis as a default persistent storage, you can change it with your own implementation. 

```
var status = require('pomelo-status-plugin');
var mysqlStatusManager = require('./mysqlStatusManager');

app.use(status, {status: {
  host: '127.0.0.1',
  port: 6379,
  channelManager: mysqlStatusManager
}});

```
in >=0.0.3 version add cleanOnStartUp option, when you enable this option, status plugin would clean up the old data with the given prefix string.

```
app.use(status, {status: {
  host: '127.0.0.1',
  port: 6379,
  cleanOnStartUp: true
}});

```

---
_Source: https://npm.io/package/kc-battle-status-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
