Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wyykak
ygopro
Commits
fa5234f0
Commit
fa5234f0
authored
Aug 08, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
into server-link
parents
df40d0c9
538a0eba
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
116 additions
and
133 deletions
+116
-133
gframe/client_field.cpp
gframe/client_field.cpp
+7
-0
gframe/config.h
gframe/config.h
+88
-87
gframe/data_manager.cpp
gframe/data_manager.cpp
+1
-6
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+2
-12
gframe/duelclient.cpp
gframe/duelclient.cpp
+3
-1
gframe/event_handler.cpp
gframe/event_handler.cpp
+1
-0
gframe/game.cpp
gframe/game.cpp
+1
-5
gframe/gframe.cpp
gframe/gframe.cpp
+3
-0
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+0
-3
gframe/replay.cpp
gframe/replay.cpp
+2
-5
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+1
-3
gframe/single_mode.cpp
gframe/single_mode.cpp
+4
-11
strings.conf
strings.conf
+3
-0
No files found.
gframe/client_field.cpp
View file @
fa5234f0
...
...
@@ -76,6 +76,13 @@ void ClientField::Clear() {
reposable_cards
.
clear
();
attackable_cards
.
clear
();
disabled_field
=
0
;
panel
=
0
;
hovered_card
=
0
;
clicked_card
=
0
;
highlighting_card
=
0
;
hovered_controler
=
0
;
hovered_location
=
0
;
hovered_sequence
=
0
;
deck_act
=
false
;
grave_act
=
false
;
remove_act
=
false
;
...
...
gframe/config.h
View file @
fa5234f0
#ifndef __CONFIG_H
#define __CONFIG_H
#pragma once
#define _IRR_STATIC_LIB_
#define IRR_COMPILE_WITH_DX9_DEV_PACK
#ifdef _WIN32
#include <WinSock2.h>
#include <windows.h>
#ifdef _MSC_VER
#define myswprintf _swprintf
#else
#define myswprintf swprintf
#endif
#define socklen_t int
#else //_WIN32
#include <errno.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#define SD_BOTH 2
#define SOCKET int
#define closesocket close
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define SOCKADDR_IN sockaddr_in
#define SOCKADDR sockaddr
#define SOCKET_ERRNO() (errno)
#include <wchar.h>
#define myswprintf(buf, fmt, ...) swprintf(buf, 4096, fmt, ##__VA_ARGS__)
inline
int
_wtoi
(
const
wchar_t
*
s
)
{
wchar_t
*
endptr
;
return
(
int
)
wcstol
(
s
,
&
endptr
,
10
);
}
#endif
/*
#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"
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <time.h>
#include "bufferio.h"
#include "mymutex.h"
#include "mysignal.h"
#include "mythread.h"
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/card.h"
/*
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
*/
extern
const
unsigned
short
PRO_VERSION
;
extern
int
enable_log
;
extern
bool
exit_on_return
;
extern
bool
open_file
;
extern
wchar_t
open_file_name
[
256
];
#endif
#ifndef __CONFIG_H
#define __CONFIG_H
#pragma once
#define _IRR_STATIC_LIB_
#define IRR_COMPILE_WITH_DX9_DEV_PACK
#ifdef _WIN32
#include <WinSock2.h>
#include <windows.h>
#ifdef _MSC_VER
#define myswprintf _swprintf
#else
#define myswprintf swprintf
#endif
#define socklen_t int
#else //_WIN32
#include <errno.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <locale.h>
#define SD_BOTH 2
#define SOCKET int
#define closesocket close
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define SOCKADDR_IN sockaddr_in
#define SOCKADDR sockaddr
#define SOCKET_ERRNO() (errno)
#include <wchar.h>
#define myswprintf(buf, fmt, ...) swprintf(buf, 4096, fmt, ##__VA_ARGS__)
inline
int
_wtoi
(
const
wchar_t
*
s
)
{
wchar_t
*
endptr
;
return
(
int
)
wcstol
(
s
,
&
endptr
,
10
);
}
#endif
/*
#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"
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <time.h>
#include "bufferio.h"
#include "mymutex.h"
#include "mysignal.h"
#include "mythread.h"
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/card.h"
/*
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
*/
extern
const
unsigned
short
PRO_VERSION
;
extern
int
enable_log
;
extern
bool
exit_on_return
;
extern
bool
open_file
;
extern
wchar_t
open_file_name
[
256
];
#endif
gframe/data_manager.cpp
View file @
fa5234f0
...
...
@@ -80,12 +80,7 @@ bool DataManager::LoadStrings(const char* file) {
char
linebuf
[
256
];
char
strbuf
[
256
];
int
value
;
fseek
(
fp
,
0
,
SEEK_END
);
int
fsize
=
ftell
(
fp
);
fseek
(
fp
,
0
,
SEEK_SET
);
fgets
(
linebuf
,
256
,
fp
);
while
(
ftell
(
fp
)
<
fsize
)
{
fgets
(
linebuf
,
256
,
fp
);
while
(
fgets
(
linebuf
,
256
,
fp
))
{
if
(
linebuf
[
0
]
!=
'!'
)
continue
;
sscanf
(
linebuf
,
"!%s"
,
strbuf
);
...
...
gframe/deck_manager.cpp
View file @
fa5234f0
...
...
@@ -13,12 +13,7 @@ void DeckManager::LoadLFList() {
char
linebuf
[
256
];
wchar_t
strBuffer
[
256
];
if
(
fp
)
{
fseek
(
fp
,
0
,
SEEK_END
);
int
fsize
=
ftell
(
fp
);
fseek
(
fp
,
0
,
SEEK_SET
);
fgets
(
linebuf
,
256
,
fp
);
while
(
ftell
(
fp
)
<
fsize
)
{
fgets
(
linebuf
,
256
,
fp
);
while
(
fgets
(
linebuf
,
256
,
fp
))
{
if
(
linebuf
[
0
]
==
'#'
)
continue
;
int
p
=
0
,
sa
=
0
,
code
,
count
;
...
...
@@ -191,12 +186,7 @@ bool DeckManager::LoadDeck(const wchar_t* file) {
int
cardlist
[
128
];
bool
is_side
=
false
;
char
linebuf
[
256
];
fseek
(
fp
,
0
,
SEEK_END
);
int
fsize
=
ftell
(
fp
);
fseek
(
fp
,
0
,
SEEK_SET
);
fgets
(
linebuf
,
256
,
fp
);
while
(
ftell
(
fp
)
<
fsize
&&
ct
<
128
)
{
fgets
(
linebuf
,
256
,
fp
);
while
(
fgets
(
linebuf
,
256
,
fp
)
&&
ct
<
128
)
{
if
(
linebuf
[
0
]
==
'!'
)
{
is_side
=
true
;
continue
;
...
...
gframe/duelclient.cpp
View file @
fa5234f0
...
...
@@ -294,6 +294,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
deckBuilder
.
result_string
[
0
]
=
L'0'
;
mainGame
->
deckBuilder
.
result_string
[
1
]
=
0
;
mainGame
->
deckBuilder
.
results
.
clear
();
mainGame
->
deckBuilder
.
hovered_code
=
0
;
mainGame
->
deckBuilder
.
is_draging
=
false
;
mainGame
->
deckBuilder
.
is_starting_dragging
=
false
;
mainGame
->
deckBuilder
.
pre_mainc
=
deckManager
.
current_deck
.
main
.
size
();
...
...
@@ -489,7 +490,6 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnEP
->
setVisible
(
false
);
mainGame
->
btnShuffle
->
setVisible
(
false
);
mainGame
->
wChat
->
setVisible
(
true
);
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
dField
);
if
(
!
mainGame
->
dInfo
.
isTag
)
{
if
(
selftype
>
1
)
{
...
...
@@ -554,6 +554,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
gMutex
.
Unlock
();
...
...
@@ -777,6 +778,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
gMutex
.
Unlock
();
...
...
gframe/event_handler.cpp
View file @
fa5234f0
...
...
@@ -115,6 +115,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
DuelClient
::
StopClient
();
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
wCardImg
->
setVisible
(
false
);
mainGame
->
wInfos
->
setVisible
(
false
);
mainGame
->
wPhase
->
setVisible
(
false
);
...
...
gframe/game.cpp
View file @
fa5234f0
...
...
@@ -990,11 +990,7 @@ void Game::LoadConfig() {
gameConf.separate_clear_button = 1;
gameConf.auto_search_limit = -1;
gameConf.chkIgnoreDeckChanges = 0;
fseek(fp, 0, SEEK_END);
int fsize = ftell(fp);
fseek(fp, 0, SEEK_SET);
while(ftell(fp) < fsize) {
fgets(linebuf, 256, fp);
while(fgets(linebuf, 256, fp)) {
sscanf(linebuf, "%s = %s", strbuf, valbuf);
if(!strcmp(strbuf, "antialias")) {
gameConf.antialias = atoi(valbuf);
...
...
gframe/gframe.cpp
View file @
fa5234f0
...
...
@@ -36,6 +36,9 @@ void ClickButton(irr::gui::IGUIElement* btn) {
}
*/
int
main
(
int
argc
,
char
*
argv
[])
{
#ifndef _WIN32
setlocale
(
LC_CTYPE
,
"UTF-8"
);
#endif
#ifdef _WIN32
#ifndef _DEBUG
wchar_t
exepath
[
MAX_PATH
];
...
...
gframe/menu_handler.cpp
View file @
fa5234f0
...
...
@@ -213,9 +213,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
btnReplayStep
->
setVisible
(
false
);
mainGame
->
btnReplayUndo
->
setVisible
(
false
);
mainGame
->
wPhase
->
setVisible
(
true
);
mainGame
->
dField
.
panel
=
0
;
mainGame
->
dField
.
hovered_card
=
0
;
mainGame
->
dField
.
clicked_card
=
0
;
mainGame
->
dField
.
Clear
();
mainGame
->
HideElement
(
mainGame
->
wReplay
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
dField
);
...
...
gframe/replay.cpp
View file @
fa5234f0
...
...
@@ -215,18 +215,15 @@ bool Replay::OpenReplay(const wchar_t* name) {
}
if
(
!
fp
)
return
false
;
fseek
(
fp
,
0
,
SEEK_END
);
comp_size
=
ftell
(
fp
)
-
sizeof
(
pheader
);
fseek
(
fp
,
0
,
SEEK_SET
);
fread
(
&
pheader
,
sizeof
(
pheader
),
1
,
fp
);
if
(
pheader
.
flag
&
REPLAY_COMPRESSED
)
{
fread
(
comp_data
,
0x1000
,
1
,
fp
);
comp_size
=
fread
(
comp_data
,
1
,
0x1000
,
fp
);
fclose
(
fp
);
replay_size
=
pheader
.
datasize
;
if
(
LzmaUncompress
(
replay_data
,
&
replay_size
,
comp_data
,
&
comp_size
,
pheader
.
props
,
5
)
!=
SZ_OK
)
return
false
;
}
else
{
fread
(
replay_data
,
0x20000
,
1
,
fp
);
comp_size
=
fread
(
replay_data
,
1
,
0x20000
,
fp
);
fclose
(
fp
);
replay_size
=
comp_size
;
}
...
...
gframe/replay_mode.cpp
View file @
fa5234f0
...
...
@@ -185,6 +185,7 @@ int ReplayMode::ReplayThread(void* param) {
mainGame
->
closeDoneSignal
.
Wait
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
ShowElement
(
mainGame
->
wReplay
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
gMutex
.
Unlock
();
if
(
exit_on_return
)
...
...
@@ -195,9 +196,6 @@ int ReplayMode::ReplayThread(void* param) {
void
ReplayMode
::
Restart
(
bool
refresh
)
{
end_duel
(
pduel
);
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dField
.
panel
=
0
;
mainGame
->
dField
.
hovered_card
=
0
;
mainGame
->
dField
.
clicked_card
=
0
;
mainGame
->
dField
.
Clear
();
//mainGame->device->setEventReceiver(&mainGame->dField);
cur_replay
.
Rewind
();
...
...
gframe/single_mode.cpp
View file @
fa5234f0
...
...
@@ -78,9 +78,6 @@ int SingleMode::SinglePlayThread(void* param) {
mainGame
->
stText
->
setText
(
L""
);
mainGame
->
scrCardText
->
setVisible
(
false
);
mainGame
->
wPhase
->
setVisible
(
true
);
mainGame
->
dField
.
panel
=
0
;
mainGame
->
dField
.
hovered_card
=
0
;
mainGame
->
dField
.
clicked_card
=
0
;
mainGame
->
dField
.
Clear
();
mainGame
->
dInfo
.
isFirst
=
true
;
mainGame
->
dInfo
.
isStarted
=
true
;
...
...
@@ -112,6 +109,7 @@ int SingleMode::SinglePlayThread(void* param) {
mainGame
->
closeDoneSignal
.
Wait
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
gMutex
.
Unlock
();
if
(
exit_on_return
)
...
...
@@ -830,15 +828,10 @@ byte* SingleMode::ScriptReader(const char* script_name, int* slen) {
#endif
if
(
!
fp
)
return
0
;
fseek
(
fp
,
0
,
SEEK_END
);
unsigned
int
len
=
ftell
(
fp
);
if
(
len
>
sizeof
(
buffer
))
{
fclose
(
fp
);
return
0
;
}
fseek
(
fp
,
0
,
SEEK_SET
);
fread
(
buffer
,
len
,
1
,
fp
);
int
len
=
fread
(
buffer
,
1
,
sizeof
(
buffer
),
fp
);
fclose
(
fp
);
if
(
len
>=
sizeof
(
buffer
))
return
0
;
*
slen
=
len
;
return
buffer
;
}
...
...
strings.conf
View file @
fa5234f0
...
...
@@ -501,6 +501,7 @@
!
counter
0
x40
指示物(
No
.
51
怪腕之必杀摔角手)
!
counter
0
x1041
捕食指示物
!
counter
0
x42
指示物(爆竹鬼)
!
counter
0
x43
缺陷指示物
#setnames, using tab for comment
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x2
次世代 ジェネクス
...
...
@@ -842,3 +843,5 @@
!
setname
0
x103
幻变骚灵 オルターガイスト
!
setname
0
x104
机怪虫 クローラー
!
setname
0
x105
玄化 メタファイズ
!
setname
0
x106
复仇死灵
Vendread
!
setname
0
x107
F
.
A
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment