xoros's Forum Posts

  • It's "the thing" which is really frustrating about C2 at the beginning. You can't pick the Sprite1 by UID untill the whole "event chain" is finished (function2 is a part of this event chain, because it was called by the function1). The thing is Sprite1 is already picked right after it is being created. There's a small hack, how to solve this problem: before picking Sprite1 by UID use "wait 0 seconds" command (this command breaks the event chain). But beware, that under some circumstances the whole thing could be unstable because of this hack. Or call function2 from the separate event. I really dislike this "feature".

  • Really looking forward to check it out

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You do not have permission to view this post

  • Could you be more specific and provide a sample .capx or at least a screenshot of the logic?

  • Wow, that's exactly what I need for my current project!

  • I'm running your node.js server on my local machine and it works like a charm right now, there's no delay.

    I just wanted to know, whether you updated anything the server source code.

  • 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