Mystra's development thread

Discussion in 'Development General' started by Mystra, Aug 10, 2010.

Thread Status:
Not open for further replies.
  1. Lamperi

    Lamperi I see what you did there

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

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    We already saw than. And it is bound to QtGUI too.
     
  3. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    sys.system() is now blocked in safe scripts mode.
     
  4. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Currently server cannot be compiled in my branch for some reason (and I doubt it was me). Maybe I'll need to try merging master… Also new pokes don't seem to show up in team builder (>_>) It's either new team builder or I forgot something (@_@) When you work alone on something the worst thing is you have no one to ask :\
     
  5. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    When I can, I'll merge mystra into devel and check it out. You just need to tell me where to put new pokemons!
     
  6. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    For client in Windows it is %APPDATA%\Pokemon Online\Mods\. Look into http://serenareem.net/files/po/test-mods.zip for example of what should be inside.

    For server only mod_db part is needed (see archive) and it should be in PO directory. i.e. PO/mod_db/pokes/blahblah. Keep in mind, that zip archive inside mod_db are prefixed with mod_. I shouldn't probably done it this way… but I thought of it as a way to differentiate between mod dirs and normal data dirs. Whatever %)

    EDIT: Just don't push it until you are sure it is actually not breaking anything (^ ^)' Just a few battles and running a server is fine, I guess.
     
  7. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    The server compiles fine (merge your branch with devel)

    I'll check the other problem when I can.
     
  8. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Thanks. Now I'll need to figure out how to do that in this new state of things (@_@)
     
  9. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Code (text):
    1. vim .git/config
    2.  
    3. Add that:
    4.  
    5. [remote "coyo"]
    6.         url = git@github.com:coyotte508/pokemon-online.git
    7.         fetch = +refs/heads/*:refs/remotes/coyotte508/*
    8.  
    9. Then:
    10.  
    11. git checkout master
    12. git pull coyo devel
     
  10. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    In readModDirectory:
    Code (C++):
    1. QString result = PoModLocalPath + mod_id + "/";
    >>

    Code (C++):
    1. QString result = PoModLocalPath + QString::number(mod_id) + "/";
    Also your code load mods not at client init, but when teambuilder is loading, it should be changed imo.

    Apparently this isn't the only thing, I'll keep looking.
     
  11. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Hmm… what exactly counts as client init? I'm not terribly familiar with TB internals (>_>)
     
  12. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Code (c++):
    1. void fill_check_mode_path(FillMode::FillModeType m, QString &filename) {
    2.     if (m == FillMode::Client) {
    3.         filename = PoCurrentModPath + filename;
    4.     }
    5. }
    6.  
    7. static void fill_container_with_file(QStringList &container, const QString & filename, FillMode::FillModeType m = FillMode::NoMod)
    8. {
    9.     QString files[] = { filename, PoCurrentModPath + "mod_" + filename };
    You readd the whole mod path to the filename.

    So:

    Code (c++):
    1. void fill_check_mode_path(FillMode::FillModeType m, QString &filename) {
    2.     if (m == FillMode::Client) {
    3.         filename = PoCurrentModPath + filename;
    4.     }
    5. }
    >>

    Code (C++):
    1. void fill_check_mode_path(FillMode::FillModeType m, QString &filename) {
    2. }
    Client init is in mainwindow.cpp line 62. That's where you load mods, not in TB code, otherwise if you don't go in TB no mods will get loaded.

    [​IMG]

    Pushing that to devel
     
    Last edited: Sep 8, 2011
  13. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    I LIKE TO ADD THINGS (>_>)
     
  14. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Pushed, with modifications to load mods at client init too.

    SOWEE :D
     
  15. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Server just eaten 90% CPU (100% = 2 cores)… (~_~)
     
  16. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Is this message normal? Never seen it before. Appeared when I called sys.unban() on non-existing player.
     
  17. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Answered you on server!
     
  18. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    That's on testing… :S
     
  19. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    You went to the dark side! I would have made a no Qt4.7 version eventually....

    Anyway you need to add BattleManager as a dependency.
     
  20. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Can you speak human, please? :}
     
  21. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    add src/BattleManager as a library and compile it before Teambuilder, like you do for pokemoninfo and utilities (maybe it should be added in client makefile)
     
  22. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Actually, I don't :P Also, it does not compile either way, unless you changes something since yesterday. Correct your Makefiles :P
     
  23. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    sure why no one uses Qt Creator instead

    or just do

    cd src/Utilities && qmake && make && cd ../PokemonInfo && qmake && make && cd ../BattleManager && qmake && make && cd ../TeamBuilder && qmake && make && cd ../../

    But i'll edit the makefiles...
     
  24. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Because running Qt Creator every time you need to compile is boring and costs more RAM :P Oh, and you need to wait. Also I don't even have X on x86 VM.
     
  25. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
  26. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    It run, but when I challenged my alt it segfaulted after I accepted… So, do I need new server to run that too?
     
  27. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I didn't try battles with it yet
     
  28. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Oh, new tr^W smart message: QML – the thing that allows you to fix all your problems. All over again.

    :}
     
  29. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Pushed sys.moveType() and sys.teamPokeShine(). I haven't merged any branches since last time, I think, so beware :}

    Code (javascript):
    1. ({
    2.    
    3.     afterLogIn: function(src) {
    4.         sys.sendAll(sys.moveType(sys.moveNum("Fire Fang")));
    5.         sys.sendAll(sys.moveType(sys.moveNum("Fire Fang"), 1));
    6.         sys.sendAll(sys.moveType(sys.moveNum("Fire Fang55")));
    7.         sys.sendAll(sys.teamPokeShine(src, 0));
    8.         sys.sendAll(sys.teamPokeShine(src, 1));
    9.         sys.sendAll(sys.teamPokeShine(src, 9));
    10.     }
    11.    
    12. })
     
  30. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Wait… what do I need to do on mods now again? I don't remember (@_@) Oh wait, there was something to do with move checker, but I remember having some problems understand what exactly should I do with it. Hmm…
     
  31. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    If you want doc on any part of the code, ask...
     
  32. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    I don't know yet (^ ^) I'll see about that later.
     
  33. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Ah, there. src/Teambuilder/Teambuilder/teambuilder.cpp

    Code (cpp):
    1. void TeamBuilder::changeMod()
    2. {
    3.     PokemonInfo::reloadMod(FillMode::Client, modActionGroup->checkedAction()->text());
    4.     // TODO: MoveSetChecker::init("db/pokes/"); ?
    5. }
    When mod reloads I probably need to reevaluate MoveSetChecker or whatever. Somehow…
     
  34. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
  35. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    TODO: make timeouts for PM auto-answers.
     
  36. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Actually, I did. Although I need to port it to current version now… *tries to remember what need to be merged first* I think I have this written somewhere.
     
  37. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Ported. Also added serverVersion() for scripts.

    Posting this so you now I have something and I'll not miss sudden release (^ ^)

    EDIT: added isServerPrivate() for scripts.
     
    Last edited: Nov 17, 2011
  38. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
  39. Kalashnikov

    Kalashnikov Despite the code quality

    Joined:
    Apr 4, 2011
    Messages:
    434
    Likes Received:
    0
    Can you make an option to disable folding to tray in the first place (and/or make it fold only after user gives such command)?
    It really annoys when server window randomly disappears during scripts debugging or configuration...
     
  40. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Sure. I'll look into that.
     
Thread Status:
Not open for further replies.