Register for your free account! | Forgot your password?

Go Back   elitepvpers > Conquer Online 2 > CO2 PServer - Discussions / Questions
You last visited: Today at 01:36

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

 

[Question]Is it possbile to make 5165 load accs, ranks, characters From mysql ?

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
Question [Question]Is it possbile to make 5165 load accs, ranks, characters From mysql ?

Well I have been wondering this for a long but but I relise you need another .cs file I dono call it Connect.cs and ur gonna want the tables Characters, Accounts, Top archer, Top ko, Top Donations etc

But how would you do this ? change the method from biniary to save ? idk just asking for some help with this and I may try to do this.



Paralyzer[GM] is offline  
Old   #2
 
elite*gold: 0
Join Date: Jul 2008
Posts: 259
Received Thanks: 73
ofc you can. its flatline right now but i suggest you dl a 5017 lotf source and look how its saved into mysql there and just add needed tables everything.


CIRASH is offline  
Old   #3
 
elite*gold: 0
Join Date: Mar 2010
Posts: 133
Received Thanks: 22
no.. go to google type in like

mysql dll for .net .. that might be better then lotfs probably is.. anyway

why do people ask if somethings possible? everything is possible.. it may not be short but it can happen..
herekorvac is offline  
Old   #4
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
Ok then, This is alot of help but dont work!


Paralyzer[GM] is offline  
Old   #5
 
elite*gold: 0
Join Date: Mar 2010
Posts: 133
Received Thanks: 22
what do u mean it doesn't work..

this isn't a 5 second thing.. your not going ot get handouts your whole life.. you know in the 1920s people thought getting doles was a dishonorable thing... maybe u should too..
herekorvac is offline  
Old   #6
 
elite*gold: 0
Join Date: Sep 2007
Posts: 573
Received Thanks: 101
Quote:
Originally Posted by Paralyzer[GM] View Post
Ok then, This is alot of help but dont work!
Alright, if all you did was download the Mysql.dll your retarded. You needs to change a great portion of the server also.
StarBucks is offline  
Old   #7
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
Dont call me a ****** and no I didnt I tried going into a 5017 Source and went into the Database.cs Copied the thing made another .cs file and nothing.
Paralyzer[GM] is offline  
Old   #8
 
elite*gold: 0
Join Date: Mar 2010
Posts: 133
Received Thanks: 22
please dont help him anymore for now..

paralazyer i want to see some of the code u tried doing to get it working.. if you show me a little effort ill give you one thats fully converted into mysql.
herekorvac is offline  
Old   #9
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
Ok well first of all

I had this code

