SyntaxBomb - Indie Coders

Languages & Coding => Blitz Code Archives => File Utilities => Topic started by: BlitzBot on June 29, 2017, 00:28:40

Title: [bb] Compile Blitz3D with Blitz3D by Spencer [ 1+ years ago ]
Post by: BlitzBot on June 29, 2017, 00:28:40
Title : Compile Blitz3D with Blitz3D
Author : Spencer
Posted : 1+ years ago

Description : This program stitches  files in a "source" and "script" directory together into a single output.bb file, then invokes blitzcc.exe to compile and run output.bb

Update AUG-5-2015 Switched NEW_LN from 10-13 to 13-10 Per RGR's suggestion.

Here is an example layout of how to use.  The image references "the code above" , but in this case its the code below. The image was a supplement to a Forum discussion regarding BriskVM See link.

<a href="http://www.blitzbasic.co.nz/Community/posts.php?topic=103814" target="_blank">Is BriskVM dead? How do I get hold of?</a>

(//spencerjobe.com/Blitz3D/Blitz3D_Script_Compiler_Example)

I should say that this is merely a proof of concept. If you were distributing a program in this fashion you might want to do a couple of things:

1) "Scrub your Inputs" - Parse the user's script files and stop if there are any dangerous commands. File I/O is a good example. You don't want the user to read/write to files. So, you will need to parse and analyze the script files and throw an error on unwanted code. This is totally possible, but the code becomes more complicated and it would muddy up this example.

2) "Protect your Source" - Find a way to obfuscate you source files in the "source" folder.  This way users can't easily alter the Game's source code. There are many different ways to do this, but they were omitted from the example code for clarity.


