|
You last visited: Today at 17:11
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.
01/02/2012, 15:06
|
#1
|
elite*gold: 0
Join Date: Nov 2008
Posts: 51
Received Thanks: 3
|
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
|
|
|
01/02/2012, 15:47
|
#2
|
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.
|
|
|
01/02/2012, 16:12
|
#3
|
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);
|
|
|
01/02/2012, 19:12
|
#4
|
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)]
|
|
|
01/02/2012, 20:11
|
#5
|
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
|
Already got there first guys. ;D
|
|
|
01/02/2012, 23:42
|
#6
|
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
|
Quote:
Originally Posted by Lateralus
Already got there first guys. ;D
|
yeah ;P , we just gave him the actual code
|
|
|
01/03/2012, 00:08
|
#7
|
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
|
|
|
01/03/2012, 09:05
|
#8
|
elite*gold: 0
Join Date: Nov 2008
Posts: 51
Received Thanks: 3
|
Thx all for help
|
|
|
 |
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.
|
|