Register for your free account! | Forgot your password?

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

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

Advertisement



Why does this not create my character?

Discussion on Why does this not create my character? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2010
Posts: 940
Received Thanks: 76
Why does this not create my character?

Why does this not create my character? Pretty sure it used to work It's failing here somewhere it doesn't actually create it?

Code:
            while (true)
            {
                try
                {
                    using (var cmd = new MySqlCommand(MySqlCommandType.INSERT))
                        cmd.Insert("entities").Insert("Name", eC.Name).Insert("Owner", client.Account.Username).Insert("Class", eC.Class).Insert("UID", client.Entity.UID)
                            .Insert("Hitpoints", client.Entity.Hitpoints).Insert("Mana", client.Entity.Mana).Insert("Body", client.Entity.Body)
                            .Insert("Face", client.Entity.Face).Insert("HairStyle", client.Entity.HairStyle).Insert("Strength", client.Entity.Strength)
                            .Insert("WarehousePW", "").Insert("Agility", client.Entity.Agility).Insert("Vitality", client.Entity.Vitality).Insert("Spirit", client.Entity.Spirit)
                            .Execute();
                    Database.MySqlCommand com = new Database.MySqlCommand(MySqlCommandType.INSERT);
                    com.Insert("achievement").Insert("UID", (long)client.Entity.UID).Insert("Owner", client.Account.Username).Insert("Name", client.Entity.Name);
                    message = "ANSWER_OK";
                    break;
                }
                catch
                {
                    client.Entity.UID = Program.EntityUID.Next;
                }
            }

            using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE).Update("configuration").Set("EntityID", client.Entity.UID).Where("Server", Constants.ServerName))
                cmd.Execute();
            client.Account.EntityID = client.Entity.UID;
            client.Account.Save();
            return true;
        }
denominator is offline  
Old 01/06/2016, 06:36   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
You effectively wrote both a brute-force algorithm on your database and a race condition when writing to the configuration table. Congrats. This code is massively ****. Will it effect your server's performance, probably not... but you should consider not being **** and sticking to better programming practices. You won't always be this lucky. If you don't understand the problems I mentioned, then you should before you continue programming a server; else, you're going to cause some very bad problems with your server.
Spirited is offline  
Old 01/06/2016, 06:50   #3
 
elite*gold: 0
Join Date: Aug 2010
Posts: 940
Received Thanks: 76
Not actually my code >.< It's what was in the source.
denominator is offline  
Thanks
1 User
Old 01/06/2016, 07:36   #4
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Quote:
Originally Posted by denominator View Post
Not actually my code >.< It's what was in the source.
How terrifying. Thank *** I don't involve myself with those sources. Have you tried debugging it using breakpoints? You can always use a not **** source as well.
Spirited is offline  
Old 01/06/2016, 08:36   #5
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
Why the hell is there a while loop if you want to create a single character.
turk55 is offline  
Old 01/06/2016, 09:14   #6
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Quote:
Originally Posted by turk55 View Post
Why the hell is there a while loop if you want to create a single character.
They apparently use brute-force logic to burn through character IDs and query the MySQL server to find the next character ID (instead of allowing MySQL to handle unique key allocation in a thread-safe manor). They then try to save the ID back to the database which can cause a race condition. It really makes me sick reading this tripe.
Spirited is offline  
Old 01/06/2016, 17:47   #7
 
elite*gold: 0
Join Date: Aug 2010
Posts: 940
Received Thanks: 76
You will be pleased to know that I have deleted the source lol

Quote:
You can always use a not **** source as well.
They are prehistoric >.< I am wondering are there any 6100+ sources out there?
denominator is offline  
Thanks
3 Users
Old 01/06/2016, 20:42   #8
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
Quote:
Originally Posted by denominator View Post
You will be pleased to know that I have deleted the source lol

They are prehistoric >.< I am wondering are there any 6100+ sources out there?
You could grab a public source and upgrade yourself.

