Register for your free account! | Forgot your password?

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

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

Advertisement



[Question] The purpose of this is...?

Discussion on [Question] The purpose of this is...? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
[Question] The purpose of this is...?

Code:
            if (_cryptKey1 != null)
            {
                [COLOR="Red"]if (_cryptKey1.Length != 0)[/COLOR]
                    return;
            }
What's the purpose of this line in red?
If the key isn't null... then the length cannot be 0... so why does it check that?

Sincerely,
Spirited
Spirited42 is offline  
Old 04/05/2011, 01:10   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Null simple means undefined in the majority of cases, Length indicates the number of values within it, or if its a string, the string is empty, but not null.

Very different things.
Korvacs is offline  
Old 04/05/2011, 01:11   #3
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
Quote:
Originally Posted by Korvacs View Post
Null simple means undefined in the majority of cases, Length indicates the number of values within it, or if its a string, the string is empty, but not null.

Very different things.
I thought that you couldn't put values into an undefined variable though.
Spirited42 is offline  
Old 04/05/2011, 01:12   #4


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by Spirited View Post
I thought that you couldn't put values into an undefined variable though.
Correct.........

Sorry just noticed the not equal, i believe this may have been an attempt to compensate for bad threading in whichever source your looking at.

Actually that makes even less sense, whats this from? If the key isnt null, then it has been defined, but that doesnt mean it has values within it.
Korvacs is offline  
Old 04/05/2011, 01:50   #5
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
Quote:
Originally Posted by Korvacs View Post
Correct.........

Sorry just noticed the not equal, i believe this may have been an attempt to compensate for bad threading in whichever source your looking at.

Actually that makes even less sense, whats this from? If the key isnt null, then it has been defined, but that doesnt mean it has values within it.
It's from Impulse's Public source. I'm using it as a very rough guide for my Cryptography.
Spirited42 is offline  
Old 04/05/2011, 02:24   #6
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
It's actually really easy.

That stops the function PrepareAuthCryptography() from re-generating the keys.

if (_cryptKey1 != null)
{
if (_cryptKey1.Length != 0)
return;
}

The second 'if' can be removed, it will be exactly the same.
-impulse- is offline  
Thanks
1 User
Old 04/05/2011, 02:26   #7
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
Quote:
Originally Posted by -impulse- View Post
It's actually really easy.

That stops the function PrepareAuthCryptography() from re-generating the keys.

if (_cryptKey1 != null)
{
if (_cryptKey1.Length != 0)
return;
}

The second 'if' can be removed, it will be exactly the same.
K, just making sure it isn't something with a meaning that I'm not aware of.

EDIT: You have a lot of things like that in your code Impulse... o.o
Code:
string IP = wr._socket.RemoteEndPoint.[COLOR="Red"]ToString()[/COLOR].Split(':')[0].[COLOR="Red"]ToString()[/COLOR];
Spirited42 is offline  
Old 04/05/2011, 09:24   #8


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
You should use the cryptographer from my cuosp project, its very good.
Korvacs is offline  
Old 04/05/2011, 10:50   #9
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Quote:
Originally Posted by Spirited View Post
Code:
string IP = wr._socket.RemoteEndPoint.[COLOR="Red"]ToString()[/COLOR].Split(':')[0].[COLOR="Red"]ToString()[/COLOR];
socket.RemoteEndPoint is not a string and so you have to use ToString to parse it. The second ToString, again, can be removed lol.
-impulse- is offline  
Old 04/05/2011, 12:41   #10
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
Quote:
Originally Posted by Korvacs View Post
You should use the cryptographer from my cuosp project, its very good.
Weird. I never got the chance to look at yours. It looks just like mine (Account Cryp). Mine works fine though. I haven't had an error since I completed it so I've kinda just stuck with it and just rewrote it using other influences (such as Impulse's crypt).

Quote:
Originally Posted by -impulse- View Post
socket.RemoteEndPoint is not a string and so you have to use ToString to parse it. The second ToString, again, can be removed lol.
Thanks. lol, but you don't have to explain things like that to me. I learned that in my first month of coding... ._.
Spirited42 is offline  
Old 04/05/2011, 12:52   #11
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Quote:
Originally Posted by Spirited View Post
Weird. I never got the chance to look at yours. It looks just like mine (Account Cryp). Mine works fine though. I haven't had an error since I completed it so I've kinda just stuck with it and just rewrote it using other influences (such as Impulse's crypt).



Thanks. lol, but you don't have to explain things like that to me. I learned that in my first month of coding... ._.
You know, you're not the only one to read whatever anyone posts, there are usually hundreds...and not everyone knows.
-impulse- is offline  
Old 04/05/2011, 19:18   #12
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
Quote:
Originally Posted by -impulse- View Post
You know, you're not the only one to read whatever anyone posts, there are usually hundreds...and not everyone knows.
Sorry, I didn't think about that.
Spirited42 is offline  
Old 04/05/2011, 23:13   #13
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
int[] i = new int[0];

Non null array with 0 length.
_tao4229_ is offline  
Old 04/05/2011, 23:34   #14
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Quote:
Originally Posted by _tao4229_ View Post
int[] i = new int[0];

Non null array with 0 length.
I know, I thought of that too, but the array is initialized with the length 0x100 so the second 'if' is really useless.
-impulse- is offline  
Old 04/06/2011, 01:26   #15
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
Quote:
Originally Posted by -impulse- View Post
I know, I thought of that too, but the array is initialized with the length 0x100 so the second 'if' is really useless.
Under that assumption then the first if is "really useless" as well.
_tao4229_ is offline  
Reply


Similar Threads Similar Threads
The purpose of this site.
07/11/2010 - Grand Chase Hacks, Bots, Cheats & Exploits - 8 Replies
The purpose of this site was to share any hacks ? or Just an strategic playing the Grand Chase ? Dude, it is for SHARING! not like a wrong thread or wrong post . If some people has the mistakes, then delete it. Not by posting a thread closure. For what? For earning a thanks ? I would rather thank the one who shares the hack or cheat willingly . .
portablitiy purpose
11/03/2009 - Soldier Front Philippines - 3 Replies
in case i dont have my FLASH DRIVE. i got this..
All Purpose Bot - Farmer John
04/23/2009 - WoW Bots - 112 Replies
Farmer John, custom made World of Warcraft bot. Has all horde waypoints set up and can level a character from 1-70. Has alliance waypoints up to 40, will be adding rest of them this week. Auto trains, auto sells, auto repairs, auto skins. Have leveled a druid with it to 62.5 in about 3 weeks and made 3950g. You'll never have to buy gold, which will pay for the program itself. Developed by me personally, currently undetected for 7 months (never been affected by a ban wave). -HideObjects Hack:...



All times are GMT +1. The time now is 11:55.


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.