Streams

Blitz3D Forums/Blitz3D Beginners Area/Streams

I'm considering using Dim player(1000000000) , yes by one million, it seams each stream has 9 digits so i'm assuming: 1. each stream will always be different, and 2. streams will always have 9 digits. is that correct? I know dimming it will take um some room, but how much? Is their a better way to do this?

...I assume you're talking about TCP/IP stream handles?

I don't think you can assume either one. The other big problem is that you likely don't have 4 gigabytes of RAM.

Why don't you create a player type with a unique ID field and a stream handle field? Then you only need to allocate RAM for the users that are there.

<EDIT> PS: 1 followed by 9 zeroes = 1 billion. You're asking for 4 billion bytes, plus the Blitz array overhead.

If you really want to use the stream handle as the player ID, you'll want to look into using a hash function with an array to index them. Then you can have a fast lookup, and use minimal memory.

I would suggest just assigning a user ID to each of them.. which will persist between sessions.

Wanna know what will happen if made such an array... Ok, I'll try... MAV! Not that unexpected

And by the way, you don't need a type, just make all your player info arrays, like: Dim playerxpos(numberofplayers-1) Dim TCPhandle(numberofplayers-1), and so on.