Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: devomage on August 16, 2016, 08:57:32 PM
Title:
DataNode Error
Post by:
devomage
on
August 16, 2016, 08:57:32 PM
In the following DataNode:
(I can use bytes in this case, but this error needs attention)
Resolves fine:
int
phpbb_id
=
info
.
data
.
GetChild
(
"phpbb_id"
,
0
)
;
Causes an error:
int
min_level
=
info
.
data
.
GetChild
(
"min_level"
,
0
)
;
int
max_level
=
info
.
data
.
GetChild
(
"max_level"
,
0
)
;
//Unable to convert System.Byte (1) to System.Int32
Version
=
20160207
type
=
"Match"
phpbb_id
=
2
isPrivate
=
false
match_type
=
"Conquest"
arena_index
=
10
arenaname
=
"Dev Map"
min_level
=
1
max_level
=
2
founder
=
"Pitch Black"
duration
=
15
start
=
636069937084710000
rules
=
"1,2"
teams
=
"Order,Yellow"
invited
=
""
Title:
Re: DataNode Error
Post by:
ArenMook
on
August 17, 2016, 06:53:39 AM
Seems to work fine here. Byte can be cast to an int, it's done on line 377 of TNSerializer.cs, in the CastValue function.
Also, why is it a byte anyway? Every number is read as an integer when you parse a text data file.
Lastly, I'd do it like this: int max_level = info.data.GetChild<int>("max_level");