Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
dfce1705
Commit
dfce1705
authored
May 08, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
2304847f
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
383 additions
and
180 deletions
+383
-180
gframe/duelclient.cpp
gframe/duelclient.cpp
+142
-51
gframe/game.cpp
gframe/game.cpp
+25
-19
gframe/game.h
gframe/game.h
+21
-17
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+11
-11
gframe/network.h
gframe/network.h
+0
-20
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+179
-59
ocgcore/processor.cpp
ocgcore/processor.cpp
+2
-0
strings.conf
strings.conf
+3
-3
No files found.
gframe/duelclient.cpp
View file @
dfce1705
This diff is collapsed.
Click to expand it.
gframe/game.cpp
View file @
dfce1705
...
...
@@ -139,26 +139,24 @@ bool Game::Initialize() {
btnHostConfirm
=
env
->
addButton
(
rect
<
s32
>
(
260
,
355
,
370
,
380
),
wCreateHost
,
BUTTON_HOST_CONFIRM
,
dataManager
.
GetSysString
(
1211
));
btnHostCancel
=
env
->
addButton
(
rect
<
s32
>
(
260
,
385
,
370
,
410
),
wCreateHost
,
BUTTON_HOST_CANCEL
,
dataManager
.
GetSysString
(
1212
));
//host(single)
wHostSingle
=
env
->
addWindow
(
rect
<
s32
>
(
270
,
120
,
750
,
420
),
false
,
dataManager
.
GetSysString
(
1250
));
wHostSingle
->
getCloseButton
()
->
setVisible
(
false
);
wHostSingle
->
setVisible
(
false
);
btnHostSingleDuelist
=
env
->
addButton
(
rect
<
s32
>
(
10
,
30
,
110
,
55
),
wHostSingle
,
BUTTON_HS_DUELIST
,
dataManager
.
GetSysString
(
1251
));
stHostSingleDuelist
[
0
]
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
40
,
65
,
240
,
85
),
true
,
false
,
wHostSingle
);
btnHostSingleKick
[
0
]
=
env
->
addButton
(
rect
<
s32
>
(
10
,
65
,
30
,
85
),
wHostSingle
,
BUTTON_HS_KICK
,
L"X"
);
chkHostSingleReady
[
0
]
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
250
,
65
,
270
,
85
),
wHostSingle
,
CHECKBOX_HS_READY
,
L""
);
chkHostSingleReady
[
0
]
->
setEnabled
(
false
);
stHostSingleDuelist
[
1
]
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
40
,
90
,
240
,
110
),
true
,
false
,
wHostSingle
);
btnHostSingleKick
[
1
]
=
env
->
addButton
(
rect
<
s32
>
(
10
,
90
,
30
,
110
),
wHostSingle
,
BUTTON_HS_KICK
,
L"X"
);
chkHostSingleReady
[
1
]
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
250
,
90
,
270
,
110
),
wHostSingle
,
CHECKBOX_HS_READY
,
L""
);
chkHostSingleReady
[
1
]
->
setEnabled
(
false
);
btnHostSingleOB
=
env
->
addButton
(
rect
<
s32
>
(
10
,
120
,
110
,
145
),
wHostSingle
,
BUTTON_HS_OBSERVER
,
dataManager
.
GetSysString
(
1252
));
wHostPrepare
=
env
->
addWindow
(
rect
<
s32
>
(
270
,
120
,
750
,
440
),
false
,
dataManager
.
GetSysString
(
1250
));
wHostPrepare
->
getCloseButton
()
->
setVisible
(
false
);
wHostPrepare
->
setVisible
(
false
);
btnHostPrepDuelist
=
env
->
addButton
(
rect
<
s32
>
(
10
,
30
,
110
,
55
),
wHostPrepare
,
BUTTON_HP_DUELIST
,
dataManager
.
GetSysString
(
1251
));
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
stHostPrepDuelist
[
i
]
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
40
,
65
+
i
*
25
,
240
,
85
+
i
*
25
),
true
,
false
,
wHostPrepare
);
btnHostPrepKick
[
i
]
=
env
->
addButton
(
rect
<
s32
>
(
10
,
65
+
i
*
25
,
30
,
85
+
i
*
25
),
wHostPrepare
,
BUTTON_HP_KICK
,
L"X"
);
chkHostPrepReady
[
i
]
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
250
,
65
+
i
*
25
,
270
,
85
+
i
*
25
),
wHostPrepare
,
CHECKBOX_HP_READY
,
L""
);
chkHostPrepReady
[
i
]
->
setEnabled
(
false
);
}
btnHostPrepOB
=
env
->
addButton
(
rect
<
s32
>
(
10
,
170
,
110
,
195
),
wHostPrepare
,
BUTTON_HP_OBSERVER
,
dataManager
.
GetSysString
(
1252
));
myswprintf
(
dataManager
.
strBuffer
,
L"%ls%d"
,
dataManager
.
GetSysString
(
1253
),
0
);
stHost
SingleOB
=
env
->
addStaticText
(
dataManager
.
strBuffer
,
rect
<
s32
>
(
10
,
150
,
270
,
170
),
false
,
false
,
wHostSingl
e
);
stHost
SingleRule
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
280
,
30
,
460
,
230
),
false
,
true
,
wHostSingl
e
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1254
),
rect
<
s32
>
(
10
,
185
,
110
,
205
),
false
,
false
,
wHostSingl
e
);
cbDeckSelect
=
env
->
addComboBox
(
rect
<
s32
>
(
120
,
180
,
270
,
205
),
wHostSingl
e
);
btnHost
SingleStart
=
env
->
addButton
(
rect
<
s32
>
(
230
,
260
,
340
,
285
),
wHostSingle
,
BUTTON_HS
_START
,
dataManager
.
GetSysString
(
1215
));
btnHost
SingleCancel
=
env
->
addButton
(
rect
<
s32
>
(
350
,
260
,
460
,
285
),
wHostSingle
,
BUTTON_HS
_CANCEL
,
dataManager
.
GetSysString
(
1212
));
stHost
PrepOB
=
env
->
addStaticText
(
dataManager
.
strBuffer
,
rect
<
s32
>
(
10
,
200
,
270
,
220
),
false
,
false
,
wHostPrepar
e
);
stHost
PrepRule
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
280
,
30
,
460
,
230
),
false
,
true
,
wHostPrepar
e
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1254
),
rect
<
s32
>
(
10
,
235
,
110
,
255
),
false
,
false
,
wHostPrepar
e
);
cbDeckSelect
=
env
->
addComboBox
(
rect
<
s32
>
(
120
,
230
,
270
,
255
),
wHostPrepar
e
);
btnHost
PrepStart
=
env
->
addButton
(
rect
<
s32
>
(
230
,
280
,
340
,
305
),
wHostPrepare
,
BUTTON_HP
_START
,
dataManager
.
GetSysString
(
1215
));
btnHost
PrepCancel
=
env
->
addButton
(
rect
<
s32
>
(
350
,
280
,
460
,
305
),
wHostPrepare
,
BUTTON_HP
_CANCEL
,
dataManager
.
GetSysString
(
1212
));
//img
wCardImg
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
1
,
1
,
199
,
273
),
true
,
false
,
0
,
-
1
,
true
);
wCardImg
->
setBackgroundColor
(
0xc0c0c0c0
);
...
...
@@ -782,6 +780,14 @@ void Game::AddChatMsg(wchar_t* msg, int player) {
chatMsg
[
0
].
append
(
dInfo
.
clientname
);
chatMsg
[
0
].
append
(
L": "
);
break
;
case
2
:
//host tag
chatMsg
[
0
].
append
(
dInfo
.
hostname_tag
);
chatMsg
[
0
].
append
(
L": "
);
break
;
case
3
:
//client tag
chatMsg
[
0
].
append
(
dInfo
.
clientname_tag
);
chatMsg
[
0
].
append
(
L": "
);
break
;
case
8
:
//system custom message, no prefix.
chatMsg
[
0
].
append
(
L"[System]: "
);
break
;
...
...
gframe/game.h
View file @
dfce1705
...
...
@@ -32,11 +32,15 @@ struct DuelInfo {
bool
isObserver
;
bool
isFirst
;
bool
is_shuffling
;
bool
is_tag
;
bool
tag_player
[
2
];
int
lp
[
2
];
int
turn
;
short
curMsg
;
wchar_t
hostname
[
20
];
wchar_t
clientname
[
20
];
wchar_t
hostname_tag
[
20
];
wchar_t
clientname_tag
[
20
];
wchar_t
strLP
[
2
][
16
];
wchar_t
strTurn
[
8
];
wchar_t
*
vic_string
;
...
...
@@ -195,18 +199,18 @@ public:
irr
::
gui
::
IGUICheckBox
*
chkNoShuffleDeck
;
irr
::
gui
::
IGUIButton
*
btnHostConfirm
;
irr
::
gui
::
IGUIButton
*
btnHostCancel
;
//host
(single)
irr
::
gui
::
IGUIWindow
*
wHost
Singl
e
;
irr
::
gui
::
IGUIButton
*
btnHost
Single
Duelist
;
irr
::
gui
::
IGUIButton
*
btnHost
Single
OB
;
irr
::
gui
::
IGUIStaticText
*
stHost
SingleDuelist
[
2
];
irr
::
gui
::
IGUICheckBox
*
chkHost
SingleReady
[
2
];
irr
::
gui
::
IGUIButton
*
btnHost
SingleKick
[
2
];
//host
panel
irr
::
gui
::
IGUIWindow
*
wHost
Prepar
e
;
irr
::
gui
::
IGUIButton
*
btnHost
Prep
Duelist
;
irr
::
gui
::
IGUIButton
*
btnHost
Prep
OB
;
irr
::
gui
::
IGUIStaticText
*
stHost
PrepDuelist
[
4
];
irr
::
gui
::
IGUICheckBox
*
chkHost
PrepReady
[
4
];
irr
::
gui
::
IGUIButton
*
btnHost
PrepKick
[
4
];
irr
::
gui
::
IGUIComboBox
*
cbDeckSelect
;
irr
::
gui
::
IGUIStaticText
*
stHost
Single
Rule
;
irr
::
gui
::
IGUIStaticText
*
stHost
Single
OB
;
irr
::
gui
::
IGUIButton
*
btnHost
Single
Start
;
irr
::
gui
::
IGUIButton
*
btnHost
Single
Cancel
;
irr
::
gui
::
IGUIStaticText
*
stHost
Prep
Rule
;
irr
::
gui
::
IGUIStaticText
*
stHost
Prep
OB
;
irr
::
gui
::
IGUIButton
*
btnHost
Prep
Start
;
irr
::
gui
::
IGUIButton
*
btnHost
Prep
Cancel
;
//replay
irr
::
gui
::
IGUIWindow
*
wReplay
;
irr
::
gui
::
IGUIListBox
*
lstReplayList
;
...
...
@@ -365,12 +369,12 @@ extern Game* mainGame;
#define BUTTON_HOST_CONFIRM 114
#define BUTTON_HOST_CANCEL 115
#define BUTTON_LAN_REFRESH 116
#define BUTTON_H
S
_DUELIST 120
#define BUTTON_H
S
_OBSERVER 121
#define BUTTON_H
S
_START 122
#define BUTTON_H
S
_CANCEL 123
#define BUTTON_H
S
_KICK 124
#define CHECKBOX_H
S
_READY 125
#define BUTTON_H
P
_DUELIST 120
#define BUTTON_H
P
_OBSERVER 121
#define BUTTON_H
P
_START 122
#define BUTTON_H
P
_CANCEL 123
#define BUTTON_H
P
_KICK 124
#define CHECKBOX_H
P
_READY 125
#define LISTBOX_REPLAY_LIST 130
#define BUTTON_LOAD_REPLAY 131
#define BUTTON_CANCEL_REPLAY 132
...
...
gframe/menu_handler.cpp
View file @
dfce1705
...
...
@@ -84,16 +84,16 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
break
;
}
case
BUTTON_H
S
_DUELIST
:
{
case
BUTTON_H
P
_DUELIST
:
{
DuelClient
::
SendPacketToServer
(
CTOS_HS_TODUELIST
);
break
;
}
case
BUTTON_H
S
_OBSERVER
:
{
case
BUTTON_H
P
_OBSERVER
:
{
DuelClient
::
SendPacketToServer
(
CTOS_HS_TOOBSERVER
);
break
;
}
case
BUTTON_H
S
_KICK
:
{
int
id
=
caller
-
static_cast
<
IGUIElement
*>
(
mainGame
->
btnHost
Single
Kick
[
0
]);
case
BUTTON_H
P
_KICK
:
{
int
id
=
caller
-
static_cast
<
IGUIElement
*>
(
mainGame
->
btnHost
Prep
Kick
[
0
]);
CTOS_Kick
csk
;
if
(
id
==
0
)
csk
.
pos
=
0
;
...
...
@@ -101,19 +101,19 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
DuelClient
::
SendPacketToServer
(
CTOS_HS_KICK
,
csk
);
break
;
}
case
BUTTON_H
S
_START
:
{
if
(
!
mainGame
->
chkHost
Single
Ready
[
0
]
->
isChecked
()
||
!
mainGame
->
chkHost
SingleReady
[
0
]
->
isChecked
())
case
BUTTON_H
P
_START
:
{
if
(
!
mainGame
->
chkHost
Prep
Ready
[
0
]
->
isChecked
()
||
!
mainGame
->
chkHost
PrepReady
[
1
]
->
isChecked
())
break
;
DuelClient
::
SendPacketToServer
(
CTOS_HS_START
);
break
;
}
case
BUTTON_H
S
_CANCEL
:
{
case
BUTTON_H
P
_CANCEL
:
{
DuelClient
::
StopClient
();
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
HideElement
(
mainGame
->
wHost
Singl
e
);
mainGame
->
HideElement
(
mainGame
->
wHost
Prepar
e
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
exit_on_return
)
mainGame
->
device
->
closeDevice
();
...
...
@@ -234,10 +234,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
case
irr
:
:
gui
::
EGET_CHECKBOX_CHANGED
:
{
switch
(
id
)
{
case
CHECKBOX_H
S
_READY
:
{
case
CHECKBOX_H
P
_READY
:
{
if
(
!
caller
->
isEnabled
())
break
;
mainGame
->
env
->
setFocus
(
mainGame
->
wHost
Singl
e
);
mainGame
->
env
->
setFocus
(
mainGame
->
wHost
Prepar
e
);
if
(
static_cast
<
irr
::
gui
::
IGUICheckBox
*>
(
caller
)
->
isChecked
())
{
if
(
mainGame
->
cbDeckSelect
->
getSelected
()
==
-
1
||
!
deckManager
.
LoadDeck
(
mainGame
->
cbDeckSelect
->
getItem
(
mainGame
->
cbDeckSelect
->
getSelected
())))
{
...
...
gframe/network.h
View file @
dfce1705
...
...
@@ -95,17 +95,6 @@ struct STOC_HS_PlayerChange {
struct
STOC_HS_WatchChange
{
unsigned
short
watch_count
;
};
struct
STOC_HT_PlayerEnter
{
unsigned
short
name
[
20
];
unsigned
char
pos
;
};
struct
STOC_HT_PlayerChange
{
//pos<<4 | state
unsigned
char
status
;
};
struct
STOC_HT_WatchChange
{
unsigned
short
watch_count
;
};
class
DuelMode
;
...
...
@@ -186,12 +175,6 @@ public:
#define CTOS_HS_NOTREADY 0x23
#define CTOS_HS_KICK 0x24
#define CTOS_HS_START 0x25
#define CTOS_HT_TODUELIST 0x30
#define CTOS_HT_TOOBSERVER 0x31
#define CTOS_HT_READY 0x32
#define CTOS_HT_NOTREADY 0x33
#define CTOS_HT_KICK 0x34
#define CTOS_HT_START 0x35
#define STOC_GAME_MSG 0x1
#define STOC_ERROR_MSG 0x2
...
...
@@ -213,9 +196,6 @@ public:
#define STOC_HS_PLAYER_ENTER 0x20
#define STOC_HS_PLAYER_CHANGE 0x21
#define STOC_HS_WATCH_CHANGE 0x22
#define STOC_HT_PLAYER_ENTER 0x30
#define STOC_HT_PLAYER_CHANGE 0x31
#define STOC_HT_WATCH_CHANGE 0x32
#define PLAYERCHANGE_READY 0x1
#define PLAYERCHANGE_NOTREADY 0x2
...
...
gframe/tag_duel.cpp
View file @
dfce1705
This diff is collapsed.
Click to expand it.
ocgcore/processor.cpp
View file @
dfce1705
...
...
@@ -3519,6 +3519,8 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
(
*
rit
)
->
recharge
();
infos
.
turn_id
++
;
infos
.
turn_player
=
turn_player
;
if
(
core
.
duel_options
&
DUEL_TAG_MODE
)
tag_swap
(
turn_player
);
pduel
->
write_buffer8
(
MSG_NEW_TURN
);
pduel
->
write_buffer8
(
turn_player
);
if
(
is_player_affected_by_effect
(
infos
.
turn_player
,
EFFECT_SKIP_TURN
))
{
...
...
strings.conf
View file @
dfce1705
...
...
@@ -309,9 +309,9 @@
!
system
1349
录像信息:
!
system
1350
离开
!
system
1351
投降
!
system
1390
等待
对方
行动中...
!
system
1391
等待
对方
行动中....
!
system
1392
等待
对方
行动中.....
!
system
1390
等待行动中...
!
system
1391
等待行动中....
!
system
1392
等待行动中.....
!
system
1400
无法连接到主机。
!
system
1401
连接已断开。
!
system
1402
网络传输发生错误。
...
...
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