xoros's Recent Forum Activity

  • Thanks to rexrainbow!

    Should anything be updated in the server sources?

  • Also found this, it seems that there was a bug in the socket.io version 0.9.5, which resulted in this delay:

    stackoverflow.com/questions/12043893/socket-io-force-a-disconnect-over-xhr-polling

    Quote:

    "Solved the issue, it turns out it was a bug introduced in socket.io 0.9.5. If you have this issue just update BOTH your server and client-side code to socket.io > 0.9.9 and set the socket.io client-side options sync disconnect on unload to true and you're all set.

    Options are set this way:

    var socket = io.connect('http://yourdomain.com', {'sync disconnect on unload' : true});

    "

  • I changed this in you server.js file:

    io.set("transports", ["flashsocket"])

    and there's no delay, but it works only in firefox :(

  • OK, I'will look into the problem.

    Found this:

    stackoverflow.com/questions/6280569/socket-io-xhr-polling-delay-on-disconnection

  • So I managed to implement rooms auto-joining without storing any data. But one thing is not clear to me - it is onUserLeft event:

    I'm testing with several browsers opened, so if I close a window in one browser there's certain delay (ca. 1-2 Minutes) until onUserLeft in the BottleNeck plugin fires. Is it possible to change this delay to zero or some very small value? or is it "socket.io" specific value? Or may be this delay is due to all the users comming from the same IP?

    The same thing is with KickUser: when this method is called onUserLeft does not respond.

  • No problem, man - the plugin is still very cool.

    In my project the "room joining" process should happen automatically. The user just inputs his name and presses start button. Than he is automatically trasfered to the next available room. If room member limit is reached (in my case it's 2-4 players), the room is automatically closed and the game starts.

    But I think I've found the way how to do this without storing anything in hash-tables, just by combing "Lobby" plug for iterating through available rooms with "Bottleneck" for joining the available room.

  • One more question about "lobby" plugin:

    there's a condition "forEachAvailableGameRoom", which cycles through all opened rooms. Is there any way to cycle through all the rooms, even those which are not available?

    Something like "forEachGameRoom" and then a condition if "GameRoom" available -> do something, else do something else.

  • Ok, i'll take a look at the bottleneck_lobby plugin.

  • Yes, I know, that RoomID is a string, but the thing I want to achieve is just automatical RoomID generation (instead of using that from the input field).

    Example flow:

    • Default RoomID is "0" (which is a string set in an event)
    • the first player(0) automatically joins the roomID "0" and is waiting for an opponent
    • the next player(1) automatically joins the roomID "0"
    • the client checks if number of players =>2, closes the roomID "0", goto Game
    • the next player(2) joins the default roomID "0", but can't because it's closed

    (until this point everything works fine)

    • Condition "onRoomUnavailable" should try to change the roomID variable to something else (e.g. convert str to int iterate it +1 and than convert back to str). This could also be just another string like "FreeRoom". It means that the next room is automatically created by the client.
    • Try to join to the newly created roomID (this step doesn't work).

    The problem is, that "onRoomUnavailable" doesn't allow to retry joining another room

  • Hey rexrainbow,

    the plugin and server are working just fine and very easy to use. But right now I'm trying to solve the following problem:

    The user should automatically connect to the next available game room or create a new one with the higher index. So I'm trying to do something like this:

    "On room unavailable" > set RoomID to str(int(RoomID)+1)

    Bottleneck "User MyUserName" join to room "RoomID"

    But it doesn't work like this. It seems that after "onRoomUnavailable" there's no other "connectivity" actions possible. Ideally it should work recursively.

    Or do I have to save room data somewhere on the server and parse the data with something like php?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, didn't notice it.

  • Hello fellas,

    I can't find the way, how to change the text/text box size according to it's content. There's also no option like text container auto-resize.

    Any work arounds?

xoros's avatar

xoros

Member since 18 May, 2012

None one is following xoros yet!

Connect with xoros

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies