Commit 76a75866 authored by mercury233's avatar mercury233 Committed by GitHub

format

parent d7dc36c5
#Ygopro script engine. # YGOPro script engine.
##Introduction ## Introduction
The core logic and lua script processor of YGOPro. this library can be made external of the project and used to power server technologies. It mantains a state engine that is manipulated by Lua scripts using manipulation functions it exposes. The core logic and lua script processor of YGOPro. this library can be made external of the project and used to power server technologies. It mantains a state engine that is manipulated by Lua scripts using manipulation functions it exposes.
##Compiling ## Compiling
###1.) Download Fluorohydride/ygopro ### 1.) Download Fluorohydride/ygopro
Start by downloading the most parent of the source code. The team developing this project are the defacto edge and experts in our community. The most upto date `ocgcore` is a compiled dll version of the `Fluorohydride/ygopro/ocgcore` folders project. Start by downloading the most parent of the source code. The team developing this project are the defacto edge and experts in our community. The most upto date `ocgcore` is a compiled dll version of the `Fluorohydride/ygopro/ocgcore` folders project.
###2.) Install Premake4 and Visual Studio 2010 (or later). ### 2.) Install Premake4 and Visual Studio 2010 (or later).
Download premake4.exe, put it in `c:\windows` or a similar folder that is globally accessiable via `cmd` or PowerShell. Install Visual Studio 2010, it is the system used for the guide because other parts of the project use C# and most the development team are Windows users. Download premake4.exe, put it in `c:\windows` or a similar folder that is globally accessiable via `cmd` or PowerShell. Install Visual Studio 2010, it is the system used for the guide because other parts of the project use C# and most the development team are Windows users.
###3.) Download dependencies ### 3.) Download dependencies
Dependencies are absent from the main project. There is information on how to build them but the easist thing to do is to download the following folders from a [soarqin/ygopro](https://github.com/soarqin/ygopro) fork and simply copy them into the `Fluorohydride/ygopro` folder. Dependencies are absent from the main project. There is information on how to build them but the easist thing to do is to download the following folders from a [soarqin/ygopro](https://github.com/soarqin/ygopro) fork and simply copy them into the `Fluorohydride/ygopro` folder.
* event * event
* freetype * freetype
* irrklang
* irrlict * irrlict
* lua * lua
* sqlite3 * sqlite3
###4.) Create the project files ### 4.) Create the project files
Run the following commands from the command line in the `Fluorohydride/ygopro` folder. Run the following commands from the command line in the `Fluorohydride/ygopro` folder.
` premake4 /help ` ` premake4 /help `
...@@ -28,7 +27,7 @@ Run the following commands from the command line in the `Fluorohydride/ygopro` f ...@@ -28,7 +27,7 @@ Run the following commands from the command line in the `Fluorohydride/ygopro` f
If you are not using Visual Studio 2010 or higher, make the needed adjustments. In the file system open `Fluorohydride/ygopro/build` folder open the `ygo` project. If you are not using Visual Studio 2010 or higher, make the needed adjustments. In the file system open `Fluorohydride/ygopro/build` folder open the `ygo` project.
### Build the system ### 5.) Build the system
Make sure the code actually compiles. Compile them in the following order one by one: Make sure the code actually compiles. Compile them in the following order one by one:
* lua * lua
...@@ -37,7 +36,7 @@ Make sure the code actually compiles. Compile them in the following order one by ...@@ -37,7 +36,7 @@ Make sure the code actually compiles. Compile them in the following order one by
This should provide you with `ocgcore.lib` in the build output folder. `YGOCore` requires a `*.dll`; in `ocgcore` project properities change it to a dynamically linked library. Recompile, it should fail with an error indicating missing dependencies. Right click the project, add a existing file. Add `lua.lib` from the build folder to the project. It should now compile. This should provide you with `ocgcore.lib` in the build output folder. `YGOCore` requires a `*.dll`; in `ocgcore` project properities change it to a dynamically linked library. Recompile, it should fail with an error indicating missing dependencies. Right click the project, add a existing file. Add `lua.lib` from the build folder to the project. It should now compile.
##Exposed Functions ## Exposed Functions
These three function need to be provided to the core so it can get card and database information. These three function need to be provided to the core so it can get card and database information.
- `void set_script_reader(script_reader f);` : Interface provided returns scripts based on number that corrosponses to a lua file, send in a string. - `void set_script_reader(script_reader f);` : Interface provided returns scripts based on number that corrosponses to a lua file, send in a string.
...@@ -65,5 +64,5 @@ These functions create the game itself and then manipulate it. ...@@ -65,5 +64,5 @@ These functions create the game itself and then manipulate it.
- `void set_responseb(ptr pduel, byte* buf);` - `void set_responseb(ptr pduel, byte* buf);`
- `int32 preload_script(ptr pduel, char* script, int32 len);` - `int32 preload_script(ptr pduel, char* script, int32 len);`
#Lua functions # Lua functions
`interpreter.cpp` `interpreter.cpp`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment