Welcome,
Guest
. Please
login
or
register
.
February 10, 2025, 11:23:07 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
TNet 3 Support
»
MissingMethodExceptions in 1.9.6
« previous
next »
Print
Pages: [
1
]
Author
Topic: MissingMethodExceptions in 1.9.6 (Read 1967 times)
luvcraft
Newbie
Thank You
-Given: 2
-Receive: 1
Posts: 11
MissingMethodExceptions in 1.9.6
«
on:
July 14, 2014, 02:26:14 PM »
I just updated to 1.9.6 and immediately got a bunch of MissingMethodExceptions trying to read my custom classes in from DataNodes, because apparently TNet now expects all custom classes' constructors to take exactly one int as an argument (my classes' constructors take no arguments). I fixed it by changing the Create function at TNSerializer line 272 to the following:
static
public
object
Create
(
this
Type type,
int
size
)
{
try
{
return
Activator
.
CreateInstance
(
type, size
)
;
}
catch
(
Exception ex
)
{
try
{
return
Activator
.
CreateInstance
(
type
)
;
}
catch
(
Exception ex2
)
{
Debug
.
LogError
(
ex2
.
Message
+
" | "
+
ex2
.
GetType
(
)
)
;
return
null
;
}
}
}
«
Last Edit: July 14, 2014, 02:47:34 PM by luvcraft
»
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: MissingMethodExceptions in 1.9.6
«
Reply #1 on:
July 15, 2014, 01:11:18 AM »
Thanks for pointing that out, but I think it might be better to change DataNode line 872 instead:
mValue
=
type
.
Implements
(
typeof
(
TList
)
)
||
type
.
Implements
(
typeof
(
System.
Collections
.
IList
)
)
?
type
.
Create
(
children
.
size
)
:
type
.
Create
(
)
;
Logged
luvcraft
Newbie
Thank You
-Given: 2
-Receive: 1
Posts: 11
Re: MissingMethodExceptions in 1.9.6
«
Reply #2 on:
July 15, 2014, 12:16:07 PM »
changing that line on DataNode but leaving TNSerializer as it was still gives me errors when I try to read in a TList of my custom class (it does, however, work just fine with the nested-try fix I suggested)
EDIT: This is fixed in 1.9.6b. Thanks!
«
Last Edit: July 15, 2014, 01:37:03 PM by luvcraft
»
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
TNet 3 Support
»
MissingMethodExceptions in 1.9.6