Page 1 of 3 123 LastLast
Results 1 to 15 of 35

Hybrid View

  1. #1
    FlashFlyyy's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    141
    Reputation
    10
    Thanks
    19
    My Mood
    Amazed

    Trying to implement the 'FriendsList'

    So now that I am able to obtain the XML data returned from making requests to the prod server (thanks to @Nobody77), I have decided I try implement the 'friendsList' functionality.


    For the client,


    Therefore I know that I must create a directory called 'friends' within the 'server' directory and have the following files,


    To implement the request handlers I was thinking about adding more tables to my database and storing the data of each friend added within there, etc. Then loading it when the request is made (for getList.cs). Likewise, for 'getRequests' I will search another table for the requests of the particular user.
    (these I think are easy to implement)
    The other requests are simple transactions on the database I believe.



    But what about the other (non-url) constants such as 'JumpServer', 'Whisper', etc.? Do I need to create files for these as well? Or are these built into the client itself already?
    How would I go about implementing these on the server?

    Any hints or information regarding implementing 'friendsList' will be hugely appreciated!
    Last edited by FlashFlyyy; 07-10-2018 at 04:21 PM.

  2. #2
    sgrawsreghawrhgwrhgr's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    UK
    Posts
    516
    Reputation
    10
    Thanks
    729
    My Mood
    Angelic
    Those I believe are built into the client.

    DB-wise, you don't need to store much information for friends, all you really need is 3 int arrays, for blocked requests, accepted requests (friends), and pending requests. Those numbers are the account IDs, and with those, you can get all the other necessary information to use for the exports (such as account name, whether the user is on-line and an alive character).

  3. #3
    FlashFlyyy's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    141
    Reputation
    10
    Thanks
    19
    My Mood
    Amazed
    Quote Originally Posted by Nobody77 View Post
    Those I believe are built into the client.

    DB-wise, you don't need to store much information for friends, all you really need is 3 int arrays, for blocked requests, accepted requests (friends), and pending requests. Those numbers are the account IDs, and with those, you can get all the other necessary information to use for the exports (such as account name, whether the user is on-line and an alive character).
    Is this similar to how 'locked' and 'ignored' players are dealt with?
    Do I need to analyse packets in order to know the name of the player to be added/blocked?

  4. #4
    sgrawsreghawrhgwrhgr's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    UK
    Posts
    516
    Reputation
    10
    Thanks
    729
    My Mood
    Angelic
    I & Mike had friend lists done some time ago (dead project now), and from what I remember, friends are handled entirely via requests, and the only thing you need to analyze from that is the usual stuff (guid & password) etc..

    Most if not all of the friend requests that actually manage things (like remove, block, accept or add friends), come with this same exact query of guid, password and targetName. What you want to do is use targetName to figure out the accountId of the account (if it exists of course), and then add it to one of the arrays mentioned above. Accept/remove/block requests are very straightforward, you should have those done in no time, they're handled in a very similar way to locking/ignoring.

    Requests like friends/getRequests or friends/getList do not use the additional query, as they don't need it, but that's when you need to use the pending, accepted int arrays, which are just account IDs. You use those to figure out many things that you have to export back to the client. getList requires things like character data of some character (just get a random alive character, or last logged in one from the account after you resolve it with the ID), whether the user is on-line, and probably some other small things (I do not remember, you can always send a request to production if you're unsure). getRequests is very similar to that I believe.
    So you essentially take in all the numbers from the accepted friends array, get data for them (an alive character, whether the user is on-line and what-not), and then export it, similar to what you had with the arena leader-boards I would assume
    Last edited by sgrawsreghawrhgwrhgr; 07-11-2018 at 03:33 AM.

  5. The Following User Says Thank You to sgrawsreghawrhgwrhgr For This Useful Post:

    FlashFlyyy (07-11-2018)

  6. #5
    FlashFlyyy's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    141
    Reputation
    10
    Thanks
    19
    My Mood
    Amazed
    I sent a request to the prod servers to get the XML structure for 'getRequests' and noticed that the 'Online' tag has data similar to an IP address...? But then I googled my public IP and they do not match. What is the data stored in the 'Online' tag?

    Thanks so much!

  7. #6
    sgrawsreghawrhgwrhgr's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    UK
    Posts
    516
    Reputation
    10
    Thanks
    729
    My Mood
    Angelic
    I'm not sure, they might have changed how it functions with the new DECA UI rework, but I'm sure exporting it as 0 is off-line, and 1 is on-line

  8. The Following User Says Thank You to sgrawsreghawrhgwrhgr For This Useful Post:

    FlashFlyyy (07-11-2018)

  9. #7
    FlashFlyyy's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    141
    Reputation
    10
    Thanks
    19
    My Mood
    Amazed
    Furthermore, what happens when a player's friend request is blocked? I checked on prod and it says "Would you like to block this person forever"... So does that mean once a person's request is blocked it cannot be undone in the client?

  10. #8
    sgrawsreghawrhgwrhgr's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    UK
    Posts
    516
    Reputation
    10
    Thanks
    729
    My Mood
    Angelic
    It means that the player can no longer receive friend requests from that person (as you'd expect). I guess it is forever, as I don't think the client has any UI for blocked requests where you could unblock etc..

  11. #9
    FlashFlyyy's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    141
    Reputation
    10
    Thanks
    19
    My Mood
    Amazed
    Quote Originally Posted by Nobody77 View Post
    It means that the player can no longer receive friend requests from that person (as you'd expect). I guess it is forever, as I don't think the client has any UI for blocked requests where you could unblock etc..
    How do I obtain the 'targetName'? I looked at how trades are done and found this,
    Code:
    var target = Owner.GetPlayerByName(pkt.Name);
    But this means I need to handle packets? How would I get the value of 'targetName' in 'AcceptRequest' for example?

    In the client I have found this,
    Code:
        private function onSearchFriendClicked(_arg_1:MouseEvent):void {
            this.actionSignal.dispatch(FriendConstant.SEARCH, this._nameInput.text());
        }
    Code:
        private function onAcceptClicked(_arg_1:MouseEvent):void {
            actionSignal.dispatch(FriendConstant.ACCEPT, this._senderName);
        }
    Am I right in thinking,
    'this._nameInput.text()' = current user
    'this._senderName' = target user

    Or is it the other way round?
    Last edited by FlashFlyyy; 07-11-2018 at 04:28 AM.

  12. #10
    sgrawsreghawrhgwrhgr's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    UK
    Posts
    516
    Reputation
    10
    Thanks
    729
    My Mood
    Angelic
    Quote Originally Posted by FlashFlyyy View Post
    How do I obtain the 'targetName'? I looked at how trades are done and found this,
    Code:
    var target = Owner.GetPlayerByName(pkt.Name);
    But this means I need to handle packets? How would I get the value of 'targetName' in 'AcceptRequest' for example?
    query["targetName"];

  13. The Following User Says Thank You to sgrawsreghawrhgwrhgr For This Useful Post:

    FlashFlyyy (07-11-2018)

  14. #11
    FlashFlyyy's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    141
    Reputation
    10
    Thanks
    19
    My Mood
    Amazed
    Quote Originally Posted by Nobody77 View Post
    query["targetName"];
    Was thinking that, but I didn't see any usage in the server so I thought it wouldn't work. Thanks!

    - - - Updated - - -

    Quote Originally Posted by Nobody77 View Post
    query["targetName"];
    Does
    Code:
     query["targetName"]
    return a string name or account id?

  15. #12
    sgrawsreghawrhgwrhgr's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    UK
    Posts
    516
    Reputation
    10
    Thanks
    729
    My Mood
    Angelic
    Quote Originally Posted by FlashFlyyy View Post
    Was thinking that, but I didn't see any usage in the server so I thought it wouldn't work. Thanks!

    - - - Updated - - -



    Does
    Code:
     query["targetName"]
    return a string name or account id?
    It returns the name, you have to figure out the AccountId by using the name (e.g. look for an account that has that name, and then get its account ID)

  16. #13
    sebastianfra12's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    361
    Reputation
    21
    Thanks
    75
    My Mood
    Inspired
    Nice try. :P

  17. #14
    FlashFlyyy's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    141
    Reputation
    10
    Thanks
    19
    My Mood
    Amazed
    Quote Originally Posted by sebastianfra12 View Post
    Nice try. :P
    Thank you! Took me a really long time
    Btw, do you know the old XML data returned from the server before the new friendslist update?

  18. #15
    sgrawsreghawrhgwrhgr's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    UK
    Posts
    516
    Reputation
    10
    Thanks
    729
    My Mood
    Angelic
    This is how the XML data was structured on the project I mentioned above, it too used the X2 client, though I can't remember if we made any modifications to the friend lists:
    getRequests : https://hastebin.com/bevadudoso.xml
    getList : https://hastebin.com/oharatihok.xml


    Looking at it now it's quite a lot, and I'm sure you could minimize it to just the essentials (Texture, Online, Name and what-not, I'm sure you don't need all the ClassStats etc.)
    Last edited by sgrawsreghawrhgwrhgr; 07-11-2018 at 12:19 PM.

  19. The Following User Says Thank You to sgrawsreghawrhgwrhgr For This Useful Post:

    FlashFlyyy (07-11-2018)

Page 1 of 3 123 LastLast

Similar Threads

  1. I'm trying to contact the owner of this site
    By dasani in forum Suggestions, Requests & General Help
    Replies: 1
    Last Post: 12-01-2008, 08:12 PM
  2. Error im getting when trying to use the nexon plugin
    By mpghhackersrock123 in forum WarRock Korea Hacks
    Replies: 4
    Last Post: 03-16-2008, 09:38 AM
  3. Replies: 12
    Last Post: 10-24-2007, 04:33 AM
  4. probem when i try to open the hack
    By klota in forum WarRock - International Hacks
    Replies: 1
    Last Post: 07-25-2007, 12:40 AM