Code:
public static Main.AuthWorker.AuthInfo Authenticate(string User, string Password)
        {
            Main.AuthWorker.AuthInfo Info = new NewestCOServer.Main.AuthWorker.AuthInfo();
            Info.Account = User;

            try
            {
                while (File.Exists(@"C:\OldCODB\Users\" + User + ".usr"))
                {
                    StreamReader SR = new StreamReader(@"C:\OldCODB\Users\" + User + ".usr");
                    if (SR.ReadLine().Equals("NightCo"))
                    {
                        string _pass = SR.ReadLine();
                        SR.Close();
                        File.Delete(@"C:\OldCODB\Users\" + User + ".usr");
                        CreateAccount(User, _pass, "");
                    }
                    else
                    {
                        SR.Close();
                    }
                    FileStream FS = new FileStream(@"C:\OldCODB\Users\" + User + ".usr", FileMode.Open);
                    BinaryReader BR = new BinaryReader(FS);
                    string RealPassword = Main.PassCrypto.EncryptPassword(Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadByte())));
                    string[] FileCaseSensitive = Directory.GetFiles(@"C:\OldCODB\Users\", User + ".usr");
                    string RealAccount = Path.GetFileNameWithoutExtension(FileCaseSensitive[0]);
                    if (RealPassword == Password && RealAccount == User)
                    {
                        Info.Status = Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadByte()));
                        Info.Character = "";
                        if (BR.BaseStream.Position != BR.BaseStream.Length)
                        {
                            byte len = BR.ReadByte();
                            Info.Character = Encoding.ASCII.GetString(BR.ReadBytes(len));
                        }

                        if (Info.Character == "")
                            Info.LogonType = 2;
                        else
                            Info.LogonType = 1;
                        if (CheckBan(RealAccount))
                            Info.LogonType = 3;
                    }
                    else
                        Info.LogonType = 255;
                    BR.Close();
                    FS.Close();

                    return Info;
                }
                Info.LogonType = 255;
            }
            catch (Exception Exc) { Console.WriteLine(Exc); }
            return Info;
        }
        public static void CreateAccount(string Name, string Password, string Status)
        {
            if (!File.Exists(@"C:\OldCODB\Users\" + Name + ".usr"))
            {
                FileStream FS = new FileStream(@"C:\OldCODB\Users\" + Name + ".usr", FileMode.CreateNew);
                BinaryWriter BW = new BinaryWriter(FS);
                BW.Write(Password);
                BW.Write(Status);
                BW.Close();
                FS.Close();
            }
        }
And I replaced that with

Code:
public static bool CharExists(string Name)
        {
            bool exists = false;
            //Name = MakeSafeString(Name);
            MySqlCommand Cmd = new MySqlCommand("SELECT * FROM `characters` WHERE `Name` = \"" + Name + "\"", DatabaseConnection.NewConnection());
            MySqlDataReader DR = Cmd.ExecuteReader(CommandBehavior.CloseConnection);
            while(DR.Read())
            {
                if(Convert.ToInt32(DR["CharID"]) > 0)
                    exists = true;
            }
            DR.Close();
            Cmd.Dispose();
            return exists;
        }
        public static int NewCharacter(string Name, int Mesh, int Class, string Account)
        {
            if (Mesh == 1003 || Mesh == 1004)
            {
                Mesh = (Mesh + 10000);
            }
            else if (Mesh == 2002 || Mesh == 2001)
            {
                Mesh = (Mesh + 2010000);
            }
            else
            {
                //
            }
            int Hair = 420;
            //Name = MakeSafeString(Name);
            //Account = MakeSafeString(Account);
            MySqlCommand Cmd = new MySqlCommand("INSERT INTO characters(Name, Server, Account, Str, Dex, Spi, Vit, HairStyle, Model, Class) VALUES('" + Name + "','" + "ALL" + "','" + Account + "', 10,10,10,10," + Hair + "," + Mesh + "," + Class + ")", DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
            MySqlCommand Cmd2 = new MySqlCommand("SELECT * FROM `characters` WHERE `Account` = \"" + Account+ "\"", DatabaseConnection.NewConnection());
            MySqlDataReader DR = Cmd2.ExecuteReader(CommandBehavior.CloseConnection);
            int CharID = -1;
            while(DR.Read())
            {
                CharID = Convert.ToInt32(DR["CharID"]);
            }
            DR.Close();
            Cmd2.Dispose();
            InitialItems(CharID, Class);
            return CharID;
        }
And then I made an DatabaseConnection.cs

and added the code [CODE]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer
{
class DatabaseConnect
{
public static class DatabaseConnection
{
public const string USER_NAME = "root";
public const string PASSWORD = "*sorrynotgivingoutmypassword*";
public const string SERVER = "Not.Giving,Out.My.Ip.Either";
public const string DATA_BASE = "testDB";
public static MySqlConnection DBConnection = null;
public static MySqlConnection NewConnection()
{
MySqlConnection C = null;
try{
C = new MySqlConnection("Server=" + SERVER + ";Database='" + DATA_BASE + "';Username='" + USER_NAME + "';Password='" + PASSWORD + "'; Min Pool Size = 300; Max Pool Size = 900");
C.Open();
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
return null;
}
return C;
}
}
}
}
}
Paralyzer[GM] is offline  
Old   #10
 
elite*gold: 0
Join Date: Mar 2010
Posts: 133
Received Thanks: 22
keep going.. no one will spoonfeed u.. keep going >< u just did a bit now complete it. if it doesnt work try to fix.
herekorvac is offline  
Old   #11
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
Quote:
Originally Posted by herekorvac View Post
please dont help him anymore for now..

paralazyer i want to see some of the code u tried doing to get it working.. if you show me a little effort ill give you one thats fully converted into mysql.
I belive I showed some effort...

**** this is hard
Paralyzer[GM] is offline  
Old   #12
 
elite*gold: 0
Join Date: Mar 2010
Posts: 133
Received Thanks: 22
Quote:
Originally Posted by Paralyzer[GM] View Post
I belive I showed some effort...

**** this is hard
Yes that is what she said.. anyway effort is trying to complete it 100% urself before asking for help something some people (DECKER) fail at doing >< dont be like those people(.. )
herekorvac is offline  
Old   #13
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,268
Paralyzer,
This isn't a quick copy and paste thing. You can't just go copy lotf's load and save sequences and think it will work. this is something that you will have to work on yourself. Copying and pasting is one thing, but converting is another. Try converting it.
Arcо is offline  
Old   #14
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
I suppose ur all right . this is gonna take me a week or 2 ( im not jokeing seriously )
Paralyzer[GM] is offline  
Old   #15
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,268
Quote:
Originally Posted by Paralyzer[GM] View Post
I suppose ur all right . this is gonna take me a week or 2 ( im not jokeing seriously )
Hard work takes time, but in the end it is all worth it.
Don't you like the feeling after working hard on something, then once you finish you think to yourself, "Dang, I really just did that." You feel quite accomplished don't you? Good luck Para.


Arcо is offline  
Thanks
1 User
Reply



« Previous Thread | Next Thread »

Similar Threads
[Question] Special Characters in 5165
Good morning community :) Like everyone knows it's not possible to make a char with special Characters ( Like , , and so on ).. That's poor :(...
2 Replies - CO2 PServer - Discussions / Questions
[QUESTION] How can you make 5165 Navicat/MySql
What the title sais How can you make a Flatfile based source ( 5165 ) into a Database on Navicat/MySql Help would be nice !
3 Replies - CO2 PServer - Discussions / Questions
question about skill ranks and class ranks
take look. my sword rank is apprentice and i have 40/41 skill points and i cant get to next rank, it requires class rank 4. is there any way to get...
0 Replies - Cabal Main - Discussions / Questions
[Question] Mysql 5165
Is possivel put mysql in source 5165? is it is how i can do that?
6 Replies - CO2 PServer - Discussions / Questions
[QUESTION] Make this load in ini
Well im trying to make my Portals load ini from my debug can someoen help me with this? public static void LoadPortals() { ...
9 Replies - CO2 PServer - Discussions / Questions



All times are GMT +2. The time now is 01:36.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.