change packet prefix, remove duplicate packets
This commit is contained in:
parent
8c30673c6c
commit
97c8b7d0aa
2 changed files with 77 additions and 84 deletions
|
|
@ -538,7 +538,7 @@
|
|||
{
|
||||
"type": "u8",
|
||||
"mappings": {
|
||||
"0x8e": "mcpe"
|
||||
"0xfe": "mcpe"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -567,10 +567,6 @@
|
|||
{
|
||||
"type": "u8",
|
||||
"mappings": {
|
||||
"0x04": "id_detect_lost_connections",
|
||||
"0x14": "id_no_free_incoming_connections",
|
||||
"0x17": "id_connection_banned",
|
||||
"0x1A": "id_ip_recently_connected",
|
||||
"0x03": "server_to_client_handshake",
|
||||
"0x04": "client_to_server_handshake",
|
||||
"0x01": "game_login",
|
||||
|
|
@ -639,10 +635,6 @@
|
|||
{
|
||||
"compareTo": "name",
|
||||
"fields": {
|
||||
"id_detect_lost_connections": "packet_id_detect_lost_connections",
|
||||
"id_no_free_incoming_connections": "packet_id_no_free_incoming_connections",
|
||||
"id_connection_banned": "packet_id_connection_banned",
|
||||
"id_ip_recently_connected": "packet_id_ip_recently_connected",
|
||||
"server_to_client_handshake": "packet_server_to_client_handshake",
|
||||
"client_to_server_handshake": "packet_client_to_server_handshake",
|
||||
"game_login": "packet_game_login",
|
||||
|
|
|
|||
|
|
@ -17,83 +17,84 @@ var server = pmp.createServer({
|
|||
server.on('connection', function(client) {
|
||||
|
||||
|
||||
client.on("mcpe",packet => console.log(packet));
|
||||
client.on("mcpe",packet => console.log(JSON.stringify(packet)));
|
||||
|
||||
client.on("game_login",packet => {
|
||||
client.writeMCPE("player_status",{
|
||||
status:0
|
||||
});
|
||||
client.writeMCPE('move_player', {
|
||||
entityId: [0,0],
|
||||
x: 1,
|
||||
y: 64 + 1.62,
|
||||
z: 1,
|
||||
yaw: 0,
|
||||
headYaw: 0,
|
||||
pitch: 0,
|
||||
mode: 0,
|
||||
onGround: 1
|
||||
});
|
||||
|
||||
client.writeMCPE("start_game",{
|
||||
seed:-1,
|
||||
dimension:0,
|
||||
generator:1,
|
||||
gamemode:1,
|
||||
entityId:[0,0],
|
||||
spawnX:1,
|
||||
spawnY:1,
|
||||
spawnZ:1,
|
||||
x:0,
|
||||
y:1+1.62,
|
||||
z:0,
|
||||
isLoadedInCreative:false,
|
||||
dayCycleStopTime:0,
|
||||
eduMode:false,
|
||||
unknown:""
|
||||
});
|
||||
|
||||
client.writeMCPE('set_spawn_position', {
|
||||
x: 1,
|
||||
y: 64,
|
||||
z: 1
|
||||
});
|
||||
client.writeMCPE("set_time",{
|
||||
time:0,
|
||||
started:1
|
||||
});
|
||||
|
||||
client.writeMCPE('respawn', {
|
||||
x: 1,
|
||||
y: 64,
|
||||
z: 1
|
||||
});
|
||||
});
|
||||
|
||||
client.on("request_chunk_radius",() => {
|
||||
client.writeMCPE('chunk_radius_update',{
|
||||
chunkRadius:1
|
||||
});
|
||||
|
||||
for (let x = -1; x <=1; x++) {
|
||||
for (let z = -1; z <=1; z++) {
|
||||
client.writeBatch([{"name":"mcpe","params":{name:"full_chunk_data",params:{
|
||||
chunkX: x,
|
||||
chunkZ: z,
|
||||
order: 1,
|
||||
chunk_data:fs.readFileSync(__dirname+"/chunk")
|
||||
}}}]);
|
||||
}
|
||||
}
|
||||
|
||||
client.writeMCPE('player_status', {
|
||||
status: 3
|
||||
});
|
||||
|
||||
client.writeMCPE('set_time', {
|
||||
time: 0,
|
||||
started: 1
|
||||
});
|
||||
console.log(packet);
|
||||
// client.writeMCPE("player_status",{
|
||||
// status:0
|
||||
// });
|
||||
// client.writeMCPE('move_player', {
|
||||
// entityId: [0,0],
|
||||
// x: 1,
|
||||
// y: 64 + 1.62,
|
||||
// z: 1,
|
||||
// yaw: 0,
|
||||
// headYaw: 0,
|
||||
// pitch: 0,
|
||||
// mode: 0,
|
||||
// onGround: 1
|
||||
// });
|
||||
//
|
||||
// client.writeMCPE("start_game",{
|
||||
// seed:-1,
|
||||
// dimension:0,
|
||||
// generator:1,
|
||||
// gamemode:1,
|
||||
// entityId:[0,0],
|
||||
// spawnX:1,
|
||||
// spawnY:1,
|
||||
// spawnZ:1,
|
||||
// x:0,
|
||||
// y:1+1.62,
|
||||
// z:0,
|
||||
// isLoadedInCreative:false,
|
||||
// dayCycleStopTime:0,
|
||||
// eduMode:false,
|
||||
// unknown:""
|
||||
// });
|
||||
//
|
||||
// client.writeMCPE('set_spawn_position', {
|
||||
// x: 1,
|
||||
// y: 64,
|
||||
// z: 1
|
||||
// });
|
||||
// client.writeMCPE("set_time",{
|
||||
// time:0,
|
||||
// started:1
|
||||
// });
|
||||
//
|
||||
// client.writeMCPE('respawn', {
|
||||
// x: 1,
|
||||
// y: 64,
|
||||
// z: 1
|
||||
// });
|
||||
// });
|
||||
//
|
||||
// client.on("request_chunk_radius",() => {
|
||||
// client.writeMCPE('chunk_radius_update',{
|
||||
// chunkRadius:1
|
||||
// });
|
||||
//
|
||||
// for (let x = -1; x <=1; x++) {
|
||||
// for (let z = -1; z <=1; z++) {
|
||||
// client.writeBatch([{"name":"mcpe","params":{name:"full_chunk_data",params:{
|
||||
// chunkX: x,
|
||||
// chunkZ: z,
|
||||
// order: 1,
|
||||
// chunk_data:fs.readFileSync(__dirname+"/chunk")
|
||||
// }}}]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// client.writeMCPE('player_status', {
|
||||
// status: 3
|
||||
// });
|
||||
//
|
||||
// client.writeMCPE('set_time', {
|
||||
// time: 0,
|
||||
// started: 1
|
||||
// });
|
||||
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue