Streams

Blitz3D Forums/Blitz3D Beginners Area/Streams

Gauge(Posted 2003) [#1]
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?


soja(Posted 2003) [#2]
...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.


soja(Posted 2003) [#3]
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.


eBusiness(Posted 2003) [#4]
Wanna know what will happen if made such an array... Ok, I'll try... MAV! Not that unexpected


eBusiness(Posted 2003) [#5]
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.