Register for your free account! | Forgot your password?

You last visited: Today at 02:59

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

Advertisement



Top Rank Problems!

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

Reply
 
Old   #1

 
jackpotsvr's Avatar
 
elite*gold: 20
Join Date: Oct 2008
Posts: 328
Received Thanks: 43
Exclamation Top Rank Problems!

--->IM USING LOTF 5017<---
NOTE** THIS IS NOT A RELEASE**<---

After following the of MaryJuana about how to add top rank in your source i was thinking about to make it more advanced so others can see it and you don't have to use the command every time you relog. Now i've coded alot and after hours of work and i finally had a succesfull build, my char was invisible. Only the chars who had the top rank in my database. Now i'll show some of scripts and tell you in where i add them.


Client.cs under Public void SaveRank()
Code:
public void Savetoprank()
        {
            LastSave = DateTime.Now;
            if (MyClient.There)
                if (MyClient.Online)
                {
                    InternalDatabase.SaveChar(this);
                    InternalDatabase.Savetoprank(this);
                }
        }
In character.cs below public byte Rank = 0;
Code:
public byte toprank = 0;
In character.cs below public void SaveRank() ... ... ...
Code:
public void Savetoprank()
        {
            LastSave = DateTime.Now;
            if (MyClient.There)
                if (MyClient.Online)
                {
                    InternalDatabase.SaveChar(this);
                    InternalDatabase.Savetoprank(this);
                }
        }
In Database.cs below Charr.VP = (uint)DR["VP"];
Code:
Charr.toprank = Convert.ToByte((uint)DR["toprank"]);
Also in DatBase.cs below public static void SaveRank(Character Charr) ... ... ...
Code:
public static void Savetoprank(Character Charr)
        {
            MySqlCommand Command = null;
            Command = new MySqlCommand("UPDATE `Characters` SET `toprank` = '" + Charr.toprank + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", ExternalDatabase.Connection);
            Command.ExecuteNonQuery();

        }
In world.CS below if if (Me.MyGuild != null)
Charr.MyClient.SendPacket(General.MyPackets.GuildN ame(Me.GuildID, Me.MyGuild.GuildName));

Quote:
if (Me.toprank == 1)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "gamefighter"));
if (Me.toprank == 2)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "gamewarrior"));
if (Me.toprank == 3)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "gamebow"));
if (Me.toprank == 4)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "gamewater"));
if (Me.toprank == 5)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "gamefire"));
In Client.CS below if (MyChar.Rank == 1)... .. ...
Code:
if (MyChar.toprank == 1)
                                    {
                                        SendPacket(General.MyPackets.String(MyChar.UID, 10, "gamefighter"));
                                    }
                                    if (MyChar.toprank == 2)
                                    {
                                        SendPacket(General.MyPackets.String(MyChar.UID, 10, "gamewarrior"));
                                    }
                                    if (MyChar.toprank == 3)
                                    {
                                        SendPacket(General.MyPackets.String(MyChar.UID, 10, "gamebow"));
                                    }
                                    if (MyChar.toprank == 4)
                                    {
                                        SendPacket(General.MyPackets.String(MyChar.UID, 10, "gamewater"));
                                    }
                                    if (MyChar.toprank == 5)
I did added toprank in my database at coproj -> characters.

Also my console give me an error when im logging in using a charr with the

Top Effect.
The console error is
Code:
System.InvalidCastException: Specified cast is not valid.
   at COServer_Project.InternalDatabase.GetCharInfo(Character Charr, String UserName) in O:\BasicCO\COServerProject\COServerProject\DataBase.cs:line 261
Q: Why i want to make this system?
A: So i can make NPC giving it. And because its nice
jackpotsvr is offline  
Old 08/31/2010, 00:59   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Show use what Line 261 of Database.cs is please.
Korvacs is offline  
Old 08/31/2010, 07:13   #3

 
jackpotsvr's Avatar
 
elite*gold: 20
Join Date: Oct 2008
Posts: 328
Received Thanks: 43
Quote:
Originally Posted by Korvacs View Post
Show use what Line 261 of Database.cs is please.
At the moment im at my laptop but i looked using notepad and it said Line 261 was
Code:
Charr.VP = (uint)DR["VP"];
but i thought yesterday at my Visual Studios it was 1 line after that one ..
Quote:
Charr.toprank = Convert.ToByte((uint)DR["toprank"]);
So its one of that 2 , Hope so you can help me
jackpotsvr is offline  
Old 08/31/2010, 08:59   #4


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Probably do this instead:

Code:
Charr.toprank = (byte)DR["toprank"];
Korvacs is offline  
Thanks
1 User
Old 08/31/2010, 17:05   #5

 
jackpotsvr's Avatar
 
