Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
I don't see why it wouldn't work since the uBound (upperbound I think it is). Gets the new index before highindex does if thats now added. Well it's pretty simple to test, so I might do it. Just wanted to know why people havn't thought of it before. Etc..
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
Where exactly is that done?
So simply create the socket array with only a single element in the beginning.
Then when new sockets are needed, we can simply add a socket (with the MAX_PLAYERS simply setting a number that the server will not exceed).
Then when someone disconnects, check to see what the highest socket number is that is in use, and unload all sockets above that number.
Basically, you'd simply load sockets when you need them and unload the ones that you don't need (as long as they're not in the middle of the array... I made that mistake one time).
Or you could just leave them loaded and not unload them. It'd still reduce the number of sockets you have loaded within the first moments of the server being up (depending on how popular the game is, if you never have more than 5 people at a time, then the server will never have more than 5 sockets loaded at a time... minus the listening socket which doesn't really count).
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
Eh, something is wrong with ubound. I made a server so people using rpg toolkit could play online. And ubound works there, but it doesn't seem to work in ms. I need to try a little more later.