Connection.cs problem

09/20/2010 18:52 RiksmanRiks#1
I get this problem when i try to log in to my server

Native.memcpy(p, p2, DataLen);

[Only registered and activated users can see links. Click Here To Register...]
09/20/2010 18:57 Basser#2
Posting a blocked website :facepalm:
Way 2 go.
09/20/2010 22:31 { Angelius }#3
you can skip that part doing the debug with out using the C# that should do it just runit using the .EXE file

its not gonna fix it but its gonna let you run the server
09/20/2010 23:03 Arcо#4
Might wanna post a bigger screenshot.
09/20/2010 23:07 Fish*#5
Quote:
Originally Posted by RiksmanRiks View Post
I get this problem when i try to log in to my server

Native.memcpy(p, p2, DataLen);
restart ur pc, should fix it.
is because ur memory use gets to high.
09/20/2010 23:17 Arcо#6
Actually, what framework are you using?
09/21/2010 04:56 RiksmanRiks#7
Quote:
Originally Posted by Аrco View Post
Actually, what framework are you using?
I Think i'm using framework 4
09/21/2010 11:41 Korvacs#8
You need to correctly assign your calling convention to your pinvoke methods in that case, do a search for calling convention ive posted the fix for this before in the release section i think.
09/21/2010 13:37 Arcо#9
Replace your native.cs with this.
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace NewestCOServer
{
    public unsafe class Native
    {
        [DllImport("kernel32.dll")]
        public static extern IntPtr GetStdHandle(uint nStdHandle);
        [DllImport("kernel32.dll")]
        public static extern bool SetConsoleTextAttribute(IntPtr hConsoleOutput, int wAttributes);
        [DllImport("msvcrt.dll", EntryPoint = "memcpy", CallingConvention = CallingConvention.Cdecl, SetLastError = false)]
        public static extern unsafe void* memcpy(void* dest, void* src, uint size);
        [DllImport("user32.dll")]
        public static extern int MessageBox(int h, string m, string c, int type);
        [DllImport("winmm.dll")]
        public static extern uint timeGetTime();
        [DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
        public extern static void BF_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 BF_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);
    }
}
09/21/2010 15:30 RiksmanRiks#10
Quote:
Originally Posted by Аrco View Post
Replace your native.cs with this.
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace NewestCOServer
{
    public unsafe class Native
    {
        [DllImport("kernel32.dll")]
        public static extern IntPtr GetStdHandle(uint nStdHandle);
        [DllImport("kernel32.dll")]
        public static extern bool SetConsoleTextAttribute(IntPtr hConsoleOutput, int wAttributes);
        [DllImport("msvcrt.dll", EntryPoint = "memcpy", CallingConvention = CallingConvention.Cdecl, SetLastError = false)]
        public static extern unsafe void* memcpy(void* dest, void* src, uint size);
        [DllImport("user32.dll")]
        public static extern int MessageBox(int h, string m, string c, int type);
        [DllImport("winmm.dll")]
        public static extern uint timeGetTime();
        [DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
        public extern static void BF_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 BF_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);
    }
}
Thx for this man. now i can play on my server :D
09/21/2010 15:50 Basser#11
You could have searched the forum, this error has been posted several times.