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
REIKAI
ygopro
Commits
51b3362d
Commit
51b3362d
authored
Sep 18, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
18731768
7a89eeb9
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
519 additions
and
138 deletions
+519
-138
gframe/bufferio.h
gframe/bufferio.h
+27
-3
gframe/config.h
gframe/config.h
+5
-3
gframe/replay.cpp
gframe/replay.cpp
+6
-3
gframe/single_mode.cpp
gframe/single_mode.cpp
+1
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+7
-7
lflist.conf
lflist.conf
+470
-119
ocgcore
ocgcore
+1
-1
premake4.lua
premake4.lua
+1
-1
script
script
+1
-1
No files found.
gframe/bufferio.h
View file @
51b3362d
...
...
@@ -60,7 +60,7 @@ public:
*
pstr
=
0
;
return
l
;
}
// U
CS-
2 to UTF-8
// U
TF-16/UTF-3
2 to UTF-8
static
int
EncodeUTF8
(
const
wchar_t
*
wsrc
,
char
*
str
)
{
char
*
pstr
=
str
;
while
(
*
wsrc
!=
0
)
{
...
...
@@ -71,18 +71,35 @@ public:
str
[
0
]
=
((
*
wsrc
>>
6
)
&
0x1f
)
|
0xc0
;
str
[
1
]
=
((
*
wsrc
)
&
0x3f
)
|
0x80
;
str
+=
2
;
}
else
{
}
else
if
(
*
wsrc
<
0x10000
&&
(
*
wsrc
<
0xd800
||
*
wsrc
>
0xdfff
))
{
str
[
0
]
=
((
*
wsrc
>>
12
)
&
0xf
)
|
0xe0
;
str
[
1
]
=
((
*
wsrc
>>
6
)
&
0x3f
)
|
0x80
;
str
[
2
]
=
((
*
wsrc
)
&
0x3f
)
|
0x80
;
str
+=
3
;
}
else
{
#ifdef _WIN32
unsigned
unicode
=
0
;
unicode
|=
(
*
wsrc
++
&
0x3ff
)
<<
10
;
unicode
|=
*
wsrc
&
0x3ff
;
unicode
+=
0x10000
;
str
[
0
]
=
((
unicode
>>
18
)
&
0x7
)
|
0xf0
;
str
[
1
]
=
((
unicode
>>
12
)
&
0x3f
)
|
0x80
;
str
[
2
]
=
((
unicode
>>
6
)
&
0x3f
)
|
0x80
;
str
[
3
]
=
((
unicode
)
&
0x3f
)
|
0x80
;
#else
str
[
0
]
=
((
*
wsrc
>>
18
)
&
0x7
)
|
0xf0
;
str
[
1
]
=
((
*
wsrc
>>
12
)
&
0x3f
)
|
0x80
;
str
[
2
]
=
((
*
wsrc
>>
6
)
&
0x3f
)
|
0x80
;
str
[
3
]
=
((
*
wsrc
)
&
0x3f
)
|
0x80
;
#endif // _WIN32
str
+=
4
;
}
wsrc
++
;
}
*
str
=
0
;
return
str
-
pstr
;
}
// UTF-8 to U
CS-
2
// UTF-8 to U
TF-16/UTF-3
2
static
int
DecodeUTF8
(
const
char
*
src
,
wchar_t
*
wstr
)
{
const
char
*
p
=
src
;
wchar_t
*
wp
=
wstr
;
...
...
@@ -97,7 +114,14 @@ public:
*
wp
=
(((
unsigned
)
p
[
0
]
&
0xf
)
<<
12
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
2
]
&
0x3f
);
p
+=
3
;
}
else
if
((
*
p
&
0xf8
)
==
0xf0
)
{
#ifdef _WIN32
unsigned
unicode
=
(((
unsigned
)
p
[
0
]
&
0x7
)
<<
18
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
12
)
|
(((
unsigned
)
p
[
2
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
3
]
&
0x3f
);
unicode
-=
0x10000
;
*
wp
++
=
(
unicode
>>
10
)
|
0xd800
;
*
wp
=
(
unicode
&
0x3ff
)
|
0xdc00
;
#else
*
wp
=
(((
unsigned
)
p
[
0
]
&
0x7
)
<<
18
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
12
)
|
(((
unsigned
)
p
[
2
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
3
]
&
0x3f
);
#endif // _WIN32
p
+=
4
;
}
else
p
++
;
...
...
gframe/config.h
View file @
51b3362d
...
...
@@ -12,11 +12,9 @@
#include <ws2tcpip.h>
#ifdef _MSC_VER
#define myswprintf _swprintf
#define mywcsncasecmp _wcsnicmp
#define mystrncasecmp _strnicmp
#else
#define myswprintf swprintf
#define mywcsncasecmp wcsncasecmp
#define mystrncasecmp strncasecmp
#endif
...
...
@@ -44,7 +42,6 @@
#define SOCKET_ERRNO() (errno)
#include <wchar.h>
#define myswprintf(buf, fmt, ...) swprintf(buf, 4096, fmt, ##__VA_ARGS__)
#define mywcsncasecmp wcsncasecmp
#define mystrncasecmp strncasecmp
inline
int
_wtoi
(
const
wchar_t
*
s
)
{
...
...
@@ -53,6 +50,11 @@ inline int _wtoi(const wchar_t * s) {
}
#endif
template
<
size_t
N
,
typename
...
TR
>
inline
int
myswprintf
(
wchar_t
(
&
buf
)[
N
],
const
wchar_t
*
fmt
,
TR
...
args
)
{
return
swprintf
(
buf
,
N
,
fmt
,
args
...);
}
#ifndef YGOPRO_SERVER_MODE
#include <irrlicht.h>
#include <GL/gl.h>
...
...
gframe/replay.cpp
View file @
51b3362d
...
...
@@ -213,7 +213,10 @@ bool Replay::OpenReplay(const wchar_t* name) {
}
if
(
!
fp
)
return
false
;
fread
(
&
pheader
,
sizeof
(
pheader
),
1
,
fp
);
if
(
fread
(
&
pheader
,
sizeof
(
pheader
),
1
,
fp
)
<
1
)
{
fclose
(
fp
);
return
false
;
}
if
(
pheader
.
flag
&
REPLAY_COMPRESSED
)
{
comp_size
=
fread
(
comp_data
,
1
,
0x1000
,
fp
);
fclose
(
fp
);
...
...
@@ -242,9 +245,9 @@ bool Replay::CheckReplay(const wchar_t* name) {
if
(
!
rfp
)
return
false
;
ReplayHeader
rheader
;
fread
(
&
rheader
,
sizeof
(
ReplayHeader
),
1
,
rfp
);
size_t
count
=
fread
(
&
rheader
,
sizeof
(
ReplayHeader
),
1
,
rfp
);
fclose
(
rfp
);
return
rheader
.
id
==
0x31707279
&&
rheader
.
version
>=
0x12d0
;
return
count
==
1
&&
rheader
.
id
==
0x31707279
&&
rheader
.
version
>=
0x12d0
;
}
bool
Replay
::
DeleteReplay
(
const
wchar_t
*
name
)
{
wchar_t
fname
[
256
];
...
...
gframe/single_mode.cpp
View file @
51b3362d
...
...
@@ -50,6 +50,7 @@ int SingleMode::SinglePlayThread(void* param) {
myswprintf
(
mainGame
->
dInfo
.
strLP
[
1
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
1
]);
BufferIO
::
CopyWStr
(
mainGame
->
ebNickName
->
getText
(),
mainGame
->
dInfo
.
hostname
,
20
);
mainGame
->
dInfo
.
clientname
[
0
]
=
0
;
mainGame
->
dInfo
.
player_type
=
0
;
mainGame
->
dInfo
.
turn
=
0
;
char
filename
[
256
];
size_t
slen
=
0
;
...
...
gframe/tag_duel.cpp
View file @
51b3362d
...
...
@@ -1924,7 +1924,7 @@ void TagDuel::RefreshMzone(int player, int flag, int use_cache, DuelPlayer* dp)
void
TagDuel
::
RefreshMzone
(
int
player
,
int
flag
,
int
use_cache
)
#endif //YGOPRO_SERVER_MODE
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1978,7 +1978,7 @@ void TagDuel::RefreshSzone(int player, int flag, int use_cache, DuelPlayer* dp)
void
TagDuel
::
RefreshSzone
(
int
player
,
int
flag
,
int
use_cache
)
#endif //YGOPRO_SERVER_MODE
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -2032,7 +2032,7 @@ void TagDuel::RefreshHand(int player, int flag, int use_cache, DuelPlayer* dp)
void
TagDuel
::
RefreshHand
(
int
player
,
int
flag
,
int
use_cache
)
#endif //YGOPRO_SERVER_MODE
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -2082,7 +2082,7 @@ void TagDuel::RefreshGrave(int player, int flag, int use_cache, DuelPlayer* dp)
void
TagDuel
::
RefreshGrave
(
int
player
,
int
flag
,
int
use_cache
)
#endif //YGOPRO_SERVER_MODE
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -2112,7 +2112,7 @@ void TagDuel::RefreshExtra(int player, int flag, int use_cache, DuelPlayer* dp)
void
TagDuel
::
RefreshExtra
(
int
player
,
int
flag
,
int
use_cache
)
#endif //YGOPRO_SERVER_MODE
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -2148,7 +2148,7 @@ if(!dp || dp == cur_player[player])
}
#ifdef YGOPRO_SERVER_MODE
void
TagDuel
::
RefreshRemoved
(
int
player
,
int
flag
,
int
use_cache
,
DuelPlayer
*
dp
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -2184,7 +2184,7 @@ void TagDuel::RefreshRemoved(int player, int flag, int use_cache, DuelPlayer* dp
}
#endif
void
TagDuel
::
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_CARD
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
lflist.conf
View file @
51b3362d
This diff is collapsed.
Click to expand it.
ocgcore
@
883f539c
Subproject commit
9258e1a39fdcf9988c858b9a003611bc2a314ea3
Subproject commit
883f539ce7b4b556dfe54bbb032bdd03ee9b67dd
premake4.lua
View file @
51b3362d
...
...
@@ -23,7 +23,7 @@ solution "ygo"
configuration
"vs*"
flags
"EnableSSE2"
buildoptions
{
"-wd4996"
}
buildoptions
{
"-wd4996"
,
"/utf-8"
}
defines
{
"_CRT_SECURE_NO_WARNINGS"
}
configuration
"not vs*"
...
...
script
@
6d6029bc
Subproject commit 6
418030726ac2e4c65e10e9a02cd32c52d953d58
Subproject commit 6
d6029bc92b22fcfd151233cc4435503291511cb
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