Register for your free account! | Forgot your password?

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

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

Advertisement



Authentication Problems.

Discussion on Authentication Problems. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Authentication Problems.

Hello guys it's been a long time since I've been here.

Anyways cutting to conclusion, I've recently came back to maybe try and learn a "bit" of the C# language by using trial/error and building up a source released here in the forums. Yes, it is a 5700+ source. I know what you think, why start at such a high patch and why not a lower patch? Well, simply because I've been developing lower patches since the day I started here lol. I also wanted to get "in sync" with the conquer world as I have felt "left out of it".

Anyways... I have here a decent but buggy source that is aimed around patch 5730 or 5733. I am having the problem of the source not logging characters back in the game after they have logged out successfully. The usual error I get in the client is this:
Quote:
Error: Disconnected with game server. Please login again!
I am not going to lie, I have been trying to figure out how to do this but I just can't seem to figure out why. Please bare with me as I have lost most, if not, all of my knowledge in C# being gone all this time. I am going to put here my AuthState.cs:
Code:
using System;
using Conquer_Online_Server.Network.Cryptography;
using System.Net.Sockets;
using System.Collections.Generic;
using Conquer_Online_Server.Network.Sockets;
using System.Collections.Concurrent;
using Conquer_Online_Server.Network.GamePackets;

namespace Conquer_Online_Server.Client
{
    public class AuthState
    {
        private bool Alive = false;
        public Network.AuthPackets.Authentication Info;

        public Database.AccountTable Account;
        public Network.Cryptography.AuthCryptography Cryptographer;
        //public int PasswordSeed;
        public WinSocket _socket;

        public AuthState(WinSocket socket)
        {
            _socket = socket;
            Alive = true;
        }
        public void Send(byte[] buffer)
        {
            if (Alive)
            {
                byte[] _buffer = new byte[buffer.Length];
                Buffer.BlockCopy(buffer, 0, _buffer, 0, buffer.Length);
                lock (Cryptographer)
                {
                    Cryptographer.Encrypt(_buffer);
                    try
                    {
                        _socket.Send(_buffer);
                    }
                    catch (Exception e)//posible proxy/food with proxy
                    {
                        Console.WriteLine(e.ToString());
                        Program.SaveException(e);
                        this.Disconnect();
                    }
                }
            }
        }
        public void Send(Interfaces.IPacket buffer)
        {
            Send(buffer.ToArray());
        }

        public void Disconnect()
        {
            if (Alive)
            {
                Alive = false;
                _socket.Disconnect(false);
            }
        }
        public static uint nextID = 0;


        public int PasswordSeed = 0;
    }
}
Any ideas/countermeasures that will help me with this problem are highly appreciated. And please, don't flame me for using "this type of source".

Thanks a lot!
killersub is offline  
Old 12/18/2013, 15:04   #2
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
"Error: Disconnected with game server. Please login again! " is not an issue in the auth server.

It's when you don't handle the login sequence at the game server proper and that it gets disconnected meanwhile.

Check that you aren't throwing any exceptions, that may disconnect it OR that the authentication at the game server goes through so it doesn't disconnect for ex. invalid UID.

I'd suggest you set a breakpoint at packet 1052.
Super Aids is offline  
Old 12/18/2013, 16:24   #3
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by Super Aids View Post
"Error: Disconnected with game server. Please login again! " is not an issue in the auth server.

It's when you don't handle the login sequence at the game server proper and that it gets disconnected meanwhile.

Check that you aren't throwing any exceptions, that may disconnect it OR that the authentication at the game server goes through so it doesn't disconnect for ex. invalid UID.

I'd suggest you set a breakpoint at packet 1052.
Oh! silly me, I almost forgot that this wasn't anywhere near the Auth sequence.

Anyways, I set the breakpoint and it seems this tricky little error(that I've seen before) has shown its face.

here is the error it's throwing:
Quote:
A call to PInvoke function 'Conquer_Online_Server!Conquer_Online_Server.Netwo rk.Cryptography.Blowfish::CAST_set_key' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
It is coming from this void:
Code:
public void SetKey(byte[] data)
        {
            _encryptNum = 0;
            _decryptNum = 0;
            this line--> CAST_set_key(_key, data.Length, data);
        }
and here is that line of code:
Code:
[DllImport("Libeay36.dll")]
        public extern static void CAST_set_key(IntPtr _key, int len, byte[] data);
I have tried the CallingConnvection method but it does not seem to fix the problem.

Sorry for another post but seeing as no one wants to reply, is this error very tricky to figure out? It doesn't even want to create an account now.

Sorry for another post but I'm really stumped as to what may be causing this error to throw. I have tried breakpoints everywhere but that doesn't seem to be getting me anywhere; Also, I have tried a method that should've worked now but worked back then called the: CallingConvection.Cdecl which supposedly dissolves this error but not in my case.
killersub is offline  
Old 12/18/2013, 20:16   #4
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
You calling convention is invalid.
Code:
[DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
Change that for ALL of them
Super Aids is offline  
Old 12/18/2013, 21:21   #5
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by Super Aids View Post
You calling convention is invalid.
Code:
[DllImport("libeay32.dll", CallingConvention = CallingConvention.Cdecl)]
Change that for ALL of them
for some reason the original uploader of the source included 3 .dll files of 32,34 and 36. Like I said, I have tried the CallingConvention before and it gave me great results, with other sources that is.

EDIT: I have tried this and it does NOT work. for characters that exist it will give me the aforementioned error, for characters that do not exist yet it gives me the invalid account id/password error.

EDIT2: I seem to be logged in now using a new account, I will try an existing account and see if it also gives me errors.

EDIT3: I have fully logged back into accounts numerous times without error in the debug console/without the debug console. Believe me when I say that I have tried that method earlier today and it still flashed me the same error for some apparent reason. Supposedly, now it is working fine.

Thanks for the help mate.
killersub is offline  
Reply


Similar Threads Similar Threads
Ep8 Authentication
08/07/2013 - Cabal Private Server - 0 Replies
Does anyone know how to inject a dll to retrieve username and password from cabalmain at the time of login? I need this to finish minervas authentication process. For updated info visit this post: http://forum.r agezone.com/f458/ep8-authaccount-949943/#post77327 96
New Authentication.cs
05/26/2012 - CO2 PServer Guides & Releases - 3 Replies
New Authentication.cs using System; using System.IO; using System.Text; namespace Conquer_Online_Server.Network.AuthPackets { public class Authentication : Interfaces.IPacket
authentication server?
09/27/2011 - Minecraft - 7 Replies
i've been trying to modify the authentication, so that instead of going to minecraft.net it will go to my website, but without success, it seems that the server wont even attempt to authenticate on my website, even if i modified the source, and set online-mode to true.. does anyone know how to modify it properly?
[Q] Authentication
06/23/2009 - Kal Online - 3 Replies
I heard is it possible to to jump behind the authentication of your account so blocked accounts work again, is it true? and how is it possible?
Authentication Key
03/15/2008 - WoW PServer Exploits, Hacks & Tools - 8 Replies
can some1 post valid Authentication Key for wow so i can create acc on blizz server...



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


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.