-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Packet 157 - Get User Remote Screenshots
Added Outbound Packet UserScreenshots * This would give you a list of screenshots given the metadata sent. * Major thanks to Zelaron just plugging away at it until we cracked the code Added Screenshot Model * Written by Zelaron, this Model holds all the relevant data for a screenshot. * Per usual, this is a frontened-orientated packet, so it has no runtime functionality, but is ready to accept and send data. Usual MessageType added.
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
|
||
namespace PFire.Core.Entities | ||
{ | ||
public class Screenshot | ||
{ | ||
public int Id { get; set; } = 0; | ||
public bool AdultContent { get; set; } = false; | ||
public string FileName { get; set; } | ||
public string Description { get; set; } = ""; | ||
public DateTime Uploaded { get; set; } | ||
public DateTime Created { get; set; } | ||
public string GameShortName { get; set; } = ""; | ||
public string GameLongName { get; set; } = ""; | ||
public string Nickname { get; set; } = ""; | ||
public int ViewCount { get; set; } = 0; | ||
public int ServerIp { get; set; } = 0; | ||
public int ServerPort { get; set; } = 0; | ||
public int GameId { get; set; } = 0; | ||
public int FileSize { get; set; } = 0; | ||
public int CreatedUnixTimestamp { get; set; } | ||
public int LockedState { get; set; } = 0; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/PFire.Core/Protocol/Messages/Outbound/UserScreenshots.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using PFire.Core.Protocol.Messages; | ||
using PFire.Core.Protocol; | ||
using PFire.Core.Session; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using PFire.Core.Entities; | ||
|
||
/* | ||
* Packet 157 - Remote User Screenshots | ||
* This is a list pulled from the server that are remote screenshots by the user. | ||
* Interestingly, if you push the packet every log in, it will just add in the client itself. | ||
* | ||
*/ | ||
|
||
internal sealed class UserScreenshots : XFireMessage | ||
{ | ||
public UserScreenshots() : base(XFireMessageType.UserScreenshots) | ||
{ | ||
} | ||
|
||
public UserScreenshots(IEnumerable<Screenshot> screenshots) : base(XFireMessageType.UserScreenshots) | ||
{ | ||
foreach (var screen in screenshots) | ||
{ | ||
ScreenshotIds.Add(screen.Id); | ||
GameIds.Add(screen.GameId); | ||
ServerIps.Add(screen.ServerIp); | ||
GamePorts.Add(screen.ServerPort); | ||
Descriptions.Add(screen.Description); | ||
Created.Add(screen.CreatedUnixTimestamp); | ||
LockedState.Add(screen.LockedState); | ||
Filenames.Add(screen.FileName); | ||
Filesizes.Add(screen.FileSize); | ||
} | ||
} | ||
|
||
[XMessageField(0x5c)] | ||
public List<int> ScreenshotIds { get; set; } = new(); | ||
[XMessageField(0x21)] | ||
public List<int> GameIds { get; set; } = new(); | ||
[XMessageField(0x22)] | ||
public List<int> ServerIps { get; set; } = new(); | ||
[XMessageField(0x23)] | ||
public List<int> GamePorts { get; set; } = new(); | ||
[XMessageField(0x54)] | ||
public List<string> Descriptions { get; set; } = new(); | ||
[XMessageField(0x50)] | ||
public List<int> Created { get; set; } = new(); | ||
[XMessageField(0x5d)] | ||
public List<int> LockedState { get; set; } = new(); | ||
[XMessageField(0x5e)] | ||
public List<string> Filenames { get; set; } = new(); | ||
[XMessageField(0x55)] | ||
public List<int> Filesizes { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters