Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jochen Bauer
spn-relayserver
Commits
2ec9bf64
Commit
2ec9bf64
authored
Apr 28, 2018
by
Hubert Denkmair
Browse files
forward database_id
parent
adf4a72e
Changes
2
Hide whitespace changes
Inline
Side-by-side
relayserver/JsonProtocol.cpp
View file @
2ec9bf64
...
...
@@ -72,6 +72,7 @@ void MsgPackProtocol::to_json(nlohmann::json &j, const MsgPackProtocol::BotItem
{
j
=
json
{
{
"id"
,
item
.
guid
},
{
"db_id"
,
item
.
database_id
},
{
"name"
,
item
.
name
},
{
"segment_radius"
,
item
.
segment_radius
},
{
"color"
,
item
.
color
},
...
...
relayserver/MsgPackProtocol.h
View file @
2ec9bf64
...
...
@@ -49,6 +49,7 @@ namespace MsgPackProtocol
real_t
segment_radius
;
std
::
vector
<
SnakeSegmentItem
>
segments
;
std
::
vector
<
uint32_t
>
color
;
int
database_id
;
};
struct
Message
...
...
@@ -513,12 +514,13 @@ namespace msgpack {
msgpack
::
object
const
&
operator
()(
msgpack
::
object
const
&
o
,
MsgPackProtocol
::
BotItem
&
v
)
const
{
if
(
o
.
type
!=
msgpack
::
type
::
ARRAY
)
throw
msgpack
::
type_error
();
if
(
o
.
via
.
array
.
size
!=
5
)
throw
msgpack
::
type_error
();
if
(
o
.
via
.
array
.
size
!=
6
)
throw
msgpack
::
type_error
();
o
.
via
.
array
.
ptr
[
0
]
>>
v
.
guid
;
o
.
via
.
array
.
ptr
[
1
]
>>
v
.
name
;
o
.
via
.
array
.
ptr
[
2
]
>>
v
.
segment_radius
;
o
.
via
.
array
.
ptr
[
3
]
>>
v
.
segments
;
o
.
via
.
array
.
ptr
[
4
]
>>
v
.
color
;
o
.
via
.
array
.
ptr
[
5
]
>>
v
.
database_id
;
for
(
auto
&
segmentItem
:
v
.
segments
)
{
segmentItem
.
bot_id
=
v
.
guid
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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