Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 04:53

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

Advertisement



first time error iv encountered in my server,anyone know why?

Discussion on first time error iv encountered in my server,anyone know why? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
marcbacor6666's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
first time error iv encountered in my server,anyone know why?

first time error iv encountered in my server,anyone know why?



is it possible that my vps memory is corrupt or faulty?

If i run my server in my pc that problem wont appear, but if i run it in my vps that error will appear.

even if i run any public sources in my current vps that error will appear. It started 2 days ago. Iv been using the vps for almost 3 months with no problem untill november 11.7
Attached Images
File Type: jpg Untitled-1 copy.jpg (49.8 KB, 23 views)
marcbacor6666 is offline  
Old 11/12/2013, 08:14   #2
 
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413
Very nice Multithreading indeed. Good job. I can guarantee you that this wont be an easy fix :3
Y u k i is offline  
Old 11/12/2013, 08:22   #3
 
marcbacor6666's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
what do u mean multithreading, multiple making post/thread or multithreading in the source?

iv hosted my game for almost 6 months, and this is the first time that error occur, any idea whats happening? if i run the server in the vps, after few seconds or minutes that error occur, it was not like that past 6 months. but if i run in my pc no error in my server.

at System.Threading._IOCompletionCallback.PerformIOCo mpletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
marcbacor6666 is offline  
Old 11/12/2013, 12:26   #4
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Put a try catch in the bitconverter method you have in your source. Put a breakpoint in the catch and then check what values you are parsing. Seems like a problem with the buffer received, perhaps it's trying to access a non-existing offset. That is all I could think of, considering that's the only line mentioned in the thrown exception, but really how do you expect us to help when you give us NO INFORMATION and NOT EVEN ANY CODES.
Super Aids is offline  
Old 11/12/2013, 15:59   #5
 
elite*gold: 0
Join Date: Oct 2006
Posts: 110
Received Thanks: 68
Quote:
Originally Posted by marcbacor6666 View Post
first time error iv encountered in my server,anyone know why?
Is this an Access Violation exception?
hadeset is offline  
Old 11/13/2013, 03:02   #6
 
marcbacor6666's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
updated

its weird my vps host transferred me to a different ip and that error did not come back. any idea guys? so that in the future if that happens again or happens to other people your ideas can help.
marcbacor6666 is offline  
Old 11/13/2013, 08:38   #7
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Thread-safety problem.
Super Aids is offline  
Old 11/13/2013, 11:39   #8
 
elite*gold: 0
Join Date: Oct 2006
Posts: 110
Received Thanks: 68
Quote:
Originally Posted by Super Aids View Post
Thread-safety problem.
Probably not.
hadeset is offline  
Old 11/13/2013, 14:37   #9
 
lostsolder05's Avatar
 
