-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from Lacyway/implement-voice-change
Add voice change route & fix abstract class
- Loading branch information
Showing
14 changed files
with
58 additions
and
14 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
Fuyu.Backend.BSG/Models/Requests/GameProfileVoiceChangeRequest.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,10 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Fuyu.Backend.BSG.Models.Requests; | ||
|
||
[DataContract] | ||
public class GameProfileVoiceChangeRequest | ||
{ | ||
[DataMember(Name = "voice")] | ||
public string Voice { get; set; } | ||
} |
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
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
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
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
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
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
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
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
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
34 changes: 34 additions & 0 deletions
34
Fuyu.Backend.EFT/Controllers/Http/GameProfileVoiceChangeController.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,34 @@ | ||
using System.Threading.Tasks; | ||
using Fuyu.Backend.BSG.Models.Requests; | ||
using Fuyu.Backend.BSG.Models.Responses; | ||
using Fuyu.Backend.EFT.Networking; | ||
using Fuyu.Common.Serialization; | ||
|
||
namespace Fuyu.Backend.EFT.Controllers.Http; | ||
|
||
public class GameProfileVoiceChangeController : AbstractEftHttpController<GameProfileVoiceChangeRequest> | ||
{ | ||
private readonly EftOrm _eftOrm; | ||
|
||
public GameProfileVoiceChangeController() : base("/client/game/profile/voice/change") | ||
{ | ||
_eftOrm = EftOrm.Instance; | ||
} | ||
|
||
public override Task RunAsync(EftHttpContext context, GameProfileVoiceChangeRequest body) | ||
{ | ||
var profile = _eftOrm.GetActiveProfile(context.GetSessionId()); | ||
|
||
profile.Pmc.Info.Voice = body.Voice; | ||
|
||
// TODO: Save profile | ||
|
||
var response = new ResponseBody<object>() | ||
{ | ||
data = null | ||
}; | ||
|
||
var text = Json.Stringify(response); | ||
return context.SendJsonAsync(text, true, true); | ||
} | ||
} |
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
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
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