Commit 579c823a authored by 神楽坂玲奈's avatar 神楽坂玲奈
parents 738de285 63c61e96
/expansions
/obj
/bin
/build
/replay
/deck
ygopro
## ygopro
A script engine for "yu-gi-oh!" and sample gui
## ygopro(server)
一个linux版的ygopro服务端,基于mycard代码修改。
[中文说明](https://github.com/Fluorohydride/ygopro/wiki/%E4%B8%AD%E6%96%87%E8%AF%B4%E6%98%8E)
现用于[YGOPRO 233服](http://mercury233.me/ygosrv233/)
###Keys:
* ESC: Minimize the window.
* A: Holding down this button will let the system stop at every timing.
* S: Holding down this button will let the system skip every timing.
* R: Fix the font error.
* F1~F4: Show the cards in your grave, banished zone, extra deck, xyz materials.
* F5~F8: Show the cards in your opponent's grave, banished zone, extra deck, xyz materials.
###编译
* 需要以下组件
* premake4
* freetype
* libevent
* sqlite3
* irrlicht1.8
* lua5.2
* libGL
* libGLU
* gcc
* 可参考 https://github.com/mycard/mycard.github.io/tree/master/server 中的脚本
###Color:
* Background:
* White = your card, Grey = your opponent's card
* Text:
* Black = default, Blue = the owner of the xyz material is different from its controller
###Sequence:
* Monster Zone: 1~5, starting from the left hand side.
* Spell & Trap Zone: 1~5, starting from the left hand side.
* Field Zone: 6
* Pendulum Zone: 7~8, starting from the left hand side.
* The others: 1~n, starting from the bottom.
###Deck edit page:
* All numeric textboxs: They support >, =, <, >=, <= signs.
* Card name: Search card names and texts by default, $foo will only search foo in card names, and @foo will search cards of "foo" archetype(due to translation, card name contains "foo" does not mean that card is "foo" card).
### Command-line options:
* -j: Join the host in system.conf file.
* -d: Enter the deck edit page.
* -r: Enter the replay mode page.
* -s: Enter the single mode page.
* -efoo: Load foo as the extra database.
### Directories:
* pics: .jpg card images(177*254).
* pics\thumbnail: .jpg thumbnail images(44*64).
* script: .lua script files.
* textures: Other image files.
* deck: .ydk deck files.
* replay: .yrp replay files.
* expansions: *.cdb will be loaded as extra databases.
###运行
* 使用[ygopro-server-lite](https://github.com/mercury233/ygopro-server)运行
* 手动运行的参数是
* ./ygopro 0 0 0 1 F F F 8000 5 1 180
* 端口(0为随机)
* 禁卡表编号
* 卡片允许
* 决斗模式
* 旧规则
* 不检查卡组
* 不洗切卡组
* 初始LP
* 初始手牌数
* 每回合抽卡
* 每回合时间
File added
......@@ -45,7 +45,7 @@ typedef std::unordered_map<unsigned int, CardDataC>::iterator code_pointer;
class ClientCard {
public:
/*
/*
irr::video::ITexture* curTexture;
irr::core::matrix4 mTransform;
irr::core::vector3df curPos;
......@@ -113,7 +113,7 @@ public:
void ClearTarget();
static bool client_card_sort(ClientCard* c1, ClientCard* c2);
static bool deck_sort_lv(code_pointer l1, code_pointer l2);
*/
*/
};
}
......
......@@ -47,8 +47,13 @@ inline int _wtoi(const wchar_t * s) {
/*
#include <irrlicht.h>
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#include "CGUITTFont.h"
#include "CGUIImageButton.h"
*/
......
......@@ -39,7 +39,6 @@ bool DataManager::LoadDB(const char* file) {
cd.attribute = sqlite3_column_int(pStmt, 9);
cd.category = sqlite3_column_int(pStmt, 10);
_datas.insert(std::make_pair(cd.code, cd));
/*
len = BufferIO::DecodeUTF8((const char*)sqlite3_column_text(pStmt, 12), strBuffer);
if(len) {
cs.name = new wchar_t[len + 1];
......
......@@ -36,6 +36,25 @@ unsigned char draw_count;
void Game::MainServerLoop(int bDuel_mode, int lflist) {
deckManager.LoadLFList();
dataManager.LoadDB("cards.cdb");
//load expansions
DIR * dir;
struct dirent * dirp;
const char *foldername = "./expansions/";
if((dir = opendir(foldername)) != NULL) {
while((dirp = readdir(dir)) != NULL) {
size_t len = strlen(dirp->d_name);
if(len < 5 || strcasecmp(dirp->d_name + len - 4, ".cdb") != 0)
continue;
char *filepath = (char *)malloc(sizeof(char)*(len + strlen(foldername)));
strncpy(filepath, foldername, strlen(foldername)+1);
strncat(filepath, dirp->d_name, len);
dataManager.LoadDB(filepath);
free(filepath);
}
closedir(dir);
}
aServerPort = NetServer::StartServer(aServerPort);
NetServer::Initduel(bDuel_mode, lflist);
printf("%u\n", aServerPort);
......
......@@ -76,7 +76,7 @@ class Game {
public:
bool Initialize();
void MainLoop();
//void MainLoop();
void MainServerLoop(int bDuel_mode, int lflist);
/*
void BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar);
......@@ -106,7 +106,7 @@ public:
void ClearTextures();
void CloseDuelWindow();
*/
*/
int LocalPlayer(int player);
const wchar_t* LocalName(int local_player);
......@@ -116,7 +116,8 @@ public:
return focus && focus->hasType(type);
}
*/
*/
Mutex gMutex;
Mutex gBuffer;
Signal frameSignal;
......@@ -162,7 +163,7 @@ public:
bool is_building;
bool is_siding;
*/
*/
/*
ClientField dField;
DeckBuilder deckBuilder;
......
......@@ -88,8 +88,7 @@ int main(int argc, char* argv[]) {
#ifdef _WIN32
WSACleanup();
#else
#endif //_WIN32
*/
return EXIT_SUCCESS;
}
......@@ -47,6 +47,7 @@ void NetServer::Initduel(int bDuel_mode, int lflist)
if(!hash)
pkt->info.lflist = deckManager._lfList[0].hash;
if(lflist == -1)
pkt->info.lflist = 0;
duel_mode->host_info = pkt->info;
......
include "lzma"
project "ygopro"
kind "WindowedApp"
kind "ConsoleApp"
files { "gframe.cpp", "config.h",
"game.cpp", "game.h",
......@@ -16,16 +16,9 @@ project "ygopro"
includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "sqlite3", "lua" , "event"}
configuration "windows"
files "ygopro.rc"
excludes "CGUIButton.cpp"
includedirs { "../irrlicht/include", "../freetype/include", "../event/include", "../sqlite3" }
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }
configuration {"windows", "not vs*"}
includedirs { "/mingw/include/irrlicht", "/mingw/include/freetype2" }
configuration "not vs*"
buildoptions { "-std=gnu++0x", "-fno-rtti" }
configuration "not windows"
includedirs { "/usr/include/lua", "/usr/include/lua5.2", "/usr/include/lua/5.2", "/usr/include/irrlicht", "/usr/include/freetype2" }
includedirs { "/usr/include/lua", "/usr/include/lua5.2", "/usr/include/lua/5.2" }
excludes { "COSOperator.*" }
links { "event_pthreads", "GL", "dl", "pthread" }
links { "event_pthreads", "dl", "pthread" }
This diff is collapsed.
Subproject commit a4839ff0aa4bf9f96cac51ef318e973d972e8748
Subproject commit 799b88b27a3c30e3e3a1534f9a7e6896ef132e6d
......@@ -15,8 +15,10 @@ solution "ygo"
configuration "macosx"
defines { "LUA_USE_MACOSX" }
includedirs { "/opt/local/include" }
libdirs { "/opt/local/lib" }
includedirs { "/usr/local/include/*" }
libdirs { "/usr/local/lib", "/usr/X11/lib" }
buildoptions { "-stdlib=libc++" }
links {"OpenGL.framework","Cocoa.framework","IOKit.framework"}
configuration "linux"
defines { "LUA_USE_LINUX" }
......
Subproject commit 26821f9728df2ea1cc3a2c1e587979dff7934172
Subproject commit 5cd2d54d7d81391a4932611fa5eacf73bf1d9746
......@@ -373,7 +373,7 @@
!system 1622 [%ls]错过时点
!system 1623 投掷硬币结果:
!system 1624 投掷骰子结果:
#vistory reason
#victory reason
!victory 0x0 投降
!victory 0x1 LP变成0
!victory 0x2 没有卡可抽
......
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