Lamperi's development thread

Discussion in 'Development General' started by Lamperi, Mar 7, 2011.

  1. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Figured I might as well post one.

    TODO
    • Web client
    • Theme Manager
    • N900 version. Never going to happen. Without modification to source it works, but battles are unplayable and only 2 rows of chat on the screen at the same time. Priority -Inf
    • Things to dream about: Everything dockable in Teambuilder. Client side scripting. Server side database, accessible from scripts.
    DONE

    • Mac-version (ongoing project). Suggestions to Mac version by PM.
    • Updates to Finnish translation. (Latest update by Viderizer)
    • 2010-06-23: Synchronous webCall, mainly for doing webCalls on server shutdown.
    • 2010-10-28: Possibility to move Players/Battles/Channels tab to right side of chat widget.
    • 2011-03-01: Better player-events. Users can enable and disable them by categories and per channel.
    • 2011-03-06: Rangebans implemented in server script (scripts.js).
    • 2011-03-07: Fixed controlpanel's UI: made IP address selectable (copyable) and made the layout resizeable.
    • 2011-03-07: Fixed links not being selectable on main chat (thanks zeroality for suggestion)
    • 2011-03-16: Clickable channel links
    • 2011-03-18: User profile links made clickable
    • 2011-03-24: Autojoin support
    • Lots of bug fixes.
    • Lots of work on server scripts
    • ...
    • Password saving.
     
    Last edited: Dec 19, 2011
  2. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    [master f2df7dd] Added autojoin support to client
    7 files changed, 61 insertions(+), 5 deletions(-)


    Ok, autojoin support added. I programmed server to send servername to connected clients so that clients can differentiate servers from eachother easier.

    I might want to convert channel specific events also to be server specific, but I guess it isn't that big concern for now.
     
  3. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    cool :)
     
  4. Blastcore

    Blastcore Developer

    Joined:
    Jul 19, 2010
    Messages:
    763
    Likes Received:
    1
    What's "Autojoin"?
     
  5. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I'll be using boost::asio (or try to) as SFML failed lamely and SDL's support is even more limited. That means they have a settings called linger time (time to wait when closing the socket, if data was not sent, to send it before closing for real), so the fix on the delete socket may be useless.
     
  6. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Great.

    Even though I'm pretty sure that QTimer::singleShot for deleteLater() would work, I couldn't test it.
     
  7. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    So… PO now will depend on Boost? (O.o)
     
  8. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Well it's only optional. QNetwork will be there by default (and used for the connection to the registry) but due to the problems on linux with 500+ connections and Qt, i'm putting boost as optional. I tried SFML first but their support is limited and so in some cases an error is returned even if a packet is partially sent, making you able to send twice the same packet. So i'm trying boost as an alternative socket library now ^^
     
  9. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    recently in branch lamperi
    Code (text):
    1.  
    2. commit 6bbace5eb2d9b3eb9c92071d37d94b948c0feded
    3. Author: Toni Fadjukoff <lamperi@lamperi.name>
    4. Date:   Tue May 24 22:49:55 2011 +0300
    5.  
    6.     Added possibility to pass Functions to webCall.
    7.    
    8.     ScriptEngine::webCall accepts both Function and String now as callbacks.
    9.  
    I got frustrated by webCall evaluating your callbacks as Strings, so I added a possibility to pass Javascript functions to it...
     
  10. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
  11. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Fixed the ScriptEngine::pokeNum bug with pokemons with spaces in their names (Mr. Mime & Mime Jr. currently)
     
  12. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    (01:01:57) +Lamperi: ok, sleeping
    (01:02:00) +Lamperi: i don't get more out of this
    (01:02:07) +Lamperi: it might be that sender() gives bad values

    --

    sender() gives the last sender() - if the slot is called directly, for example, sender() would still return the last object to have emitted a signal that was sent to a slot of your object, so using sender() in that case would be kind of wrong.
     
  13. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    While wondering why the challenge thingy crashes, I got tired of long login times, and implemented it such that channel.cpp only sorts the players after the channel is fully loaded. It cut the login time for me from 6 seconds to 3 seconds.
     
  14. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
  15. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Something a lot of people have requested:

    [​IMG]
    [​IMG]
     
    Last edited: Oct 18, 2011
  16. Kalashnikov

    Kalashnikov Despite the code quality

    Joined:
    Apr 4, 2011
    Messages:
    434
    Likes Received:
    0
    Please make it possible for clients to remember this password.
    Storing user password would be awesome as well.
     
  17. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Yeah I already started password saving for user and server right after finishing the server password ^
     
  18. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Password saving!

    [video=youtube;4-qVqT5XvAQ]http://www.youtube.com/watch?v=4-qVqT5XvAQ[/video]

     
    Last edited: Oct 19, 2011
  19. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
  20. supertrunks8

    supertrunks8 Pwnage

    Joined:
    Jun 20, 2011
    Messages:
    350
    Likes Received:
    0
    That is really nice, the password saving. When you are finished @Lamperi is it going to be in the Server.exe download with the next updated of PO? It would be pretty cool to have:3
     
  21. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    The server password requires new server and new client, as the server password prompt doesn't even exist on the current client. When there's a new release, these will be available for everyone.
     
  22. Kalashnikov

    Kalashnikov Despite the code quality

    Joined:
    Apr 4, 2011
    Messages:
    434
    Likes Received:
    0
    How will old clients connect to new password protected server?
    Won't they bypass password check simply because ...they don't know it exists? Or will the connections from outdated clients be simply rejected?
     
  23. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    "Your client received an unknown command.. maybe an update for the program is available?" will be printed.

    Also it would be handy to add servers to send the bit if the server is password protected to registry, so that people can see a lock(?) if the server is protected.
     
  24. supertrunks8

    supertrunks8 Pwnage

    Joined:
    Jun 20, 2011
    Messages:
    350
    Likes Received:
    0
    Oh so yay! It will be released to PO Public :) also Lamperi your doing a really good on the Password Saving. Lol...
     
  25. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Began work on Theme Manager, that will be a client plugin.

    My target is to create a plugin which can browse, install and uninstall themes easily. It will use a remote XML database maintained probably in PO's repository, or, in a separate repository (any input on this?). If possible, I'm going to pull thread ratings from PO forums and display them on the widget.


    [​IMG]
     
  26. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    That's really great!

    About the xml database, maybe another repo separate in the same way as po-server-goodies is separate from the main repo.
     
  27. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    http://nightly.lamperi.name/

    Setup a site to build nightly binaries for Windows. Todo: change version number to "Nightly-2011-01-01" or similar, package each day for simple download. Make also Linux builds if possible.

    Will continue on Theme Manager soon. But first I need to solve one design bug. How to allow themes to be loaded from user's theme dir? Since Mac builds contains all resources, downloading a new version replaces old. For proper linux packaging, a way to have user installed themes is a must.

    Also worked out a simple way to copy smogon tiers to us:
    https://github.com/lamperi/po-server-goodies/blob/master/updatesmogontiers.py
     
  28. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Ugh, realized a bit late that Theme User Path does not copy with any images which use url(Themes/MyTheme/Foo.png) since the QUrl is no longer valid.

    Well, compiling PNGs into resource file and then loading with QResources would be sufficient for QStyleSheets to work, but we would need couple of things for it.

    1) Good, new guide for theme makers and testers to use QResources.
    2) Look for ways for PO to convert existing themes easily into resource format.

    Also coyo why you removed Dratini Dreams... Palette depends on it x)
     
  29. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Could you make nightly builds of devel version of PO? Since now we have a separate registry and all... :)
     
  30. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    k will look into it
     
  31. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    :6130:junk `L_&L__ZN12BattleWindowD1Ev$stub$stub"$stub"' after expression
    :118346:invalid character '_' in mnemonic

    cool stuff, errors in linking.... compiling for Leopard even on Leopard is going to take some finetuning...
     
  32. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Ok, compiles and runs with GCC 4.6.3 now, was using GCC 4.7.0 :)

    Only thing missing is shaders – they do not work, at least on Mac OSX Leopard. Result? Pokemon Sprites are missing (substitues etc. work fine).

    The error, any idea coyo:
    Code (text):
    1. QGLShaderProgram::addShader: Program and shader are not associated with same context.
     
  33. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Well, did you merge my last commits to the battle window? They should load the default sprite if the shader fails loading.

    FieldPokemon.qml
    Code (javascript):
    1.  
    2.     /* Used to display fainted pokemon */
    3.     Component {
    4.         id: shaderComponent
    5.         ColorShader {
    6.             id: shader
    7.             image: img
    8.             blendColor: Colors.statusColor(pokemon.status)
    9.             alpha: (pokemon.status === PokeData.Fine || pokemon.status === PokeData.Koed) ? 0.0 : 0.3
    10.         }
    11.     }
    12.  
    13.     Component {
    14.         id: nonShaderComponent
    15.         Item {
    16.             function grab() {}
    17.         }
    18.     }
    19.  
    20.     Loader {
    21.         id: shader
    22.         sourceComponent: shaderComponent
    23.         onStatusChanged: if (shader.status == Loader.Error) {sourceComponent = nonShaderComponent; }
    24.     }
    25.  
    If you don't see the sprites still, it means it didn't detect an error (and it sucks).

    What does it do when you change:

    Code (javascript):
    1.     ShaderEffectSource {
    2.         id: sourceImage
    3.         hideSource: true
    4.         sourceItem: image
    5.         live: false
    6.     }
    and set hideSource to false ? (in ColorShader.qml)

    If the image shows, that means then that whatever error you get, colorshaders still load :(

    If you want to disable the shader (for a test), with the code the only thing you have to do is change:

    Code (text):
    1.         onStatusChanged: if (shader.status == Loader.Error) {sourceComponent = nonShaderComponent; }
    to

    Code (text):
    1.         onStatusChanged: if (shader.status == Loader.Error || 1) {sourceComponent = nonShaderComponent; }
     
  34. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    I'll try that later on. The sprites worked on Snow Leopard with the same build though.
     
  35. TheOneThatGotAway

    TheOneThatGotAway Banned

    Joined:
    Aug 14, 2012
    Messages:
    74
    Likes Received:
    0
    Great job Lamperi! Your always right up top on keeping us up to date.
     
  36. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Can't really know if that's being sarcastic or not.

    Currently working on:
    playing with kids... our third child was born on Sunday so I really don't have any spare time before 9 pm and even then the youngest may be awake
     
  37. TheOneThatGotAway

    TheOneThatGotAway Banned

    Joined:
    Aug 14, 2012
    Messages:
    74
    Likes Received:
    0
    No lamperi it's not. I am the kind of girl who likes to say things that should be said and that was not met to be sarcastic in anyway, shape, or form
     
  38. Tyki

    Tyki Change

    Joined:
    Nov 13, 2011
    Messages:
    926
    Likes Received:
    0
    PO Trainer Name:
    Tyki
    This may be my client's problem, though the mac QR still seems broken. I can use kalashnikov's site to convert it, though it'd still be nice.
     
  39. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    If you really need it then you can use wine + windows version until it gets fixed.
     
  40. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    QR Code plugin is broken in v2 by design unfortunately.

    Is it included in 1.0.60 ?