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
MobiusMei
ygopro
Commits
6dcb7a3f
Commit
6dcb7a3f
authored
Feb 22, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
1308d53b
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
413 additions
and
429 deletions
+413
-429
gframe/drawing.cpp
gframe/drawing.cpp
+2
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+43
-71
gframe/event_handler.cpp
gframe/event_handler.cpp
+22
-21
gframe/game.cpp
gframe/game.cpp
+0
-1
gframe/game.h
gframe/game.h
+1
-1
gframe/netserver.cpp
gframe/netserver.cpp
+8
-0
gframe/network.h
gframe/network.h
+9
-1
gframe/replay.cpp
gframe/replay.cpp
+1
-0
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+6
-6
gframe/single_duel.cpp
gframe/single_duel.cpp
+6
-0
gframe/single_duel.h
gframe/single_duel.h
+2
-0
ocgcore/operations.cpp
ocgcore/operations.cpp
+304
-320
script/c33396948.lua
script/c33396948.lua
+1
-1
script/c8062132.lua
script/c8062132.lua
+1
-1
script/c95308449.lua
script/c95308449.lua
+1
-1
strings.conf
strings.conf
+5
-3
system.conf
system.conf
+1
-1
No files found.
gframe/drawing.cpp
View file @
6dcb7a3f
...
...
@@ -2,6 +2,7 @@
#include "materials.h"
#include "image_manager.h"
#include "deck_manager.h"
#include "duelclient.h"
#include "../ocgcore/field.h"
namespace
ygo
{
...
...
@@ -442,7 +443,7 @@ void Game::DrawGUI() {
fu
.
guiFading
->
setRelativePosition
(
irr
::
core
::
recti
(
fu
.
fadingUL
,
fu
.
fadingLR
));
}
if
(
fu
.
signalAction
&&
!
fu
.
fadingFrame
)
{
localAction
.
Set
();
DuelClient
::
SendResponse
();
fu
.
signalAction
=
false
;
}
}
...
...
gframe/duelclient.cpp
View file @
6dcb7a3f
...
...
@@ -401,8 +401,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1500
));
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Wait
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
CloseDuelWindow
();
mainGame
->
dInfo
.
isStarted
=
false
;
...
...
@@ -521,8 +521,8 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
stMessage
->
setText
(
dataManager
.
GetDesc
(
data
));
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Wait
();
break
;
}
case
HINT_SELECTMSG
:
{
...
...
@@ -715,12 +715,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
btnEP
->
setPressed
(
false
);
}
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
mainGame
->
dField
.
ClearCommandFlag
();
mainGame
->
btnM2
->
setVisible
(
false
);
mainGame
->
btnEP
->
setVisible
(
false
);
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_IDLECMD
:
{
...
...
@@ -820,12 +814,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
btnEP
->
setEnabled
(
true
);
mainGame
->
btnEP
->
setPressed
(
false
);
}
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
mainGame
->
dField
.
ClearCommandFlag
();
mainGame
->
btnBP
->
setVisible
(
false
);
mainGame
->
btnEP
->
setVisible
(
false
);
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_EFFECTYN
:
{
...
...
@@ -843,9 +831,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
textFont
,
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_YESNO
:
{
...
...
@@ -855,9 +840,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
dataManager
.
GetDesc
(
desc
));
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_OPTION
:
{
...
...
@@ -881,9 +863,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
wOptions
->
setText
(
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wOptions
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_CARD
:
{
...
...
@@ -932,10 +911,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
stHintMsg
->
setText
(
textBuffer
);
mainGame
->
stHintMsg
->
setVisible
(
true
);
}
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
mainGame
->
dField
.
ClearSelect
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_CHAIN
:
{
...
...
@@ -982,10 +957,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
mainGame
->
dField
.
ClearChainSelect
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_PLACE
:
...
...
@@ -1030,9 +1001,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
DuelClient
::
SendResponse
();
return
true
;
}
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_POSITION
:
{
...
...
@@ -1076,9 +1044,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
gMutex
.
Lock
();
mainGame
->
PopupElement
(
mainGame
->
wPosSelect
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_TRIBUTE
:
{
...
...
@@ -1108,10 +1073,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
}
mainGame
->
stHintMsg
->
setText
(
dataManager
.
GetSysString
(
531
));
mainGame
->
stHintMsg
->
setVisible
(
false
);
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
mainGame
->
dField
.
ClearSelect
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_COUNTER
:
{
...
...
@@ -1138,10 +1099,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
stHintMsg
->
setText
(
textBuffer
);
mainGame
->
stHintMsg
->
setVisible
(
true
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
mainGame
->
dField
.
ClearSelect
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SELECT_SUM
:
{
...
...
@@ -1183,13 +1140,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
stHintMsg
->
setText
(
textBuffer
);
mainGame
->
stHintMsg
->
setVisible
(
true
);
}
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
selectsum_all
.
size
();
++
i
)
{
mainGame
->
dField
.
selectsum_all
[
i
]
->
is_selectable
=
false
;
mainGame
->
dField
.
selectsum_all
[
i
]
->
is_selected
=
false
;
}
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_SORT_CARD
:
...
...
@@ -1225,9 +1175,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
dField
.
select_min
=
0
;
mainGame
->
dField
.
select_max
=
count
;
mainGame
->
dField
.
ShowSelectCard
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_CONFIRM_DECKTOP
:
{
...
...
@@ -1337,8 +1284,8 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
dField
.
selectable_cards
=
panel_confirm
;
mainGame
->
dField
.
ShowSelectCard
(
true
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Wait
();
}
return
true
;
}
...
...
@@ -2301,9 +2248,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
wANRace
->
setText
(
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wANRace
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_ANNOUNCE_ATTRIB
:
{
...
...
@@ -2324,9 +2268,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
wANAttribute
->
setText
(
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wANAttribute
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_ANNOUNCE_CARD
:
{
...
...
@@ -2340,9 +2281,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
wANCard
->
setText
(
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wANCard
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_ANNOUNCE_NUMBER
:
{
...
...
@@ -2363,9 +2301,6 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame
->
wANNumber
->
setText
(
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wANNumber
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
DuelClient
::
SendResponse
();
return
true
;
}
case
MSG_CARD_HINT
:
{
...
...
@@ -2405,6 +2340,43 @@ void DuelClient::SetResponseB(unsigned char* respB, unsigned char len) {
response_len
=
len
;
}
void
DuelClient
::
SendResponse
()
{
switch
(
mainGame
->
dInfo
.
curMsg
)
{
case
MSG_SELECT_BATTLECMD
:
{
mainGame
->
dField
.
ClearCommandFlag
();
mainGame
->
btnM2
->
setVisible
(
false
);
mainGame
->
btnEP
->
setVisible
(
false
);
break
;
}
case
MSG_SELECT_IDLECMD
:
{
mainGame
->
dField
.
ClearCommandFlag
();
mainGame
->
btnBP
->
setVisible
(
false
);
mainGame
->
btnEP
->
setVisible
(
false
);
break
;
}
case
MSG_SELECT_CARD
:
{
mainGame
->
dField
.
ClearSelect
();
break
;
}
case
MSG_SELECT_CHAIN
:
{
mainGame
->
dField
.
ClearChainSelect
();
break
;
}
case
MSG_SELECT_TRIBUTE
:
{
mainGame
->
dField
.
ClearSelect
();
break
;
}
case
MSG_SELECT_COUNTER
:
{
mainGame
->
dField
.
ClearSelect
();
break
;
}
case
MSG_SELECT_SUM
:
{
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
selectsum_all
.
size
();
++
i
)
{
mainGame
->
dField
.
selectsum_all
[
i
]
->
is_selectable
=
false
;
mainGame
->
dField
.
selectsum_all
[
i
]
->
is_selected
=
false
;
}
break
;
}
}
SendBufferToServer
(
CTOS_RESPONSE
,
response_buf
,
response_len
);
}
void
DuelClient
::
BeginRefreshHost
()
{
...
...
gframe/event_handler.cpp
View file @
6dcb7a3f
...
...
@@ -106,12 +106,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
DuelClient
::
SendPacketToServer
(
CTOS_SURRENDER
);
if
(
panel
)
mainGame
->
HideElement
(
panel
);
mainGame
->
localAction
.
Set
();
}
break
;
}
case
BUTTON_MSG_OK
:
{
mainGame
->
HideElement
(
mainGame
->
wMessage
,
true
);
mainGame
->
HideElement
(
mainGame
->
wMessage
);
mainGame
->
actionSignal
.
Set
();
break
;
}
case
BUTTON_YES
:
{
...
...
@@ -254,7 +254,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
else
{
DuelClient
::
SetResponseI
(
index
);
}
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
else
{
mainGame
->
SetStaticText
(
mainGame
->
stOptions
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
dataManager
.
GetDesc
(
select_options
[
0
]));
selected_option
=
0
;
...
...
@@ -305,7 +305,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
summonable_cards
[
i
]
==
clicked_card
)
{
ClearCommandFlag
();
DuelClient
::
SetResponseI
(
i
<<
16
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
break
;
}
}
...
...
@@ -320,7 +320,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
spsummonable_cards
[
i
]
==
clicked_card
)
{
ClearCommandFlag
();
DuelClient
::
SetResponseI
((
i
<<
16
)
+
1
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
break
;
}
}
...
...
@@ -359,7 +359,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
for
(
int
i
=
0
;
i
<
msetable_cards
.
size
();
++
i
)
{
if
(
msetable_cards
[
i
]
==
clicked_card
)
{
DuelClient
::
SetResponseI
((
i
<<
16
)
+
3
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
break
;
}
}
...
...
@@ -372,7 +372,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
for
(
int
i
=
0
;
i
<
ssetable_cards
.
size
();
++
i
)
{
if
(
ssetable_cards
[
i
]
==
clicked_card
)
{
DuelClient
::
SetResponseI
((
i
<<
16
)
+
4
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
break
;
}
}
...
...
@@ -385,7 +385,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
for
(
int
i
=
0
;
i
<
reposable_cards
.
size
();
++
i
)
{
if
(
reposable_cards
[
i
]
==
clicked_card
)
{
DuelClient
::
SetResponseI
((
i
<<
16
)
+
2
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
break
;
}
}
...
...
@@ -398,7 +398,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
for
(
int
i
=
0
;
i
<
attackable_cards
.
size
();
++
i
)
{
if
(
attackable_cards
[
i
]
==
clicked_card
)
{
DuelClient
::
SetResponseI
((
i
<<
16
)
+
1
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
break
;
}
}
...
...
@@ -445,24 +445,24 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
BUTTON_BP
:
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
(
6
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
break
;
}
case
BUTTON_M2
:
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
DuelClient
::
SetResponseI
(
2
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
break
;
}
case
BUTTON_EP
:
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
DuelClient
::
SetResponseI
(
3
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
(
7
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
break
;
}
...
...
@@ -613,7 +613,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break
;
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_CONFIRM_CARDS
)
{
mainGame
->
HideElement
(
mainGame
->
wCardSelect
,
true
);
mainGame
->
HideElement
(
mainGame
->
wCardSelect
);
mainGame
->
actionSignal
.
Set
();
break
;
}
else
{
mainGame
->
HideElement
(
mainGame
->
wCardSelect
);
...
...
@@ -957,7 +958,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
selectable_field
=
0
;
selected_field
=
0
;
DuelClient
::
SetResponseB
(
respbuf
,
p
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
}
}
...
...
@@ -989,7 +990,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
for
(
int
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
respbuf
[
i
+
1
]
=
selected_cards
[
i
]
->
select_seq
;
DuelClient
::
SetResponseB
(
respbuf
,
selected_cards
.
size
()
+
1
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
else
if
(
max
>=
select_min
)
{
if
(
selected_cards
.
size
()
==
selectable_cards
.
size
())
{
unsigned
char
respbuf
[
64
];
...
...
@@ -997,7 +998,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
for
(
int
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
respbuf
[
i
+
1
]
=
selected_cards
[
i
]
->
select_seq
;
DuelClient
::
SetResponseB
(
respbuf
,
selected_cards
.
size
()
+
1
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
else
{
select_ready
=
true
;
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_TRIBUTE
)
{
...
...
@@ -1028,7 +1029,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
stHintMsg
->
setVisible
(
false
);
ClearSelect
();
DuelClient
::
SetResponseB
(
respbuf
,
selectable_cards
.
size
());
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
else
{
myswprintf
(
formatBuffer
,
dataManager
.
GetSysString
(
204
),
select_counter_count
,
dataManager
.
GetCounterName
(
select_counter_type
));
mainGame
->
stHintMsg
->
setText
(
formatBuffer
);
...
...
@@ -1052,7 +1053,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
for
(
int
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
respbuf
[
i
+
1
]
=
selected_cards
[
i
]
->
select_seq
;
DuelClient
::
SetResponseB
(
respbuf
,
selected_cards
.
size
()
+
1
);
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
else
{
select_ready
=
true
;
wchar_t
wbuf
[
256
],
*
pwbuf
=
wbuf
;
...
...
@@ -1113,7 +1114,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mainGame
->
wCardSelect
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wCardSelect
,
true
);
else
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
break
;
}
...
...
@@ -1135,7 +1136,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mainGame
->
wCardSelect
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wCardSelect
,
true
);
else
mainGame
->
localAction
.
Set
();
DuelClient
::
SendResponse
();
}
break
;
}
...
...
gframe/game.cpp
View file @
6dcb7a3f
...
...
@@ -514,7 +514,6 @@ void Game::MainLoop() {
}
}
DuelClient
::
StopClient
(
true
);
NetServer
::
StopServer
();
SaveConfig
();
device
->
drop
();
}
...
...
gframe/game.h
View file @
6dcb7a3f
...
...
@@ -84,7 +84,7 @@ public:
Mutex
gMutex
;
Mutex
gBuffer
;
Signal
frameSignal
;
Signal
localAction
;
Signal
actionSignal
;
Signal
replaySignal
;
Config
gameConf
;
DuelInfo
dInfo
;
...
...
gframe/netserver.cpp
View file @
6dcb7a3f
...
...
@@ -178,6 +178,12 @@ void NetServer::HandleCTOSPacket(DuelPlayer* dp, char* data, unsigned int len) {
duel_mode
->
GetResponse
(
dp
,
pdata
,
len
>
64
?
64
:
len
-
1
);
break
;
}
case
CTOS_TIME_CONFIRM
:
{
if
(
!
dp
->
game
||
!
duel_mode
->
pduel
)
return
;
duel_mode
->
TimeConfirm
(
dp
);
break
;
}
case
CTOS_UPDATE_DECK
:
{
if
(
!
dp
->
game
)
return
;
...
...
@@ -212,6 +218,8 @@ void NetServer::HandleCTOSPacket(DuelPlayer* dp, char* data, unsigned int len) {
}
else
if
(
pkt
->
info
.
mode
==
MODE_MATCH
)
{
duel_mode
=
new
SingleDuel
(
true
);
}
timeval
timeout
=
{
1
,
0
};
duel_mode
->
etimer
=
event_new
(
net_evbase
,
0
,
EV_PERSIST
,
SingleDuel
::
SingleTimer
,
duel_mode
);
if
(
pkt
->
info
.
rule
>
3
)
pkt
->
info
.
rule
=
0
;
if
(
pkt
->
info
.
mode
>
1
)
...
...
gframe/network.h
View file @
6dcb7a3f
...
...
@@ -73,7 +73,11 @@ struct STOC_TypeChange {
unsigned
char
type
;
};
struct
STOC_ExitGame
{
unsigned
pos
;
unsigned
char
pos
;
};
struct
STOC_TimeLimit
{
unsigned
char
player
;
unsigned
short
left_time
;
};
struct
STOC_HS_PlayerEnter
{
unsigned
short
name
[
20
];
...
...
@@ -123,9 +127,11 @@ public:
}
virtual
void
Surrender
(
DuelPlayer
*
dp
)
{}
virtual
void
GetResponse
(
DuelPlayer
*
dp
,
void
*
pdata
,
unsigned
int
len
)
{}
virtual
void
TimeConfirm
(
DuelPlayer
*
dp
)
{}
virtual
void
EndDuel
()
{};
public:
event
*
etimer
;
DuelPlayer
*
host_player
;
HostInfo
host_info
;
unsigned
long
pduel
;
...
...
@@ -155,6 +161,7 @@ public:
#define CTOS_JOIN_GAME 0x12
#define CTOS_LEAVE_GAME 0x13
#define CTOS_SURRENDER 0x14
#define CTOS_TIME_CONFIRM 0x15
#define CTOS_HS_TODUELIST 0x20
#define CTOS_HS_TOOBSERVER 0x21
#define CTOS_HS_READY 0x22
...
...
@@ -177,6 +184,7 @@ public:
#define STOC_DUEL_START 0x15
#define STOC_DUEL_END 0x16
#define STOC_REPLAY 0x17
#define STOC_TIME_LIMIT 0x18
#define STOC_HS_PLAYER_ENTER 0x20
#define STOC_HS_PLAYER_CHANGE 0x21
#define STOC_HS_WATCH_CHANGE 0x22
...
...
gframe/replay.cpp
View file @
6dcb7a3f
...
...
@@ -119,6 +119,7 @@ void Replay::EndRecord() {
pheader
.
flag
|=
REPLAY_COMPRESSED
;
size_t
propsize
=
5
;
comp_size
=
0x1000
;
printf
(
"%x
\n
"
,
comp_data
);
LzmaCompress
(
comp_data
,
&
comp_size
,
replay_data
,
pdata
-
replay_data
,
pheader
.
props
,
&
propsize
,
5
,
1
<<
24
,
3
,
0
,
2
,
32
,
1
);
is_recording
=
false
;
}
...
...
gframe/replay_mode.cpp
View file @
6dcb7a3f
...
...
@@ -25,7 +25,7 @@ void ReplayMode::StopReplay(bool is_exiting) {
is_continuing
=
false
;
is_closing
=
is_exiting
;
exit_pending
=
true
;
mainGame
->
localAction
.
Set
();
mainGame
->
actionSignal
.
Set
();
}
void
ReplayMode
::
SwapField
()
{
if
(
is_paused
)
...
...
@@ -39,7 +39,7 @@ void ReplayMode::Pause(bool is_pause, bool is_step) {
else
{
if
(
!
is_step
)
is_pausing
=
false
;
mainGame
->
localAction
.
Set
();
mainGame
->
actionSignal
.
Set
();
}
}
bool
ReplayMode
::
ReadReplayResponse
()
{
...
...
@@ -105,9 +105,9 @@ int ReplayMode::ReplayThread(void* param) {
end_duel
(
pduel
);
if
(
!
is_closing
)
{
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1501
));
mainGame
->
localAction
.
Reset
();
mainGame
->
actionSignal
.
Reset
();
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
localAction
.
Wait
();
mainGame
->
actionSignal
.
Wait
();
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isReplay
=
false
;
mainGame
->
CloseDuelWindow
();
...
...
@@ -554,8 +554,8 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
}
if
(
pauseable
&&
is_pausing
)
{
is_paused
=
true
;
mainGame
->
localAction
.
Reset
();
mainGame
->
localAction
.
Wait
();
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Wait
();
is_paused
=
false
;
}
}
...
...
gframe/single_duel.cpp
View file @
6dcb7a3f
...
...
@@ -1257,6 +1257,9 @@ void SingleDuel::WaitforResponse(int playerid) {
players
[
playerid
]
->
state
=
CTOS_RESPONSE
;
unsigned
char
msg
=
MSG_WAITING
;
NetServer
::
SendPacketToPlayer
(
players
[
1
-
playerid
],
STOC_GAME_MSG
,
msg
);
}
void
SingleDuel
::
TimeConfirm
(
DuelPlayer
*
dp
)
{
}
void
SingleDuel
::
RefreshMzone
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x1000
];
...
...
@@ -1358,5 +1361,8 @@ int SingleDuel::MessageHandler(long fduel, int type) {
fclose
(
fp
);
return
0
;
}
void
SingleDuel
::
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
)
{
SingleDuel
*
sd
=
static_cast
<
SingleDuel
*>
(
arg
);
}
}
gframe/single_duel.h
View file @
6dcb7a3f
...
...
@@ -25,6 +25,7 @@ public:
virtual
void
Surrender
(
DuelPlayer
*
dp
);
virtual
int
Analyze
(
char
*
msgbuffer
,
unsigned
int
len
);
virtual
void
GetResponse
(
DuelPlayer
*
dp
,
void
*
pdata
,
unsigned
int
len
);
virtual
void
TimeConfirm
(
DuelPlayer
*
dp
);
virtual
void
EndDuel
();
void
DuelEndProc
();
...
...
@@ -37,6 +38,7 @@ public:
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0x181fff
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
protected:
DuelPlayer
*
players
[
2
];
...
...
ocgcore/operations.cpp
View file @
6dcb7a3f
This diff is collapsed.
Click to expand it.
script/c33396948.lua
View file @
6dcb7a3f
...
...
@@ -28,7 +28,7 @@ function c33396948.check(g)
return
a1
and
a2
and
a3
and
a4
and
a5
end
function
c33396948
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
WIN_REASON_EXODIA
=
0x
3
local
WIN_REASON_EXODIA
=
0x
10
local
g1
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_HAND
,
0
)
local
g2
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
)
local
wtp
=
c33396948
.
check
(
g1
)
...
...
script/c8062132.lua
View file @
6dcb7a3f
...
...
@@ -75,6 +75,6 @@ function c8062132.ctop(e,tp,eg,ep,ev,re,r,rp)
local
c
=
e
:
GetHandler
()
c
:
AddCounter
(
0x11
,
1
)
if
c
:
GetCounter
(
0x11
)
>=
3
then
Duel
.
Win
(
tp
,
0x
5
)
Duel
.
Win
(
tp
,
0x
12
)
end
end
script/c95308449.lua
View file @
6dcb7a3f
...
...
@@ -32,6 +32,6 @@ function c95308449.checkop(e,tp,eg,ep,ev,re,r,rp)
ct
=
ct
+
1
c
:
SetTurnCounter
(
ct
)
if
ct
==
20
then
Duel
.
Win
(
tp
,
0x
4
)
Duel
.
Win
(
tp
,
0x
11
)
end
end
strings.conf
View file @
6dcb7a3f
...
...
@@ -351,9 +351,11 @@
!
victory
0
x0
投降
!
victory
0
x1
LP
变成
0
!
victory
0
x2
没有卡可抽
!
victory
0
x3
被封印的埃及使者
!
victory
0
x4
終焉のカウントダウン
!
victory
0
x5
毒蛇神ヴェノミナーガ
!
victory
0
x3
超时
!
victory
0
x4
失去连接
!
victory
0
x10
封印されしエクゾディア
!
victory
0
x11
終焉のカウントダウン
!
victory
0
x12
毒蛇神ヴェノミナーガ
#counters
!
counter
0
x3001
魔力指示物
!
counter
0
x2
楔指示物
...
...
system.conf
View file @
6dcb7a3f
...
...
@@ -3,7 +3,7 @@
antialias
=
2
nickname
=
Player
gamename
=
Game
lastdeck
=
Burn1
lastdeck
=
test
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
serverport
=
7911
...
...
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