Beispiel #1
0
 public Package PlayerDisconnect(McpeDisconnect package, Player player)
 {
     if (_registerlist.Contains(player.User))
     {
         player.User.IsAuthenticated = false;
     }
     return package;
 }
        public void Disconnect(string reason, bool sendDisconnect = true)
        {
            //Log.Warn("Got disconnect in proxy: " + reason);

            McpeDisconnect message = McpeDisconnect.CreateObject();

            message.message = reason;
            WriteBytes(message.Encode());
            message.PutPool();
        }
Beispiel #3
0
 public virtual void HandleMcpeDisconnect(McpeDisconnect message)
 {
     Client.StopClient();
 }
Beispiel #4
0
        private void HandlePackage(Package message)
        {
            var handler = _player;

            //var result = Server.PluginManager.PluginPacketHandler(message, true, Player);
            ////if (result != message) message.PutPool();
            //message = result;

            if (message == null)
            {
                return;
            }

            else if (typeof(McpeDisconnect) == message.GetType())
            {
                McpeDisconnect disconnect = (McpeDisconnect)message;
                Log.Warn("Got disconnect in node: " + disconnect.message);

                // Start encrypotion
                handler.Disconnect(disconnect.message, false);
            }

            else if (typeof(McpeClientToServerHandshake) == message.GetType())
            {
                _loginTimer.Start();
                // Start encrypotion
                handler.HandleMcpeClientToServerHandshake((McpeClientToServerHandshake)message);
            }

            else if (typeof(McpeUpdateBlock) == message.GetType())
            {
                // DO NOT USE. Will dissapear from MCPE any release.
                // It is a bug that it leaks these messages.
            }

            else if (typeof(McpeRemoveBlock) == message.GetType())
            {
                handler.HandleMcpeRemoveBlock((McpeRemoveBlock)message);
            }

            else if (typeof(McpeAnimate) == message.GetType())
            {
                handler.HandleMcpeAnimate((McpeAnimate)message);
            }

            else if (typeof(McpeUseItem) == message.GetType())
            {
                handler.HandleMcpeUseItem((McpeUseItem)message);
            }

            else if (typeof(McpeEntityEvent) == message.GetType())
            {
                handler.HandleMcpeEntityEvent((McpeEntityEvent)message);
            }

            else if (typeof(McpeText) == message.GetType())
            {
                handler.HandleMcpeText((McpeText)message);
            }

            else if (typeof(McpeRemoveEntity) == message.GetType())
            {
                // Do nothing right now, but should clear out the entities and stuff
                // from this players internal structure.
            }

            else if (typeof(McpeLogin) == message.GetType())
            {
                handler.HandleMcpeLogin((McpeLogin)message);
            }

            else if (typeof(McpeMovePlayer) == message.GetType())
            {
                handler.HandleMcpeMovePlayer((McpeMovePlayer)message);
            }

            else if (typeof(McpeInteract) == message.GetType())
            {
                handler.HandleMcpeInteract((McpeInteract)message);
            }

            else if (typeof(McpeRespawn) == message.GetType())
            {
                handler.HandleMcpeRespawn((McpeRespawn)message);
            }

            else if (typeof(McpeBlockEntityData) == message.GetType())
            {
                handler.HandleMcpeBlockEntityData((McpeBlockEntityData)message);
            }

            else if (typeof(McpePlayerAction) == message.GetType())
            {
                handler.HandleMcpePlayerAction((McpePlayerAction)message);
            }

            else if (typeof(McpeDropItem) == message.GetType())
            {
                handler.HandleMcpeDropItem((McpeDropItem)message);
            }

            else if (typeof(McpeContainerSetSlot) == message.GetType())
            {
                handler.HandleMcpeContainerSetSlot((McpeContainerSetSlot)message);
            }

            else if (typeof(McpeContainerClose) == message.GetType())
            {
                handler.HandleMcpeContainerClose((McpeContainerClose)message);
            }

            else if (typeof(McpeMobEquipment) == message.GetType())
            {
                handler.HandleMcpeMobEquipment((McpeMobEquipment)message);
            }

            else if (typeof(McpeMobArmorEquipment) == message.GetType())
            {
                handler.HandleMcpeMobArmorEquipment((McpeMobArmorEquipment)message);
            }

            else if (typeof(McpeCraftingEvent) == message.GetType())
            {
                handler.HandleMcpeCraftingEvent((McpeCraftingEvent)message);
            }

            else if (typeof(McpeRequestChunkRadius) == message.GetType())
            {
                handler.HandleMcpeRequestChunkRadius((McpeRequestChunkRadius)message);
            }

            else if (typeof(McpeMapInfoRequest) == message.GetType())
            {
                handler.HandleMcpeMapInfoRequest((McpeMapInfoRequest)message);
            }

            else if (typeof(McpeItemFrameDropItem) == message.GetType())
            {
                handler.HandleMcpeItemFrameDropItem((McpeItemFrameDropItem)message);
            }

            else if (typeof(McpeResourcePackClientResponse) == message.GetType())
            {
                handler.HandleMcpeResourcePackClientResponse((McpeResourcePackClientResponse)message);
            }

            else if (typeof(McpePlayerInput) == message.GetType())
            {
                handler.HandleMcpePlayerInput((McpePlayerInput)message);
            }

            else
            {
                Log.Error($"Unhandled package: {message.GetType().Name} 0x{message.Id:X2} for user: {_player.Username}");
                return;
            }

            if (message.Timer.IsRunning)
            {
                long elapsedMilliseconds = message.Timer.ElapsedMilliseconds;
                if (elapsedMilliseconds > 1000)
                {
                    Log.WarnFormat("Package (0x{1:x2}) handling too long {0}ms for {2}", elapsedMilliseconds, message.Id, _player.Username);
                }
            }
            else
            {
                Log.WarnFormat("Package (0x{0:x2}) timer not started for {1}.", message.Id, _player.Username);
            }
        }