elite*gold: 20
Join Date: Oct 2008
Posts: 328
Received Thanks: 43
Quote:
Originally Posted by Korvacs View Post
Probably do this instead:

Code:
Charr.toprank = (byte)DR["toprank"];
Thanks, i tried but actually the only differnce was i also couldn't log in chars who actually shouldn't have the effect :S Maybe i have to add codes to other .cs files of the solution? Or my code was to bad :S ,,
Thanks for help i hope so we can fix it
jackpotsvr is offline  
Old 08/31/2010, 17:07   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Depends what type the value is being stored as in the database, can you tell me what the column is defined as?
Korvacs is offline  
Thanks
1 User
Old 08/31/2010, 19:16   #7

 
jackpotsvr's Avatar
 
elite*gold: 20
Join Date: Oct 2008
Posts: 328
Received Thanks: 43
Quote:
Originally Posted by Korvacs View Post
Depends what type the value is being stored as in the database, can you tell me what the column is defined as?
Column is..
Name: toprank
Type: int
Length: 8
Decimals: 0
Allow Null: unvinked
----------------------

Is that wrong?
jackpotsvr is offline  
Old 09/01/2010, 05:15   #8
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Quote:
Originally Posted by jackpotsvr View Post
Column is..
Name: toprank
Type: int
Length: 8
Decimals: 0
Allow Null: unvinked
----------------------

Is that wrong?
is the value over 255? if you're loading it as a byte and yet the column in the database is a length 8 int that means you can EASILY have a value over 255... If any of them are this will cause an issue because obviously you can't (byte) something over 255 as that's the max value.
pro4never is offline  
Thanks
1 User
Old 09/01/2010, 07:34   #9

 
jackpotsvr's Avatar
 
elite*gold: 20
Join Date: Oct 2008
Posts: 328
Received Thanks: 43
The vavlues and where they stand for
0 for top rank
1 for Tro
2 for War
3 for Archer
4 for Water
5 for Fire
jackpotsvr is offline  
Old 09/10/2010, 17:42   #10

 
jackpotsvr's Avatar
 
elite*gold: 20
Join Date: Oct 2008
Posts: 328
Received Thanks: 43
UPDATE*
My LOTF Source has got Noble Rank, when i searched for Rank trough the whole solution i found much more places where i should ad some top rank thingys,, ill update it soon and ill think this willl fix the bug, when i get more trouble ill post here
jackpotsvr is offline  
Old 09/11/2010, 18:15   #11

 
jackpotsvr's Avatar
 
elite*gold: 20
Join Date: Oct 2008
Posts: 328
Received Thanks: 43
After i tried a lot its unsolveable
jackpotsvr is offline  
Reply

Tags
top rank problems


Similar Threads Similar Threads
sale rank bug rank 12-18 cabal chronicel
09/15/2010 - Cabal Online Trading - 2 Replies
seling rank bug (rank 12-18) no need do story quess just take rank quess add me in ym [email protected]
5165 Problems! 2 problems!
02/28/2010 - CO2 Private Server - 8 Replies
Okay so NOW I get these 2 problems in ma command prompt window of ma source... 2 problems: I really need help since I dunno wtf is the problem on 1 and 2...I'd appreciate it!
[Problems] Source 5165 All Problems
11/28/2009 - CO2 Private Server - 7 Replies
Hello Everyone, Ok i will put All my problems here So i hope noone spamming and Say Go learn C# and w/e 1-RegPage: fixed all by adding  to the start of the pass and  to the end of the pass. its working okay and when i create character and try to rejoin the game close with itself Note: When i make From NewestCOServer Cmd it works fine and the game dont close i mean i want other players to make thier own accounts and dont ask me to make them The Accounts they want. 2-Lottery: Cant...
[Request-Help] Online Server Rank like GW Rank
12/05/2008 - CO2 Private Server - 6 Replies
im requesting for help for this idea: when you enter guild gate you see a top 5 guilds is it possible that when you enter Market and Twincity and Jail and PKArena you see a top 5 players based on Level EXP? so when you have 2x lvl 134 they will rank the 134 higher with the higher exp.
[Problems]Having problems in Cabal Wudijt
07/01/2008 - Cabal Online - 0 Replies
1>im having problems in registering in Wudijt can anyone help me give me working link 2>i cant seem to update my red cabal online is it offline? 3>when i load Cabal.exe the cabal window will just dissapear please help me,i followed everyone's advice but it doesnt work, can anyone tell me what the real problem? thanks! ^_^



All times are GMT +1. The time now is 03:01.


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.