Code :
Code (blitzbasic) Select
ml lang="en" >
<!-- Mirrored from www.blitzbasic.com/codearcs/codearcs.php?code=3218 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 09 Jun 2017 07:31:25 GMT -->
<head ><title >Compile Blitz3D with Blitz3D</title><meta name='description' content='Compile and run source and script files in Blitz3D using Blitzcc.exe, language=bb, category=File Utilities'><meta name='author' content='Spencer'>
    <script type="application/ld+json">
     {
      "@context": "http://schema.org/",
      "@type": "ComputerLanguage",
      "name": "BlitzMax",
      "url":"http://blitzmax.com",
 "description": "BlitzMax is a versatile desktop development environment for game coders with BASIC skills.",
      "image": "http://www.blitzbasic.com/img/blitzmax_512px.png"
     }
   </script><link rel="styleSheet" href=../skins/default/style.css type="text/css"><style type="text/css">div.bbcode {padding: 8px;background: #E5E5E5;color: #000000;border: 1px dashed #B4B4BE;}</style></head><body ><div style="display:block;width:100%;height:30px;"></div><table width=100% cellspacing=0 cellpadding=0><tr ><td align="left" valign="bottom"><table width=100% cellspacing=0 cellpadding=0><tr ><td ><table width=100% cellspacing=0 cellpadding=0><tr ><td class=tableft></td><td class=tab><a href="../Home/_index_.html" class=tab>Home</a></td><td class=tabright></td></tr></table></td><td ><table width=100% cellspacing=0 cellpadding=0><tr ><td class=tableft></td><td class=tab><a href="../Community/_index_.html" class=tab>Community</a></td><td class=tabright></td></tr></table></td><td ><table width=100% cellspacing=0 cellpadding=0><tr ><td class=tableft></td><td class=tab><a href="../Manuals/_index_.html" class=tab>Manuals</a></td><td class=tabright></td></tr></table></td></tr></table></td><td align="right"><a href="../Account/login.html" >Login</a> or <a href="../Account/signup.html" >Signup</a></td></tr></table><table width=100% cellspacing=0 cellpadding=0><tr ><td class="menubarleft"></td><td class="menubar"><table cellspacing="0" cellpadding="0"><tr ><td >&nbsp;</td></tr></table></td><td class="menubarright"></td></tr></table><div class="main"><h1 ><a href=codearcs.html>Code archives</a>/<a href=codearcsd65e.html?cat=8>File Utilities</a>/Compile Blitz3D with Blitz3D</h1><div class="quote">This code has been declared by its author to be Public Domain code.</div><br><a href="codearcs_bb/3218.html">Download source code</a><br><br><table width="100%" cellspacing="0" cellpadding="0"><tr ><td width="100%"><table width=100% cellspacing=0 cellpadding=0><tr ><td class=headleft></td><td class=head><table width=100% cellspacing=0 cellpadding=0><tr ><td >Compile Blitz3D with Blitz3D by Spencer</td><td align="right">1+ years ago </td></tr></table></td><td class=headright></td></tr></table></td></tr><tr ><td class="cell"> This program stitches  files in a "source" and "script" directory together into a single output.bb file, then invokes blitzcc.exe to compile and run output.bb<br><br><b>Update AUG-5-2015</b> Switched NEW_LN from 10-13 to 13-10 Per RGR's suggestion.<br><br>Here is an example layout of how to use.  The image references "the code above" , but in this case its the code below. The image was a supplement to a Forum discussion regarding BriskVM See link.<br><br><a href="http://www.blitzbasic.co.nz/Community/posts.php?topic=103814" target="_blank">Is BriskVM dead? How do I get hold of?</a><br><br>[img]spencerjobe.com/Blitz3D/Blitz3D_Script_Compiler_Example[/img]<br><br>I should say that this is merely a proof of concept. If you were distributing a program in this fashion you might want to do a couple of things: <br><br>1) "Scrub your Inputs" - Parse the user's script files and stop if there are any dangerous commands. File I/O is a good example. You don't want the user to read/write to files. So, you will need to parse and analyze the script files and throw an error on unwanted code. This is totally possible, but the code becomes more complicated and it would muddy up this example. <br><br>2) "Protect your Source" - Find a way to obfuscate you source files in the "source" folder.  This way users can't easily alter the Game's source code. There are many different ways to do this, but they were omitted from the example code for clarity. </td></tr><tr ><td class="cel


Comments : Mirrored from www.blitzbasic.com/codearcs/codearcs.php?code=3218 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 09 Jun 2017 07:31:25 GMT -->
<head ><title >Compile Blitz3D with Blitz3D</title><meta name='description' content='Compile and run source and script files in Blitz3D using Blitzcc.exe, language=bb, category=File Utilities'><meta name='author' content='Spencer'>
    <script type="application/ld+json">
     {
      "@context": "http://schema.org/",
      "@type": "ComputerLanguage",
      "name": "BlitzMax",
      "url":"http://blitzmax.com",
     "description": "BlitzMax is a versatile desktop development environment for game coders with BASIC skills.",
      "image": "http://www.blitzbasic.com/img/blitzmax_512px.png"
     }
   </script><link rel="styleSheet" href=../skins/default/style.css type="text/css"><style type="text/css">div.bbcode {padding: 8px;background: #E5E5E5;color: #000000;border: 1px dashed #B4B4BE;}</style></head><body ><div style="display:block;width:100%;height:30px;"></div>

<td align="left" valign="bottom">



<td class=tableft><td class=tab><a href="../Home/_index_.html" class=tab>Home</a><td class=tabright>

<td class=tableft><td class=tab><a href="../Community/_index_.html" class=tab>Community</a><td class=tabright>

<td class=tableft><td class=tab><a href="../Manuals/_index_.html" class=tab>Manuals</a><td class=tabright><td align="right"><a href="../Account/login.html" >Login</a> or <a href="../Account/signup.html" >Signup</a>

<td class="menubarleft"><td class="menubar"><table cellspacing="0" cellpadding="0">&nbsp;<td class="menubarright"><div class="main"><h1 ><a href=codearcs.html>Code archives</a>/<a href=codearcsd65e.html?cat=8>File Utilities</a>/Compile Blitz3D with Blitz3D</h1><div class="quote">This code has been declared by its author to be Public Domain code.</div><a href="codearcs_bb/3218.html">Download source code</a><table width="100%" cellspacing="0" cellpadding="0"><td width="100%">

<td class=headleft><td class=head>

Compile Blitz3D with Blitz3D by Spencer<td align="right">1+ years ago <td class=headright><td class="cell"> This program stitches  files in a "source" and "script" directory together into a single output.bb file, then invokes blitzcc.exe to compile and run output.bbUpdate AUG-5-2015 Switched NEW_LN from 10-13 to 13-10 Per RGR's suggestion.Here is an example layout of how to use.  The image references "the code above" , but in this case its the code below. The image was a supplement to a Forum discussion regarding BriskVM See link.<a href="http://www.blitzbasic.co.nz/Community/posts.php?topic=103814" target="_blank">Is BriskVM dead? How do I get hold of?</a>(//spencerjobe.com/Blitz3D/Blitz3D_Script_Compiler_Example)I should say that this is merely a proof of concept. If you were distributing a program in this fashion you might want to do a couple of things: 1) "Scrub your Inputs" - Parse the user's script files and stop if there are any dangerous commands. File I/O is a good example. You don't want the user to read/write to files. So, you will need to parse and analyze the script files and throw an error on unwanted code. This is totally possible, but the code becomes more complicated and it would muddy up this example. 2) "Protect your Source" - Find a way to obfuscate you source files in the "source" folder.  This way users can't easily alter the Game's source code. There are many different ways to do this, but they were omitted from the example code for clarity. </t