Determine online character

Results 1 to 24 of 24
  1. #1
    Valued Member Riko is offline
    MemberRank
    Sep 2009 Join Date
    105Posts

    Question Determine online character

    Hello everyone!

    I need to find the best way to check if a character is online...

    Best solution i found is to trigger the login event in the gamelog db...it also set the logout event, even when you disconnect or kill client process. But with delay.

    Just wanted to know if theres maybe a better way?

    And for people thinking "Why the fuck do he need this?":

    I'm planning to do some web based auction house and need to grab the itemkeys and delete them from tItem...but it isnt that good to do that while the character is online :S

    I thought like uhm...the user can choose his character, then it lists all items in the character's inventory and filter the tradeable\non cs items by looking up the values in the iteminfo/charged effect.

    Then I need to read tItem & tItemOption and transfer to a auction table or something...and delete from tItem :S but with character logged in it cause some bugs.

    Maybe someone got a better way :D

    And pls no flame here @.@ there are like 1000000000000 other threads you can do that


  2. #2
    Gruntilda Gruntilda is offline
    MemberRank
    Apr 2010 Join Date
    468Posts

    Re: Determine online character

    You can't. There is no for-sure way, except using my bot.

  3. #3
    Valued Member Riko is offline
    MemberRank
    Sep 2009 Join Date
    105Posts

    Re: Determine online character

    Quote Originally Posted by Riko View Post
    Best solution i found is to trigger the login event in the gamelog db...it also set the logout event, even when you disconnect or kill client process.
    so this wont work that good?

  4. #4
    Account Upgraded | Title Enabled! Charisma Doll is offline
    MemberRank
    Oct 2012 Join Date
    Wonderland.Location
    256Posts

    Re: Determine online character

    No. My idea. D:

  5. #5
    Valued Member Riko is offline
    MemberRank
    Sep 2009 Join Date
    105Posts

    Re: Determine online character

    :/ haha shit...maybe we can work together on it? I still dont know if I should do it as web-app since I suck in web stuff...it's like hacked in 5 minutes

    I would rather do a wpf/xaml app...way easier for me ^^;

  6. #6
    -.- NextIdea is offline
    MemberRank
    Nov 2012 Join Date
    343Posts

    Re: Determine online character

    If character is logged in you dc him. Also make sure you add a warning about that.

  7. #7
    Valued Member Riko is offline
    MemberRank
    Sep 2009 Join Date
    105Posts

    Re: Determine online character

    How should I dc him? I got no control over the TCP... could do that using something like a tunnel but mhm

  8. #8
    Rada Rada. Delius is offline
    MemberRank
    Jul 2012 Join Date
    AustraliaLocation
    431Posts

    Re: Determine online character

    &kickout PlayerName xD

  9. #9
    Valued Member Riko is offline
    MemberRank
    Sep 2009 Join Date
    105Posts

    Re: Determine online character

    haha i need to call that from code, or do you think I watch every item move in the auction house and the linked character?

    atm i do it like this:

    Code:
    AFTER INSERT AS
    	DECLARE @nType int
    	DECLARE @nCharNo int
    
    			SELECT @nType = ins.nType FROM inserted ins
    			SELECT @nCharNo = ins.nCharNo FROM inserted ins
    			
    			IF ( @nType = '10')
    			BEGIN
    			INSERT tOnlineChar (nCharNo, dDate) VALUES (@nCharNo, GETDATE())
    			END
    
    			IF ( @nType = '11')
    			BEGIN
    			DELETE FROM tOnlineChar WHERE nCharNo = @nCharNo
    			END

    that way i can check if online or not...and just to update my first post, there is no delay D:

    event id 10 should be login and 11 logout...not sure tho

  10. #10
    ExtrinsicStudio™ Myth is offline
    MemberRank
    Jan 2012 Join Date
    367Posts

    Re: Determine online character

    Why not take a look at the OPTool; it has a disconnect feature, you might be able to create your own application that parses a request to the world-manager to kick a player, which you could then incorporated into your Auction House as an automated back-end process.

  11. #11
    Valued Member Riko is offline
    MemberRank
    Sep 2009 Join Date
    105Posts

    Re: Determine online character

    Oh, the optool got that? Didnt noticed! Yeah i will take a look on it :D

  12. #12
    Mr. Kenshin Alsm97 is offline
    MemberRank
    Oct 2010 Join Date
    SwedenLocation
    202Posts

    Re: Determine online character

    Yo,

    This is actually quite the interesting thread. If I may, could somebody explain how exactly the OP Tool works? Does it command the World Manager directly and how can I that pull that out? I'd like to try making a useful App with the features that I personally need, and once it's done I can share it if you guys want to.
    Thanks in advance! Have a good morning!

    PS: Oh and also I can only go as far as C#, I hope that 'll be enough. I have never touched C++, only had a little sneak peak.

    Regards,
    Alex

  13. #13
    Valued Member Riko is offline
    MemberRank
    Sep 2009 Join Date
    105Posts

    Re: Determine online character

    You can do that in c# heres an example made by "csharp/kerelmans" it seems he took it down on his github.

    GM_TCP_Shout

  14. #14
    Mr. Kenshin Alsm97 is offline
    MemberRank
    Oct 2010 Join Date
    SwedenLocation
    202Posts

    Re: Determine online character

    Thank you very much for the quick reply! I got a little issues here... haha

    http://gyazo.com/41b7521901141a8abf3fcc7fc0a434dd


  15. #15
    Valued Member Riko is offline
    MemberRank
    Sep 2009 Join Date
    105Posts

    Re: Determine online character

    mhm try now

  16. #16
    Mr. Kenshin Alsm97 is offline
    MemberRank
    Oct 2010 Join Date
    SwedenLocation
    202Posts

    Re: Determine online character

    Thanks, worked. :D

    EDIT: Shit, I've always been bad with network stuff.. xD I'll understand how it exactly works eventually.. Thanks for sharing this with me tho :)!

  17. #17
    Gruntilda Gruntilda is offline
    MemberRank
    Apr 2010 Join Date
    468Posts

    Re: Determine online character

    The Kickout command @ OPTool never worked.

    At least the one I tried didn't.

  18. #18
    Mr. Kenshin Alsm97 is offline
    MemberRank
    Oct 2010 Join Date
    SwedenLocation
    202Posts

    Re: Determine online character

    I'll see what I can do.. Just opening the project file got me confused.. xD

  19. #19
    Coeven Tronic is offline
    MemberRank
    Apr 2010 Join Date
    LocalhostLocation
    238Posts

    Re: Determine online character

    i have been working on this long time ago on php, i think theres a db table on new files that says the online characters i was using that table to check if user was online ,if both characters were online trade cant be made untill both characters are off. its a lot of work to finish something like that xD. you can create like a character ID = 0 and edit nOwner on tItems every time someone wants to sell their items, so its easier to check which items are in auction ( i think you can do this while character is logged in, if he wants to move the item says something like "Failed to move item") i think seller can be online but the ones that buy cant D:

  20. #20
    Gruntilda Gruntilda is offline
    MemberRank
    Apr 2010 Join Date
    468Posts

    Re: Determine online character

    The online character table is untrustworthy.

  21. #21
    -.- NextIdea is offline
    MemberRank
    Nov 2012 Join Date
    343Posts

    Re: Determine online character

    It may be or not, but for first try it's a good place to start.

    As for the auction:
    * To add an item it's is best that the Character is logged off. If player adds and item, that character will be disconnected from server, no exceptions (You warn before doing it so players get used to it). Getting the "Failed to move" message and not able to use that slot is annoying, also less errors in Services.
    * As for buying character must be logged off too, because removing money would cause problems. When you remove money while player is online and he logs off I think it gets money back as the money is overwritten. As for money reciever you add it to auction Account and can claim it when that Character is offline or disconnect it before add. For item you could use reward inventory, should be possible.

  22. #22
    Valued Member Riko is offline
    MemberRank
    Sep 2009 Join Date
    105Posts

    Re: Determine online character

    uhm i thought i could do like let the user deposit money in the auction table and then i subtract/add money in there...so they can purchase stuff while they are online.

    I tested the reward bag and its working good (with normal items), just adding CS items to it wont work. They are not useable...using a Mystery Vault or stuff work tho.

  23. #23
    ExtrinsicStudio™ Myth is offline
    MemberRank
    Jan 2012 Join Date
    367Posts

    Re: Determine online character

    Makes me want to try doing something like this, even though there's one in-game.

    Only space I can think of that may not be effected whether they're online or offline is normal Storage (like Guild Storage), as it requests content each time a user opens it up (including the money stored).

  24. #24
    Valued Member Riko is offline
    MemberRank
    Sep 2009 Join Date
    105Posts

    Re: Determine online character

    Isnt the user able to dupe then? If he's online and open the storage with money in and then put money to auction house the money would be still ingame, same for items. I would need to block the whole account then. :S



Advertisement