Does anyone know how to get a list of all online characters/account programmatically?

Page 3 of 3 FirstFirst 123
Results 31 to 44 of 44
  1. #31
    Programmer cyberinferno is offline
    True MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    694Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Does anyone know how to get a list of all online characters/account programmatically?
    Quote Originally Posted by Reaguee View Post
    @cyberinferno: you can use the game_login.php for registering who is logged, but I do not recommend to use it, because you will not get accurate logins. As you may know that php what it does is check against the database if the password that was sent on the GET request to the web, matches the password stored in the database, and if so, it creates the .txt file that is used by DBSRV to create the socket for the client. But, as you may know too, that does not guarantees that the account will be login into the server. Why I say that? well consider this scenario: your server needs to run /openserver to allow users to get in, while you don't run /openserver players are stuck on the Server selection window, which is AFTER the login window, so the login passed (game_login.php) but you still not login into the server. Another common scenario will be when your server is under maintenance, you are not running any zone neither dbsrv, but your website is on (where you have the game_login.php) clients will pass the login verification and again will be stuck on server selection.

    So if you want to be accurate with the info of the logged characters on the server, then, as dTantra said, hook server functions. Where is wrong dTantra, or at least he didn't said well, is that there is no login function on the server, what server have, is a function with a switch that process all client requirements, one of them is the Login request, another is the character selection, and so on.
    And for the logout, just hook CUser::CloseUser(void) function. Im specific with the class because there are 2 CloseUser functions, one on CUser and the other in Server.cpp.

    I saw in another of your post that you have the old c++ code of the zonesrv.exe, so go to ProcessClientMessage and find the value of the switch that you need for what you want to do, for example one of the switch is CSP_REQ_CHAR_INIT and another one is CSP_REQ_CHAR_SELECT or CSP_REQ_LOGIN, check what each does and which one gives what you want.

    If you need more help let me know. I will not charge you any fees jajajajaj

    Regards
    Reverse engineering and hooking functions is not my forte. But in my opinion wouldn't it easier if we edit SQLDAEMON would update database each time character logs in or logs out?
    ** Web developer **

  2. #32
    Member Reaguee is offline
    MemberRank
    Jan 2011 Join Date
    84Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    If you have the old c++ code you really dont need to reverse engineering, reverse engineering is when you dont have the high level language code, so you need to go with a debugger and read the asm opcodes or use programs like for example IDA which will do a 80% reverse engineer for you.

    About SQLDAEMON, i didnt ever use it to hook any, to be honest I never took time to reverse it, because what I think is it's function is to keep the god caste of the game, probably it does more, but for sure it is not in charge of players login and logout (login and logout is what I understand you want to control to show in your website who are online inside the game).

    Hooking or codecaving are the same, or at least they have the same functionality, programmers use them to change the original behavior of a function w/o the need to rewrite all the code, so I will recommend you to enforce your skills on it.

    So for example, if i were you, and want my website to show the characters that are inside the game, what i will do is a dll that I attach to my zone.exe, where I hook the ProcessClientMessage, and if the request I receive is to Init a character, then I send a GET or POST request to my web with the info of the character that i want to show and keep that in an list or dictionary, of course you can instead of sending a request to the web, create a record on a table in a DB, and configure your web to read that table info in a time interval, that is up to you the way you want to handle it , then when the user logs out again, hook the CloseUser function that is on the user, and when it is called by the server then my dll will send a request to the web or delete the record in the table.

    And even I think is clear why I hook CloseUser instead of the client request of logout, is because server can disconnect any user w/o the explicit request of the user.

    And BTW for those who dont know Hanbit did a dll (its on the client side) is called HTWeb.dll which its main purpose was to login the users on the game by using the web and not the login window of the client. I really don't know how it works, but is there for anyone who wants to reverse it and know its full functionality.

    Regards
    Last edited by Reaguee; 08-01-18 at 04:29 AM.

  3. #33
    Programmer cyberinferno is offline
    True MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    694Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Quote Originally Posted by Reaguee View Post
    If you have the old c++ code you really dont need to reverse engineering, reverse engineering is when you dont have the high level language code, so you need to go with a debugger and read the asm opcodes or use programs like for example IDA which will do a 80% reverse engineer for you.

    About SQLDAEMON, i didnt ever use it to hook any, to be honest I never took time to reverse it, because what I think is it's function is to keep the god caste of the game, probably it does more, but for sure it is not in charge of players login and logout (login and logout is what I understand you want to control to show in your website who are online inside the game).

    Hooking or codecaving are the same, or at least they have the same functionality, programmers use them to change the original behavior of a function w/o the need to rewrite all the code, so I will recommend you to enforce your skills on it.

    So for example, if i were you, and want my website to show the characters that are inside the game, what i will do is a dll that I attach to my zone.exe, where I hook the ProcessClientMessage, and if the request I receive is to Init a character, then I send a GET or POST request to my web with the info of the character that i want to show and keep that in an list or dictionary, of course you can instead of sending a request to the web, create a record on a table in a DB, and configure your web to read that table info in a time interval, that is up to you the way you want to handle it , then when the user logs out again, hook the CloseUser function that is on the user, and when it is called by the server then my dll will send a request to the web or delete the record in the table.

    And even I think is clear why I hook CloseUser instead of the client request of logout, is because server can disconnect any user w/o the explicit request of the user.

    And BTW for those who dont know Hanbit did a dll (its on the client side) is called HTWeb.dll which its main purpose was to login the users on the game by using the web and not the login window of the client. I really don't know how it works, but is there for anyone who wants to reverse it and know its full functionality.

    Regards
    I just wanted to show online player names in my server website. if it takes so much effort why bother? I would rather add some other better feature if I knew adding ASM code into zone.exe
    ** Web developer **

  4. #34
    Member dTantra is offline
    MemberRank
    Jul 2013 Join Date
    94Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Quote Originally Posted by Reaguee View Post
    If you need more help let me know. I will not charge you any fees jajajajaj
    I don't charge people for "help", I charge people for "work". Clearly he wants more help, so your going to write it for him for free?

    For processing server side packets, you can use the following addresses.

    K4 = 0x49DE73

    K6 = 0x49BD8A

    Pop the size off the stack, followed by the Packet, cast the packet header to the HEADER struct, filter out the character selection in this case, record the character name as online.

    Close user for k6 is 0x66E60, first item on the stack is the packet, second item on the stack is the connection id, use the connection id to find the character name and record is as offline.

  5. #35
    Programmer cyberinferno is offline
    True MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    694Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Quote Originally Posted by dTantra View Post
    I don't charge people for "help", I charge people for "work". Clearly he wants more help, so your going to write it for him for free?

    For processing server side packets, you can use the following addresses.

    K4 = 0x49DE73

    K6 = 0x49BD8A

    Pop the size off the stack, followed by the Packet, cast the packet header to the HEADER struct, filter out the character selection in this case, record the character name as online.

    Close user for k6 is 0x66E60, first item on the stack is the packet, second item on the stack is the connection id, use the connection id to find the character name and record is as offline.
    Thanks. Will see what I can do!
    ** Web developer **

  6. #36
    Member Reaguee is offline
    MemberRank
    Jan 2011 Join Date
    84Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Quote Originally Posted by dTantra View Post
    I don't charge people for "help", I charge people for "work". Clearly he wants more help, so your going to write it for him for free?
    hahaha on you, you really make me laught a lot when i read you.

    See what you have wrote: you dont charge for help, but then you said: he Clearly wants more help and then that you would not doit for free.

    BTW my comment of not charging fee was not for you was for him.

    and c'mon, writing that code for him will just take you few mins, because you well know that it does not take more than few lines of code.

    - - - Updated - - -

    Quote Originally Posted by cyberinferno View Post
    ... if I knew adding ASM code into zone.exe
    I thought you were a C# programmer not a c++ or CLI/CLR programmer, where is common to use asm to handle and manipulate the contents of the stack and registers. While is not so common in c# to use ASM, you can still do it by for example using the Fasm.NET lib
    Last edited by Reaguee; 10-01-18 at 05:55 AM.

  7. #37
    Programmer cyberinferno is offline
    True MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    694Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Quote Originally Posted by Reaguee View Post
    I thought you were a C# programmer not a c++ or CLI/CLR programmer, where is common to use asm to handle and manipulate the contents of the stack and registers. While is not so common in c# to use ASM, you can still do it by for example using the Fasm.NET lib
    I am mainly a web developer who works on PHP and NodeJS. But I do code in C# if needed for building emulator and desktop applications. My C++ skill not too high to write good complex applications yet. As far as ASM goes, I just know basics and that would not help in this matter.
    ** Web developer **

  8. #38
    Member Reaguee is offline
    MemberRank
    Jan 2011 Join Date
    84Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Well probably you think you need ASM because you are following what other have shown. But as a C# programer I can tell you that you dont need coding in asm at all for doing what you mentioned you want to do, and for that is why I made the comment that I thought you were a C# programmer. For the only thing you need asm knowledge, is for understanding the code that you are going to replace/modify if you dont have the code sources and you are reversing from the .exe

    You said that you wanted to add ASM code to the zone.exe (or at least that is what I understand of your comment), you don't need to add asm code if you attach a dll made on the language that you manage. (of course im not talking about php). You dont even have to bother changing code on the .exe to jump to your custom functions because there are a lot libs for c# out there that do that job for you.

    for example see the videos of this guy https://www.youtube.com/watch?v=pORR8O6ZCWQ&t=528s

    You dont need any of what he shows needed to hook if you are programming in c#, because as I said there are libs which does that work.
    Last edited by Reaguee; 10-01-18 at 09:09 AM.

  9. #39
    Programmer cyberinferno is offline
    True MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    694Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Quote Originally Posted by Reaguee View Post
    Well probably you think you need ASM because you are following what other have shown. But as a C# programer I can tell you that you dont need coding in asm at all for doing what you mentioned you want to do, and for that is why I made the comment that I thought you were a C# programmer. For the only thing you need asm knowledge, is for understanding the code that you are going to replace/modify if you dont have the code sources and you are reversing from the .exe

    You said that you wanted to add ASM code to the zone.exe (or at least that is what I understand of your comment), you don't need to add asm code if you attach a dll made on the language that you manage. (of course im not talking about php). You dont even have to bother changing code on the .exe to jump to your custom functions because there are a lot libs for c# out there that do that job for you.

    for example see the videos of this guy https://www.youtube.com/watch?v=pORR8O6ZCWQ&t=528s

    You dont need any of what he shows needed to hook if you are programming in c#, because as I said there are libs which does that work.
    Beautiful tutorial! Thanks
    ** Web developer **

  10. #40
    Member dTantra is offline
    MemberRank
    Jul 2013 Join Date
    94Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Quote Originally Posted by Reaguee View Post
    See what you have wrote: you dont charge for help, but then you said: he Clearly wants more help and then that you would not doit for free.
    BTW my comment of not charging fee was not for you was for him.
    That's precisely why I asked if you were going to write the code for him for free, because you made a comment about not charging for "help". As I stated, I do not charge for help, I don't mind answering questions or pointing in the right direction, but when it comes to providing a complete solution for something I do not already have, I do most certainly charge.

  11. #41
    Member nikcoder is offline
    MemberRank
    Apr 2017 Join Date
    PhilippinesLocation
    27Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    it is easy if your php script can read Zone logs.. we dont need to more efforts to do about it, i checked the zone logs seems it tracked the login and logout of the player together also what character is selected and the date and time.. only we need to do is to write a code in php that will monitor the Zones logs txt files..

  12. #42
    Programmer cyberinferno is offline
    True MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    694Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Quote Originally Posted by nikcoder View Post
    it is easy if your php script can read Zone logs.. we dont need to more efforts to do about it, i checked the zone logs seems it tracked the login and logout of the player together also what character is selected and the date and time.. only we need to do is to write a code in php that will monitor the Zones logs txt files..
    Reading zone logs while it's zone is busy writing to it is hassle if you ask me!
    ** Web developer **

  13. #43
    Registered taichinwang is offline
    MemberRank
    Mar 2017 Join Date
    17Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    You can send a request to DBSRV port 8895 for checking user status, but the packet is encrypted. GM Tool uses the way to make sure user is offline before writing data to file. Looking for someone sharing the experience of encryption/decryption.

  14. #44
    Member heinz1 is offline
    MemberRank
    Oct 2015 Join Date
    50Posts

    Re: Does anyone know how to get a list of all online characters/account programmatica

    Quote Originally Posted by master_unknown View Post
    Since you are a pro in Php, I really encourage you to look into the gamelogin.php and enhance that from there.
    And that will also probably solve in multi-client instances in 1 pc.
    As it will record per account who logged in.
    Hi sir, about the record who login and how about the record for logout sir??



Page 3 of 3 FirstFirst 123

Advertisement