Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / The Matrix1Utils plugins collection

Author
Message
enderleit
16
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 23rd Sep 2011 12:26
Oh right... lol.

Have been using Java alot lately and forgot that DBPro does it this way.

Thanks anyway

miso
13
Years of Service
User Offline
Joined: 16th Jun 2010
Location: Budapest, Hungary, 127.0.0.1
Posted: 25th Sep 2011 16:15 Edited at: 25th Sep 2011 17:14
Hello all!

Can someone point me to the right direction, what am I doing wrong?
I want to create a new UDP socket using matrix1, and bind it to my public ip. I'm behind a router, port is forwarded and not in use.

Winsock allows me to bind a "channel" to my public IP, but matrix1 doesn't. (Edit: No, winsock doesnot allows either...)

(I created a reduced example of the problem, please replace IP in the snippet if you want to try.)



Edit:
Well I think I solved my problem, sorry for the bother
I dont know if its the best, but I used 0 for IP, and it started to work. I think in this way its opened for all network traffic...

If I'm going on a wrong way, don't afraid to tell me.

Thanks.

No place like 127.0.0.1 .
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Sep 2011 15:05
What IP address was that anyway? If it's your public address, then you can't bind to it - you can only bind to IP addresses that are local to your machine.

miso
13
Years of Service
User Offline
Joined: 16th Jun 2010
Location: Budapest, Hungary, 127.0.0.1
Posted: 27th Sep 2011 23:22
You may say its very basic, but wasn't clear for me. I used a mobilnet before, and I was able to bind the public ip.

Now changed net connection to cable net, and I'm behind NAT again. Suddenly my apps started not to work.

(I had that misbelief, that I have to bind sockets to public IPs to work over internet)

I think everything is ok again, I've learnt something, and my old functions started to work again too.

No place like 127.0.0.1 .
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Sep 2011 23:32
Quote: "You may say its very basic"

I didn't say that, or even try to imply that - most people's systems are NAT'ed nowadays, so I assumed that was the case for you (and it is for your current configuration).

I guess your mobilnet connection put your system directly onto the Internet - I used to have something similar when I used to use a USB modem. If that's the case, then the public IP address is the same as your local network address, and what you did would work.

miso
13
Years of Service
User Offline
Joined: 16th Jun 2010
Location: Budapest, Hungary, 127.0.0.1
Posted: 28th Sep 2011 00:09
Quote: "I didn't say that, or even try to imply that."

Ehm, and I didnt say you said that, it was just a good starting phrase.

Also, thanks for the replies.

No place like 127.0.0.1 .
Manson_NS
19
Years of Service
User Offline
Joined: 4th May 2004
Location: Denmark
Posted: 28th Sep 2011 11:37 Edited at: 28th Sep 2011 11:38
Simple request that you've probably had a few times, I'm just hopeing for a "due to popular demand" kindof action:
Message Boxes - can you please add a call for a message box, and preferably one for a warning box as well - a simple one that does not involve a multitude of choices and annoying code?

It were one of the easiest ways to debug code when using BlueGUI, but seeing as BBB is now more advanced, I've scrapped it.
The downside is that message box code in BBB is a mess with possibilities for returned values, etc.

I just need a Windows GUI friendly alternative to "PRINT" to return values or text to the user - your "report error" is the closest, but kills the application.
maybe just an "error text$" - command?
revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 9th Oct 2011 14:46
Hi Ian, do you think you could add a command like: "Change Instance Source ObjID,SourceID" which does the equivalent to:


It seems like a plugin may be able to simply change an instance's source without needing to re-create the object.
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Oct 2011 00:36
Just a thought (it may not work) but have you tried simply using "instance object" again without deleting the old object. It may simply redirect it to the new source.

