re-emit mcpe packets as client event
This commit is contained in:
parent
083079d619
commit
d17c62307a
3 changed files with 6 additions and 0 deletions
|
|
@ -12,6 +12,10 @@ var server = pmp.createServer({
|
|||
});
|
||||
|
||||
server.on('connection', function(client) {
|
||||
client.on("mcpe_login",packet => {
|
||||
console.log(packet);
|
||||
});
|
||||
|
||||
client.on('error', function(err) {
|
||||
console.log(err.stack);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ function createClient(options) {
|
|||
|
||||
var client=raknet.createClient(options);
|
||||
client.username = options.username;
|
||||
client.on("mcpe",packet => client.emit(packet.name,packet.params))
|
||||
|
||||
return client;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ function createServer(options) {
|
|||
server.playerCount = 0;
|
||||
|
||||
server.on("connection", function (client) {
|
||||
client.on("mcpe",packet => client.emit(packet.name,packet.params))
|
||||
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue