FlashFlyyy (07-11-2018)
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.
FlashFlyyy (07-11-2018)
You do need the ClassStats I think.
Btw, I fixed up my XML structure but still not working. Keep getting a black faded screen when I click on 'Social' -_-
Also there is no request for '/friends/getRequests', so Idk
When I make '/friends/getList' return an error, client requests '/friends/getRequests' and this is the XML data. But still black faded screen -.-
This is my '/friends/getRequest' XML example data,
This is my '/friends/getList' XML example data,Code:<Requests> <Account> <Character> <ObjectType>782</ObjectType> <Level>1</Level> <Exp>0</Exp> <CurrentFame>0</CurrentFame> <Texture>0</Texture> </Character> <Name>TestOne</Name> <Online>0</Online> <Stats> <ClassStats objectType="0x30e"> <BestLevel>1</BestLevel> <BestFame>45</BestFame> </ClassStats> <BestCharFame>0</BestCharFame> <TotalFame>1045</TotalFame> <Fame>1045</Fame> </Stats> </Account> </Requests>
EDITCode:<Friends> <Account> <Character> <ObjectType>782</ObjectType> <Level>1</Level> <Exp>36</Exp> <CurrentFame>0</CurrentFame> <Texture>0</Texture> </Character> <Name>TestTwo</Name> <Online>0</Online> <Stats> <ClassStats objectType="0x30e"> <BestLevel>1</BestLevel> <BestFame>45</BestFame> </ClassStats> <ClassStats objectType="0x31f"> <BestLevel>9</BestLevel> <BestFame>3</BestFame> </ClassStats> <BestCharFame>3</BestCharFame> <TotalFame>1045</TotalFame> <Fame>45</Fame> </Stats> </Account> </Friends>
- tried 'objectType' as int instead of hex but doesn't change anything
- strange thing is, why was I able to see the box when it was giving errors? But when I give it data it doesn't work?
- btw, the commands such as 'Add Friend' work perfectly as I have used them using the tooltip box thing. So only problem is this thing :@
- btw,
If the XML data is correct then perhaps the issue might be this,
Should I be writing something else?Code:(...) result += "</Requests>"; byte[] buf = Encoding.UTF8.GetBytes(result); Context.Response.OutputStream.Write(buf, 0, buf.Length); using (StreamWriter wtr = new StreamWriter(Context.Response.OutputStream)) wtr.Write("<Success/>");
OH ****************
I REMOVED THE HIGHLIGHTED PART AND IT WORKS NOW!!! OMFG :OOOOO
Btw,
What should "{amount}" be? So I can display the friend count?
https://i.gyazo.com/146b310145cfde89...f4f3513a39.mp4
Last edited by FlashFlyyy; 07-11-2018 at 03:26 PM.
Try simply exporting <Friends></Friends> & <Requests></Requests>. If those don't work (still black screen), then you're doing something wrong, I unfortunately do not remember exactly how the whole friend-list mechanic works, but the things I put above should 100% work, you must be able to open the UI by exporting them, and if the UI does not open, you're most likely not handling your requests correctly (perhaps you mixed them up somewhere, just have a recheck)
FlashFlyyy (07-11-2018)
It's fine it works!
Btw,
1. What should "{amount}" be? So I can display the friend count?
https://gyazo.com/146b310145cfde89205262f4f3513a39
2. Does the 'Search' functionality not work as it is not implemented?
Should this in the client be:Code:public static const SEARCH:String = "searchFriend";
Then make another handler for it?Code:public static const SEARCH:String = "/searchFriend";
3. When a player has no friends they can't open their friends list. What XML should I pass when there's no data? I thought of,
But this doesn't work.Code:<Friends> </Friends>
Last edited by FlashFlyyy; 07-11-2018 at 03:49 PM.
1) Look into the client to see how it handles the {amount} stuff, but I think you're using the new production language strings that have different stuff
Take a look here: https://hastebin.com/abukizihen.json
Those are the strings that we used, and everything looked okay, don't just copy & paste it as I believe it has some differences (as it was a custom server project), just look over the friends stuff
2) I don't think it is implemented, you'd have to debug that a little, try logging if a request/unknown packet is sent to server
3) That should work fine, check over your code
FlashFlyyy (07-11-2018)
Last edited by FlashFlyyy; 07-11-2018 at 04:39 PM.
Yeah my bad, I was thinking you exported <Friends></Friends>, didn't see the other CMD.
Either way, I was wrong.
Export <Friends/> & <Requests/> if you don't have anything else to export, that should be good (that's what we did at least, other option should work the same)
Last edited by sgrawsreghawrhgwrhgr; 07-11-2018 at 04:43 PM.
FlashFlyyy (07-11-2018)
Last edited by FlashFlyyy; 07-11-2018 at 04:56 PM.
DevilRotMG (07-12-2018),FlashFlyyy (07-12-2018)
I'm assuming you only have 1 server, so the IP would just be the ip of the server in server.cfg
This is how NR-Core get's the usersCode:var servers = player.Manager.InterServer.GetServerList(); foreach (var server in servers) foreach (PlayerInfo plr in server.playerList) { if (!plr.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase) || plr.Hidden && !player.Client.Account.Admin) continue; player.SendInfo($"{plr.Name} is playing on {server.name} at [{plr.WorldInstance}]{plr.WorldName}."); return true; }
DevilRotMG (07-12-2018)