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
5a674dab
Commit
5a674dab
authored
Mar 27, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dialogue test
parent
1838599b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
3 deletions
+35
-3
gframe/game.cpp
gframe/game.cpp
+3
-0
gframe/game.h
gframe/game.h
+1
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+27
-3
gframe/single_duel.h
gframe/single_duel.h
+1
-0
strings.conf
strings.conf
+3
-0
No files found.
gframe/game.cpp
View file @
5a674dab
...
...
@@ -81,6 +81,9 @@ void Game::LoadBetaDB() {
}
#endif
}
wchar_t
*
Game
::
GetSysString
(
int
code
)
{
return
dataManager
.
GetSysString
(
code
);
}
#else //YGOPRO_SERVER_MODE
bool
Game
::
Initialize
()
{
srand
(
time
(
0
));
...
...
gframe/game.h
View file @
5a674dab
...
...
@@ -105,6 +105,7 @@ public:
void
LoadExpansionDB
();
void
LoadBetaDB
();
void
AddDebugMsg
(
char
*
msgbuf
);
wchar_t
*
GetSysString
(
int
code
);
#else
void
MainLoop
();
void
BuildProjectionMatrix
(
irr
::
core
::
matrix4
&
mProjection
,
f32
left
,
f32
right
,
f32
bottom
,
f32
top
,
f32
znear
,
f32
zfar
);
...
...
gframe/single_duel.cpp
View file @
5a674dab
...
...
@@ -1275,7 +1275,8 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SUMMONING
:
{
pbuf
+=
8
;
int
summon_code
=
BufferIO
::
ReadInt32
(
pbuf
);
pbuf
+=
4
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
@@ -1283,6 +1284,8 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
#ifdef YGOPRO_SERVER_MODE
NetServer
::
ReSendToPlayers
(
cache_recorder
,
replay_recorder
);
#endif
if
(
summon_code
==
35595518
)
SendDialogues
(
2002
);
break
;
}
case
MSG_SUMMONED
:
{
...
...
@@ -1300,7 +1303,8 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SPSUMMONING
:
{
pbuf
+=
8
;
int
summon_code
=
BufferIO
::
ReadInt32
(
pbuf
);
pbuf
+=
4
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
@@ -1308,6 +1312,8 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
#ifdef YGOPRO_SERVER_MODE
NetServer
::
ReSendToPlayers
(
cache_recorder
,
replay_recorder
);
#endif
if
(
summon_code
==
35595518
)
SendDialogues
(
2002
);
break
;
}
case
MSG_SPSUMMONED
:
{
...
...
@@ -1351,7 +1357,8 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_CHAINING
:
{
pbuf
+=
16
;
int
effect_code
=
BufferIO
::
ReadInt32
(
pbuf
);
pbuf
+=
12
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
@@ -1359,6 +1366,9 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
#ifdef YGOPRO_SERVER_MODE
NetServer
::
ReSendToPlayers
(
cache_recorder
,
replay_recorder
);
#endif
//2pick dialogues - hanoi force
if
(
effect_code
==
44095762
)
SendDialogues
(
2001
);
break
;
}
case
MSG_CHAINED
:
{
...
...
@@ -2018,5 +2028,19 @@ void SingleDuel::SwapPickDeck() {
pick_deck_saved
[
0
]
=
pick_deck_saved
[
1
];
pick_deck_saved
[
1
]
=
pick_deck_saved_temp
;
}
void
SingleDuel
::
SendDialogues
(
int
words
)
{
STOC_Chat
scc
;
scc
.
player
=
15
;
wchar_t
*
msg
=
L"[Server]: "
+
mainGame
->
GetSysString
(
words
);
int
msglen
=
BufferIO
::
CopyWStr
(
msg
,
scc
.
msg
,
256
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_CHAT
,
&
scc
,
4
+
msglen
*
2
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
pit
=
observers
.
begin
();
pit
!=
observers
.
end
();
++
pit
)
NetServer
::
ReSendToPlayer
(
*
pit
);
#ifdef YGOPRO_SERVER_MODE
if
(
cache_recorder
)
NetServer
::
ReSendToPlayer
(
cache_recorder
);
#endif
}
}
gframe/single_duel.h
View file @
5a674dab
...
...
@@ -42,6 +42,7 @@ public:
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
//2pick
void
SwapPickDeck
();
void
SendDialogues
(
int
words
);
protected:
//2pick
...
...
strings.conf
View file @
5a674dab
...
...
@@ -445,6 +445,9 @@
!
system
1624
投掷骰子结果:
#tips
!
system
1700
可以用鼠标右键%
ls
#2pick
!
system
2001
臣服在汉诺崇高的力量面前吧!
!
system
2002
正义双刃,解离连接的锁链,破杀而出!
#victory reason
!
victory
0
x0
投降
!
victory
0
x1
LP
变成
0
...
...
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