[b]
revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 10th Oct 2011 09:02
Quote: "have you tried simply using "instance object" again without deleting"
Thanks Diggsey, that actually does work. It doesn't retain the old object's position, rotation, or scale, but it is a bit better.
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 4th Nov 2011 20:27
IanM, your sort array just replaced one weeks work and 90 cumbersome lines of code Thank you so very, very much!

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Westmere
14
Years of Service
User Offline
Joined: 12th Mar 2010
Location: Germany
Posted: 16th Nov 2011 19:38
IanM, thanks for a great collection of add-on commands.

I know that you are not asking for anything in return but I would like to ask about the licensing conditions of those .dlls required and supplied by you to run this, as they are Microsoft dlls. (I'm talking about msvcp71.dll and msvcr71.dll)

When I reinstall my system I definitely need to add these files so they are not supplied with newer Windows versions (at least 64 bit Win 7). Is it legal to just put them in a package and install them with my game (in the game directory) as they are Visual-C Runtime files or do I need to do something in order to be able to add them legally (like "Buy VisualC")? What if I intend to sell the game for a small price, does that change licensing?

If there is anything I would need to do - is it possible to just link to a Download of these files on microsoft.com like you can do with the dx9redist? Thanks in advance


IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Nov 2011 20:21
As I own a licensed copy of Visual C++ 2003, I am licensed to distribute them as long as I distribute them alongside my own executables. You are likewise allowed to pass them on as long as they are transferred alongside one or more of my plug-ins.

Unfortunately, Microsoft never provided a redist package of these DLLs so I can't provide you with a link. However the .NET 1.1 runtime installer also installs these DLLs if they're not on your system, so you could get them by trying to install that.

Westmere
14
Years of Service
User Offline
Joined: 12th Mar 2010
Location: Germany
Posted: 16th Nov 2011 20:45
You're fast. Thanks.

So can I pass them on when they are transferred alongside an application using your plug-ins? After all there's no .dll file, it's all in the main executable.

If not, would this be the file to link to?


IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Nov 2011 20:54
Quote: "You're fast. Thanks."

I have mailback on for this thread.

Yes, you can pass them along - the DBPro exe is no different to an installer really, the DLL is embedded in the executable and extracted when you run it.

I believe the link is the correct one - I do notice though that Windows 7 is NOT listed in the list of supported OS's.

Westmere
14
Years of Service
User Offline
Joined: 12th Mar 2010
Location: Germany
Posted: 16th Nov 2011 21:05
Oh well, I would rather not require people to download an entire (and pretty old) .NET-package just to play my game. The DirectX 9 package is no problem as many games require Pre-DX10 to be up to date anyway.

I will just add those two dlls to my own download and keep them in the game's directory (as I have them in my test-installation), so it doesn't screw with people's systems. If MS asks I'll just point them to you ;-p

Thanks for the quick answers. You will receive a special thanks credit in the game when it is ready


zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 23rd Nov 2011 14:33 Edited at: 23rd Nov 2011 14:35
I gave up reading the entire thread.

@IanM,, Do you have anything on using the Console from matrix1utils 11? Not much in the help. I know the commands are rather straight-foward,, just wondering if you had any implementations in using the console. I thought it was interesting, just not sure what you had in mind when including it.

Thanks

~ZENassem
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Nov 2011 14:56
I use it for debugging, along with the log commands...



GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 23rd Nov 2011 18:48
@IanM:

I am trying to write a program that will eventually loop through a list of internal IP Addresses checking to see if a VNC program is installed. The VNC program listens on TCP port 5900. My idea was to use your SOCKET commands to just attempt a connection, and then immediately drop the connection. Here is what I have so far:


I am getting an error on the "connect socket" line about my parameters. What am I doing wrong? Is there a better way to do what I want to do?

Thanks!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Nov 2011 19:32
You can't use a string directly with the CONNECT SOCKET function like that - you have to convert your string to an IP address using the HOSTNAME TO IP function, then use the result of that to connect.



@zenassem & BatVink,
It was primarily as a debugging aid, although personally I use the LOG functions/commands to do all that kind of stuff now with the DebugView application to log/trace everything.

Recently I've had an idea or two about better ways of writing to the console window, so watch this space.

zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 25th Nov 2011 16:25
Quote: "Recently I've had an idea or two about better ways of writing to the console window, so watch this space"


I will. And I think what you may be planning is what I am hoping for...

Thanks for the DebugView link as well.

~ZENassem
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Nov 2011 19:20
I have no idea what you are hoping for, so judge for yourself...

I'm planning on allowing the programmer to redirect the standard DBPro PRINT statement to the console window, and adding an AT(x,y) function to allow the cursor to be positioned for both console and DBPro.

So, that's the 'earth-shaking' idea I had - there are some details that I'll need to work out, like how to deal with the INPUT command (which can use the PRINT statement behind the scenes), but that's basically it.

Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 26th Nov 2011 18:40 Edited at: 27th Nov 2011 00:11
I thought it would be nice if we could modify values passed to functions... So I did some research and found this:



If you start looking backwards from the return address of any function called by DBPro you will find those byte patterns. First will be the calling code which depends on if you are in a DBPro function or a plugin function. Next will come the arguments from left to right.

The important part is that it's actually safe to use. If an expression is passed in as a parameter, DBPro will put the result in a temporary variable before beginning to push the parameters onto the stack. If you then try to modify the parameter you will simply be modifying a temporary which is completely safe.

Perhaps you could make some commands which work with the argument lists to actually modify arguments

If you want to see these for yourself, here's the program I used:


If you call "test" a few times it will look at the calling code and find the bytes that don't change with each call. It will then disassemble this code and display it with pretty colours.


edit:
Also, here's a simple implementation in DBPro which works on integers, floats and strings:


edit2:
OK, there is one case I missed -.- If a UDT member is passed in it gives a different pattern (but still shouldn't crash as long as the implementation checks for the correct pattern properly).

edit3:
I programmed the whole lot. Now it supports all types including UDTs when they're local, global or in a UDT.

[b]
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Nov 2011 16:06
That's some good work you've done there.

The only way this could be better is if there was some way to mark a function parameter as by-reference so you know which ones are potentially going to be changed - at least the caller has the ability to turn the argument into an expression by putting brackets around the variable.

Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 27th Nov 2011 17:45
Actually, that is almost possible. If the parameter is a pointer to the value to be changed then the caller has to use the addressOfXXX functions for it to work.

[b]
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Nov 2011 20:03
So back to C? I was actually thinking about the other end of the equation: the function definition

function DoSomething(a as integer, b as float ref)


There's something else I need to work out - how to adjust what you've done to take into account functions called through the CALL FUNCTION PTR / CALL FUNCTION NAME commands. It shouldn't be too difficult as these functions all have the same function-call depth. The code just needs to know that the current DBPro function has been called directly in this way.

Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 27th Nov 2011 20:53 Edited at: 29th Nov 2011 20:33
Actually that is possible too, if you do it like this:


The "ref" command would modify the return address of the function to call your DLL, which would copy the value of "b" to the argument used by the caller.

"ref" would also be a perfect use for a variadic command

Also, I've been doing some research into when array elements are used as parameters. In short, it's not nice. You can detect these cases very easily though, since the pattern will always end with "0F 85 ?? ?? ?? ?? 50"
Also, array indices are always stored in temporary variables ($D0, $D1, ...)

I was slightly surprised that DBPro doesn't let you pass a UDT array element as a parameter, but at least its a case that doesn't need to be taken into account...

edit:
Just realised a flaw in my logic: after the function returns, any strings will have been freed already. There are two ways I can think of solving this:
- Override the "?FreeSS@@YAKK@Z" function to check if you are about to return from a function and if so do any necessary copying.
- Override the "?EquateSS@@YAKKK@Z" function to do the copying and not bother with processing strings at the end of the function.

The first would be more consistent but the second seems less hacky.

edit2:
Also here's a new version of my disassembler which supports pretty much all the instructions DBPro uses:


[b]
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Nov 2011 00:13
Hey, I didn't notice that you did another update - after working through the implementation issues I'd gotten to the point where I was thinking that a full disassembly would be the easier way to go with this too (although still painful - looks like you've fixed some of the pain for me there ).

I have a mechanism in mind - I just need to get it down into a document so I can clean it up, make sure I get everything, and most importantly, make sure it will work.

Quote: "which supports pretty much all the instructions DBPro uses"

What opcodes doesn't it support yet?

Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th Nov 2011 01:31
Quote: "What opcodes doesn't it support yet?"


I don't know I just add support for any instructions that haven't been decompiled by it. In this latest update I added support for the extra addressing modes possible with the SIB byte (such as [ecx + eax*4]) and some more conditional operations among other things. These were instructions I found when using arrays.

You can tell if there's something it doesn't support because the disassembly will be white (an opcode) but there will be no text next to it. The pale blue bytes are ones which are recognised as parameters to the opcode. ?? means that the bytes changed between calls to "test".

It's very easy to add new instructions, so if there are any it doesn't support just let me know. There's a good list here if you want to do it yourself.

[b]
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 30th Nov 2011 04:21
A little question about the Zone(x,y,z) expression. Can its query be limited to a group of zones?

If one has many zones, say 1000 of them, but only wanted to test 10 of them, a for loop could be used; or I could use First Zone In Group, Next Zone In Group but I just wanted to know if Set Default Zone Group could set expressions to return results from the group, so that zone IDs out of sequence could be checked quickly.

But the Zone expression may work quickly anyway as I haven't set up the program yet; I want to test if particle and physics systems should shown if a player is in a zone; also I will interact with AI zones.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Nov 2011 08:26
I could add a function to limit checks to a particular group and to return either the first zone it finds, or the smallest zone.

I'm not sure what that has to do with the SET DEFAULT ZONE GROUP command though - perhaps you could explain?

Quote: "I don't know I just add support for any instructions that haven't been decompiled by it"

Ah, you're talking about the machine instructions, while I'm talking about DBPro instructions. I'll just work it out as I go along.

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 30th Nov 2011 21:34
Well if it is not too difficult; if think it would be good.

The Set Default Zone Group could not only set the group ID for new zones; but also limit the group ID for zone expressions.

On the other hand, an additional function; rather than Set Default Zone Group function; such as [Set Current Group], could limit all expressions to a group, or range of groups instead; setting the group to zero could remove any limits specified, and normal zone functionality could be restored.

Final way I can think of, each expression could have an optional parameter or series of optional parameters to limit the expression to a group, or a range of groups respectively. Which ever is easiest; because so as long as you do not have to do group sorting in DBPRO, the better. It is not difficult to do in DBPRO, but it maybe easier and more efficient to do in your plugin, I'm not sure.

In DBPRO code it could be acheived by storing Zone Ids and groups in a 2D array (or memblocks); like:



with memblocks/banks, each integer inside of the memory could store a zone ID that belongs to the group that shares same ID as the memblock/bank Id.

Each zone could then be checked individually within one or more groups, instead of all groups. But doing data sorting and group management code in DBPRO is not the nicest thing in the world; it is better to not have to compile the necessary code; even in a simple design; which I tend to favour; we are limited to either a fixed number of groups or fixed number of zones that could be stored in the second dimension of a 2d array; otherwise it would eat up the RAM. If we are not happy with fixed 2d arrays, then we must increase complexity by using memblocks, link lists etc.

All in all there are many practical applications for your zone idea in an open world game which I feel are almost as important as the objects themselves. We could use place name zones, AI zones, sound zones, emitter zones, physics, triggers and interact with other plugins which use zones and groups aswell. Where distance checks could not fit irregular shaped rooms and line of sight and collision checking is overkill for situations like seeing if the player can see a bunch of physics objects in a room from within a hallway.

That's my view anyway.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Nov 2011 22:34
Here's a new release, prior to me starting work on variable references.

There are duplicates of standard DBPro function using double floats (increased speed and accuracy when using double floats).
There are commands to redirect the standard PRINT statement to a console window (SET CURSOR too).
You now have limited support for monitors (not fullscreen, but you can determine which monitors cover which screen coords and reposition the window accordingly).
I quickly added a method of searching zones by their group rather than forcing 1-at-a-time checking.

Release 20111130
Matrix1Util_06 - 1.1.0.2
- Added SET ERROR FUNCTION command.

Matrix1Util_07 - 1.1.0.9
- DOUBLE VAL() function
- Double float equivalents of COS/SIN/TAN/ACOS/ASIN/ATAN/HCOS/HSIN/HTAN/ATANFULL
- Double float equivalents of CEIL/FLOOR/SQRT/EXP/WRAPVALUE
- INT that accepts double float and returns a double integer

Matrix1Util_11 - 1.1.0.4
- Added 4 new versions of the OPEN CONSOLE command to size the window.
- Internal reorganisation to support better cursor control.
- Added PRINT TO CONSOLE and PRINT TO WINDOW commands, with saved cursor positions.
- Added the AT() function to position the cursor.

Matrix1Util_13 - 1.1.0.9
- Added PERFORM CHECKLIST FOR MONITORS command.
- Added GET WINDOW POSITION X and GET WINDOW POSITION Y functions.

Matrix1Util_21 - 1.1.0.8
- Added 2D and 3D versions of POINT IN ZONE GROUP function, to search whole zone groups at a time.

Matrix1Util_22 - 1.1.0.15
- Fixed FILE SIZE function so that data isn't skipped when flushing a 'read' file.

Matrix1Util_24 - 1.1.0.4
- Added DIR COMMON APPDATA function.
- Added DIR SHELL FOLDER function.

Matrix1Util_26 - 1.1.0.4
- Fixed rare crash situation in plug-in shutdown.
- Modification to startup code - use GetModuleHandle rather than LoadLibrary.

Matrix1Util_29 - 1.1.0.8
- Corrected help for the SORT commands.

Matrix1Util_32 - 1.1.0.5
- Added VECTOR3 DEGREES TO VECTOR & VECTOR3 VECTOR TO DEGREES conversion commands.

Attachments

Login to view attachments
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 1st Dec 2011 01:03
Cool, looking forward to the new commands. Also there's some other info that I didn't explicitly say before:

- The first member of a UDT is passed around as though it is not in a UDT, rather than as a member with an offset of zero.

- When passing a local UDT member to a function, the assembly is identical to if you pass a local variable to a function, because locals are already an offset from EBP so no extra code is used, whereas global UDT members have extra code to apply the offset. That's why there are two versions of each global pattern but only one local pattern.

- Nested UDTs don't exist as far as the compiler is concerned, it is as though all the members were in the outer-most udt.

[b]
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 1st Dec 2011 01:27
Wow that was fast. Nice set of functions as well. Looking forward to using them. Thanks for the work.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Dec 2011 20:28
Capturing a runtime error.

Here's the example - moving an object that doesn't exist:


Note that because of the method I've used to implement this, returning from the error handler function will allow the program to exit cleanly.

In addition, the error handler is cleared whenever it is invoked, so you need to reset it if necessary. The reason for this is that if your error handler contains an error, you'd want your program to exit rather than loop back to the error handler to fail again and again etc.

The function is supposed to allow you a last chance at saving game-state etc before exiting due to the failure, however if you wish, you can attempt to resume the game at some point you define.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Dec 2011 20:38
Printing to a console

Quick demo of opening a custom-sized console, using the PRINT command the SET CURSOR command to access it:


IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Dec 2011 21:51
Expanded system folder function

There's an additional function in the system directory plug-in that accepts a value that specified which directory you want.

Here's an example:


Manson_NS
19
Years of Service
User Offline
Joined: 4th May 2004
Location: Denmark
Posted: 3rd Dec 2011 09:54 Edited at: 3rd Dec 2011 10:06
As allways with your updates Ian, my code keeps shrinking nicely.
Thank you, that console update is very usefull, and effectively solves a load of issues on my end.
The double float commands is an extremely nice addition as well, that I can assure you will be heavily tested.
Edit: With that beeing said, the Double Val command seems to neither exist, nor have a help file - though it is refereced

Looking forward to see what you can do with regards to the variables.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 3rd Dec 2011 21:14
@ IanM,

Have you thought about Linked List ccmmands and saving and loading them?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Dec 2011 13:01
DBPro's arrays already simulate linked lists well enough that I don't think there'd be anything to gain from that.

Binary trees and heaps and n-ary trees though, that's another matter.

@Manson_MS,
Thanks, I'll get that fixed in the next release.

basjak
13
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 4th Dec 2011 20:29 Edited at: 5th Dec 2011 01:21
@Ian. thank you for the hash functions, first time I know they exist.

some websites claim that we are able to unhash and some say that it is impssible to do so unless trying to create brute force to try out different hashes.

so, are hashes one way or two ways. no website I searched comfirmed this question.

and although whirlpool hash seems to be the strongest, which hash is mostly used.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Dec 2011 22:18
A hash is one-way, but it's not unique - that's where the brute-forcing comes in.

For instance, I could have a hash of the word 'banana', but it's absolutely possible for another word to generate the exact same hash value. That's what rainbow tables were invented for - they precompute hashes for known values, so once you know the hash, you can lookup the password that was used to generate it.

Stick with one of the later ones - Whirlpool or SHA-224 are reasonably recent and not known to be broken yet.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Dec 2011 20:54
I just want to highlight how very useful the console is now that I have extended it.

As I'm working on variable references right now, using Diggsey's disassembly code to assist in working things out, it's useful to disassemble everything at once and see it all in one place. The console does this for me perfectly.

Here's how I've got things set up:


If you also set the application compilation mode to 'hidden', you have a simple text console application that has 10,000 lines of history, and that can be scrolled though.

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Dec 2011 01:27 Edited at: 10th Dec 2011 03:19
I find it handy for debugging events, keeping an eye on certain variables and viewing statistics without using your main window; all while being able to take advantage of mixed datatypes in print commands.

I sometimes need to log certain events to file as well as print them to the console; I am using a function to take in the information and output it to the console and file using [Print Console] and [WriteLn Log].

Edit: The console is not documented to work with Input commands at the moment, do you have any plans to handle input commands on the console window? It already works to a degree if the DBPRO window has focus; although you can get input with Get Console Char$ ( ); and print it with Print Console Get Console Char$( ). I do not use the Input commands anyway because I want the game loop to proceed. I can just use the DBPRO window to get input anyway.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Dec 2011 18:53
It doesn't work with the input command correctly.

Right now, any prompts you apply to your input command will appear in the console, but you'd need to switch back to the DBPro window to type stuff and the output would again appear in the console as you type.

I might spend some time on fixing that, but it's not a high priority right now.

tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 19th Dec 2011 02:25
I usually drop my trap to a disk file, but this console sounds very interesting ... Thanks IanM!


A 3D marble platformer using Newton physics.
Jambo B
14
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 23rd Dec 2011 12:53
That error function command is excellent... can't think why it wasn't included in DBP from the start!

Many thanks, IanM
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Dec 2011 13:42
Unfortunately, DBPro wasn't designed for error-recovery, so you'll need to take care when using that command.

It's main use in my view is to allow you to save state (debug log for instance), or to save the game etc. You'll need to test well for any other purposes you use it for.

GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 26th Dec 2011 06:59
Ian:

I would like to start using your error capturing functions but unfortunately error codes do not mean a whole lot. Is there an "error code to text" function or reference somewhere?

Login to post a reply

Server time is: 2024-04-16 07:35:09
Your offset time is: 2024-04-16 07:35:09