elite*gold: 20
Join Date: Jan 2006
Posts: 890
Received Thanks: 241
Quote:
Originally Posted by Super Aids View Post
Thread-safety problem.
How would that even be a logical conclusion if every source he tried, randomly started doing it after 3 months of no problems?
lostsolder05 is offline  
Old 11/13/2013, 15:49   #10
 
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413
Quote:
Originally Posted by lostsolder05 View Post
How would that even be a logical conclusion if every source he tried, randomly started doing it after 3 months of no problems?
Probably because most sources are based off the same ****? Mostly Messi v937401 and so on.
Y u k i is offline  
Thanks
1 User
Old 11/13/2013, 19:34   #11
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
I believe someone asked me about this over skype. First, you should strongly consider keeping to one source. Don't "upgrade" whenever a new source comes out on the eastern forum. They're just slowly degrading the quality of the source (and there wasn't too quality to begin with). So, regarding the problem, it most likely is an issue with threading. It wasn't strong to begin with, and with people constantly editing the source without knowing what they're doing, it's just gotten to the point where it cannot function as a server. I'm honestly confused on why you come to this forum to ask these generic questions when you got it from another forum. Why not ask the "programmers" who edited the source?
Spirited is offline  
Old 11/14/2013, 05:11   #12
 
marcbacor6666's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
bitconverter.cs

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace C02
{
    public unsafe class BitConverter
    {
        public static ulong ToUInt64(byte[] buffer, int offset)
        {
            fixed (byte* Buffer = buffer)
            {
                return *((ulong*)(Buffer + offset));
            }
        }
        public static uint ToUInt32(byte[] buffer, int offset)
        {
            fixed (byte* Buffer = buffer)
            {
                return *((uint*)(Buffer + offset));
            }
        }
        public static int ToInt32(byte[] buffer, int offset)
        {
            fixed (byte* Buffer = buffer)
            {
                return *((int*)(Buffer + offset));
            }
        }
        public static ulong ReadUlong(byte[] buffer, int offset)
        {
            fixed (byte* Buffer = buffer)
            {
                return *((ulong*)(Buffer + offset));
            }
        }
        public static uint ReadUint(byte[] buffer, int offset)
        {
            fixed (byte* Buffer = buffer)
            {
                return *((uint*)(Buffer + offset));
            }
        }
        public static ushort ReadUshort(byte[] buffer, int offset)
        {
            fixed (byte* Buffer = buffer)
            {
                return *((ushort*)(Buffer + offset));
            }
        }
        public static ushort ToUInt16(byte[] buffer, int offset)
        {
            fixed (byte* Buffer = buffer)
            {
                return *((ushort*)(Buffer + offset));
            }
        }
        public static short ToInt16(byte[] buffer, int offset)
        {
            fixed (byte* Buffer = buffer)
            {
                return *((short*)(Buffer + offset));
            }
        }
    }
}




AssyncSocket.cs

Code:
namespace C02.Network.Sockets
{
    using C02;
    using System;
    using System.Net;
    using System.Net.Sockets;
    using System.Threading;
    using C02.Interfaces;

    public class AsyncSocket
    {
        private int backlog;
        private int clientbuffersize = 0xffff;
        private WinSocket Connection = new WinSocket();
        private bool enabled;
        public bool GameServer = false;
        private Action<ISocketWrapper> OnClientConnects;
        private Action<ISocketWrapper> OnClientDisconnects;
        private Action<byte[], ISocketWrapper> OnClientReceives;
        private ushort port;

        public event Action<ISocketWrapper> OnClientConnect
        {
            add
            {
                Action<ISocketWrapper> action2;
                Action<ISocketWrapper> onClientConnect = this.OnClientConnects;
                do
                {
                    action2 = onClientConnect;
                    Action<ISocketWrapper> action3 = (Action<ISocketWrapper>)Delegate.Combine(action2, value);
                    onClientConnect = Interlocked.CompareExchange<Action<ISocketWrapper>>(ref this.OnClientConnects, action3, action2);
                }
                while (onClientConnect != action2);
            }
            remove
            {
                Action<ISocketWrapper> action2;
                Action<ISocketWrapper> onClientConnect = this.OnClientConnects;
                do
                {
                    action2 = onClientConnect;
                    Action<ISocketWrapper> action3 = (Action<ISocketWrapper>)Delegate.Remove(action2, value);
                    onClientConnect = Interlocked.CompareExchange<Action<ISocketWrapper>>(ref this.OnClientConnects, action3, action2);
                }
                while (onClientConnect != action2);
            }
        }

        public event Action<ISocketWrapper> OnClientDisconnect
        {
            add
            {
                Action<ISocketWrapper> action2;
                Action<ISocketWrapper> onClientDisconnect = this.OnClientDisconnects;
                do
                {
                    action2 = onClientDisconnect;
                    Action<ISocketWrapper> action3 = (Action<ISocketWrapper>)Delegate.Combine(action2, value);
                    onClientDisconnect = Interlocked.CompareExchange<Action<ISocketWrapper>>(ref this.OnClientDisconnects, action3, action2);
                }
                while (onClientDisconnect != action2);
            }
            remove
            {
                Action<ISocketWrapper> action2;
                Action<ISocketWrapper> onClientDisconnect = this.OnClientDisconnects;
                do
                {
                    action2 = onClientDisconnect;
                    Action<ISocketWrapper> action3 = (Action<ISocketWrapper>)Delegate.Remove(action2, value);
                    onClientDisconnect = Interlocked.CompareExchange<Action<ISocketWrapper>>(ref this.OnClientDisconnects, action3, action2);
                }
                while (onClientDisconnect != action2);
            }
        }

        public event Action<byte[], ISocketWrapper> OnClientReceive
        {
            add
            {
                Action<byte[], ISocketWrapper> action2;
                Action<byte[], ISocketWrapper> onClientReceive = this.OnClientReceives;
                do
                {
                    action2 = onClientReceive;
                    Action<byte[], ISocketWrapper> action3 = (Action<byte[], ISocketWrapper>)Delegate.Combine(action2, value);
                    onClientReceive = Interlocked.CompareExchange<Action<byte[], ISocketWrapper>>(ref this.OnClientReceives, action3, action2);
                }
                while (onClientReceive != action2);
            }
            remove
            {
                Action<byte[], ISocketWrapper> action2;
                Action<byte[], ISocketWrapper> onClientReceive = this.OnClientReceives;
                do
                {
                    action2 = onClientReceive;
                    Action<byte[], ISocketWrapper> action3 = (Action<byte[], ISocketWrapper>)Delegate.Remove(action2, value);
                    onClientReceive = Interlocked.CompareExchange<Action<byte[], ISocketWrapper>>(ref this.OnClientReceives, action3, action2);
                }
                while (onClientReceive != action2);
            }
        }

        public AsyncSocket(ushort port)
        {
            if (!this.enabled)
            {
                this.port = port;
                this.Connection.Bind(new IPEndPoint(IPAddress.Any, this.port));
                this.Connection.Listen(100);
                this.Connection.BeginAccept(new AsyncCallback(this.AsyncConnect), null);
                this.enabled = true;
            }
        }

        private void AsyncConnect(IAsyncResult res)
        {
            AsyncSocketWrapper wrapper = null;
            try
            {
                string iPAddress = "";
                wrapper = new AsyncSocketWrapper();
                wrapper.Create(this.Connection.EndAccept(res));
                iPAddress = wrapper.Socket.RemoteEndPoint.ToString().Split(new char[] { ':' })[0].ToString();
                if (!BruteforceProtection.IsBanned(iPAddress))
                {
                    BruteforceProtection.AddWatch(iPAddress);
                    if (wrapper.Socket == null)
                    {
                        this.Connection.BeginAccept(new AsyncCallback(this.AsyncConnect), null);
                    }
                    else
                    {
                        if (this.OnClientConnects != null)
                        {
                            this.OnClientConnects(wrapper);
                        }
                        wrapper.Socket.BeginReceive(wrapper.Buffer, 0, wrapper.Buffer.Length, SocketFlags.None, new AsyncCallback(this.AsyncReceive), wrapper);
                        this.Connection.BeginAccept(new AsyncCallback(this.AsyncConnect), null);
                    }
                }
            }
            catch (SocketException exception)
            {
                Program.SaveException(exception);
                C02.Console.WriteLine(exception);
                if (this.enabled)
                {
                    this.Connection.BeginAccept(new AsyncCallback(this.AsyncConnect), null);
                }
            }
            catch (ObjectDisposedException exception2)
            {
                Program.SaveException(exception2);
                C02.Console.WriteLine(exception2);
            }
        }

        private void AsyncReceive(IAsyncResult res)
        {
            AsyncSocketWrapper asyncState;
            bool flag = false;
            try
            {
                SocketError error;
                asyncState = (AsyncSocketWrapper)res.AsyncState;
                int num = asyncState.Socket.EndReceive(res, out error);
                if ((error == SocketError.Success) && (num > 0))
                {
                    flag = true;
                    byte[] buffer = new byte[num];
                    for (int i = 0; i < num; i++)
                    {
                        buffer[i] = asyncState.Buffer[i];
                    }
                    if (this.OnClientReceives != null)
                    {
                        this.OnClientReceives(buffer, asyncState);
                    }
                    asyncState.Socket.BeginReceive(asyncState.Buffer, 0, asyncState.Buffer.Length, SocketFlags.None, new AsyncCallback(this.AsyncReceive), asyncState);
                }
                else
                {
                    this.InvokeDisconnect(asyncState);
                }
            }
            catch (SocketException exception)
            {
                Program.SaveException(exception);
                C02.Console.WriteLine(exception);
            }
            catch (ObjectDisposedException exception2)
            {
                Program.SaveException(exception2);
                C02.Console.WriteLine(exception2);
            }
            catch (Exception exception3)
            {
                Program.SaveException(exception3);
                if (flag)
                {
                    asyncState = (AsyncSocketWrapper)res.AsyncState;
                    asyncState.Socket.BeginReceive(asyncState.Buffer, 0, asyncState.Buffer.Length, SocketFlags.None, new AsyncCallback(this.AsyncReceive), asyncState);
                }
            }
        }

        public void Disable()
        {
            if (this.enabled)
            {
                this.Connection.Disable();
                this.enabled = false;
            }
        }

        public void Enable()
        {
            if (!this.enabled)
            {
                this.Connection.Bind(new IPEndPoint(IPAddress.Any, this.port));
                this.Connection.Listen(this.backlog);
                this.Connection.BeginAccept(new AsyncCallback(this.AsyncConnect), null);
                this.enabled = true;
            }
        }

        private void enabledCheck(string Variable)
        {
            if (this.enabled)
            {
                throw new Exception("Cannot modify " + Variable + " while socket is enabled.");
            }
        }

        public void InvokeDisconnect(AsyncSocketWrapper Client)
        {
            if (Client != null)
            {
                try
                {
                    if (Client.Socket.Connected)
                    {
                        Client.Socket.Shutdown(SocketShutdown.Both);
                        Client.Socket.Close();
                        if (this.OnClientDisconnects != null)
                        {
                            this.OnClientDisconnects(Client);
                        }
                        Client.Connector = null;
                        Client = null;
                    }
                    else
                    {
                        if (this.OnClientDisconnects != null)
                        {
                            this.OnClientDisconnects(Client);
                        }
                        Client.Connector = null;
                        Client = null;
                    }
                }
                catch (ObjectDisposedException exception)
                {
                    Program.SaveException(exception);
                    C02.Console.WriteLine(exception);
                }
            }
        }

        public int Backlog
        {
            get
            {
                return this.backlog;
            }
            set
            {
                this.enabledCheck("Backlog");
                this.backlog = value;
            }
        }

        public int ClientBufferSize
        {
            get
            {
                return this.clientbuffersize;
            }
            set
            {
                this.enabledCheck("ClientBufferSize");
                this.clientbuffersize = value;
            }
        }

        public bool Enabled
        {
            get
            {
                return this.enabled;
            }
        }

        public ushort Port
        {
            get
            {
                return this.port;
            }
            set
            {
                this.enabledCheck("Port");
                this.port = value;
            }
        }
    }
}
marcbacor6666 is offline  
Old 11/14/2013, 16:40   #13
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,655
Received Thanks: 705
Have you put any effort in trying to fix it ?
If yes, what did you try to do?

You can't expect people to help solve your problems if you haven't put any effort in yourself.
turk55 is offline  
Old 11/14/2013, 21:37   #14
 
elite*gold: 0
Join Date: Oct 2006
Posts: 110
Received Thanks: 68
An access violation exception occurs, when unmanaged memory allocated by P/Invoke functions, does not get released, and eventually gets accessed by managed part of the code. Unmanaged resources are for example MySQL connections, file handles etc.. Basically not using .Net regular functions means, that you are taking a risk of getting those kinds of exceptions.

So, I think you should see if all such unmanaged resources get released(disposed) correctly and memory allocated by P/Invoke functions gets released, because the Garbage Collector will not collect those for you.
hadeset is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
directx encountered an unrecoverable error mw3
05/19/2013 - Call of Duty - 2 Replies
Hi Leute, Mein MW3 4d1 funkt net -.-" Da kommt immer diese meldung : directx encountered an unrecoverable error mw3 kann mir da wer helfen?
Archlord test server run time error
07/22/2011 - Archlord - 4 Replies
Also ich wollte mal mit dem beta key die beta testen, und wenn ich das game jetzt starten will steht da immer http://www.fotos-hochladen.net/uploads/unbenannta dtw3b1qjp.png was kann ich dagegen tun? kann es sein das ich vieleicht noch das normale archlord drauf habe?
[HELP] fixing server has disconnected error 0 and time out
04/12/2010 - Shaiya Private Server - 0 Replies
for some reason i keep getting either server has disconnected error 0 or a time out every service runs, passwords match with eachother did /vchkoff on the login group did /nprotectoff on the game group psm client log 2010-04-12 20:01:49 PSM_AGENT__system log start (PS_AGENT)
[How to Register ECSRO Guide] - Server time out error
11/27/2008 - SRO Private Server - 30 Replies
Guide for people that are geting "Server time out Error" on registration page. Step 1 - go to Proxy80.Info - Anonymously Surf MySpace, Facebook, Bebo and More! Step 2 - enter into address bar, above the banner add http://221.195.40.141:1026/ Step 3 - click Browse Anon Button



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


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.