I'm trying to come up with the best way to do some random match making in a simple game.
While experimenting with netStreams, I can easily set up direct connections, send data, text, video, sound all using Cirrus which is great. I find it pretty easy to get a simple P2P connection going, and it works just like i need it to.
But I really want to implement a random matchmaking feature using ONLY cirrus so everything is though p2p...
How would I go about grabbing a random peer in the same group...that's not in a direct connection with someone else already?
-I was thinking maybe I could use object replication...and when someone connects to the GroupSpecifier, I could then push another object into this shared array that has the local peerID and their status. then i could just alter the array when theyre in a "game". But then im worried there is no guarantee that their entry will get removed if the person just closes the web window.
-I also thought about just doing a "post" to the group containing the nearID, and other peers can get the post...and those that aren't in a game will try and direct connect back. Then that side will then connect to them. so then theyll both be in direct connections with each other. But then i feel like if potentially 100s of people that are "available"...get the post...then they all try and connect to one person, then it could cause problems.
- Also, I thought about just doing sendToNearest rather than a POST and seeing if EVERYONE is in a game or not...but wouldnt that not be the best way to match people...because you can only have so many neighbors i think... if there were 1000 people in the group. youll only be able to connect to a few peers actually considered your neighbor right? Then basically you could end up just matching up with the same 5-10 people or however are technically considered a neighbor.
any suggestions or articles someone could link to for how to do random matching to direct connections with cirrus? thanks!
Really looking forward to a lot of projects with cirrus if this is possible