Mike Chambers
Veteran Member
- Joined
- Sep 2, 2006
- Messages
- 2,621
(please excuse this, it's a bit long but i had to explain exactly whats wrong)
ok, so development on leetIRC has been pretty much exponential in the last week or so. the entire client is now more or less finished. i've even got DCC file transfers working, with one (major) caveat.
my problem is that good ol' quickbasic's largest numerical data type is a 32-bit long integer. BUT, it doesnt go up to 4.2 billion since it allows for negative values... this means the range is -2.1 bil to +2.1 bil.
now, in the IRC DCC send spec the sender gives the recipient the info to connect to (IP and port of sender) in this format: DCC SEND <ip to connect to> <port>
but instead of it sending the IP as a xxx.xxx.xxx.xxx string, it sends it as a single, non-period-delimited, numerical string based on using each of the four IP xxx value sections as a binary byte and converting those 4 bytes into an unsigned 32-bit integer. i'm not explaining this well, so here's an example:
i know this is an invalid IP, but say your IP was 0.0.1.0
that would make the numerical string "256" - does that make sense?
here's a real world example. my IP is 68.184.216.98 (plz dont haxx0r me thanks)
in the DCC SEND format, it gets sent as this numerical string: "1152964706"
so what i have my program do is turn that numerical string back into a 4-byte binary value, and then single out each byte and reconstructing the xxx.xxx.xxx.xxx format that way. for an IP like mine starting with 68 that works just fine in QB. the problem is if the IP is greater than 128.0.0.0 then QB simply can't put a number over 2.1 billion into it's native long integer type format.
SOO, the simplest solution i can think of is to make a small little "helper" executable in another language like C. it would have to let me feed it the huge numerical string in the command line or through a file, and then it would simply subtract 2,147,483,648 and drop the new value into a file or somewhere in memory for quickbasic to read and then go from there with the newly valid long integer.
is there anybody who would be able to offer me some assistance with this? did i even explain my problem well enough? lol. i would really appreciate any help at all!
i have made a resolution that when i'm completely through writing this IRC client, i am DITCHING QUICKBASIC and i'm gonna learn a decent language like C++ or C#!!!! i'm sick of little project-killers like this, not to mention the horrible speed of QB apps. QB doesn't even allow you to make a byte array. the closest thing you can do it dimension a string and chop it apart constantly to emulate a byte array. (or use PEEKs to read each value as if it were an array, but surprisingly enough that's not really any faster)
ok, so development on leetIRC has been pretty much exponential in the last week or so. the entire client is now more or less finished. i've even got DCC file transfers working, with one (major) caveat.
my problem is that good ol' quickbasic's largest numerical data type is a 32-bit long integer. BUT, it doesnt go up to 4.2 billion since it allows for negative values... this means the range is -2.1 bil to +2.1 bil.
now, in the IRC DCC send spec the sender gives the recipient the info to connect to (IP and port of sender) in this format: DCC SEND <ip to connect to> <port>
but instead of it sending the IP as a xxx.xxx.xxx.xxx string, it sends it as a single, non-period-delimited, numerical string based on using each of the four IP xxx value sections as a binary byte and converting those 4 bytes into an unsigned 32-bit integer. i'm not explaining this well, so here's an example:
i know this is an invalid IP, but say your IP was 0.0.1.0
that would make the numerical string "256" - does that make sense?
here's a real world example. my IP is 68.184.216.98 (plz dont haxx0r me thanks)
in the DCC SEND format, it gets sent as this numerical string: "1152964706"
so what i have my program do is turn that numerical string back into a 4-byte binary value, and then single out each byte and reconstructing the xxx.xxx.xxx.xxx format that way. for an IP like mine starting with 68 that works just fine in QB. the problem is if the IP is greater than 128.0.0.0 then QB simply can't put a number over 2.1 billion into it's native long integer type format.
SOO, the simplest solution i can think of is to make a small little "helper" executable in another language like C. it would have to let me feed it the huge numerical string in the command line or through a file, and then it would simply subtract 2,147,483,648 and drop the new value into a file or somewhere in memory for quickbasic to read and then go from there with the newly valid long integer.
is there anybody who would be able to offer me some assistance with this? did i even explain my problem well enough? lol. i would really appreciate any help at all!
i have made a resolution that when i'm completely through writing this IRC client, i am DITCHING QUICKBASIC and i'm gonna learn a decent language like C++ or C#!!!! i'm sick of little project-killers like this, not to mention the horrible speed of QB apps. QB doesn't even allow you to make a byte array. the closest thing you can do it dimension a string and chop it apart constantly to emulate a byte array. (or use PEEKs to read each value as if it were an array, but surprisingly enough that's not really any faster)
Last edited: