Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Dev] Map Structure

Junior Spellweaver
Joined
Nov 19, 2014
Messages
132
Reaction score
12
if i didn't make this simple wrong, you are would not to share your informations.
:)
 
Retired (Goddamn idiots)
Joined
Dec 3, 2003
Messages
391
Reaction score
483
bergi, BOOL in C++ is an int, not a bool type.
So you're looking at 4 bytes versus one byte.
As well as char being 2 bytes due to unicode. I recommend using byte instead.
 
Last edited:
[emoji848]
Legend
Joined
Dec 3, 2011
Messages
2,232
Reaction score
1,518
bergi, BOOL in C++ is an int, not a bool type.
So you're looking at 4 bytes versus one byte.
As well as char being 2 bytes due to unicode. I recommend using byte instead.

This is all about Marshaling in C# really. You can apply native / unmanaged type attributes like he did with:
Code:
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 40)]
or optionally
Code:
[MarshalAs(UnmanagedType.Bool)]
which will make a C# bool always a 4-byte integer. This is the default btw. so it's not necessary to specify it explicitly!

The struct posted by bergi9 works because:
  • The marshals every C# bool to a 32-bit integer
  • He applied a ByValArray Type with a constant size marshal tag to the "strEventParam" Array
 
Back
Top