Beispiel #5
0
        private void HandlePackage(Package message)
        {
            if (typeof(McpeBatch) == message.GetType())
            {
                OnBatch(message);

                return;
            }

            //TraceReceive(message);

            if (typeof(UnknownPackage) == message.GetType())
            {
                return;
            }

            else if (typeof(McpeDisconnect) == message.GetType())
            {
                McpeDisconnect msg = (McpeDisconnect)message;
                Log.InfoFormat("Disconnect {1}: {0}", msg.message, Username);
                //SendDisconnectionNotification();
                StopClient();
                return;
            }

            else if (typeof(ConnectedPing) == message.GetType())
            {
                ConnectedPing msg = (ConnectedPing)message;
                SendConnectedPong(msg.sendpingtime);
                return;
            }

            else if (typeof(McpeFullChunkData) == message.GetType())
            {
                OnFullChunkData(message);
                return;
            }

            else if (typeof(ConnectionRequestAccepted) == message.GetType())
            {
                OnConnectionRequestAccepted();
                return;
            }

            else if (typeof(McpeSetSpawnPosition) == message.GetType())
            {
                OnMcpeSetSpawnPosition(message);

                return;
            }

            else if (typeof(McpeStartGame) == message.GetType())
            {
                OnMcpeStartGame(message);

                return;
            }

            else if (typeof(McpeTileEvent) == message.GetType())
            {
                OnMcpeTileEvent(message);
                return;
            }
            else if (typeof(McpeAddEntity) == message.GetType())
            {
                OnMcpeAddEntity(message);

                return;
            }
            else if (typeof(McpeAddPlayer) == message.GetType())
            {
                OnMcpeAddPlayer(message);

                return;
            }
            else if (typeof(McpeSetEntityData) == message.GetType())
            {
                OnMcpeSetEntityData(message);
                return;
            }

            else if (typeof(McpeMovePlayer) == message.GetType())
            {
                //OnMcpeMovePlayer(message);
                return;
            }

            else if (typeof(McpeUpdateBlock) == message.GetType())
            {
                OnMcpeUpdateBlock(message);
                return;
            }

            else if (typeof(McpeLevelEvent) == message.GetType())
            {
                OnMcpeLevelEvent(message);
                return;
            }

            else if (typeof(McpeMobEffect) == message.GetType())
            {
                OnMcpeMobEffect(message);
                return;
            }

            else if (typeof(McpeSpawnExperienceOrb) == message.GetType())
            {
                OnMcpeSpawnExperienceOrb(message);
                return;
            }


            else if (typeof(McpeContainerSetContent) == message.GetType())
            {
                OnMcpeContainerSetContent(message);
                return;
            }

            else if (typeof(McpeCraftingData) == message.GetType())
            {
                OnMcpeCraftingData(message);
                return;
            }
        }
