Home | Search | Login | RSS
We have 1080 members and counting!
Next Page

1

Previous Page

Thread: List of allowed instance names

Created on: 10/15/10 12:45 AM

Replies: 3

sularome





Joined: 06/25/10

Posts: 11

List of allowed instance names
10/15/10 12:45 AM

Is it possible to restrain the instance names to some list e.g. (room1, room2, room3)?
The reason i'm asking this is, cause i wonder:
How does FMS protects against malicious users, that can create script to connect on 1000000 instances on the server?

Link | Top | Bottom

Graeme





Joined: 10/18/07

Posts: 1592

RE: List of allowed instance names
10/15/10 3:10 PM

Yes. You can grab the instance name when the app starts up and compare it to a list of room names that are allowed. If it isn't in that list then close the application down.

Link | Top | Bottom

sularome





Joined: 06/25/10

Posts: 11

RE: List of allowed instance names
10/18/10 1:01 AM

just to share how i did it. This goes at the top of application.onAppStart function:


//disconnect the application instance if not in the allowed room list
this.roomName = application.name.replace(/.*?\//, "");
var allowedRooms = new Array('English','French','Dutch','General','_definst_');
var disconnectflag = true;
var l = allowedRooms.length;
while(l--)
{
if(allowedRooms[l] == this.roomName){
disconnectflag = false;
break;
}
}
if(disconnectflag) application.shutdown();

Link | Top | Bottom

Graeme





Joined: 10/18/07

Posts: 1592

RE: List of allowed instance names
10/18/10 4:30 PM

Thanks for posting back with the code you wrote. Looks great! I'm sure it will be of good use to others.

Link | Top | Bottom

Next Page

1

Previous Page

New Post

Please login to post a response.