Debugging issues

07/19/2012 02:42 Im2Frosty#1
I converted my project to x86 and i debug, the server turns on, i go to login, and it freezes at account server. I get these issues in vs any1 got a clue?

Also any1 got an idea as for schooling for C# C++ like classes i should take. is it just basic computer programming or game design? Cuz im enrolling within the next year just wanna know fersure what i should take.
07/19/2012 03:12 InfamousNoone#2
Set the calling convention for memcpy to cdecl.
07/19/2012 03:27 Im2Frosty#3
debug claims native doesn't contain a definition for cdecl
07/19/2012 03:46 I don't have a username#4
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace ConquerOnline.Native
{
    public unsafe class Msvcrt
    {
        [DllImport(NativeConfiguration.MSVCRT, EntryPoint = "memcpy", CallingConvention = CallingConvention.Cdecl, SetLastError = false)]
        private static extern void* Memcpy(void* dest, void* src, uint count);

        [DllImport(NativeConfiguration.MSVCRT, EntryPoint = "memset", CallingConvention = CallingConvention.Cdecl)]
        private static extern void* Memset(void* dst, byte fill, int length);

        [DllImport(NativeConfiguration.MSVCRT, EntryPoint = "srand", CallingConvention = CallingConvention.StdCall)]
        public static extern short srand(int seed);

        [DllImport(NativeConfiguration.MSVCRT, EntryPoint = "rand", CallingConvention = CallingConvention.StdCall)]
        public static extern short rand();

        #region memset
        public static void MemorySet(byte[] Dest, byte Fill, int Length)
        {
            fixed (byte* dest = Dest)
                Memset(dest, Fill, Length);
        }
        public static void MemorySet(byte[] Dest, byte Fill, uint Length)
        {
            fixed (byte* dest = Dest)
                Memset(dest, Fill, (int)Length);
        }

        public static void MemorySet(byte* Dest, byte Fill, int Length)
        {
            Memset(Dest, Fill, Length);
        }
        public static void MemorySet(byte* Dest, byte Fill, uint Length)
        {
            Memset(Dest, Fill, (int)Length);
        }

        public static void MemorySet(void* Dest, byte Fill, int Length)
        {
            Memset(Dest, Fill, Length);
        }
        public static void MemorySet(void* Dest, byte Fill, uint Length)
        {
            Memset(Dest, Fill, (int)Length);
        }
        #endregion

        #region memcpy
        public static void MemoryCopy(byte* Dest, byte* Src, uint Count)
        {
            Memcpy(Dest, Src, Count);
        }
        public static void MemoryCopy(byte* Dest, byte* Src, int Count)
        {
            Memcpy(Dest, Src, (uint)Count);
        }

        public static void MemoryCopy(void* Dest, void* Src, uint Count)
        {
            Memcpy(Dest, Src, Count);
        }
        public static void MemoryCopy(void* Dest, void* Src, int Count)
        {
            Memcpy(Dest, Src, (uint)Count);
        }

        public static void MemoryCopy(byte[] Dest, byte[] Src, int Count)
        {
            fixed (byte* dest = Dest, src = Src)
                Memcpy(dest, src, (uint)Count);
        }
        public static void MemoryCopy(byte[] Dest, byte[] Src, uint Count)
        {
            fixed (byte* dest = Dest, src = Src)
                Memcpy(dest, src, Count);
        }
        #endregion
    }
}
.
07/19/2012 06:16 Im2Frosty#5
i still dont understand what was that code for?
07/19/2012 09:05 Korvacs#6
memcpy copies data in memory from one location to another, in this case its part of the socket system.
07/19/2012 16:14 InfamousNoone#7
Quote:
Originally Posted by Im2Frosty View Post
i still dont understand what was that code for?
I suggest learning general coding rather than diving into private servers. You're shooting yourself in the foot.
07/19/2012 20:18 Im2Frosty#8
yea, i was going to try to learn via having a server but its not working out. i appreciate the help tho guys.
07/20/2012 03:59 InfamousNoone#9
My mind was just blown. Someone on E*pvp finally acknowledges that they should learn general coding before trying to run a server? I am shocked.
07/20/2012 16:28 I don't have a username#10
Quote:
Originally Posted by InfamousNoone View Post
My mind was just blown. Someone on E*pvp finally acknowledges that they should learn general coding before trying to run a server? I am shocked.
Miracle happens.