Beispiel #6
0
        /// <summary>
        ///     Handles the specified package.
        /// </summary>
        /// <param name="message">The package.</param>
        /// <param name="senderEndpoint">The sender's endpoint.</param>
        private void HandlePackage(Package message, IPEndPoint senderEndpoint)
        {
            if (typeof(McpeBatch) == message.GetType())
            {
                McpeBatch batch = (McpeBatch)message;

                var messages = new List <Package>();

                // Get bytes
                byte[] payload = batch.payload;
                // Decompress bytes

                MemoryStream stream = new MemoryStream(payload);
                if (stream.ReadByte() != 0x78)
                {
                    throw new InvalidDataException("Incorrect ZLib header. Expected 0x78 0x9C");
                }
                stream.ReadByte();
                using (var defStream2 = new DeflateStream(stream, CompressionMode.Decompress, false))
                {
                    // Get actual package out of bytes
                    MemoryStream destination = new MemoryStream();
                    defStream2.CopyTo(destination);
                    byte[] internalBuffer = destination.ToArray();
                    messages.Add(PackageFactory.CreatePackage(internalBuffer[0], internalBuffer) ?? new UnknownPackage(internalBuffer[0], internalBuffer));
                }
                foreach (var msg in messages)
                {
                    HandlePackage(msg, senderEndpoint);
                }
                return;
            }

            TraceReceive(message);

            if (typeof(UnknownPackage) == message.GetType())
            {
                return;
            }

            if (typeof(McpeDisconnect) == message.GetType())
            {
                McpeDisconnect msg = (McpeDisconnect)message;
                Log.Debug(msg.message);
                StopServer();
                return;
            }

            if (typeof(ConnectedPing) == message.GetType())
            {
                ConnectedPing msg = (ConnectedPing)message;
                SendConnectedPong(msg.sendpingtime);
                return;
            }

            if (typeof(McpeFullChunkData) == message.GetType())
            {
                McpeFullChunkData msg   = (McpeFullChunkData)message;
                ChunkColumn       chunk = ClientUtils.DecocedChunkColumn(msg.chunkData);
                if (chunk != null)
                {
                    Log.DebugFormat("Chunk X={0}", chunk.x);
                    Log.DebugFormat("Chunk Z={0}", chunk.z);

                    ClientUtils.SaveChunkToAnvil(chunk);
                }
                return;
            }

            if (typeof(ConnectionRequestAccepted) == message.GetType())
            {
                Thread.Sleep(50);
                SendNewIncomingConnection();
                var t1 = new Timer(state => SendConnectedPing(), null, 2000, 5000);
                Thread.Sleep(50);
                SendLogin("Client12");
                return;
            }

            if (typeof(McpeSetSpawnPosition) == message.GetType())
            {
                McpeSetSpawnPosition msg = (McpeSetSpawnPosition)message;
                _spawn        = new Vector3(msg.x, msg.y, msg.z);
                _level.SpawnX = (int)_spawn.X;
                _level.SpawnY = (int)_spawn.Y;
                _level.SpawnZ = (int)_spawn.Z;

                return;
            }

            if (typeof(McpeStartGame) == message.GetType())
            {
                McpeStartGame msg = (McpeStartGame)message;
                _entityId        = msg.entityId;
                _spawn           = new Vector3(msg.x, msg.y, msg.z);
                _level.LevelName = "Default";
                _level.Version   = 19133;
                _level.GameType  = msg.gamemode;

                ClientUtils.SaveLevel(_level);

                return;
            }

            if (typeof(McpeTileEvent) == message.GetType())
            {
                McpeTileEvent msg = (McpeTileEvent)message;
                Log.DebugFormat("X: {0}", msg.x);
                Log.DebugFormat("Y: {0}", msg.y);
                Log.DebugFormat("Z: {0}", msg.z);
                Log.DebugFormat("Case 1: {0}", msg.case1);
                Log.DebugFormat("Case 2: {0}", msg.case2);
                return;
            }
            if (typeof(McpeAddEntity) == message.GetType())
            {
                McpeAddEntity msg = (McpeAddEntity)message;
                Log.DebugFormat("Entity ID: {0}", msg.entityId);
                Log.DebugFormat("Entity Type: {0}", msg.entityType);
                Log.DebugFormat("X: {0}", msg.x);
                Log.DebugFormat("Y: {0}", msg.y);
                Log.DebugFormat("Z: {0}", msg.z);
                Log.DebugFormat("Yaw: {0}", msg.yaw);
                Log.DebugFormat("Pitch: {0}", msg.pitch);
                Log.DebugFormat("Velocity X: {0}", msg.speedX);
                Log.DebugFormat("Velocity Y: {0}", msg.speedY);
                Log.DebugFormat("Velocity Z: {0}", msg.speedZ);
                Log.DebugFormat("Metadata: {0}", msg.metadata.ToString());
                Log.DebugFormat("Links count: {0}", msg.links);

                return;
            }
            if (typeof(McpeSetEntityData) == message.GetType())
            {
                McpeSetEntityData msg = (McpeSetEntityData)message;
                Log.DebugFormat("Entity ID: {0}", msg.entityId);
                MetadataDictionary metadata = msg.metadata;
                Log.DebugFormat("Metadata: {0}", metadata.ToString());
                return;
            }

            if (typeof(McpeMovePlayer) == message.GetType())
            {
                McpeMovePlayer msg = (McpeMovePlayer)message;
                Log.DebugFormat("Entity ID: {0}", msg.entityId);

                _currentLocation = new PlayerLocation(msg.x, msg.y + 10, msg.z);
                SendMcpeMovePlayer();
                return;
            }

            if (typeof(McpeUpdateBlock) == message.GetType())
            {
                McpeUpdateBlock msg = (McpeUpdateBlock)message;
                Log.DebugFormat("No of Blocks: {0}", msg.blocks.Count);
                return;
            }

            if (typeof(McpeLevelEvent) == message.GetType())
            {
                McpeLevelEvent msg = (McpeLevelEvent)message;
                Log.DebugFormat("Event ID: {0}", msg.eventId);
                Log.DebugFormat("X: {0}", msg.x);
                Log.DebugFormat("Y: {0}", msg.y);
                Log.DebugFormat("Z: {0}", msg.z);
                Log.DebugFormat("Data: {0}", msg.data);
                return;
            }
        }
