Exemple #1
0
        public static void loadqbnetworking(string path)
        {
            if (Client.net != null && Client.net.ConnectionsCount == 0)
            {
                Client.print("error", "Error : loadqbnetworking - is meant for network loading of files. Connect your client to a server before running this command, or try using \"loadqb\"");
                return;
            }

            Client.OpenGLContextThread.Add(() =>
            {
                StopwatchUtil.startclient("internalqbread", "Begin Qb Read");
                ImporterQb importer = new ImporterQb();
                QbModel model       = importer._read(path);

                StopwatchUtil.stopclient("internalqbread", "End Qb Read");

                StopwatchUtil.startclient("clientwriteqbpacket", "Begin Qb Packet Write");
                var packet = PacketWriter.write <Packet_QbImported>(NetEndpoint.CLIENT);
                packet.write(model);
                packet.send();
                StopwatchUtil.stopclient("clientwriteqbpacket", "End qb Packet Write");
            });
        }