Throne should work with patches on and above 6090.
I know that the author also said that the source isn't recommended to use for running a server but you could however use it as reference for packets etc.
turk55 is offline  
Thanks
2 Users
Old 01/06/2016, 21:57   #9
 
elite*gold: 0
Join Date: Aug 2010
Posts: 940
Received Thanks: 76
Yeah I have throne but the loader will not load the client up to it
denominator is offline  
Old 01/06/2016, 21:59   #10
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Absolutely. I have a few members on my board that I'm privately advising doing just that. They're using Redux, but there are many you can chose from. Upgrading a source isn't easy though if you have no programming experience... so I'm not sure how comfortable you'd be doing that (as I don't know your experience in programming). It's not a challenging task, but it will take some dedication (which will be rewarded, of course, when your server isn't a heaping pile of software).
Spirited is offline  
Thanks
1 User
Old 01/06/2016, 22:04   #11
 
elite*gold: 0
Join Date: Aug 2010
Posts: 940
Received Thanks: 76
I was using ncos 5165 at one stage but lost it due to a hard drive issue, it was fun at the time, recently suffered a stroke so most of what I had learnt is now non existent
denominator is offline  
Old 01/07/2016, 01:03   #12
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Quote:
Originally Posted by denominator View Post
I was using ncos 5165 at one stage but lost it due to a hard drive issue, it was fun at the time, recently suffered a stroke so most of what I had learnt is now non existent
Sorry to hear that. You may want to look into Redux, then. From what I've seen, it's relatively easy to understand. You can also look at Phoenix, since that's documented. The server model in Phoenix is bad, though. I still recommend Chris's Redux source for a good, moderately complete source. It's definitely better organized than most sources I've seen. You can keep at the patch it's at until you feel more comfortable with modifying the source. Then, you can upgrade / downgrade the source as you wish. It's up to you, of course. If you don't think this is worth your time, then you can always use a ****** server. Just don't expect to see it work ideally (as you've seen from this thread), and don't expect to be able to maintain those types of sources without programming experience of some type.
Spirited is offline  
Thanks
1 User
Old 01/07/2016, 01:23   #13
 
elite*gold: 0
Join Date: Aug 2010
Posts: 940
Received Thanks: 76
I'll look into redux see if I like it, I'm looking for something for personal use so bugs are not a problem because there will only be me using it, as I thought redux is like all the others based on a primitve client. Thanks but no thanks
denominator is offline  
Reply


Similar Threads Similar Threads
Can't create character
06/02/2015 - Metin2 - 0 Replies
# Bitte Closen! Falscher Bereich ...
Help About New create Character
01/26/2014 - Flyff Private Server - 4 Replies
How to change the Spawn point of a new Character Create. Example the original spawn point is in flaris how to change to Saintmorning or New World or custom.
Can't create Character
01/04/2014 - Rappelz Private Server - 3 Replies
Hello. At first I want to say thank you for your great help and your advices on this forum. You made me smiling after I could log into my local Test Server. Everything seems to be alright. 1. I can start without any trouble my CaptainHerlockServer, PrincessAuroraServer and UploadServer :) 2. Then I'm going to write "start_service" and "set game.open_external 1" into the Auth Server :) It also works perfectly 3. Then I'm going to open my launcher and the game starts perfectly too...
You may not create this character
01/11/2012 - Rappelz Private Server - 5 Replies
I have my server up and running. I can log in to it. When i try to make a character (name doesnt mater) I get "You may not create this character" I am runing an old 6.2 client from old installer straight from galanet. the aor link is broken and I cant get that one. How do i fix this.
[Need Help]Create character
05/06/2008 - SRO Private Server - 2 Replies
When im try too create a character its says , Wrong words , im try out word just numbers and its seems not works:mad:Any 1 can help me?



All times are GMT +2. The time now is 21:28.


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