Helpful 5165 Thread

12/15/2016 10:13 corept#16
(noob alert)
Hello,
Sorry to bring this up!

I was trying to compile when I got this error:
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'NewestCOServer!NewestCOServer.Native::BF_set_key' has unbalanced the stack.

Highlighting the following code:
Code:
 public void SetKey(byte[] data)
        {
            _encryptNum = 0;
            _decryptNum = 0;
            [COLOR="Red"]Native.BF_set_key(_key, data.Length, data);[/COLOR]
        }
So I applyed Korvacs suggestion
changing
Code:
 [DllImport("libeay32.dll")]
for
Code:
[DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
But now I have the following error "A call to PInvoke function 'NewestCOServer!NewestCOServer.Native::BF_cfb64_en crypt' has unbalanced the stack."

Code:
Native.BF_cfb64_encrypt(buffer, ret, buffer.Length, _key, _encryptIv, ref _encryptNum, 1);
[Only registered and activated users can see links. Click Here To Register...]

Can anyone help me?

Thank you in advance.
12/15/2016 14:30 pintinho12#17
This happens because the libeay dll isn't compatible with the project or you're trying to run the x86 dll in a x64 project or the x64 dll in a x86 project.

If your project is x86, make sure you have the x86 libeay dll.
12/16/2016 09:21 Super Aids#18
You should drop the source anyway and use another source. Becasue it's garbage anyway
12/16/2016 09:44 corept#19
Hi! thanks for the answers! I could solve that issue, but I got others. So I am really thinking droping the source.
Any recommendations for a nice classic source?
thanks
12/16/2016 11:51 Soulfly25#20
Quote:
Originally Posted by corept View Post
Hi! thanks for the answers! I could solve that issue, but I got others. So I am really thinking droping the source.
Any recommendations for a nice classic source?
thanks
Just continue what you are doing don't mind them. It's not about the source it's about how you code and how you fix it. Just like shannarar classic look at them they use the same source with you and they succeeded. So continue what you are doing. and patcac have the solution for your error.
12/16/2016 14:57 Super Aids#21
Quote:
Originally Posted by Soulfly25 View Post
Just continue what you are doing don't mind them. It's not about the source it's about how you code and how you fix it. Just like shannarar classic look at them they use the same source with you and they succeeded. So continue what you are doing. and patcac have the solution for your error.
Yeah, but if the source is fucking shit, your code will be fucking shit.
12/16/2016 15:46 Nyorai#22
Quote:
Originally Posted by Soulfly25 View Post
Just continue what you are doing don't mind them. It's not about the source it's about how you code and how you fix it. Just like shannarar classic look at them they use the same source with you and they succeeded. So continue what you are doing. and patcac have the solution for your error.
You're wrong. The source is a terrible base. The amount of time I've spent rewritting some of the old code was enough to make a better base myself by now - and trust me, considering I haven't been learning for that long it would take me quite a while (only started taking "classes" from a friend around a year and half ago) - and I haven't even starting rewritting the ridiculous way used to handle skills - can't even imagine how long I'll spend rewritting all that crap.
Just so you can have an idea, just rewritting the whole NPCDialog class (that by the time I started doing it was around 30k lines of code) took me around 2 weeks - it's all organized and scattered through different classes and trust me, it's so much easier to write everything from scratch than having to rewrite the code.

One would be better off by making a new one from scratch and get references or packet structures from this one as it has lots of content - although most are either bugged or terribly coded. But from someone who have been working with that source for around a year now, hosting a server with it will just force you to lose your time rewritting things instead of actually improving the server and honestly you learn so much more by writting things from scratch than by rewritting the same old crap over and over again.
12/17/2016 01:25 Soulfly25#23
Quote:
Originally Posted by Nyorai View Post
You're wrong. The source is a terrible base. The amount of time I've spent rewritting some of the old code was enough to make a better base myself by now - and trust me, considering I haven't been learning for that long it would take me quite a while (only started taking "classes" from a friend around a year and half ago) - and I haven't even starting rewritting the ridiculous way used to handle skills - can't even imagine how long I'll spend rewritting all that crap.
Just so you can have an idea, just rewritting the whole NPCDialog class (that by the time I started doing it was around 30k lines of code) took me around 2 weeks - it's all organized and scattered through different classes and trust me, it's so much easier to write everything from scratch than having to rewrite the code.

One would be better off by making a new one from scratch and get references or packet structures from this one as it has lots of content - although most are either bugged or terribly coded. But from someone who have been working with that source for around a year now, hosting a server with it will just force you to lose your time rewritting things instead of actually improving the server and honestly you learn so much more by writting things from scratch than by rewritting the same old crap over and over again.
Yeah you are right about that. But the source he used for is same to classic-veteran (NCOS based if I am not wrong) so it's clearly well written source. I doubt they buy'd that source.
12/17/2016 04:41 pro4never#24
Quote:
Originally Posted by Soulfly25 View Post
...so it's clearly well written source.
hilarious


There is no version of ncos that's worth using in any way shape or form. Write your own source from scratch if you want to run a server. If you cant then you have no place running a server.

If you don't have the time to do it from scratch at least start from something somewhat approaching useful like cops.


Coemu, lotf, redux, trinity are all shitty sources and should never, ever be touched if you plan to do a public project. That's not really something anyone can debate.
12/19/2016 08:39 Super Aids#25
Quote:
Originally Posted by Soulfly25 View Post
Yeah you are right about that. But the source he used for is same to classic-veteran (NCOS based if I am not wrong) so it's clearly well written source. I doubt they buy'd that source.
I can't tell if you're just an idiot or trying to troll, because who the fuck in their right mind would ever call NCOS a good source? It's garbage no matter how you look at it.
12/19/2016 13:58 Soulfly25#26
Quote:
Originally Posted by Super Aids View Post
I can't tell if you're just an idiot or trying to troll, because who the fuck in their right mind would ever call NCOS a good source? It's garbage no matter how you look at it.
Why did you think your source is well written? oh come on idiot! get a life!. of course everyone can use any base source here. what the purpose of the release?. It's not about the based source It's about how you code and how you fix it! so that thing you called NCOS a garbage is the source that 90% newbie coder use it, and 9% of Redux source and 1% of your source. Have a nice day fella!
12/19/2016 14:11 Super Aids#27
Quote:
Originally Posted by Soulfly25 View Post
Why did you think your source is well written?
Because my source isn't full of garbage, vulnerabilities, a million different coding style and hasn't been infected by a thousand camels trying to put a source together.

Quote:
Originally Posted by Soulfly25 View Post
so that thing you called NCOS a garbage is the source that 90% newbie coder use it, and 9% of Redux source and 1% of your source. Have a nice day fella!
Popularity does not equal quality. A small fraction uses my source, because it's only a small fraction in this community who actually has a working brain.

[Only registered and activated users can see links. Click Here To Register...]
12/19/2016 15:20 Soulfly25#28
Okay ka Kokey.. I won't debate on you.