Beispiel #7
0
        //public override void HandleMcpePlayStatus(McpePlayStatus message)
        //{
        //	throw new NotImplementedException();
        //}

        //public override void HandleMcpeServerToClientHandshake(McpeServerToClientHandshake message)
        //{
        //	throw new NotImplementedException();
        //}

        public override void HandleMcpeDisconnect(McpeDisconnect message)
        {
            Log.InfoFormat("Disconnect {1}: {0}", message.message, Client.Username);

            base.HandleMcpeDisconnect(message);
        }
Beispiel #8
0
        /// <summary>
        ///     Handles the specified package.
        /// </summary>
        /// <param name="message">The package.</param>
        /// <param name="senderEndpoint">The sender's endpoint.</param>
        private void HandlePackage(Package message, IPEndPoint senderEndpoint)
        {
            if (typeof(McpeBatch) == message.GetType())
            {
                Log.Debug("Processing Batch package");
                McpeBatch batch = (McpeBatch)message;

                var messages = new List <Package>();

                // Get bytes
                byte[] payload = batch.payload;
                // Decompress bytes

                MemoryStream stream = new MemoryStream(payload);
                if (stream.ReadByte() != 0x78)
                {
                    throw new InvalidDataException("Incorrect ZLib header. Expected 0x78");
                }
                stream.ReadByte();
                using (var defStream2 = new DeflateStream(stream, CompressionMode.Decompress, false))
                {
                    // Get actual package out of bytes
                    MemoryStream destination = new MemoryStream();
                    defStream2.CopyTo(destination);
                    destination.Position = 0;
                    NbtBinaryReader reader = new NbtBinaryReader(destination, true);
                    do
                    {
                        int    len            = reader.ReadInt32();
                        byte[] internalBuffer = reader.ReadBytes(len);
                        messages.Add(PackageFactory.CreatePackage(internalBuffer[0], internalBuffer) ?? new UnknownPackage(internalBuffer[0], internalBuffer));
                    } while (destination.Position < destination.Length);                     // throw new Exception("Have more data");
                }
                foreach (var msg in messages)
                {
                    HandlePackage(msg, senderEndpoint);
                    msg.PutPool();
                }
                return;
            }

            TraceReceive(message);

            if (typeof(UnknownPackage) == message.GetType())
            {
                return;
            }

            if (typeof(McpeDisconnect) == message.GetType())
            {
                McpeDisconnect msg = (McpeDisconnect)message;
                Log.InfoFormat("Disconnect {1}: {0}", msg.message, Username);
                SendDisconnectionNotification();
                StopClient();
                return;
            }

            if (typeof(ConnectedPing) == message.GetType())
            {
                ConnectedPing msg = (ConnectedPing)message;
                SendConnectedPong(msg.sendpingtime);
                return;
            }

            if (typeof(McpeFullChunkData) == message.GetType())
            {
                //McpeFullChunkData msg = (McpeFullChunkData) message;
                //ChunkColumn chunk = ClientUtils.DecocedChunkColumn(msg.chunkData);
                //if (chunk != null)
                //{
                //	Log.DebugFormat("Chunk X={0}", chunk.x);
                //	Log.DebugFormat("Chunk Z={0}", chunk.z);

                //	//ClientUtils.SaveChunkToAnvil(chunk);
                //}
                return;
            }

            if (typeof(ConnectionRequestAccepted) == message.GetType())
            {
                Thread.Sleep(50);
                SendNewIncomingConnection();
                //_connectedPingTimer = new Timer(state => SendConnectedPing(), null, 1000, 1000);
                Thread.Sleep(50);
                SendLogin(Username);
                return;
            }

            if (typeof(McpeSetSpawnPosition) == message.GetType())
            {
                McpeSetSpawnPosition msg = (McpeSetSpawnPosition)message;
                _spawn        = new Vector3(msg.x, msg.y, msg.z);
                _level.SpawnX = (int)_spawn.X;
                _level.SpawnY = (int)_spawn.Y;
                _level.SpawnZ = (int)_spawn.Z;

                return;
            }

            if (typeof(McpeStartGame) == message.GetType())
            {
                McpeStartGame msg = (McpeStartGame)message;
                _entityId        = msg.entityId;
                _spawn           = new Vector3(msg.x, msg.y, msg.z);
                _level.LevelName = "Default";
                _level.Version   = 19133;
                _level.GameType  = msg.gamemode;

                //ClientUtils.SaveLevel(_level);

                return;
            }

            if (typeof(McpeTileEvent) == message.GetType())
            {
                McpeTileEvent msg = (McpeTileEvent)message;
                Log.DebugFormat("X: {0}", msg.x);
                Log.DebugFormat("Y: {0}", msg.y);
                Log.DebugFormat("Z: {0}", msg.z);
                Log.DebugFormat("Case 1: {0}", msg.case1);
                Log.DebugFormat("Case 2: {0}", msg.case2);
                return;
            }
            if (typeof(McpeAddEntity) == message.GetType())
            {
                McpeAddEntity msg = (McpeAddEntity)message;
                Log.DebugFormat("Entity ID: {0}", msg.entityId);
                Log.DebugFormat("Entity Type: {0}", msg.entityType);
                Log.DebugFormat("X: {0}", msg.x);
                Log.DebugFormat("Y: {0}", msg.y);
                Log.DebugFormat("Z: {0}", msg.z);
                Log.DebugFormat("Yaw: {0}", msg.yaw);
                Log.DebugFormat("Pitch: {0}", msg.pitch);
                Log.DebugFormat("Velocity X: {0}", msg.speedX);
                Log.DebugFormat("Velocity Y: {0}", msg.speedY);
                Log.DebugFormat("Velocity Z: {0}", msg.speedZ);
                //Log.DebugFormat("Metadata: {0}", msg.metadata.ToString());
                //Log.DebugFormat("Links count: {0}", msg.links);

                return;
            }
            if (typeof(McpeSetEntityData) == message.GetType())
            {
                McpeSetEntityData msg = (McpeSetEntityData)message;
                Log.DebugFormat("Entity ID: {0}", msg.entityId);
                MetadataDictionary metadata = msg.metadata;
                Log.DebugFormat("Metadata: {0}", metadata.ToString());
                return;
            }

            if (typeof(McpeMovePlayer) == message.GetType())
            {
                //McpeMovePlayer msg = (McpeMovePlayer) message;
                //Log.DebugFormat("Entity ID: {0}", msg.entityId);

                //CurrentLocation = new PlayerLocation(msg.x, msg.y + 10, msg.z);
                //SendMcpeMovePlayer();
                return;
            }

            if (typeof(McpeUpdateBlock) == message.GetType())
            {
                McpeUpdateBlock msg = (McpeUpdateBlock)message;
                Log.DebugFormat("No of Blocks: {0}", msg.blocks.Count);
                return;
            }

            if (typeof(McpeLevelEvent) == message.GetType())
            {
                McpeLevelEvent msg = (McpeLevelEvent)message;
                Log.DebugFormat("Event ID: {0}", msg.eventId);
                Log.DebugFormat("X: {0}", msg.x);
                Log.DebugFormat("Y: {0}", msg.y);
                Log.DebugFormat("Z: {0}", msg.z);
                Log.DebugFormat("Data: {0}", msg.data);
                return;
            }

            if (typeof(McpeContainerSetContent) == message.GetType())
            {
                McpeContainerSetContent msg = (McpeContainerSetContent)message;
                Log.DebugFormat("Window ID: 0x{0:x2}, Count: {1}", msg.windowId, msg.slotData.Count);
                var slots = msg.slotData.GetValues();

                foreach (var entry in slots)
                {
                    MetadataSlot slot = (MetadataSlot)entry;
                    //Log.DebugFormat(" - Id: {0}, Metadata: {1}, Count: {2}", slot.Value.Item.Id, slot.Value.Item.Metadata, slot.Value.Count);
                }
                return;
            }

            if (typeof(McpeCraftingData) == message.GetType())
            {
                string fileName = Path.GetTempPath() + "Recipes_" + Guid.NewGuid() + ".txt";
                Log.Info("Writing recipes to filename: " + fileName);
                FileStream file = File.OpenWrite(fileName);

                McpeCraftingData   msg    = (McpeCraftingData)message;
                IndentedTextWriter writer = new IndentedTextWriter(new StreamWriter(file));

                writer.WriteLine("static RecipeManager()");
                writer.WriteLine("{");
                writer.Indent++;
                writer.WriteLine("Recipes = new Recipes");
                writer.WriteLine("{");
                writer.Indent++;

                foreach (Recipe recipe in msg.recipes)
                {
                    ShapelessRecipe shapelessRecipe = recipe as ShapelessRecipe;
                    if (shapelessRecipe != null)
                    {
                        writer.WriteLine(string.Format("new ShapelessRecipe(new ItemStack(ItemFactory.GetItem({0}, {1}), {2}),", shapelessRecipe.Result.Id, shapelessRecipe.Result.Metadata, shapelessRecipe.Result.Count));
                        writer.Indent++;
                        writer.WriteLine("new List<ItemStack>");
                        writer.WriteLine("{");
                        writer.Indent++;
                        foreach (var itemStack in shapelessRecipe.Input)
                        {
                            writer.WriteLine(string.Format("new ItemStack(ItemFactory.GetItem({0}, {1}), {2}),", itemStack.Id, itemStack.Metadata, itemStack.Count));
                        }
                        writer.Indent--;
                        writer.WriteLine("}),");
                        writer.Indent--;

                        continue;
                    }

                    ShapedRecipe shapedRecipe = recipe as ShapedRecipe;
                    if (shapedRecipe != null)
                    {
                        writer.WriteLine(string.Format("new ShapedRecipe({0}, {1}, new ItemStack(ItemFactory.GetItem({2}, {3}), {4}),", shapedRecipe.Width, shapedRecipe.Height, shapedRecipe.Result.Id, shapedRecipe.Result.Metadata, shapedRecipe.Result.Count));
                        writer.Indent++;
                        writer.WriteLine("new Item[]");
                        writer.WriteLine("{");
                        writer.Indent++;
                        foreach (Item item in shapedRecipe.Input)
                        {
                            writer.WriteLine(string.Format("ItemFactory.GetItem({0}, {1}),", item.Id, item.Metadata));
                        }
                        writer.Indent--;
                        writer.WriteLine("}),");
                        writer.Indent--;

                        continue;
                    }
                }

                writer.WriteLine("};");
                writer.Indent--;
                writer.WriteLine("}");
                writer.Indent--;

                writer.Flush();

                file.Close();
                Environment.Exit(0);
                return;
            }
        }
Beispiel #9
0
 public override void HandleMcpeDisconnect(McpeDisconnect message)
 {
     Log.Info($"Received disconnect: {message.message}");
     BaseClient.ShowDisconnect(message.message, false);
     base.HandleMcpeDisconnect(message);
 }