forked from NetEase/lordofpomelo
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2,087 changed files
with
111,078 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Created by lixiaodong on 17/3/4. | ||
*/ | ||
'use strict'; | ||
|
||
var PomeloAdmin = require('pomelo-admin'); | ||
|
||
/** | ||
* 获取在线人数 | ||
* @param data | ||
* @param callback | ||
*/ | ||
function onlineUser(data, callback) { | ||
console.log("获取在线人数" + JSON.stringify(data)); | ||
var jsonData = {}; | ||
var client = new PomeloAdmin.adminClient({username: data.username, password: data.password}); | ||
client.connect('game-admin', data.host, data.port, function (errConnect, msgConnect) { | ||
if (errConnect) { | ||
jsonData.code = 1; | ||
jsonData.message = '连接游戏服务器失败' + data.host + ":" + data.port; | ||
console.log(JSON.stringify(errConnect)); | ||
callback(jsonData); | ||
client.socket.disconnect(); | ||
} else { | ||
//console.log('连接游戏服务器成功' + data.host + ":" + data.port); | ||
client.request('onlineUser', null, function (errRequest, msgRequest) { | ||
if (errRequest) { | ||
jsonData.code = 1; | ||
jsonData.message = '获取在线人数失败'; | ||
} else { | ||
jsonData.code = 0; | ||
jsonData.data = msgRequest; | ||
} | ||
console.log(JSON.stringify(jsonData)); | ||
callback(jsonData); | ||
client.socket.disconnect(); | ||
process.exit(0); | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
var data = { | ||
username: 'admin', | ||
password: 'admin', | ||
host: '127.0.0.1', | ||
port: 3005 | ||
} | ||
|
||
onlineUser(data, function (data) { | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
result = logger.info("hello");fd | ||
result = logger.info("hello"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.project | ||
*/node-log.log | ||
logs/*.log | ||
!.gitignore | ||
node_modules/* | ||
.project | ||
.settings/ | ||
**/*.svn | ||
*.svn | ||
*.sublime-project | ||
*.sublime-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(The MIT License) | ||
|
||
Copyright (c) 2012 Netease, Inc. and other pomelo contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
'Software'), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# pomelo-admin-web | ||
pomelo-admin-web is a web console for [pomelo](https://github.com/NetEase/pomelo). it is based on [pomelo-admin](https://github.com/NetEase/pomelo-admin). it is just an web console example, you can implement your style like web console. | ||
|
||
##Installation | ||
``` | ||
npm install pomelo-admin-web | ||
``` | ||
##Usage | ||
just run | ||
``` | ||
node app.js | ||
``` | ||
|
||
open browser in your computer,and enjoy it |
Oops, something went wrong.