Commit ac3baf79 authored by nanahira's avatar nanahira

mg_custom

parents 6a15c97a 14a10e97
## YGOPro(Server)
OCG server data for 222/7210
[![Build Status](https://travis-ci.org/purerosefallen/ygopro-7210srv.svg?branch=master)](https://travis-ci.org/purerosefallen/ygopro-7210srv)
\ No newline at end of file
## YGOPro-222DIY
The server of YGOPRO 222DIY group
[![Build Status](https://travis-ci.org/purerosefallen/ygopro-222DIY.svg?branch=master)](https://travis-ci.org/purerosefallen/ygopro-222DIY)
\ No newline at end of file
......@@ -26,6 +26,9 @@ install:
# let premake happy
- xcopy /E premake\* .
# patch lua
# - patch -p0 < lua\lua.patch
# premake
- premake5 vs2015
......@@ -37,6 +40,7 @@ build:
after_build:
- ps: move bin\release\ygopro.exe .
- git clone https://github.com/Smile-DK/ygopro-svrelease
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/ygopro-server/archive/master.zip ; exit 0"
- 7z x ygopro-server-master.zip
......@@ -112,7 +116,7 @@ artifacts:
- path: ygopro.exe
name: ygopro
- path: ygopro-server.7z
name: ygopro-server
name: ygopro-server
cache:
- premake-5.0.0-alpha12-windows.zip
......@@ -124,3 +128,4 @@ cache:
- irrKlang-32bit-1.5.0.zip
- premake-5.0.0-alpha10-windows.zip
- Redis-x64-3.2.100.zip
......@@ -33,9 +33,9 @@ HostInfo game_info;
void Game::MainServerLoop() {
deckManager.LoadLFList();
LoadBetaDB();
LoadExpansionDB();
dataManager.LoadDB("cards.cdb");
aServerPort = NetServer::StartServer(aServerPort);
NetServer::InitDuel();
printf("%u\n", aServerPort);
......@@ -49,6 +49,38 @@ void Game::MainServerLoop() {
#endif
}
}
void Game::LoadBetaDB() {
#ifdef _WIN32
char fpath[1000];
WIN32_FIND_DATAW fdataw;
HANDLE fh = FindFirstFileW(L"./beta/*.cdb", &fdataw);
if(fh != INVALID_HANDLE_VALUE) {
do {
if(!(fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./beta/%s", fname);
dataManager.LoadDB(fpath);
}
} while(FindNextFileW(fh, &fdataw));
FindClose(fh);
}
#else
DIR * dir;
struct dirent * dirp;
if((dir = opendir("./beta/")) != 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[1000];
sprintf(filepath, "./beta/%s", dirp->d_name);
dataManager.LoadDB(filepath);
}
closedir(dir);
}
#endif
}
#else //YGOPRO_SERVER_MODE
bool Game::Initialize() {
srand(time(0));
......
......@@ -102,6 +102,7 @@ public:
#ifdef YGOPRO_SERVER_MODE
void MainServerLoop();
void LoadExpansionDB();
void LoadBetaDB();
void AddDebugMsg(char* msgbuf);
#else
void MainLoop();
......
......@@ -741,7 +741,12 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
//modded
case 10:
case 11:
<<<<<<< HEAD
case 12: {
=======
case 12:
case 13: {
>>>>>>> 14a10e9739978823dada7a651464807daa69d5a3
NetServer::SendBufferToPlayer(players[0], STOC_GAME_MSG, offset, pbuf - offset);
NetServer::SendBufferToPlayer(players[1], STOC_GAME_MSG, offset, pbuf - offset);
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
......
......@@ -667,7 +667,12 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
}
//modded
case 11:
<<<<<<< HEAD
case 12: {
=======
case 12:
case 13: {
>>>>>>> 14a10e9739978823dada7a651464807daa69d5a3
for(int i = 0; i < 4; ++i)
NetServer::SendBufferToPlayer(players[i], STOC_GAME_MSG, offset, pbuf - offset);
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
......
......@@ -104,7 +104,7 @@ public:
public:
void addcard(card* pcard);
};
//millux
uint32 get_ritual_type();
//modded
......
......@@ -783,6 +783,10 @@ public:
#define HINT_CODE 8
#define HINT_NUMBER 9
#define HINT_CARD 10
//custom hints in KoishiPro for custom sound
#define HINT_MUSIC 11
#define HINT_SOUND 12
#define HINT_MUSIC_OGG 13
//
#define CHINT_TURN 1
#define CHINT_CARD 2
......
......@@ -645,7 +645,7 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setglobal(lua_state, "Debug");
//extra scripts
load_script((char*) "./script/constant.lua");
load_script((char*) "./script/utility.lua");
load_script((char*) "./script/utility.lua");
//load kpro constant
lua_pushinteger(lua_state, EFFECT_CHANGE_LINK_MARKER_KOISHI);
lua_setglobal(lua_state, "EFFECT_CHANGE_LINK_MARKER_KOISHI");
......@@ -655,10 +655,16 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setglobal(lua_state, "EFFECT_REMOVE_LINK_MARKER_KOISHI");
lua_pushinteger(lua_state, EFFECT_CANNOT_LOSE_KOISHI);
lua_setglobal(lua_state, "EFFECT_CANNOT_LOSE_KOISHI");
lua_pushinteger(lua_state, HINT_MUSIC);
lua_setglobal(lua_state, "HINT_MUSIC");
lua_pushinteger(lua_state, HINT_SOUND);
lua_setglobal(lua_state, "HINT_SOUND");
lua_pushinteger(lua_state, HINT_MUSIC_OGG);
lua_setglobal(lua_state, "HINT_MUSIC_OGG");
//load init.lua by MLD
load_script((char*) "./expansions/script/init.lua");
//2pick rule
load_script((char*) "./2pick/pick.lua");
//load init.lua by MLD
load_script((char*) "./expansions/script/init.lua");
}
interpreter::~interpreter() {
lua_close(lua_state);
......
......@@ -3379,7 +3379,7 @@ int32 field::process_battle_command(uint16 step) {
pduel->write_buffer32(indestructable_effect->owner->data.code);
if(indestructable_effect->description) {
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(12);
pduel->write_buffer8(HINT_SOUND);
pduel->write_buffer8(0);
pduel->write_buffer32(indestructable_effect->description);
}
......@@ -3396,7 +3396,7 @@ int32 field::process_battle_command(uint16 step) {
pduel->write_buffer32(indestructable_effect->owner->data.code);
if(indestructable_effect->description) {
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(12);
pduel->write_buffer8(HINT_SOUND);
pduel->write_buffer8(0);
pduel->write_buffer32(indestructable_effect->description);
}
......
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