-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add C# model repository in preparation to remove protobuf. Implement …
…ASP.NET API
- Loading branch information
Showing
82 changed files
with
9,367 additions
and
7,164 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,68 @@ | ||
using System.Collections.Generic; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace SubterfugeCore.Models.GameEvents | ||
{ | ||
public interface INetworkAccountManager | ||
{ | ||
AuthorizationResponse Login(AuthorizationRequest request); | ||
AuthorizationResponse LoginWithToken(AuthorizedTokenRequest tokenRequest); | ||
AuthorizationResponse RegisterAccount(AccountRegistrationRequest registrationRequeset); | ||
GetRolesResponse GetRoles(GetRolesRequest roleRequest); | ||
} | ||
|
||
public class User | ||
{ | ||
public string Id { get; set; } | ||
public string Username { get; set; } | ||
} | ||
|
||
public class AuthorizationRequest | ||
{ | ||
public string Username { get; set; } | ||
public string Password { get; set; } | ||
} | ||
|
||
public class AuthorizedTokenRequest | ||
{ | ||
public string Token { get; set; } | ||
} | ||
|
||
public class AuthorizationResponse : NetworkResponse | ||
{ | ||
public User User { get; set; } | ||
public string Token { get; set; } | ||
} | ||
|
||
public class AccountRegistrationRequest | ||
{ | ||
public string Username { get; set; } | ||
public string Password { get; set; } | ||
public string Email { get; set; } | ||
public string DeviceIdentifier { get; set; } | ||
public string PhoneNumber { get; set; } | ||
} | ||
|
||
public class AccountRegistrationResponse : NetworkResponse | ||
{ | ||
public User User { get; set; } | ||
public string Token { get; set; } | ||
} | ||
|
||
public class GetRolesRequest {} | ||
|
||
public class GetRolesResponse : NetworkResponse | ||
{ | ||
public List<UserClaim> Claims { get; set; } | ||
} | ||
|
||
public enum UserClaim | ||
{ | ||
Unknown, | ||
User, | ||
Moderator, | ||
Administrator, | ||
EmailVerified, | ||
Banned, | ||
} | ||
} |
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,27 @@ | ||
using System; | ||
|
||
namespace SubterfugeCore.Models.GameEvents | ||
{ | ||
public interface INetworkHealthInterface | ||
{ | ||
PingResponse Ping(PingRequest pingRequest); | ||
PingResponse AuthorizedHealthCheck(AuthorizedPingRequest authorizedPingRequest); | ||
} | ||
|
||
public class NetworkResponse | ||
{ | ||
public ResponseStatus Status { get; set; } | ||
} | ||
|
||
public class ResponseStatus | ||
{ | ||
public Boolean IsSuccess { get; set; } | ||
public String Detail { get; set; } | ||
} | ||
|
||
public class PingRequest { } | ||
|
||
public class PingResponse : NetworkResponse { } | ||
|
||
public class AuthorizedPingRequest { } | ||
} |
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,94 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace SubterfugeCore.Models.GameEvents | ||
{ | ||
|
||
public interface INetworkChatManager | ||
{ | ||
CreateMessageGroupResponse CreateMessageGroup(CreateMessageGroupRequest createMessageGroupRequest); | ||
|
||
SendMessageResponse SendMessage(SendMessageRequest sendMessageRequest); | ||
|
||
GetMessageGroupsResponse GetMessageGroups(GetMessageGroupsRequest getMessageGroupsRequest); | ||
|
||
GetGroupMessagesResponse GetGroupMessages(GetGroupMessagesRequest getGroupMessagesRequest); | ||
} | ||
|
||
public class MessageGroupDatabaseModel | ||
{ | ||
public string Id { get; set; } | ||
public string RoomId { get; set; } | ||
public List<string> MemberIds { get; set; } | ||
} | ||
|
||
public class MessageGroup | ||
{ | ||
public string Id { get; set; } | ||
public string RoomId { get; set; } | ||
public List<User> GroupMembers { get; set; } | ||
public List<ChatMessage> Messages { get; set; } | ||
|
||
public MessageGroupDatabaseModel ToDatabaseModel() | ||
{ | ||
return new MessageGroupDatabaseModel() | ||
{ | ||
Id = Id, | ||
RoomId = RoomId, | ||
MemberIds = GroupMembers.Select(it => it.Id).ToList() | ||
}; | ||
} | ||
} | ||
|
||
public class ChatMessage | ||
{ | ||
public string RoomId { get; set; } | ||
public string GroupId { get; set; } | ||
public string Id { get; set; } | ||
public long UnixTimeCreatedAt { get; set; } | ||
public User SentBy { get; set; } | ||
public string Message { get; set; } | ||
} | ||
|
||
public class CreateMessageGroupRequest | ||
{ | ||
public string RoomId { get; set; } | ||
public List<string> UserIdsInGroup { get; set; } | ||
} | ||
|
||
public class CreateMessageGroupResponse : NetworkResponse | ||
{ | ||
public string GroupId { get; set; } | ||
} | ||
|
||
public class SendMessageRequest | ||
{ | ||
public string RoomId { get; set; } | ||
public string GroupId { get; set; } | ||
public string Message { get; set; } | ||
} | ||
|
||
public class SendMessageResponse : NetworkResponse { } | ||
|
||
public class GetMessageGroupsRequest | ||
{ | ||
public string RoomId { get; set; } | ||
} | ||
|
||
public class GetMessageGroupsResponse : NetworkResponse | ||
{ | ||
private List<MessageGroup> MessageGroups { get; set; } | ||
} | ||
|
||
public class GetGroupMessagesRequest | ||
{ | ||
public string RoomId { get; set; } | ||
public string GroupId { get; set; } | ||
public long Pagination { get; set; } | ||
} | ||
|
||
public class GetGroupMessagesResponse : NetworkResponse | ||
{ | ||
public MessageGroup Group { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SubterfugeCore.Models.GameEvents | ||
{ | ||
public interface INetworkCustomSpeicliastManager | ||
{ | ||
|
||
SubmitCustomSpecialistResponse SubmitCustomSpecialist( | ||
SubmitCustomSpecialistRequest submitCustomSpecialistRequest); | ||
|
||
GetCustomSpecialistsResponse GetCustomSpecialists(GetCustomSpecialistsRequest getCustomSpecialistsRequest); | ||
|
||
CreateSpecialistPackageResponse CreateSpecialistPackage(CreateSpecialistPackageRequest createSpecialistPackageRequest); | ||
|
||
GetSpecialistPackagesResponse GetSpecialistPackages(GetSpecialistPackagesRequest getSpecialistPackagesRequest); | ||
} | ||
|
||
public class SpecialistConfiguration | ||
{ | ||
public string Id { get; set; } | ||
public long Priority { get; set; } | ||
public string SpecialistName { get; set; } | ||
public User Creator { get; set; } | ||
public List<SpecialistEffectConfiguration> SpecialistEffects { get; set; } | ||
public string PromotesFromSpecialistId { get; set; } | ||
public List<SpecialistClass> SpecialistClasses { get; set; } | ||
} | ||
|
||
public class SpecialistEffectConfiguration | ||
{ | ||
public long Value { get; set; } | ||
public EffectTrigger EffectTrigger { get; set; } | ||
public EffectTarget EffectTarget { get; set; } | ||
public EffectTriggerRange EffectTriggerRange { get; set; } | ||
public EffectModifier EffectModifier { get; set; } | ||
public SpecialistEffectScale EffectScale { get; set; } | ||
} | ||
|
||
public class SpecialistEffectScale { | ||
public EffectScale EffectScale { get; set; } | ||
public EffectTarget EffectScaleTarget { get; set; } | ||
public EffectTriggerRange EffectTriggerRange { get; set; } | ||
} | ||
|
||
public enum SpecialistClass | ||
{ | ||
Unknown, | ||
Warrier, | ||
Protector, | ||
Theif, | ||
Zoner, | ||
Investor, | ||
Controller, | ||
Producer, | ||
Influencer, | ||
Leecher, | ||
Zoomer, | ||
Piercer, | ||
} | ||
|
||
public enum EffectTrigger | ||
{ | ||
NoTrigger, | ||
Hire, | ||
Promote, | ||
SubLaunch, | ||
SubArrive, | ||
OutpostCombat, | ||
SubCombat, | ||
CombatLoss, | ||
CombatVictory, | ||
FactoryProduce, | ||
MineProduce, | ||
SubEnterVision, | ||
} | ||
|
||
public enum EffectTarget | ||
{ | ||
NoTarget, | ||
Friendly, | ||
Enemy, | ||
OnlyCombatParticipants, | ||
Any, | ||
} | ||
|
||
public enum EffectTriggerRange | ||
{ | ||
Self, | ||
Local, | ||
ConstantRange, | ||
LocationVisionRange, | ||
PlayerVisionRange, | ||
Global, | ||
} | ||
|
||
public enum EffectModifier | ||
{ | ||
NoEffect, | ||
Driller, | ||
SpecialistCapacity, | ||
ShieldValue, | ||
ShieldRegenerationRate, | ||
ShieldMaxValue, | ||
VisionRange, | ||
Speed, | ||
KillPlayer, | ||
VictoryPlayer, | ||
NeptuniumGenerationRate, | ||
KillSpecialist, | ||
SwapSpecialistOwner, | ||
} | ||
|
||
public enum EffectScale | ||
{ | ||
NoScale, | ||
ConstantValue, | ||
PlayerOutpostCount | ||
} | ||
|
||
public class SpecialistPackage { | ||
public string Id { get; set; } | ||
public User Creator { get; set; } | ||
public string PackageName { get; set; } | ||
public List<string> SpecialistIds { get; set; } | ||
public long TimesUsedInGame { get; set; } | ||
} | ||
|
||
public class SubmitCustomSpecialistRequest | ||
{ | ||
public SpecialistConfiguration SpecialistConfiguration { get; set; } | ||
} | ||
|
||
public class SubmitCustomSpecialistResponse : NetworkResponse | ||
{ | ||
public string SpecialistConfigurationId { get; set; } | ||
} | ||
|
||
public class GetCustomSpecialistsRequest | ||
{ | ||
public long PageNumber { get; set; } | ||
public string SearchTerm { get; set; } | ||
public string PromotesFromSpecialistId { get; set; } | ||
public string CreatedByPlayerId { get; set; } | ||
} | ||
|
||
public class GetCustomSpecialistsResponse : NetworkResponse | ||
{ | ||
public List<SpecialistConfiguration> CustomSpecialists { get; set; } | ||
} | ||
|
||
public class CreateSpecialistPackageRequest | ||
{ | ||
public SpecialistPackage SpecialistPackage { get; set; } | ||
} | ||
|
||
public class CreateSpecialistPackageResponse : NetworkResponse | ||
{ | ||
public string SpecialistPackageId { get; set; } | ||
} | ||
|
||
public class GetSpecialistPackagesRequest | ||
{ | ||
public long PageNumber { get; set; } | ||
public string SearchTerm { get; set; } | ||
public string IsPackageCreatedById { get; set; } | ||
public string PackageContainsSpecialistId { get; set; } | ||
} | ||
|
||
public class GetSpecialistPackagesResponse : NetworkResponse | ||
{ | ||
public List<SpecialistPackage> SpecialistPackages { get; set; } | ||
} | ||
|
||
} |
Oops, something went wrong.