Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 17:11

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Can complite error? (program C#)

Discussion on Can complite error? (program C#) within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
Arvydas000's Avatar
 
elite*gold: 0
Join Date: Nov 2008
Posts: 51
Received Thanks: 3
Post Can complite error? (program C#)

Maybe can help me complite this error?.I click F5 and i cannot connect to my server. Drop this error
Arvydas000 is offline  
Old 01/02/2012, 15:47   #2
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
Change the calling convention of the imported function to cdecl (I think the blowfish library is C or C++, right?). I learned this a while back when I was having the same problem after upgrading to .NET 4.0; it turns out that .NET 3.5 disables PInvoke debugging messages. Basically the parameters of that function are getting ordered incorrectly when they get passed to the native function... which means that the stack will get used up and throw an exception eventually, causing your server to crash.
Lateralus is offline  
Old 01/02/2012, 16:12   #3

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
I don't understand the theory behind the problem like Lateralus but I do know the solution to it.
Search
Code:
public class Blowfish : IDisposable
And replace the DllImports with these:
Code:
[DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
        public extern static void CAST_set_key(IntPtr _key, int len, byte[] data);

        [DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
        public extern static void BF_ecb_encrypt(byte[] in_, byte[] out_, IntPtr schedule, int enc);

        [DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
        public extern static void BF_cbc_encrypt(byte[] in_, byte[] out_, int length, IntPtr schedule, byte[] ivec, int enc);

        [DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
        public extern static void CAST_cfb64_encrypt(byte[] in_, byte[] out_, int length, IntPtr schedule, byte[] ivec, ref int num, int enc);

        [DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
        public extern static void BF_ofb64_encrypt(byte[] in_, byte[] out_, int length, IntPtr schedule, byte[] ivec, out int num);
Kiyono is offline  
Old 01/02/2012, 19:12   #4
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
the calling convention in native code, you can specify a calling convention __cdecl, __stdcall etc, it's basically the way arguments are passed to a function when it's called on x86, it determines how args are pushed/popped onto stack and return value stored in eax etc, the difference between __cdecl and __stdcall is whether the caller or callee cleans up the stack .

so basicly you want to say :-

Code:
[DllImport("libeay32.dll" , CallingConvention = CallingConvention.Cdecl)]
Mr_PoP is offline  
Old 01/02/2012, 20:11   #5
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
Already got there first guys. ;D
Lateralus is offline  
Old 01/02/2012, 23:42   #6
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by Lateralus View Post
Already got there first guys. ;D
yeah ;P , we just gave him the actual code
Mr_PoP is offline  
Old 01/03/2012, 00:08   #7


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
I released the fix for this in the pserver guide section somewhere, search please =x
Korvacs is offline  
Old 01/03/2012, 09:05   #8
 
Arvydas000's Avatar
 
elite*gold: 0
Join Date: Nov 2008
Posts: 51
Received Thanks: 3
Thx all for help
Arvydas000 is offline  
Reply


Similar Threads Similar Threads
Error : Invalid Client Program will be terminated plz help
08/26/2017 - Silkroad Online - 16 Replies
When i have install silkroad and the luncher starts it comes up and error invalid client, program will be terminated. what is wrong plz answer :)
[ERROR] ( undefined file pleasez réinstall the program )
10/09/2011 - Kal Online - 4 Replies
Hello guys . i have 3 problems with connecting on a PServer , i'm out of idea so i post here , its my last chance .. Ive download an PServer . Extracted it , updated it . when i start the game , it work , 2 mins after login/playing , my game crash , it close totally without any error . When i want restart it , it say this error like 10 time every second
5375 Program.cs error ?mysql?
08/28/2011 - CO2 Private Server - 6 Replies
Hey Guys, igot an error when i try to start a 5375 server. so i just debug the server in C# and got this error. it is at the code in program.cs
[Help] Program.cs minor (yet annoying) error
06/13/2011 - CO2 Private Server - 4 Replies
okay, so let me cut to the chase. I have been getting this problem in my program.cs file and I have not yet figured out how to solve it... I tried commenting it but yet nothing has happened. when I debug the build the whole solution it brings up the server command prompt with all the data loading then stops at the bottom saying this error (NullReferenceException): on this piece of code: if (EntityUID.Now == 0) { Console.Clear(); ...
could any one tell me how to fix this error in Program.cs ?
03/04/2010 - CO2 Private Server - 12 Replies
could any one tell me how to fix this error in Program.cs ? using System.Threading; using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text; using NewestCOServer.Game; namespace NewestCOServer



All times are GMT +1. The time now is 17:17.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.