First push

This commit is contained in:
xeon 2024-01-30 02:49:21 +03:00
parent 9bc5bd9531
commit 9448e68f2e
129 changed files with 158558 additions and 0 deletions

7
.editorconfig Normal file
View file

@ -0,0 +1,7 @@
[*.cs]
# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = none
# IDE0290: Use primary constructor
csharp_style_prefer_primary_constructors = false

79
KafkaSR.sln Normal file
View file

@ -0,0 +1,79 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RPG.Network.Proto", "RPG.Network.Proto\RPG.Network.Proto.csproj", "{7DA70126-3F73-407B-A024-5856F354FA97}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RPG.GameCore", "RPG.GameCore\RPG.GameCore.csproj", "{74042D70-7EA0-4348-9BDB-D1E5D0FC868A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{0FF9D567-C413-43F0-9EDF-09D4D36154B7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{F199706E-4A92-4A2F-BDDD-25DA4691D43E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RPG.Services.SDK", "RPG.Services.SDK\RPG.Services.SDK.csproj", "{855DA130-974F-4CE8-8DB5-2BD59DC2C3AA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RPG.Services.Gateserver", "RPG.Services.Gateserver\RPG.Services.Gateserver.csproj", "{EB7A2038-E2AF-4565-944C-D850D6AEAEED}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RPG.Services.Gameserver", "RPG.Services.Gameserver\RPG.Services.Gameserver.csproj", "{565F9857-3E97-4363-9A5D-05CED8718116}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RPG.Services.Core", "RPG.Services.Core\RPG.Services.Core.csproj", "{1B434662-DEC9-40C9-A709-CE87026191D9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D96091AB-B78F-4092-ADEF-7A4D9F1B90C6}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RPG.Services.MUIP", "RPG.Services.MUIP\RPG.Services.MUIP.csproj", "{2E029A8A-8878-4B71-B72B-2881CDE83B71}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7DA70126-3F73-407B-A024-5856F354FA97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DA70126-3F73-407B-A024-5856F354FA97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DA70126-3F73-407B-A024-5856F354FA97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DA70126-3F73-407B-A024-5856F354FA97}.Release|Any CPU.Build.0 = Release|Any CPU
{74042D70-7EA0-4348-9BDB-D1E5D0FC868A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74042D70-7EA0-4348-9BDB-D1E5D0FC868A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74042D70-7EA0-4348-9BDB-D1E5D0FC868A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74042D70-7EA0-4348-9BDB-D1E5D0FC868A}.Release|Any CPU.Build.0 = Release|Any CPU
{855DA130-974F-4CE8-8DB5-2BD59DC2C3AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{855DA130-974F-4CE8-8DB5-2BD59DC2C3AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{855DA130-974F-4CE8-8DB5-2BD59DC2C3AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{855DA130-974F-4CE8-8DB5-2BD59DC2C3AA}.Release|Any CPU.Build.0 = Release|Any CPU
{EB7A2038-E2AF-4565-944C-D850D6AEAEED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB7A2038-E2AF-4565-944C-D850D6AEAEED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB7A2038-E2AF-4565-944C-D850D6AEAEED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB7A2038-E2AF-4565-944C-D850D6AEAEED}.Release|Any CPU.Build.0 = Release|Any CPU
{565F9857-3E97-4363-9A5D-05CED8718116}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{565F9857-3E97-4363-9A5D-05CED8718116}.Debug|Any CPU.Build.0 = Debug|Any CPU
{565F9857-3E97-4363-9A5D-05CED8718116}.Release|Any CPU.ActiveCfg = Release|Any CPU
{565F9857-3E97-4363-9A5D-05CED8718116}.Release|Any CPU.Build.0 = Release|Any CPU
{1B434662-DEC9-40C9-A709-CE87026191D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B434662-DEC9-40C9-A709-CE87026191D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B434662-DEC9-40C9-A709-CE87026191D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B434662-DEC9-40C9-A709-CE87026191D9}.Release|Any CPU.Build.0 = Release|Any CPU
{2E029A8A-8878-4B71-B72B-2881CDE83B71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E029A8A-8878-4B71-B72B-2881CDE83B71}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E029A8A-8878-4B71-B72B-2881CDE83B71}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E029A8A-8878-4B71-B72B-2881CDE83B71}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7DA70126-3F73-407B-A024-5856F354FA97} = {0FF9D567-C413-43F0-9EDF-09D4D36154B7}
{74042D70-7EA0-4348-9BDB-D1E5D0FC868A} = {0FF9D567-C413-43F0-9EDF-09D4D36154B7}
{855DA130-974F-4CE8-8DB5-2BD59DC2C3AA} = {F199706E-4A92-4A2F-BDDD-25DA4691D43E}
{EB7A2038-E2AF-4565-944C-D850D6AEAEED} = {F199706E-4A92-4A2F-BDDD-25DA4691D43E}
{565F9857-3E97-4363-9A5D-05CED8718116} = {F199706E-4A92-4A2F-BDDD-25DA4691D43E}
{1B434662-DEC9-40C9-A709-CE87026191D9} = {0FF9D567-C413-43F0-9EDF-09D4D36154B7}
{2E029A8A-8878-4B71-B72B-2881CDE83B71} = {F199706E-4A92-4A2F-BDDD-25DA4691D43E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9B5CE103-882A-419D-8FA3-89C8642687F6}
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,13 @@
namespace RPG.GameCore.Enums;
public enum AttackDamageType
{
Unknow = 0,
Physical = 1,
Fire = 2,
Ice = 3,
Thunder = 4,
Wind = 5,
Quantum = 6,
Imaginary = 7,
Heal = 8,
}

View file

@ -0,0 +1,12 @@
namespace RPG.GameCore.Enums;
public enum AvatarBaseType
{
Unknown = 0,
Warrior = 1,
Rogue = 2,
Mage = 3,
Shaman = 4,
Warlock = 5,
Knight = 6,
Priest = 7,
}

View file

@ -0,0 +1,6 @@
namespace RPG.GameCore.Enums;
public enum CombatPowerAvatarRarityType
{
CombatPowerAvatarRarityType4 = 4,
CombatPowerAvatarRarityType5 = 5
}

View file

@ -0,0 +1,7 @@
namespace RPG.GameCore.Enums;
public enum EJNAACLHIHI
{
None,
Or,
Add
}

View file

@ -0,0 +1,16 @@
namespace RPG.GameCore.Enums;
public enum GameModeType
{
Unknown = 0,
Town = 1,
Maze = 2,
Train = 3,
Challenge = 4,
RogueExplore = 5,
RogueChallenge = 6,
TownRoom = 7,
Raid = 8,
FarmRelic = 9,
Client = 10,
ChallengeActivity = 11
}

View file

@ -0,0 +1,9 @@
namespace RPG.GameCore.Enums;
public enum MainMissionType
{
None,
Main,
Branch,
Daily,
Maze
}

View file

@ -0,0 +1,8 @@
namespace RPG.GameCore.Enums;
public enum MapEntryType
{
Unknown,
Town,
Mission,
Explore
}

View file

@ -0,0 +1,15 @@
namespace RPG.GameCore.Enums;
public enum RequirementType // AEGBKHMFGPO
{
Unknown = 0,
Auto = 1,
Sequence = 2,
Client = 3,
MultiSequence = 4,
PlayerLevel = 5,
WorldLevel = 6,
MultiEvent = 7,
PrestigeLevel = 8,
HeroPathLevel = 9,
SequenceNextDay = 10
}

View file

@ -0,0 +1,19 @@
namespace RPG.GameCore.Enums;
public enum TutorialTriggerType
{
None = 0,
TutorialFinish = 1,
GetItem = 2,
AnyAvatarToLevel = 3,
GetAvatar = 4,
FinishMainMission = 5,
TaskUnlock = 6,
TakeSubMission = 7,
EnterBattle = 8,
GetAnyLightCone = 9,
AvatarInTeam = 10,
EquipLightCone = 11,
PlayerLevel = 12,
GachaPoolValid = 13,
TriggerPuzzle = 14
}

View file

@ -0,0 +1,14 @@
namespace RPG.GameCore.Excel.Attributes;
[AttributeUsage(AttributeTargets.Class)]
internal class ExcelTableAttribute : Attribute
{
public string Path { get; }
public ExcelType Type { get; }
public ExcelTableAttribute(string path, ExcelType type)
{
Path = path;
Type = type;
}
}

View file

@ -0,0 +1,56 @@
using System.Text.Json.Serialization;
using RPG.GameCore.Enums;
using RPG.GameCore.Excel.Attributes;
using RPG.GameCore.Types;
namespace RPG.GameCore.Excel;
[ExcelTable("AvatarExcelTable.json", ExcelType.Avatar)]
public class AvatarRow : ExcelRow
{
public override uint Id => AvatarID;
public uint AvatarID { get; set; } // 0x10
public TextID AvatarName { get; set; } // 0x14
public TextID AvatarFullName { get; set; } // 0x18
public uint AdventurePlayerID { get; set; } // 0x1C
public string? AvatarVOTag { get; set; } // 0x20
[JsonConverter(typeof(JsonStringEnumConverter))]
public CombatPowerAvatarRarityType Rarity { get; set; } // 0x28
public string? JsonPath { get; set; } // 0x30
public uint NatureID { get; set; } // 0x38
[JsonConverter(typeof(JsonStringEnumConverter))]
public AttackDamageType DamageType { get; set; } // 0x3C
public FixPoint SPNeed { get; set; } // 0x40
public uint ExpGroup { get; set; } // 0x48
public uint MaxPromotion { get; set; } // 0x4C
public uint MaxRank { get; set; } // 0x50
public uint[] RankIDList { get; set; } = []; // 0x58
public ItemConfig[] RewardList { get; set; } = []; // 0x60
public ItemConfig[] RewardListMax { get; set; } = []; // 0x68
public uint[] SkillList { get; set; } = []; // 0x70
[JsonConverter(typeof(JsonStringEnumConverter))]
public AvatarBaseType AvatarBaseType { get; set; } // 0x78
public string? DefaultAvatarModelPath { get; set; } // 0x80
public string? DefaultAvatarHeadIconPath { get; set; } // 0x88
public string? AvatarSideIconPath { get; set; } // 0x90
public string? ActionAvatarHeadIconPath { get; set; } // 0x98
public string? AvatarBaseTypeIconPath { get; set; } // 0xA0
public string? AvatarDialogHalfImagePath { get; set; } // 0xA8
public string? UltraSkillCutInPrefabPath { get; set; } // 0xB0
public string? UIAvatarModelPath { get; set; } // 0xB8
public string? ManikinJsonPath { get; set; } // 0xC0
public TextID AvatarDesc { get; set; } // 0xC8
public string? AIPath { get; set; } // 0xD0
public string? SkilltreePrefabPath { get; set; } // 0xD8
public bool Release { get; set; } // 0xE8
public string? SideAvatarHeadIconPath { get; set; } // 0xF0
public string? WaitingAvatarHeadIconPath { get; set; } // 0xF8
public string? AvatarCutinImgPath { get; set; } // 0x100
public string? AvatarCutinBgImgPath { get; set; } // 0x108
public string? AvatarCutinFrontImgPath { get; set; } // 0x110
public TextID AvatarCutinIntroText { get; set; } // 0x118
public float[] GachaResultOffset { get; set; } = []; // 0x120
public float[] AvatarDropOffset { get; set; } = []; // 0x128
public float[] AvatarTrialOffset { get; set; } = []; // 0x130
}

View file

@ -0,0 +1,5 @@
namespace RPG.GameCore.Excel;
public abstract class ExcelRow
{
public abstract uint Id { get; }
}

View file

@ -0,0 +1,73 @@
using System.Collections.Immutable;
using System.Reflection;
using System.Text.Json;
using Microsoft.Extensions.Logging;
using RPG.GameCore.Excel.Attributes;
namespace RPG.GameCore.Excel;
public class ExcelTables
{
private readonly ILogger _logger;
private ImmutableDictionary<ExcelType, ImmutableArray<ExcelRow>>? _tables;
public ExcelTables(ILogger<ExcelTables> logger)
{
_logger = logger;
}
public TExcelRow? GetExcelRow<TExcelRow>(ExcelType type, uint id) where TExcelRow : ExcelRow
{
if (_tables == null) throw new InvalidOperationException("GetExcelRow called when ExcelTables not loaded.");
if (_tables.TryGetValue(type, out ImmutableArray<ExcelRow> rows))
{
return rows.SingleOrDefault(row => row.Id == id) as TExcelRow;
}
throw new ArgumentException($"GetExcelRow: table for excel type not found {type}");
}
public IEnumerable<ExcelRow> GetAllRows(ExcelType type)
{
if (_tables == null) throw new InvalidOperationException("GetAllRows called when ExcelTables not loaded.");
if (_tables.TryGetValue(type, out ImmutableArray<ExcelRow> rows))
{
return rows;
}
throw new ArgumentException($"GetAllRows: table for excel type not found {type}");
}
public void Load()
{
ImmutableDictionary<ExcelType, ImmutableArray<ExcelRow>>.Builder tables = ImmutableDictionary.CreateBuilder<ExcelType, ImmutableArray<ExcelRow>>();
IEnumerable<Type> types = Assembly.GetExecutingAssembly().GetTypes()
.Where(type => type.GetCustomAttribute<ExcelTableAttribute>() != null);
foreach (Type type in types)
{
ExcelTableAttribute attribute = type.GetCustomAttribute<ExcelTableAttribute>()!;
// TODO: asset provider
JsonDocument tableJson = JsonDocument.Parse(File.ReadAllText("data/ExcelBinOutput/" + attribute.Path));
ImmutableArray<ExcelRow>.Builder rows = ImmutableArray.CreateBuilder<ExcelRow>();
foreach (JsonProperty property in tableJson.RootElement.EnumerateObject())
{
if (property.Value.ValueKind != JsonValueKind.Object)
throw new ArgumentException($"Failed to load excel: expected an object, got {property.Value.ValueKind}");
ExcelRow row = (property.Value.Deserialize(type) as ExcelRow)!;
rows.Add(row);
}
tables.Add(attribute.Type, rows.ToImmutable());
}
_tables = tables.ToImmutable();
_logger.LogInformation("Loaded {count} excel tables", _tables.Count);
}
}

View file

@ -0,0 +1,8 @@
namespace RPG.GameCore.Excel;
public enum ExcelType
{
Avatar,
MainMission,
MapEntry,
TutorialData
}

View file

@ -0,0 +1,46 @@
using System.Text.Json.Serialization;
using RPG.GameCore.Enums;
using RPG.GameCore.Excel.Attributes;
using RPG.GameCore.Types;
namespace RPG.GameCore.Excel;
[ExcelTable("MainMissionExcelTable.json", ExcelType.MainMission)]
public class MainMissionRow : ExcelRow
{
public override uint Id => MainMissionID;
public uint MainMissionID { get; set; } // 0x10
[JsonConverter(typeof(JsonStringEnumConverter))]
public MainMissionType Type { get; set; } // 0x14
public uint MissionTag { get; set; } // 0x18
public bool IsLoop { get; set; } // 0x1C
public uint[] NextMainMissionList { get; set; } = []; // 0x20
public TextID Name { get; set; } // 0x28
[JsonConverter(typeof(JsonStringEnumConverter))]
public RequirementType? TakeTypeA { get; set; } // 0x2C
public uint TakeParamAInt1 { get; set; } // 0x30
public uint[] TakeParamAIntList { get; set; } = []; // 0x38
[JsonConverter(typeof(JsonStringEnumConverter))]
public RequirementType? TakeTypeB { get; set; } // 0x40
public uint TakeParamBInt1 { get; set; } // 0x44
public uint[] TakeParamBIntList { get; set; } = []; // 0x48
[JsonConverter(typeof(JsonStringEnumConverter))]
public RequirementType? BeginType { get; set; } // 0x50
[JsonConverter(typeof(JsonStringEnumConverter))]
public EJNAACLHIHI? TakeOperation { get; set; } // 0x54
public uint BeginParamInt1 { get; set; } // 0x58
public TextID BeginDesc { get; set; } // 0x5C
public uint[] BeginParamIntList { get; set; } = []; // 0x60
public uint[] StartSubMissionList { get; set; } = []; // 0x68
public uint[] FinishSubMissionList { get; set; } = []; // 0x70
public uint NextTrackMainMission { get; set; } // 0x78
public uint TrackWeight { get; set; } // 0x7C
public bool IsShowStartHint { get; set; } // 0x80
public bool IsShowFinishHint { get; set; } // 0x81
public bool IsShowRedDot { get; set; } // 0x82
public uint RewardID { get; set; } // 0x84
public uint DisplayRewardID { get; set; } // 0x88
public string? AudioEmotionState { get; set; } // 0x90
public uint ChapterID { get; set; } // 0x98
}

View file

@ -0,0 +1,35 @@
using System.Text.Json.Serialization;
using RPG.GameCore.Enums;
using RPG.GameCore.Excel.Attributes;
using RPG.GameCore.Types;
namespace RPG.GameCore.Excel;
[ExcelTable("MapEntryExcelTable.json", ExcelType.MapEntry)]
public class MapEntryRow : ExcelRow
{
public override uint Id => ID;
public uint ID { get; set; } // 0x10
public bool IsShowInMapMenu { get; set; } // 0x14
public uint MapMenuSortID { get; set; } // 0x18
[JsonConverter(typeof(JsonStringEnumConverter))]
public MapEntryType EntranceType { get; set; } // 0x1C
public uint EntranceGroupID { get; set; } // 0x20
public TextID Name { get; set; } // 0x24
public TextID Desc { get; set; } // 0x28
public string? EntranceListIcon { get; set; } // 0x30
public string? ImagePath { get; set; } // 0x38
public uint[] MiniMapIconHintList { get; set; } = []; // 0x40
public uint ShowReward { get; set; } // 0x48
public uint PlaneID { get; set; } // 0x4C
public uint FloorID { get; set; } // 0x50
public uint StartGroupID { get; set; } // 0x54
public uint StartAnchorID { get; set; } // 0x58
public uint TargetMission { get; set; } // 0x5C
public uint[] TargetMainMissionList { get; set; } = []; // 0x60
public uint[] BeginMainMissionList { get; set; } = []; // 0x68
public uint[] FinishMainMissionList { get; set; } = []; // 0x70
public uint[] FinishQuestList { get; set; } = []; // 0x78
public uint UnlockQuest { get; set; } // 0x80
}

View file

@ -0,0 +1,15 @@
using RPG.GameCore.Excel.Attributes;
using RPG.GameCore.Types;
namespace RPG.GameCore.Excel;
[ExcelTable("TutorialDataExcelTable.json", ExcelType.TutorialData)]
public class TutorialDataRow : ExcelRow
{
public override uint Id => TutorialID;
public uint TutorialID { get; set; } // 0x10
public string? TutorialJsonPath { get; set; } // 0x18
public TutorialTriggerParam[] TriggerParams { get; set; } = []; // 0x20
public TutorialTriggerParam[] FinishTriggerParams { get; set; } = []; // 0x28
}

View file

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<Content Include="data\ExcelBinOutput\*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Remove="data\ExcelBinOutput\TutorialDataExcelTable.json" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,5 @@
namespace RPG.GameCore.Types;
public struct FixPoint
{
public long RawValue { get; }
}

View file

@ -0,0 +1,8 @@
using RPG.GameCore.Enums;
namespace RPG.GameCore.Types;
public class GCINNHHNFMP
{
public AttackDamageType LDIGCDHLBGE { get; set; } // 0x10
public FixPoint BNHLMJGNADI { get; set; } // 0x18
}

View file

@ -0,0 +1,6 @@
namespace RPG.GameCore.Types;
public class ItemConfig
{
public uint ItemID { get; set; } // 0x10
public uint ItemNum { get; set; } // 0x14
}

View file

@ -0,0 +1,8 @@
using System.Text.Json.Serialization;
namespace RPG.GameCore.Types;
public struct TextID
{
[JsonPropertyName("hash")]
public int Hash { get; set; }
}

View file

@ -0,0 +1,8 @@
using RPG.GameCore.Enums;
namespace RPG.GameCore.Types;
public class TutorialTriggerParam
{
public TutorialTriggerType TriggerType; // 0x10
public required string TriggerParam { get; set; } // 0x18
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,590 @@
{
"1001": {
"TutorialID": 1001,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_1001.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20001001"
}
],
"FinishTriggerParams": [
{
"TriggerType": "TakeSubMission",
"TriggerParam": "100010105"
}
]
},
"1002": {
"TutorialID": 1002,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_1002.json",
"TriggerParams": [
{
"TriggerType": "TakeSubMission",
"TriggerParam": "100010105"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000101"
}
]
},
"1003": {
"TutorialID": 1003,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_1003.json",
"TriggerParams": [
{
"TriggerType": "TaskUnlock",
"TriggerParam": "1003"
}
],
"FinishTriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20001002"
}
]
},
"1004": {
"TutorialID": 1004,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_1004.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20001002"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000101"
}
]
},
"1005": {
"TutorialID": 1005,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_1005_test01.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20001003"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000101"
}
]
},
"1007": {
"TutorialID": 1007,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_1007_test01.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20001006"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000101"
}
]
},
"1008": {
"TutorialID": 1008,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_1008.json",
"TriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000112"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000101"
}
]
},
"1010": {
"TutorialID": 1010,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_1010.json",
"TriggerParams": [
{
"TriggerType": "TakeSubMission",
"TriggerParam": "100010111"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000101"
}
]
},
"1011": {
"TutorialID": 1011,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_1007.json",
"TriggerParams": [],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000101"
}
]
},
"2001": {
"TutorialID": 2001,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2001.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20002001"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000201"
}
]
},
"2002": {
"TutorialID": 2002,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2002.json",
"TriggerParams": [],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000201"
}
]
},
"2003": {
"TutorialID": 2003,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2003.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20002002"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000201"
}
]
},
"2004": {
"TutorialID": 2004,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2004.json",
"TriggerParams": [],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"2005": {
"TutorialID": 2005,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2005.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20002004"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"2008": {
"TutorialID": 2008,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2008.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20002009"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"2009": {
"TutorialID": 2009,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2009.json",
"TriggerParams": [],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"2010": {
"TutorialID": 2010,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2010.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20002008"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"2011": {
"TutorialID": 2011,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2011.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20002007"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"2012": {
"TutorialID": 2012,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2012.json",
"TriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000204"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"2013": {
"TutorialID": 2013,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2011.json",
"TriggerParams": [],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"2014": {
"TutorialID": 2014,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2011.json",
"TriggerParams": [],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"2015": {
"TutorialID": 2015,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_2015.json",
"TriggerParams": [
{
"TriggerType": "TakeSubMission",
"TriggerParam": "100020104"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"3001": {
"TutorialID": 3001,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_3001.json",
"TriggerParams": [
{
"TriggerType": "GetItem",
"TriggerParam": "20002"
},
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000202"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
]
},
"3002": {
"TutorialID": 3002,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_3002.json",
"TriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000301"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000401"
}
]
},
"3003": {
"TutorialID": 3003,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_3003.json",
"TriggerParams": [
{
"TriggerType": "GetAvatar",
"TriggerParam": "1002"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000401"
}
]
},
"3004": {
"TutorialID": 3004,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_3004.json",
"TriggerParams": [
{
"TriggerType": "EnterBattle",
"TriggerParam": "20003001"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000401"
}
]
},
"3005": {
"TutorialID": 3005,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_3005.json",
"TriggerParams": [],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000401"
}
]
},
"3006": {
"TutorialID": 3006,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_3006.json",
"TriggerParams": [],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1000401"
}
]
},
"4002": {
"TutorialID": 4002,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_4002.json",
"TriggerParams": [
{
"TriggerType": "GetItem",
"TriggerParam": "211"
},
{
"TriggerType": "TutorialFinish",
"TriggerParam": "3003"
}
],
"FinishTriggerParams": [
{
"TriggerType": "AnyAvatarToLevel",
"TriggerParam": "15"
}
]
},
"4003": {
"TutorialID": 4003,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_4003.json",
"TriggerParams": [],
"FinishTriggerParams": []
},
"5001": {
"TutorialID": 5001,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5001.json",
"TriggerParams": [
{
"TriggerType": "GetItem",
"TriggerParam": "31041"
},
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1010302"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1010502"
}
]
},
"5002": {
"TutorialID": 5002,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5002.json",
"TriggerParams": [
{
"TriggerType": "GetItem",
"TriggerParam": "18001"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1011001"
}
]
},
"5003": {
"TutorialID": 5003,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5003.json",
"TriggerParams": [
{
"TriggerType": "TutorialFinish",
"TriggerParam": "5001"
},
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1010403"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1010502"
}
]
},
"5004": {
"TutorialID": 5004,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5004.json",
"TriggerParams": [],
"FinishTriggerParams": []
},
"5005": {
"TutorialID": 5005,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5005.json",
"TriggerParams": [
{
"TriggerType": "PlayerLevel",
"TriggerParam": "22"
}
],
"FinishTriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1010901"
}
]
},
"5007": {
"TutorialID": 5007,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5007.json",
"TriggerParams": [
{
"TriggerType": "TakeSubMission",
"TriggerParam": "101050125"
}
],
"FinishTriggerParams": []
},
"5008": {
"TutorialID": 5008,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5008.json",
"TriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1010201"
}
],
"FinishTriggerParams": []
},
"5009": {
"TutorialID": 5009,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5009.json",
"TriggerParams": [],
"FinishTriggerParams": []
},
"5010": {
"TutorialID": 5010,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5010.json",
"TriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "4010101"
}
],
"FinishTriggerParams": []
},
"5011": {
"TutorialID": 5011,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5011.json",
"TriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1011102"
}
],
"FinishTriggerParams": []
},
"5012": {
"TutorialID": 5012,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_5012.json",
"TriggerParams": [
{
"TriggerType": "FinishMainMission",
"TriggerParam": "1011301"
}
],
"FinishTriggerParams": []
},
"9009": {
"TutorialID": 9009,
"TutorialJsonPath": "Config/Level/Tutorial/Tutorial_9009.json",
"TriggerParams": [
{
"TriggerType": "TaskUnlock",
"TriggerParam": "9009"
}
],
"FinishTriggerParams": []
}
}

View file

@ -0,0 +1,396 @@
namespace RPG.Network.Proto;
public enum CmdType
{
CmdTypeNone = 0,
CmdGetLoginActivityCsReq = 2601,
CmdGetLoginActivityScRsp = 2602,
CmdTakeLoginActivityRewardCsReq = 2603,
CmdTakeLoginActivityRewardScRsp = 2604,
CmdSceneEntityMoveCsReq = 1401,
CmdSceneEntityMoveScRsp = 1402,
CmdInteractPropCsReq = 1403,
CmdInteractPropScRsp = 1404,
CmdSceneCastSkillCsReq = 1405,
CmdSceneCastSkillScRsp = 1406,
CmdGetCurSceneInfoCsReq = 1407,
CmdGetCurSceneInfoScRsp = 1408,
CmdSceneEntityUpdateScNotify = 1409,
CmdSceneEntityDisappearScNotify = 1410,
CmdSceneEntityMoveScNotify = 1411,
CmdSpringTransferCsReq = 1414,
CmdSpringTransferScRsp = 1415,
CmdUpdateBuffScNotify = 1416,
CmdDelBuffScNotify = 1417,
CmdSpringRefreshCsReq = 1418,
CmdSpringRefreshScRsp = 1419,
CmdLastSpringRefreshTimeNotify = 1420,
CmdReturnLastTownCsReq = 1421,
CmdReturnLastTownScRsp = 1422,
CmdSceneEnterStageCsReq = 1423,
CmdSceneEnterStageScRsp = 1424,
CmdEnterSectionCsReq = 1427,
CmdEnterSectionScRsp = 1428,
CmdSetCurInteractEntityCsReq = 1431,
CmdSetCurInteractEntityScRsp = 1432,
CmdRecoverAllLineupCsReq = 1433,
CmdRecoverAllLineupScRsp = 1434,
CmdSavePointsInfoNotify = 1435,
CmdStartCocoonStageCsReq = 1436,
CmdStartCocoonStageScRsp = 1437,
CmdEntityBindPropCsReq = 1438,
CmdEntityBindPropScRsp = 1439,
CmdSetClientPausedCsReq = 1440,
CmdSetClientPausedScRsp = 1441,
CmdUpdateBuffGroupStartScNotify = 1442,
CmdUpdateBuffGroupEndScNotify = 1443,
CmdActivateFarmElementCsReq = 1445,
CmdActivateFarmElementScRsp = 1446,
CmdGetSpringRecoverDataCsReq = 1447,
CmdGetSpringRecoverDataScRsp = 1448,
CmdSetSpringRecoverConfigCsReq = 1449,
CmdSetSpringRecoverConfigScRsp = 1450,
CmdSpringRecoverCsReq = 1451,
CmdSpringRecoverScRsp = 1452,
CmdHealPoolInfoNotify = 1453,
CmdEnterAdventureCsReq = 1301,
CmdEnterAdventureScRsp = 1302,
CmdGetArchiveDataCsReq = 2301,
CmdGetArchiveDataScRsp = 2302,
CmdGetUpdatedArchiveDataCsReq = 2303,
CmdGetUpdatedArchiveDataScRsp = 2304,
CmdGetAvatarDataCsReq = 301,
CmdGetAvatarDataScRsp = 302,
CmdAvatarExpUpCsReq = 303,
CmdAvatarExpUpScRsp = 304,
CmdUnlockSkilltreeCsReq = 305,
CmdUnlockSkilltreeScRsp = 306,
CmdPromoteAvatarCsReq = 307,
CmdPromoteAvatarScRsp = 308,
CmdDressAvatarCsReq = 309,
CmdDressAvatarScRsp = 310,
CmdTakeOffEquipmentCsReq = 311,
CmdTakeOffEquipmentScRsp = 312,
CmdAddAvatarScNotify = 313,
CmdRankUpAvatarCsReq = 314,
CmdRankUpAvatarScRsp = 315,
CmdDressRelicAvatarCsReq = 316,
CmdDressRelicAvatarScRsp = 317,
CmdTakeOffRelicCsReq = 318,
CmdTakeOffRelicScRsp = 319,
CmdPVEBattleResultCsReq = 101,
CmdPVEBattleResultScRsp = 102,
CmdQuitBattleCsReq = 103,
CmdQuitBattleScRsp = 104,
CmdGetCurBattleInfoCsReq = 105,
CmdGetCurBattleInfoScRsp = 106,
CmdSyncClientResVersionCsReq = 107,
CmdSyncClientResVersionScRsp = 108,
CmdQuitBattleScNotify = 109,
CmdGetMazeCsReq = 1001,
CmdGetMazeScRsp = 1002,
CmdChooseMazeSeriesCsReq = 1003,
CmdChooseMazeSeriesScRsp = 1004,
CmdChooseMazeAbilityCsReq = 1005,
CmdChooseMazeAbilityScRsp = 1006,
CmdEnterMazeCsReq = 1007,
CmdEnterMazeScRsp = 1008,
CmdMazeBuffScNotify = 1011,
CmdCastMazeSkillCsReq = 1012,
CmdCastMazeSkillScRsp = 1013,
CmdMazePlaneEventScNotify = 1014,
CmdEnterMazeByServerScNotify = 1015,
CmdGetMazeMapInfoCsReq = 1016,
CmdGetMazeMapInfoScRsp = 1017,
CmdGetMazeTimeOfDayCsReq = 1018,
CmdGetMazeTimeOfDayScRsp = 1019,
CmdSetMazeTimeOfDayCsReq = 1020,
CmdSetMazeTimeOfDayScRsp = 1021,
CmdDelMazeTimeOfDayCsReq = 1022,
CmdDelMazeTimeOfDayScRsp = 1023,
CmdReturnStartAnchorCsReq = 1024,
CmdReturnStartAnchorScRsp = 1025,
CmdGetStageLineupCsReq = 701,
CmdGetStageLineupScRsp = 702,
CmdGetCurLineupDataCsReq = 703,
CmdGetCurLineupDataScRsp = 704,
CmdJoinLineupCsReq = 705,
CmdJoinLineupScRsp = 706,
CmdQuitLineupCsReq = 707,
CmdQuitLineupScRsp = 708,
CmdSwapLineupCsReq = 709,
CmdSwapLineupScRsp = 710,
CmdSyncLineupNotify = 711,
CmdGetLineupAvatarDataCsReq = 712,
CmdGetLineupAvatarDataScRsp = 713,
CmdChangeLineupLeaderCsReq = 714,
CmdChangeLineupLeaderScRsp = 715,
CmdSwitchLineupIndexCsReq = 716,
CmdSwitchLineupIndexScRsp = 717,
CmdSetLineupNameCsReq = 718,
CmdSetLineupNameScRsp = 719,
CmdGetAllLineupDataCsReq = 720,
CmdGetAllLineupDataScRsp = 721,
CmdVirtualLineupDestroyNotify = 722,
CmdGetChallengeCsReq = 1701,
CmdGetChallengeScRsp = 1702,
CmdStartChallengeCsReq = 1703,
CmdStartChallengeScRsp = 1704,
CmdLeaveChallengeCsReq = 1705,
CmdLeaveChallengeScRsp = 1706,
CmdChallengeSettleNotify = 1707,
CmdFinishChallengeCsReq = 1708,
CmdFinishChallengeScRsp = 1709,
CmdGetCurChallengeCsReq = 1710,
CmdGetCurChallengeScRsp = 1711,
CmdChallengeLineupNotify = 1712,
CmdTakeChallengeTargetRewardCsReq = 1713,
CmdTakeChallengeTargetRewardScRsp = 1714,
CmdGetRogueInfoCsReq = 1801,
CmdGetRogueInfoScRsp = 1802,
CmdStartRogueCsReq = 1803,
CmdStartRogueScRsp = 1804,
CmdEnterRogueCsReq = 1805,
CmdEnterRogueScRsp = 1806,
CmdLeaveRogueCsReq = 1807,
CmdLeaveRogueScRsp = 1808,
CmdSyncRogueBuffSelectInfoScNotify = 1809,
CmdSelectRogueBuffCsReq = 1810,
CmdSelectRogueBuffScRsp = 1811,
CmdRollRogueBuffCsReq = 1812,
CmdRollRogueBuffScRsp = 1813,
CmdEnterNextRogueRoomScNotify = 1814,
CmdSyncRogueFinishScNotify = 1815,
CmdPickRogueAvatarCsReq = 1816,
CmdPickRogueAvatarScRsp = 1817,
CmdAddRogueBuffScNotify = 1818,
CmdReviveRogueAvatarCsReq = 1819,
CmdReviveRogueAvatarScRsp = 1820,
CmdSaveRogueRecordCsReq = 1821,
CmdSaveRogueRecordScRsp = 1822,
CmdRecoverRogueStaminaCsReq = 1823,
CmdRecoverRogueStaminaScRsp = 1824,
CmdStartRogueChallengeCsReq = 1827,
CmdStartRogueChallengeScRsp = 1828,
CmdLeaveRogueChallengeCsReq = 1829,
CmdLeaveRogueChallengeScRsp = 1830,
CmdSyncRogueChallengeFinishScNotify = 1831,
CmdQuitRogueCsReq = 1832,
CmdQuitRogueScRsp = 1833,
CmdAppraisalRogueStoneCsReq = 1834,
CmdAppraisalRogueStoneScRsp = 1835,
CmdSyncRogueSeasonFinishScNotify = 1836,
CmdSyncRogueInfoChangeScNotify = 1837,
CmdAddRogueExtraBuffScNotify = 1838,
CmdEnterRogueMapRoomCsReq = 1839,
CmdEnterRogueMapRoomScRsp = 1840,
CmdEnterRogueNextLevelCsReq = 1841,
CmdEnterRogueNextLevelScRsp = 1842,
CmdSyncRogueMapRoomScNotify = 1843,
CmdSyncRoguePickAvatarScNotify = 1844,
CmdSetRogueBlessCsReq = 1845,
CmdSetRogueBlessScRsp = 1846,
CmdSyncRogueBlessScNotify = 1847,
CmdGetRogueShopInfoCsReq = 1848,
CmdGetRogueShopInfoScRsp = 1849,
CmdBuyRogueShopBuffCsReq = 1850,
CmdBuyRogueShopBuffScRsp = 1851,
CmdFinishRogueDialogueGroupCsReq = 1852,
CmdFinishRogueDialogueGroupScRsp = 1853,
CmdUnlockRogueRoomCsReq = 1856,
CmdUnlockRogueRoomScRsp = 1857,
CmdGetRogueGachaInfoCsReq = 1858,
CmdGetRogueGachaInfoScRsp = 1859,
CmdSetRogueGachaWishListCsReq = 1860,
CmdSetRogueGachaWishListScRsp = 1861,
CmdDoRogueGachaCsReq = 1862,
CmdDoRogueGachaScRsp = 1863,
CmdSyncRogueGachaRefreshScNotify = 1864,
CmdBuyRogueShopItemCsReq = 1865,
CmdBuyRogueShopItemScRsp = 1866,
CmdGetRogueAppraisalItemInfoCsReq = 1867,
CmdGetRogueAppraisalItemInfoScRsp = 1868,
CmdSyncRogueMiracleGetItemScNotify = 1869,
CmdGetDialogueEventDataCsReq = 2401,
CmdGetDialogueEventDataScRsp = 2402,
CmdSelectDialogueEventCsReq = 2403,
CmdSelectDialogueEventScRsp = 2404,
CmdSyncDialogueEventDataScNotify = 2405,
CmdGetExpeditionDataCsReq = 2501,
CmdGetExpeditionDataScRsp = 2502,
CmdAcceptExpeditionCsReq = 2503,
CmdAcceptExpeditionScRsp = 2504,
CmdCancelExpeditionCsReq = 2505,
CmdCancelExpeditionScRsp = 2506,
CmdTakeExpeditionRewardCsReq = 2507,
CmdTakeExpeditionRewardScRsp = 2508,
CmdGetGachaInfoCsReq = 1901,
CmdGetGachaInfoScRsp = 1902,
CmdDoGachaCsReq = 1903,
CmdDoGachaScRsp = 1904,
CmdGetBagCsReq = 501,
CmdGetBagScRsp = 502,
CmdPromoteEquipmentCsReq = 503,
CmdPromoteEquipmentScRsp = 504,
CmdLockEquipmentCsReq = 505,
CmdLockEquipmentScRsp = 506,
CmdUseItemCsReq = 507,
CmdUseItemScRsp = 508,
CmdRankUpEquipmentCsReq = 509,
CmdRankUpEquipmentScRsp = 510,
CmdExpUpEquipmentCsReq = 511,
CmdExpUpEquipmentScRsp = 512,
CmdComposeItemCsReq = 513,
CmdComposeItemScRsp = 514,
CmdExpUpRelicCsReq = 515,
CmdExpUpRelicScRsp = 516,
CmdLockRelicCsReq = 517,
CmdLockRelicScRsp = 518,
CmdSellItemCsReq = 519,
CmdSellItemScRsp = 520,
CmdRechargeSuccNotify = 521,
CmdGetMailCsReq = 801,
CmdGetMailScRsp = 802,
CmdMarkReadMailCsReq = 803,
CmdMarkReadMailScRsp = 804,
CmdDelMailCsReq = 805,
CmdDelMailScRsp = 806,
CmdTakeMailAttachmentCsReq = 807,
CmdTakeMailAttachmentScRsp = 808,
CmdNewMailScNotify = 809,
CmdGetMissionDataCsReq = 1201,
CmdGetMissionDataScRsp = 1202,
CmdFinishTalkMissionCsReq = 1203,
CmdFinishTalkMissionScRsp = 1204,
CmdMissionRewardScNotify = 1205,
CmdSyncTaskCsReq = 1206,
CmdSyncTaskScRsp = 1207,
CmdDailyTaskDataScNotify = 1208,
CmdTakeDailyTaskExtraRewardCsReq = 1209,
CmdTakeDailyTaskExtraRewardScRsp = 1210,
CmdDailyTaskRewardScNotify = 1211,
CmdMissionGroupWarnScNotify = 1212,
CmdFinishCosumeItemMissionCsReq = 1213,
CmdFinishCosumeItemMissionScRsp = 1214,
CmdGetMissionEventDataCsReq = 1215,
CmdGetMissionEventDataScRsp = 1216,
CmdMissionEventRewardScNotify = 1217,
CmdAcceptMissionEventCsReq = 1218,
CmdAcceptMissionEventScRsp = 1219,
CmdGetMissionStatusCsReq = 1220,
CmdGetMissionStatusScRsp = 1221,
CmdInterruptMissionEventCsReq = 1222,
CmdInterruptMissionEventScRsp = 1223,
CmdSetMissionEventProgressCsReq = 1224,
CmdSetMissionEventProgressScRsp = 1225,
CmdSubMissionRewardScNotify = 1226,
CmdPlayerLoginCsReq = 1,
CmdPlayerLoginScRsp = 2,
CmdPlayerLogoutCsReq = 3,
CmdPlayerLogoutScRsp = 4,
CmdPlayerGetTokenCsReq = 5,
CmdPlayerGetTokenScRsp = 6,
CmdPlayerKeepAliveNotify = 7,
CmdGmTalkScNotify = 8,
CmdPlayerKickOutScNotify = 9,
CmdGmTalkCsReq = 10,
CmdGmTalkScRsp = 11,
CmdGetStaminaExchangeCsReq = 12,
CmdGetStaminaExchangeScRsp = 13,
CmdExchangeStaminaCsReq = 14,
CmdExchangeStaminaScRsp = 15,
CmdGetAuthkeyCsReq = 16,
CmdGetAuthkeyScRsp = 17,
CmdRegionStopScNotify = 18,
CmdAntiAddictScNotify = 19,
CmdSetNicknameCsReq = 20,
CmdSetNicknameScRsp = 21,
CmdGetLevelRewardTakenListCsReq = 22,
CmdGetLevelRewardTakenListScRsp = 23,
CmdGetLevelRewardCsReq = 24,
CmdGetLevelRewardScRsp = 25,
CmdSyncTimeCsReq = 26,
CmdSyncTimeScRsp = 27,
CmdSetLanguageCsReq = 28,
CmdSetLanguageScRsp = 29,
CmdServerAnnounceNotify = 30,
CmdSetHeroBasicTypeCsReq = 31,
CmdSetHeroBasicTypeScRsp = 32,
CmdGetHeroBasicTypeInfoCsReq = 33,
CmdGetHeroBasicTypeInfoScRsp = 34,
CmdGetHeroPathCsReq = 35,
CmdGetHeroPathScRsp = 36,
CmdHeroPathChangedNotify = 37,
CmdSetGenderCsReq = 38,
CmdSetGenderScRsp = 39,
CmdSetPlayerInfoCsReq = 40,
CmdSetPlayerInfoScRsp = 41,
CmdHeroBasicTypeChangedNotify = 42,
CmdQueryProductInfoCsReq = 43,
CmdQueryProductInfoScRsp = 44,
CmdClientDownloadDataScNotify = 45,
CmdUpdateFeatureSwitchScNotify = 46,
CmdFinishPlotCsReq = 1101,
CmdFinishPlotScRsp = 1102,
CmdGetPrestigeInfoCsReq = 2001,
CmdGetPrestigeInfoScRsp = 2002,
CmdPrestigeInfoChangeNotify = 2003,
CmdTakePrestigeLevelRewardCsReq = 2004,
CmdTakePrestigeLevelRewardScRsp = 2005,
CmdTakePrestigeMissionRewardCsReq = 2006,
CmdTakePrestigeMissionRewardScRsp = 2007,
CmdGetQuestDataCsReq = 901,
CmdGetQuestDataScRsp = 902,
CmdTakeQuestRewardCsReq = 903,
CmdTakeQuestRewardScRsp = 904,
CmdTakeAchievementLevelRewardCsReq = 905,
CmdTakeAchievementLevelRewardScRsp = 906,
CmdStartRaidCsReq = 2201,
CmdStartRaidScRsp = 2202,
CmdLeaveRaidCsReq = 2203,
CmdLeaveRaidScRsp = 2204,
CmdRaidInfoNotify = 2205,
CmdGetChallengeRaidInfoCsReq = 2206,
CmdGetChallengeRaidInfoScRsp = 2207,
CmdTakeChallengeRaidRewardCsReq = 2208,
CmdTakeChallengeRaidRewardScRsp = 2209,
CmdChallengeRaidNotify = 2210,
CmdGetShopListCsReq = 1501,
CmdGetShopListScRsp = 1502,
CmdBuyGoodsCsReq = 1503,
CmdBuyGoodsScRsp = 1504,
CmdGetStageDataCsReq = 201,
CmdGetStageDataScRsp = 202,
CmdStageBeginCsReq = 203,
CmdStageBeginScRsp = 204,
CmdPlayerSyncScNotify = 601,
CmdGetNpcTakenRewardCsReq = 2101,
CmdGetNpcTakenRewardScRsp = 2102,
CmdTakeTalkRewardCsReq = 2103,
CmdTakeTalkRewardScRsp = 2104,
CmdGetFirstTalkNpcCsReq = 2105,
CmdGetFirstTalkNpcScRsp = 2106,
CmdFinishFirstTalkNpcCsReq = 2107,
CmdFinishFirstTalkNpcScRsp = 2108,
CmdGetTutorialCsReq = 1601,
CmdGetTutorialScRsp = 1602,
CmdGetTutorialGuideCsReq = 1603,
CmdGetTutorialGuideScRsp = 1604,
CmdUnlockTutorialCsReq = 1605,
CmdUnlockTutorialScRsp = 1606,
CmdUnlockTutorialGuideCsReq = 1607,
CmdUnlockTutorialGuideScRsp = 1608,
CmdFinishTutorialCsReq = 1609,
CmdFinishTutorialScRsp = 1610,
CmdFinishTutorialGuideCsReq = 1611,
CmdFinishTutorialGuideScRsp = 1612,
CmdGetWaypointCsReq = 401,
CmdGetWaypointScRsp = 402,
CmdSetCurWaypointCsReq = 403,
CmdSetCurWaypointScRsp = 404,
CmdGetChapterCsReq = 405,
CmdGetChapterScRsp = 406,
CmdWaypointShowNewCsNotify = 407,
CmdTakeChapterRewardCsReq = 408,
CmdTakeChapterRewardScRsp = 409,
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,484 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: cs.adventure.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021, 8981
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace RPG.Network.Proto {
/// <summary>Holder for reflection information generated from cs.adventure.proto</summary>
public static partial class CsAdventureReflection {
#region Descriptor
/// <summary>File descriptor for cs.adventure.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static CsAdventureReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChJjcy5hZHZlbnR1cmUucHJvdG8SBXByb3RvGg5jcy5zY2VuZS5wcm90byIs",
"ChNFbnRlckFkdmVudHVyZUNzUmVxEhUKBm1hcF9pZBgBIAEoDVIFbWFwSWQi",
"VwoTRW50ZXJBZHZlbnR1cmVTY1JzcBIYCgdyZXRjb2RlGAEgASgNUgdyZXRj",
"b2RlEiYKBXNjZW5lGAIgASgLMhAucHJvdG8uU2NlbmVJbmZvUgVzY2VuZSpm",
"ChBDbWRBZHZlbnR1cmVUeXBlEhgKFENtZEFkdmVudHVyZVR5cGVOb25lEAAS",
"GwoWQ21kRW50ZXJBZHZlbnR1cmVDc1JlcRCVChIbChZDbWRFbnRlckFkdmVu",
"dHVyZVNjUnNwEJYKYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::RPG.Network.Proto.CsSceneReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::RPG.Network.Proto.CmdAdventureType), }, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::RPG.Network.Proto.EnterAdventureCsReq), global::RPG.Network.Proto.EnterAdventureCsReq.Parser, new[]{ "MapId" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::RPG.Network.Proto.EnterAdventureScRsp), global::RPG.Network.Proto.EnterAdventureScRsp.Parser, new[]{ "Retcode", "Scene" }, null, null, null, null)
}));
}
#endregion
}
#region Enums
public enum CmdAdventureType {
[pbr::OriginalName("CmdAdventureTypeNone")] None = 0,
[pbr::OriginalName("CmdEnterAdventureCsReq")] CmdEnterAdventureCsReq = 1301,
[pbr::OriginalName("CmdEnterAdventureScRsp")] CmdEnterAdventureScRsp = 1302,
}
#endregion
#region Messages
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class EnterAdventureCsReq : pb::IMessage<EnterAdventureCsReq>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<EnterAdventureCsReq> _parser = new pb::MessageParser<EnterAdventureCsReq>(() => new EnterAdventureCsReq());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<EnterAdventureCsReq> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::RPG.Network.Proto.CsAdventureReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public EnterAdventureCsReq() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public EnterAdventureCsReq(EnterAdventureCsReq other) : this() {
mapId_ = other.mapId_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public EnterAdventureCsReq Clone() {
return new EnterAdventureCsReq(this);
}
/// <summary>Field number for the "map_id" field.</summary>
public const int MapIdFieldNumber = 1;
private uint mapId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint MapId {
get { return mapId_; }
set {
mapId_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as EnterAdventureCsReq);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(EnterAdventureCsReq other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (MapId != other.MapId) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (MapId != 0) hash ^= MapId.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (MapId != 0) {
output.WriteRawTag(8);
output.WriteUInt32(MapId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (MapId != 0) {
output.WriteRawTag(8);
output.WriteUInt32(MapId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (MapId != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MapId);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(EnterAdventureCsReq other) {
if (other == null) {
return;
}
if (other.MapId != 0) {
MapId = other.MapId;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
MapId = input.ReadUInt32();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
MapId = input.ReadUInt32();
break;
}
}
}
}
#endif
}
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class EnterAdventureScRsp : pb::IMessage<EnterAdventureScRsp>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<EnterAdventureScRsp> _parser = new pb::MessageParser<EnterAdventureScRsp>(() => new EnterAdventureScRsp());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<EnterAdventureScRsp> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::RPG.Network.Proto.CsAdventureReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public EnterAdventureScRsp() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public EnterAdventureScRsp(EnterAdventureScRsp other) : this() {
retcode_ = other.retcode_;
scene_ = other.scene_ != null ? other.scene_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public EnterAdventureScRsp Clone() {
return new EnterAdventureScRsp(this);
}
/// <summary>Field number for the "retcode" field.</summary>
public const int RetcodeFieldNumber = 1;
private uint retcode_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint Retcode {
get { return retcode_; }
set {
retcode_ = value;
}
}
/// <summary>Field number for the "scene" field.</summary>
public const int SceneFieldNumber = 2;
private global::RPG.Network.Proto.SceneInfo scene_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::RPG.Network.Proto.SceneInfo Scene {
get { return scene_; }
set {
scene_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as EnterAdventureScRsp);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(EnterAdventureScRsp other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Retcode != other.Retcode) return false;
if (!object.Equals(Scene, other.Scene)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (Retcode != 0) hash ^= Retcode.GetHashCode();
if (scene_ != null) hash ^= Scene.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Retcode != 0) {
output.WriteRawTag(8);
output.WriteUInt32(Retcode);
}
if (scene_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Scene);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Retcode != 0) {
output.WriteRawTag(8);
output.WriteUInt32(Retcode);
}
if (scene_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Scene);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (Retcode != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Retcode);
}
if (scene_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Scene);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(EnterAdventureScRsp other) {
if (other == null) {
return;
}
if (other.Retcode != 0) {
Retcode = other.Retcode;
}
if (other.scene_ != null) {
if (scene_ == null) {
Scene = new global::RPG.Network.Proto.SceneInfo();
}
Scene.MergeFrom(other.Scene);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Retcode = input.ReadUInt32();
break;
}
case 18: {
if (scene_ == null) {
Scene = new global::RPG.Network.Proto.SceneInfo();
}
input.ReadMessage(Scene);
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
Retcode = input.ReadUInt32();
break;
}
case 18: {
if (scene_ == null) {
Scene = new global::RPG.Network.Proto.SceneInfo();
}
input.ReadMessage(Scene);
break;
}
}
}
}
#endif
}
#endregion
}
#endregion Designer generated code

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

2048
RPG.Network.Proto/CsGacha.cs Normal file

File diff suppressed because it is too large Load diff

6453
RPG.Network.Proto/CsItem.cs Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

2897
RPG.Network.Proto/CsMail.cs Normal file

File diff suppressed because it is too large Load diff

6835
RPG.Network.Proto/CsMaze.cs Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

13258
RPG.Network.Proto/CsPlayer.cs Normal file

File diff suppressed because it is too large Load diff

474
RPG.Network.Proto/CsPlot.cs Normal file
View file

@ -0,0 +1,474 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: cs.plot.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021, 8981
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace RPG.Network.Proto {
/// <summary>Holder for reflection information generated from cs.plot.proto</summary>
public static partial class CsPlotReflection {
#region Descriptor
/// <summary>File descriptor for cs.plot.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static CsPlotReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cg1jcy5wbG90LnByb3RvEgVwcm90byIqCg9GaW5pc2hQbG90Q3NSZXESFwoH",
"cGxvdF9pZBgBIAEoDVIGcGxvdElkIkQKD0ZpbmlzaFBsb3RTY1JzcBIYCgdy",
"ZXRjb2RlGAEgASgNUgdyZXRjb2RlEhcKB3Bsb3RfaWQYAiABKA1SBnBsb3RJ",
"ZCpUCgtDbWRQbG90VHlwZRITCg9DbWRQbG90VHlwZU5vbmUQABIXChJDbWRG",
"aW5pc2hQbG90Q3NSZXEQzQgSFwoSQ21kRmluaXNoUGxvdFNjUnNwEM4IYgZw",
"cm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::RPG.Network.Proto.CmdPlotType), }, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::RPG.Network.Proto.FinishPlotCsReq), global::RPG.Network.Proto.FinishPlotCsReq.Parser, new[]{ "PlotId" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::RPG.Network.Proto.FinishPlotScRsp), global::RPG.Network.Proto.FinishPlotScRsp.Parser, new[]{ "Retcode", "PlotId" }, null, null, null, null)
}));
}
#endregion
}
#region Enums
public enum CmdPlotType {
[pbr::OriginalName("CmdPlotTypeNone")] None = 0,
[pbr::OriginalName("CmdFinishPlotCsReq")] CmdFinishPlotCsReq = 1101,
[pbr::OriginalName("CmdFinishPlotScRsp")] CmdFinishPlotScRsp = 1102,
}
#endregion
#region Messages
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class FinishPlotCsReq : pb::IMessage<FinishPlotCsReq>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<FinishPlotCsReq> _parser = new pb::MessageParser<FinishPlotCsReq>(() => new FinishPlotCsReq());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<FinishPlotCsReq> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::RPG.Network.Proto.CsPlotReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FinishPlotCsReq() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FinishPlotCsReq(FinishPlotCsReq other) : this() {
plotId_ = other.plotId_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FinishPlotCsReq Clone() {
return new FinishPlotCsReq(this);
}
/// <summary>Field number for the "plot_id" field.</summary>
public const int PlotIdFieldNumber = 1;
private uint plotId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint PlotId {
get { return plotId_; }
set {
plotId_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as FinishPlotCsReq);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(FinishPlotCsReq other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (PlotId != other.PlotId) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (PlotId != 0) hash ^= PlotId.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (PlotId != 0) {
output.WriteRawTag(8);
output.WriteUInt32(PlotId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (PlotId != 0) {
output.WriteRawTag(8);
output.WriteUInt32(PlotId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (PlotId != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(PlotId);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(FinishPlotCsReq other) {
if (other == null) {
return;
}
if (other.PlotId != 0) {
PlotId = other.PlotId;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
PlotId = input.ReadUInt32();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
PlotId = input.ReadUInt32();
break;
}
}
}
}
#endif
}
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class FinishPlotScRsp : pb::IMessage<FinishPlotScRsp>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<FinishPlotScRsp> _parser = new pb::MessageParser<FinishPlotScRsp>(() => new FinishPlotScRsp());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<FinishPlotScRsp> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::RPG.Network.Proto.CsPlotReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FinishPlotScRsp() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FinishPlotScRsp(FinishPlotScRsp other) : this() {
retcode_ = other.retcode_;
plotId_ = other.plotId_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FinishPlotScRsp Clone() {
return new FinishPlotScRsp(this);
}
/// <summary>Field number for the "retcode" field.</summary>
public const int RetcodeFieldNumber = 1;
private uint retcode_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint Retcode {
get { return retcode_; }
set {
retcode_ = value;
}
}
/// <summary>Field number for the "plot_id" field.</summary>
public const int PlotIdFieldNumber = 2;
private uint plotId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint PlotId {
get { return plotId_; }
set {
plotId_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as FinishPlotScRsp);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(FinishPlotScRsp other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Retcode != other.Retcode) return false;
if (PlotId != other.PlotId) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (Retcode != 0) hash ^= Retcode.GetHashCode();
if (PlotId != 0) hash ^= PlotId.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Retcode != 0) {
output.WriteRawTag(8);
output.WriteUInt32(Retcode);
}
if (PlotId != 0) {
output.WriteRawTag(16);
output.WriteUInt32(PlotId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Retcode != 0) {
output.WriteRawTag(8);
output.WriteUInt32(Retcode);
}
if (PlotId != 0) {
output.WriteRawTag(16);
output.WriteUInt32(PlotId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (Retcode != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Retcode);
}
if (PlotId != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(PlotId);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(FinishPlotScRsp other) {
if (other == null) {
return;
}
if (other.Retcode != 0) {
Retcode = other.Retcode;
}
if (other.PlotId != 0) {
PlotId = other.PlotId;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Retcode = input.ReadUInt32();
break;
}
case 16: {
PlotId = input.ReadUInt32();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
Retcode = input.ReadUInt32();
break;
}
case 16: {
PlotId = input.ReadUInt32();
break;
}
}
}
}
#endif
}
#endregion
}
#endregion Designer generated code

File diff suppressed because it is too large Load diff

1720
RPG.Network.Proto/CsQuest.cs Normal file

File diff suppressed because it is too large Load diff

2566
RPG.Network.Proto/CsRaid.cs Normal file

File diff suppressed because it is too large Load diff

22322
RPG.Network.Proto/CsRogue.cs Normal file

File diff suppressed because it is too large Load diff

15640
RPG.Network.Proto/CsScene.cs Normal file

File diff suppressed because it is too large Load diff

1723
RPG.Network.Proto/CsShop.cs Normal file

File diff suppressed because it is too large Load diff

1288
RPG.Network.Proto/CsStage.cs Normal file

File diff suppressed because it is too large Load diff

1997
RPG.Network.Proto/CsSync.cs Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

703
RPG.Network.Proto/Head.cs Normal file
View file

@ -0,0 +1,703 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: head.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021, 8981
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace RPG.Network.Proto {
/// <summary>Holder for reflection information generated from head.proto</summary>
public static partial class HeadReflection {
#region Descriptor
/// <summary>File descriptor for head.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static HeadReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CgpoZWFkLnByb3RvEgVwcm90byKGAwoKUGFja2V0SGVhZBIbCglwYWNrZXRf",
"aWQYASABKA1SCHBhY2tldElkEhsKCXNpZ25fdHlwZRgCIAEoDVIIc2lnblR5",
"cGUSEgoEc2lnbhgDIAEoDVIEc2lnbhIXCgd1c2VyX2lkGAQgASgNUgZ1c2Vy",
"SWQSGQoIc3JjX2FkZHIYBSABKA1SB3NyY0FkZHISGQoIZHN0X2FkZHIYBiAB",
"KA1SB2RzdEFkZHISIwoNZGlzcGF0Y2hfdHlwZRgHIAEoDVIMZGlzcGF0Y2hU",
"eXBlEh8KC3NlcnZlcl90eXBlGAggASgNUgpzZXJ2ZXJUeXBlEiEKDGRpc3Bh",
"dGNoX2tleRgJIAEoDVILZGlzcGF0Y2hLZXkSJgoPdXNlcl9zZXNzaW9uX2lk",
"GAogASgNUg11c2VyU2Vzc2lvbklkEg4KAmlkGAsgASgNUgJpZBIhCgxjb3Jv",
"dXRpbmVfaWQYDCABKA1SC2Nvcm91dGluZUlkEhcKB2hvcF9jbnQYDSABKA1S",
"BmhvcENudCrUAQoMRGlzcGF0Y2hUeXBlEhYKEkRJU1BBVENIX1RZUEVfTk9O",
"RRAAEhkKFURJU1BBVENIX1RZUEVfQllfQUREUhABEhgKFERJU1BBVENIX1RZ",
"UEVfQllfTU9EEAISGQoVRElTUEFUQ0hfVFlQRV9CWV9SQU5EEAMSGgoWRElT",
"UEFUQ0hfVFlQRV9CWV9DSEFTSBAEEiMKH0RJU1BBVENIX1RZUEVfQllfU1RJ",
"Q0tZX1NFU1NJT04QBRIbChdESVNQQVRDSF9UWVBFX0JZX09CSkVDVBAGYgZw",
"cm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::RPG.Network.Proto.DispatchType), }, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::RPG.Network.Proto.PacketHead), global::RPG.Network.Proto.PacketHead.Parser, new[]{ "PacketId", "SignType", "Sign", "UserId", "SrcAddr", "DstAddr", "DispatchType", "ServerType", "DispatchKey", "UserSessionId", "Id", "CoroutineId", "HopCnt" }, null, null, null, null)
}));
}
#endregion
}
#region Enums
public enum DispatchType {
[pbr::OriginalName("DISPATCH_TYPE_NONE")] None = 0,
[pbr::OriginalName("DISPATCH_TYPE_BY_ADDR")] ByAddr = 1,
[pbr::OriginalName("DISPATCH_TYPE_BY_MOD")] ByMod = 2,
[pbr::OriginalName("DISPATCH_TYPE_BY_RAND")] ByRand = 3,
[pbr::OriginalName("DISPATCH_TYPE_BY_CHASH")] ByChash = 4,
[pbr::OriginalName("DISPATCH_TYPE_BY_STICKY_SESSION")] ByStickySession = 5,
[pbr::OriginalName("DISPATCH_TYPE_BY_OBJECT")] ByObject = 6,
}
#endregion
#region Messages
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class PacketHead : pb::IMessage<PacketHead>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<PacketHead> _parser = new pb::MessageParser<PacketHead>(() => new PacketHead());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<PacketHead> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::RPG.Network.Proto.HeadReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public PacketHead() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public PacketHead(PacketHead other) : this() {
packetId_ = other.packetId_;
signType_ = other.signType_;
sign_ = other.sign_;
userId_ = other.userId_;
srcAddr_ = other.srcAddr_;
dstAddr_ = other.dstAddr_;
dispatchType_ = other.dispatchType_;
serverType_ = other.serverType_;
dispatchKey_ = other.dispatchKey_;
userSessionId_ = other.userSessionId_;
id_ = other.id_;
coroutineId_ = other.coroutineId_;
hopCnt_ = other.hopCnt_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public PacketHead Clone() {
return new PacketHead(this);
}
/// <summary>Field number for the "packet_id" field.</summary>
public const int PacketIdFieldNumber = 1;
private uint packetId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint PacketId {
get { return packetId_; }
set {
packetId_ = value;
}
}
/// <summary>Field number for the "sign_type" field.</summary>
public const int SignTypeFieldNumber = 2;
private uint signType_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint SignType {
get { return signType_; }
set {
signType_ = value;
}
}
/// <summary>Field number for the "sign" field.</summary>
public const int SignFieldNumber = 3;
private uint sign_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint Sign {
get { return sign_; }
set {
sign_ = value;
}
}
/// <summary>Field number for the "user_id" field.</summary>
public const int UserIdFieldNumber = 4;
private uint userId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint UserId {
get { return userId_; }
set {
userId_ = value;
}
}
/// <summary>Field number for the "src_addr" field.</summary>
public const int SrcAddrFieldNumber = 5;
private uint srcAddr_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint SrcAddr {
get { return srcAddr_; }
set {
srcAddr_ = value;
}
}
/// <summary>Field number for the "dst_addr" field.</summary>
public const int DstAddrFieldNumber = 6;
private uint dstAddr_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint DstAddr {
get { return dstAddr_; }
set {
dstAddr_ = value;
}
}
/// <summary>Field number for the "dispatch_type" field.</summary>
public const int DispatchTypeFieldNumber = 7;
private uint dispatchType_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint DispatchType {
get { return dispatchType_; }
set {
dispatchType_ = value;
}
}
/// <summary>Field number for the "server_type" field.</summary>
public const int ServerTypeFieldNumber = 8;
private uint serverType_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint ServerType {
get { return serverType_; }
set {
serverType_ = value;
}
}
/// <summary>Field number for the "dispatch_key" field.</summary>
public const int DispatchKeyFieldNumber = 9;
private uint dispatchKey_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint DispatchKey {
get { return dispatchKey_; }
set {
dispatchKey_ = value;
}
}
/// <summary>Field number for the "user_session_id" field.</summary>
public const int UserSessionIdFieldNumber = 10;
private uint userSessionId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint UserSessionId {
get { return userSessionId_; }
set {
userSessionId_ = value;
}
}
/// <summary>Field number for the "id" field.</summary>
public const int IdFieldNumber = 11;
private uint id_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint Id {
get { return id_; }
set {
id_ = value;
}
}
/// <summary>Field number for the "coroutine_id" field.</summary>
public const int CoroutineIdFieldNumber = 12;
private uint coroutineId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint CoroutineId {
get { return coroutineId_; }
set {
coroutineId_ = value;
}
}
/// <summary>Field number for the "hop_cnt" field.</summary>
public const int HopCntFieldNumber = 13;
private uint hopCnt_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint HopCnt {
get { return hopCnt_; }
set {
hopCnt_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as PacketHead);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(PacketHead other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (PacketId != other.PacketId) return false;
if (SignType != other.SignType) return false;
if (Sign != other.Sign) return false;
if (UserId != other.UserId) return false;
if (SrcAddr != other.SrcAddr) return false;
if (DstAddr != other.DstAddr) return false;
if (DispatchType != other.DispatchType) return false;
if (ServerType != other.ServerType) return false;
if (DispatchKey != other.DispatchKey) return false;
if (UserSessionId != other.UserSessionId) return false;
if (Id != other.Id) return false;
if (CoroutineId != other.CoroutineId) return false;
if (HopCnt != other.HopCnt) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (PacketId != 0) hash ^= PacketId.GetHashCode();
if (SignType != 0) hash ^= SignType.GetHashCode();
if (Sign != 0) hash ^= Sign.GetHashCode();
if (UserId != 0) hash ^= UserId.GetHashCode();
if (SrcAddr != 0) hash ^= SrcAddr.GetHashCode();
if (DstAddr != 0) hash ^= DstAddr.GetHashCode();
if (DispatchType != 0) hash ^= DispatchType.GetHashCode();
if (ServerType != 0) hash ^= ServerType.GetHashCode();
if (DispatchKey != 0) hash ^= DispatchKey.GetHashCode();
if (UserSessionId != 0) hash ^= UserSessionId.GetHashCode();
if (Id != 0) hash ^= Id.GetHashCode();
if (CoroutineId != 0) hash ^= CoroutineId.GetHashCode();
if (HopCnt != 0) hash ^= HopCnt.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (PacketId != 0) {
output.WriteRawTag(8);
output.WriteUInt32(PacketId);
}
if (SignType != 0) {
output.WriteRawTag(16);
output.WriteUInt32(SignType);
}
if (Sign != 0) {
output.WriteRawTag(24);
output.WriteUInt32(Sign);
}
if (UserId != 0) {
output.WriteRawTag(32);
output.WriteUInt32(UserId);
}
if (SrcAddr != 0) {
output.WriteRawTag(40);
output.WriteUInt32(SrcAddr);
}
if (DstAddr != 0) {
output.WriteRawTag(48);
output.WriteUInt32(DstAddr);
}
if (DispatchType != 0) {
output.WriteRawTag(56);
output.WriteUInt32(DispatchType);
}
if (ServerType != 0) {
output.WriteRawTag(64);
output.WriteUInt32(ServerType);
}
if (DispatchKey != 0) {
output.WriteRawTag(72);
output.WriteUInt32(DispatchKey);
}
if (UserSessionId != 0) {
output.WriteRawTag(80);
output.WriteUInt32(UserSessionId);
}
if (Id != 0) {
output.WriteRawTag(88);
output.WriteUInt32(Id);
}
if (CoroutineId != 0) {
output.WriteRawTag(96);
output.WriteUInt32(CoroutineId);
}
if (HopCnt != 0) {
output.WriteRawTag(104);
output.WriteUInt32(HopCnt);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (PacketId != 0) {
output.WriteRawTag(8);
output.WriteUInt32(PacketId);
}
if (SignType != 0) {
output.WriteRawTag(16);
output.WriteUInt32(SignType);
}
if (Sign != 0) {
output.WriteRawTag(24);
output.WriteUInt32(Sign);
}
if (UserId != 0) {
output.WriteRawTag(32);
output.WriteUInt32(UserId);
}
if (SrcAddr != 0) {
output.WriteRawTag(40);
output.WriteUInt32(SrcAddr);
}
if (DstAddr != 0) {
output.WriteRawTag(48);
output.WriteUInt32(DstAddr);
}
if (DispatchType != 0) {
output.WriteRawTag(56);
output.WriteUInt32(DispatchType);
}
if (ServerType != 0) {
output.WriteRawTag(64);
output.WriteUInt32(ServerType);
}
if (DispatchKey != 0) {
output.WriteRawTag(72);
output.WriteUInt32(DispatchKey);
}
if (UserSessionId != 0) {
output.WriteRawTag(80);
output.WriteUInt32(UserSessionId);
}
if (Id != 0) {
output.WriteRawTag(88);
output.WriteUInt32(Id);
}
if (CoroutineId != 0) {
output.WriteRawTag(96);
output.WriteUInt32(CoroutineId);
}
if (HopCnt != 0) {
output.WriteRawTag(104);
output.WriteUInt32(HopCnt);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (PacketId != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(PacketId);
}
if (SignType != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(SignType);
}
if (Sign != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Sign);
}
if (UserId != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(UserId);
}
if (SrcAddr != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(SrcAddr);
}
if (DstAddr != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(DstAddr);
}
if (DispatchType != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(DispatchType);
}
if (ServerType != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ServerType);
}
if (DispatchKey != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(DispatchKey);
}
if (UserSessionId != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(UserSessionId);
}
if (Id != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Id);
}
if (CoroutineId != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CoroutineId);
}
if (HopCnt != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(HopCnt);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(PacketHead other) {
if (other == null) {
return;
}
if (other.PacketId != 0) {
PacketId = other.PacketId;
}
if (other.SignType != 0) {
SignType = other.SignType;
}
if (other.Sign != 0) {
Sign = other.Sign;
}
if (other.UserId != 0) {
UserId = other.UserId;
}
if (other.SrcAddr != 0) {
SrcAddr = other.SrcAddr;
}
if (other.DstAddr != 0) {
DstAddr = other.DstAddr;
}
if (other.DispatchType != 0) {
DispatchType = other.DispatchType;
}
if (other.ServerType != 0) {
ServerType = other.ServerType;
}
if (other.DispatchKey != 0) {
DispatchKey = other.DispatchKey;
}
if (other.UserSessionId != 0) {
UserSessionId = other.UserSessionId;
}
if (other.Id != 0) {
Id = other.Id;
}
if (other.CoroutineId != 0) {
CoroutineId = other.CoroutineId;
}
if (other.HopCnt != 0) {
HopCnt = other.HopCnt;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
PacketId = input.ReadUInt32();
break;
}
case 16: {
SignType = input.ReadUInt32();
break;
}
case 24: {
Sign = input.ReadUInt32();
break;
}
case 32: {
UserId = input.ReadUInt32();
break;
}
case 40: {
SrcAddr = input.ReadUInt32();
break;
}
case 48: {
DstAddr = input.ReadUInt32();
break;
}
case 56: {
DispatchType = input.ReadUInt32();
break;
}
case 64: {
ServerType = input.ReadUInt32();
break;
}
case 72: {
DispatchKey = input.ReadUInt32();
break;
}
case 80: {
UserSessionId = input.ReadUInt32();
break;
}
case 88: {
Id = input.ReadUInt32();
break;
}
case 96: {
CoroutineId = input.ReadUInt32();
break;
}
case 104: {
HopCnt = input.ReadUInt32();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
PacketId = input.ReadUInt32();
break;
}
case 16: {
SignType = input.ReadUInt32();
break;
}
case 24: {
Sign = input.ReadUInt32();
break;
}
case 32: {
UserId = input.ReadUInt32();
break;
}
case 40: {
SrcAddr = input.ReadUInt32();
break;
}
case 48: {
DstAddr = input.ReadUInt32();
break;
}
case 56: {
DispatchType = input.ReadUInt32();
break;
}
case 64: {
ServerType = input.ReadUInt32();
break;
}
case 72: {
DispatchKey = input.ReadUInt32();
break;
}
case 80: {
UserSessionId = input.ReadUInt32();
break;
}
case 88: {
Id = input.ReadUInt32();
break;
}
case 96: {
CoroutineId = input.ReadUInt32();
break;
}
case 104: {
HopCnt = input.ReadUInt32();
break;
}
}
}
}
#endif
}
#endregion
}
#endregion Designer generated code

View file

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Remove="server_only.proto" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.25.2" />
<PackageReference Include="Grpc.Tools" Version="2.60.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Protobuf Include="server_only.proto" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,280 @@
namespace RPG.Network.Proto;
public static class Retcode
{
public const uint RET_SUCC = 0;
public const uint RET_FAIL = 1;
public const uint RET_SERVER_INTERNAL_ERROR = 2;
public const uint RET_TIMEOUT = 3;
public const uint RET_REPEATED_REQ = 4;
public const uint RET_REQ_PARA_INVALID = 5;
public const uint RET_PLAYER_DATA_ERROR = 6;
public const uint RET_PLAYER_CLIENT_PAUSED = 7;
public const uint RET_FUNC_CHECK_FAILED = 8;
public const uint RET_FEATURE_SWITCH_CLOSED = 9;
public const uint RET_REPEATE_LOGIN = 1000;
public const uint RET_RETRY_LOGIN = 1001;
public const uint RET_WAIT_LOGIN = 1002;
public const uint RET_NOT_IN_WHITE_LIST = 1003;
public const uint RET_IN_BLACK_LIST = 1004;
public const uint RET_ACCOUNT_VERIFY_ERROR = 1005;
public const uint RET_ACCOUNT_PARA_ERROR = 1006;
public const uint RET_ANTI_ADDICT_LOGIN = 1007;
public const uint RET_CHECK_SUM_ERROR = 1008;
public const uint RET_REACH_MAX_PLAYER_NUM = 1009;
public const uint RET_ALREADY_REGISTERED = 1010;
public const uint RET_GENDER_ERROR = 1011;
public const uint SET_NICKNAME_RET_CALLBACK_PROCESSING = 1012;
public const uint RET_IN_GM_BIND_ACCESS = 1013;
public const uint RET_QUEST_REWARD_ALREADY_TAKEN = 1100;
public const uint RET_QUEST_NOT_ACCEPT = 1101;
public const uint RET_QUEST_NOT_FINISH = 1102;
public const uint RET_QUEST_STATUS_ERROR = 1103;
public const uint RET_ACHIEVEMENT_LEVEL_NOT_REACH = 1104;
public const uint RET_ACHIEVEMENT_LEVEL_ALREADY_TAKEN = 1105;
public const uint RET_AVATAR_NOT_EXIST = 1200;
public const uint RET_AVATAR_RES_EXP_NOT_ENOUGH = 1201;
public const uint RET_AVATAR_EXP_REACH_PROMOTION_LIMIT = 1202;
public const uint RET_AVATAR_REACH_MAX_PROMOTION = 1203;
public const uint RET_SKILLTREE_CONFIG_NOT_EXIST = 1204;
public const uint RET_SKILLTREE_ALREADY_UNLOCK = 1205;
public const uint RET_SKILLTREE_PRE_LOCKED = 1206;
public const uint RET_SKILLTREE_LEVEL_NOT_MEET = 1207;
public const uint RET_SKILLTREE_RANK_NOT_MEET = 1208;
public const uint RET_AVATAR_DRESS_NO_EQUIPMENT = 1209;
public const uint RET_AVATAR_EXP_ITEM_NOT_EXIST = 1210;
public const uint RET_SKILLTREE_POINT_UNLOCK = 1211;
public const uint RET_SKILLTREE_POINT_LEVEL_UPGRADE_NOT_MATCH = 1212;
public const uint RET_SKILLTREE_POINT_LEVEL_REACH_MAX = 1213;
public const uint RET_WORLD_LEVEL_NOT_MEET = 1214;
public const uint RET_PLAYER_LEVEL_NOT_MEET = 1215;
public const uint RET_AVATAR_RANK_NOT_MATCH = 1216;
public const uint RET_AVATAR_RANK_REACH_MAX = 1217;
public const uint RET_HERO_BASIC_TYPE_NOT_MATCH = 1218;
public const uint RET_ITEM_NOT_EXIST = 1300;
public const uint RET_ITEM_COST_NOT_ENOUGH = 1301;
public const uint RET_ITEM_COST_TOO_MUCH = 1302;
public const uint RET_ITEM_NO_COST = 1303;
public const uint RET_ITEM_NOT_ENOUGH = 1304;
public const uint RET_ITEM_INVALID = 1305;
public const uint RET_ITEM_CONFIG_NOT_EXIST = 1306;
public const uint RET_SCOIN_NOT_ENOUGH = 1307;
public const uint RET_ITEM_REWARD_EXCEED_LIMIT = 1308;
public const uint RET_ITEM_INVALID_USE = 1309;
public const uint RET_ITEM_USE_CONFIG_NOT_EXIST = 1310;
public const uint RET_REWARD_CONFIG_NOT_EXIST = 1311;
public const uint RET_ITEM_EXCEED_LIMIT = 1312;
public const uint RET_ITEM_COUNT_INVALID = 1313;
public const uint RET_ITEM_USE_TARGET_TYPE_INVALID = 1314;
public const uint RET_ITEM_USE_SATIETY_FULL = 1315;
public const uint RET_ITEM_COMPOSE_NOT_EXIST = 1316;
public const uint RET_RELIC_COMPOSE_NOT_EXIST = 1317;
public const uint RET_ITEM_CAN_NOT_SELL = 1318;
public const uint RET_ITEM_SELL_EXCEDD_LIMIT = 1319;
public const uint RET_EQUIPMENT_ALREADY_DRESSED = 1350;
public const uint RET_EQUIPMENT_NOT_EXIST = 1351;
public const uint RET_EQUIPMENT_REACH_LEVEL_LIMIT = 1352;
public const uint RET_EQUIPMENT_CONSUME_SELF = 1353;
public const uint RET_EQUIPMENT_ALREADY_LOCKED = 1354;
public const uint RET_EQUIPMENT_ALREADY_UNLOCKED = 1355;
public const uint RET_EQUIPMENT_LOCKED = 1356;
public const uint RET_EQUIPMENT_SELECT_NUM_OVER_LIMIT = 1357;
public const uint RET_EQUIPMENT_RANK_UP_MUST_CONSUME_SAME_TID = 1358;
public const uint RET_EQUIPMENT_PROMOTION_REACH_MAX = 1359;
public const uint RET_EQUIPMENT_RANK_UP_REACH_MAX = 1360;
public const uint RET_EQUIPMENT_LEVEL_REACH_MAX = 1361;
public const uint RET_EQUIPMENT_EXCEED_LIMIT = 1362;
public const uint RET_RELIC_NOT_EXIST = 1363;
public const uint RET_RELIC_REACH_LEVEL_LIMIT = 1364;
public const uint RET_RELIC_CONSUME_SELF = 1365;
public const uint RET_RELIC_ALREADY_DRESSED = 1366;
public const uint RET_RELIC_LOCKED = 1367;
public const uint RET_RELIC_ALREADY_LOCKED = 1368;
public const uint RET_RELIC_ALREADY_UNLOCKED = 1369;
public const uint RET_RELIC_LEVEL_IS_NOT_ZERO = 1370;
public const uint RET_LINEUP_INVALID_INDEX = 1400;
public const uint RET_LINEUP_INVALID_MEMBER_POS = 1401;
public const uint RET_LINEUP_SWAP_NOT_EXIST = 1402;
public const uint RET_LINEUP_AVATAR_ALREADY_IN = 1403;
public const uint RET_LINEUP_CREATE_AVATAR_ERROR = 1404;
public const uint RET_LINEUP_AVATAR_INIT_ERROR = 1405;
public const uint RET_LINEUP_NOT_EXIST = 1406;
public const uint RET_LINEUP_ONLY_ONE_MEMBER = 1407;
public const uint RET_LINEUP_SAME_LEADER_SLOT = 1408;
public const uint RET_LINEUP_NO_LEADER_SELECT = 1409;
public const uint RET_LINEUP_SWAP_SAME_SLOT = 1410;
public const uint RET_LINEUP_AVATAR_NOT_EXIST = 1411;
public const uint RET_LINEUP_TRIAL_AVATAR_CAN_NOT_QUIT = 1412;
public const uint RET_LINEUP_VIRTUAL_LINEUP_PLANE_NOT_MATCH = 1413;
public const uint RET_LINEUP_NOT_VALID_LEADER = 1414;
public const uint RET_LINEUP_SAME_INDEX = 1415;
public const uint RET_LINEUP_IS_EMPTY = 1416;
public const uint RET_LINEUP_NAME_FORMAT_ERROR = 1417;
public const uint RET_LINEUP_TYPE_NOT_MATCH = 1418;
public const uint RET_LINEUP_REPLACE_ALL_FAILED = 1419;
public const uint RET_LINEUP_NOT_ALLOW_EDIT = 1420;
public const uint RET_MAIL_NOT_EXIST = 1700;
public const uint RET_MAIL_RANGE_INVALID = 1701;
public const uint RET_MAIL_MAIL_ID_INVALID = 1702;
public const uint RET_MAIL_NO_MAIL_TAKE_ATTACHMENT = 1703;
public const uint RET_MAIL_NO_MAIL_TO_DEL = 1704;
public const uint RET_STAGE_SETTLE_ERROR = 1800;
public const uint RET_STAGE_CONFIG_NOT_EXIST = 1801;
public const uint RET_STAGE_NOT_FOUND = 1802;
public const uint RET_STAGE_COCOON_PROP_NOT_VALID = 1804;
public const uint RET_STAGE_COCOON_WAVE_NOT_VALID = 1805;
public const uint RET_STAGE_PROP_ID_NOT_EQUAL = 1806;
public const uint RET_STAGE_COCOON_WAVE_OVER = 1807;
public const uint RET_STAGE_WEEK_COCOON_OVER_CNT = 1808;
public const uint RET_STAGE_COCOON_NOT_OPEN = 1809;
public const uint RET_CHAPTER_LOCK = 1900;
public const uint RET_CHAPTER_CHALLENGE_NUM_NOT_ENOUGH = 1901;
public const uint RET_CHAPTER_REWARD_ID_NOT_EXIST = 1902;
public const uint RET_CHAPTER_REWARD_ALREADY_TAKEN = 1903;
public const uint RET_BATTLE_STAGE_NOT_MATCH = 2000;
public const uint RET_IN_BATTLE_NOW = 2001;
public const uint RET_BATTLE_CHEAT = 2002;
public const uint RET_BATTLE_FAIL = 2003;
public const uint RET_BATTLE_NO_LINEUP = 2004;
public const uint RET_BATTLE_LINEUP_EMPTY = 2005;
public const uint RET_BATTLE_VERSION_NOT_MATCH = 2006;
public const uint RET_BATTLE_QUIT_BY_SERVER = 2007;
public const uint RET_LACK_EXCHANGE_STAMINA_TIMES = 2100;
public const uint RET_LACK_STAMINA = 2101;
public const uint RET_STAMINA_FULL = 2102;
public const uint RET_AUTHKEY_SIGN_TYPE_ERROR = 2103;
public const uint RET_AUTHKEY_SIGN_VER_ERROR = 2104;
public const uint RET_NICKNAME_FORMAT_ERROR = 2105;
public const uint RET_SENSITIVE_WORDS = 2106;
public const uint RET_LEVEL_REWARD_HAS_TAKEN = 2107;
public const uint RET_LEVEL_REWARD_LEVEL_ERROR = 2108;
public const uint RET_LANGUAGE_INVALID = 2109;
public const uint RET_MAZE_NOT_FINISH = 2200;
public const uint RET_MAZE_LACK_TICKET = 2201;
public const uint RET_MAZE_NOT_UNLOCK = 2202;
public const uint RET_MAZE_DIFFICULTY_LIMIT = 2203;
public const uint RET_MAZE_NO_ABILITY = 2204;
public const uint RET_MAZE_NO_PLANE = 2205;
public const uint RET_MAZE_STAGE_DISMATCH = 2206;
public const uint RET_MAZE_MAP_NOT_EXIST = 2207;
public const uint RET_MAZE_TYPE_NOT_EXIST = 2208;
public const uint RET_MAZE_ALREADY_FINISH = 2209;
public const uint RET_MAZE_PROP_NOT_EXIST = 2210;
public const uint RET_MAZE_POSITION_TOO_FAR = 2211;
public const uint RET_MAZE_SKILL_CAST_CNT_REACH_MAX = 2212;
public const uint RET_MAZE_MP_NOT_ENOUGH = 2213;
public const uint RET_SPRING_NOT_ENABLE = 2214;
public const uint RET_SPRING_REFRESH_IN_CD = 2215;
public const uint RET_SPRING_TOO_FAR = 2216;
public const uint RET_MAZE_NO_FLOOR = 2217;
public const uint RET_NOT_IN_MAZE = 2218;
public const uint RET_PLANE_ID_NOT_MATCH = 2219;
public const uint RET_FLOOR_ID_NOT_MATCH = 2220;
public const uint RET_SAVEPOINTS_TIMES_ZERO = 2221;
public const uint RET_MAZE_TIME_OF_DAY_TYPE_IS_SAME = 2222;
public const uint RET_MAZE_TIME_OF_DAY_TYPE_ERROR = 2223;
public const uint RET_PLOT_NOT_UNLOCK = 2300;
public const uint RET_MISSION_NOT_EXIST = 2400;
public const uint RET_MISSION_ALREADY_DONE = 2401;
public const uint RET_DAILY_TASK_NOT_FINISH = 2402;
public const uint RET_DAILY_TASK_REWARD_HAS_TAKEN = 2403;
public const uint RET_MISSION_NOT_FINISH = 2404;
public const uint RET_MISSION_NOT_DOING = 2405;
public const uint RET_MISSION_FINISH_WAY_NOT_MATCH = 2406;
public const uint RET_MISSION_SCENE_NOT_MATCH = 2407;
public const uint RET_ADVENTURE_MAP_NOT_EXIST = 2500;
public const uint RET_SCENE_ENTITY_NOT_EXIST = 2600;
public const uint RET_NOT_IN_SCENE = 2601;
public const uint RET_SCENE_MONSTER_NOT_EXIST = 2602;
public const uint RET_INTERACT_CONFIG_NOT_EXIST = 2603;
public const uint RET_UNSUPPORTED_PROP_STATE = 2604;
public const uint RET_SCENE_ENTRY_ID_NOT_MATCH = 2605;
public const uint RET_ASSIST_MONSTER_COUNT_LIMIT = 2607;
public const uint RET_SCENE_USE_SKILL_FAIL = 2608;
public const uint RET_PROP_IS_HIDDEN = 2609;
public const uint RET_LOADING_SUCC_ALREADY = 2610;
public const uint RET_SCENE_ENTITY_TYPE_INVALID = 2611;
public const uint RET_INTERACT_TYPE_INVALID = 2612;
public const uint RET_INTERACT_NOT_IN_REGION = 2613;
public const uint RET_INTERACT_SUB_TYPE_INVALID = 2614;
public const uint RET_NOT_LEADER_ENTITY = 2615;
public const uint RET_MONSTER_IS_NOT_FARM_ELEMENT = 2616;
public const uint RET_MONSTER_CONFIG_NOT_EXIST = 2617;
public const uint RET_BUY_TIMES_LIMIT = 2700;
public const uint RET_BUY_LIMIT_TYPE = 2701;
public const uint RET_SHOP_NOT_OPEN = 2702;
public const uint RET_GOODS_NOT_OPEN = 2703;
public const uint RET_TUTORIAL_NOT_UNLOCK = 2751;
public const uint RET_TUTORIAL_UNLOCK_ALREADY = 2752;
public const uint RET_TUTORIAL_FINISH_ALREADY = 2753;
public const uint RET_TUTORIAL_PRE_NOT_UNLOCK = 2754;
public const uint RET_TUTORIAL_PLAYER_LEVEL_NOT_MATCH = 2755;
public const uint RET_TUTORIAL_TUTORIAL_NOT_FOUND = 2756;
public const uint RET_CHALLENGE_NOT_EXIST = 2801;
public const uint RET_CHALLENGE_NOT_UNLOCK = 2802;
public const uint RET_CHALLENGE_ALREADY = 2803;
public const uint RET_CHALLENGE_LINEUP_EDIT_FORBIDDEN = 2804;
public const uint RET_CHALLENGE_LINEUP_EMPTY = 2805;
public const uint RET_CHALLENGE_NOT_DOING = 2806;
public const uint RET_CHALLENGE_NOT_FINISH = 2807;
public const uint RET_CHALLENGE_TARGET_NOT_FINISH = 2808;
public const uint RET_CHALLENGE_TARGET_REWARD_TAKEN = 2809;
public const uint RET_CHALLENGE_TIME_NOT_VALID = 2810;
public const uint RET_BASIC_TYPE_ALREADY = 2850;
public const uint RET_NO_BASIC_TYPE = 2851;
public const uint RET_NOT_CHOOSE_BASIC_TYPE = 2852;
public const uint RET_NOT_FUNC_CLOSE = 2853;
public const uint RET_ROGUE_STATUS_NOT_MATCH = 2901;
public const uint RET_ROGUE_SELECT_BUFF_NOT_EXIST = 2902;
public const uint RET_ROGUE_COIN_NOT_ENOUGH = 2903;
public const uint RET_ROGUE_STAMINA_NOT_ENOUGH = 2904;
public const uint RET_ROGUE_COUNT_INVALID = 2905;
public const uint RET_ROGUE_PROP_ALREADY_USED = 2906;
public const uint RET_ROGUE_RECORD_ALREADY_SAVED = 2907;
public const uint RET_ROGUE_ROLL_BUFF_MAX_COUNT = 2908;
public const uint RET_ROGUE_PICK_AVATAR_INVALID = 2909;
public const uint RET_MISSION_EVENT_CONFIG_NOT_EXIST = 2951;
public const uint RET_MISSION_EVENT_NOT_CLIENT = 2952;
public const uint RET_MISSION_EVENT_FINISHED = 2953;
public const uint RET_MISSION_EVENT_DOING = 2954;
public const uint RET_HAS_CHALLENGE_MISSION_EVENT = 2955;
public const uint RET_NOT_CHALLENGE_MISSION_EVENT = 2956;
public const uint RET_GACHA_ID_NOT_EXIST = 3001;
public const uint RET_GACHA_NUM_INVALID = 3002;
public const uint RET_GACHA_FIRST_GACHA_MUST_ONE = 3003;
public const uint RET_GACHA_REQ_DUPLICATED = 3004;
public const uint RET_GACHA_NOT_IN_SCHEDULE = 3005;
public const uint RET_GACHA_NEWBIE_CLOSE = 3006;
public const uint RET_GACHA_TODAY_LIMITED = 3007;
public const uint RET_PRESTIGE_ID_NOT_EXIST = 3051;
public const uint RET_PRESTIGE_LEVEL_REWARD_LEVEL_ERROR = 3052;
public const uint RET_PRESTIGE_LEVEL_REWARD_HAS_TAKEN = 3053;
public const uint RET_PRESTIGE_MISSION_NOT_EXIST = 3054;
public const uint RET_PRESTIGE_MISSION_NOT_FINISHED = 3055;
public const uint RET_PRESTIGE_MISSION_REWARD_HAS_TAKEN = 3056;
public const uint RET_NOT_IN_RAID = 3101;
public const uint RET_RAID_DOING = 3102;
public const uint RET_NOT_PROP = 3103;
public const uint RET_RAID_ID_NOT_MATCH = 3104;
public const uint RET_RAID_RESTART_NOT_MATCH = 3105;
public const uint RET_RAID_LIMIT = 3106;
public const uint RET_RAID_AVATAR_LIST_EMPTY = 3107;
public const uint RET_RAID_AVATAR_NOT_EXIST = 3108;
public const uint RET_CHALLENGE_RAID_REWARD_ALREADY = 3109;
public const uint RET_CHALLENGE_RAID_SCORE_NOT_REACH = 3110;
public const uint RET_CHALLENGE_RAID_NOT_OPEN = 3111;
public const uint RET_TALK_EVENT_ALREADY_TAKEN = 3151;
public const uint RET_NPC_ALREADY_MEET = 3152;
public const uint RET_NPC_NOT_IN_CONFIG = 3153;
public const uint RET_DIALOGUE_GROUP_DISMATCH = 3154;
public const uint RET_EXPEDITION_CONFIG_NOT_EXIST = 3201;
public const uint RET_EXPEDITION_REWARD_CONFIG_NOT_EXIST = 3202;
public const uint RET_EXPEDITION_NOT_UNLOCKED = 3203;
public const uint RET_EXPEDITION_ALREADY_ACCEPTED = 3204;
public const uint RET_EXPEDITION_REPEATED_AVATAR = 3205;
public const uint RET_AVATAR_ALREADY_DISPATCHED = 3206;
public const uint RET_EXPEDITION_NOT_ACCEPTED = 3207;
public const uint RET_EXPEDITION_NOT_FINISH = 3208;
public const uint RET_EXPEDITION_ALREADY_FINISH = 3209;
public const uint RET_LOGIN_ACTIVITY_HAS_TAKEN = 3301;
public const uint RET_LOGIN_ACTIVITY_DAYS_LACK = 3302;
}

View file

@ -0,0 +1,61 @@
syntax = "proto3";
option csharp_namespace = "RPG.Network.Proto";
enum RPGServiceType
{
RPG_SERVICE_TYPE_NONE = 0;
RPG_SERVICE_TYPE_SDK = 1;
RPG_SERVICE_TYPE_GATESERVER = 2;
RPG_SERVICE_TYPE_GAMESERVER = 3;
RPG_SERVICE_TYPE_MUIPSERVER = 4;
}
enum ServiceCommandType
{
SERVICE_COMMAND_TYPE_NONE = 0;
SERVICE_COMMAND_TYPE_GMTALK_BY_MUIP = 10;
SERVICE_COMMAND_TYPE_BIND_CONTAINER = 100;
SERVICE_COMMAND_TYPE_BIND_CONTAINER_RESULT = 101;
SERVICE_COMMAND_TYPE_UNBIND_CONTAINER = 102;
SERVICE_COMMAND_TYPE_FORWARD_GAME_MESSAGE = 103;
}
message CmdGmtalkByMuip
{
uint64 session_id = 1;
string msg = 2;
}
message CmdBindContainer
{
uint64 session_id = 1;
uint32 player_uid = 2;
}
message CmdBindContainerResult
{
uint32 retcode = 1;
uint64 session_id = 2;
RPGServiceType service_type = 3;
}
message CmdUnbindContainer
{
UnbindContainerReason reason = 1;
uint64 session_id = 2;
enum UnbindContainerReason
{
UNBIND_CONTAINER_REASON_NONE = 0;
UNBIND_CONTAINER_REASON_LOGOUT = 1;
UNBIND_CONTAINER_REASON_KICK = 2;
}
}
message CmdForwardGameMessage
{
uint32 cmd_type = 1;
bytes payload = 2;
uint64 session_id = 3;
}

View file

@ -0,0 +1,31 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using RPG.Services.Core.Network;
using RPG.Services.Core.Network.Command;
using RPG.Services.Core.Options;
using RPG.Services.Core.Session;
namespace RPG.Services.Core.Extensions;
public static class HostApplicationBuilderExtensions
{
public static IHostApplicationBuilder SetupRPGService<TService, TCommandHandler>(this IHostApplicationBuilder builder, bool stateless = false)
where TService : RPGServiceBase
where TCommandHandler : ServiceCommandHandler
{
IConfigurationSection serviceOptionsSection = builder.Configuration.GetRequiredSection("Service");
IConfigurationSection serviceNodesSection = builder.Configuration.GetRequiredSection("Nodes");
builder.Services.Configure<RPGServiceOptions>(serviceOptionsSection)
.Configure<ServiceNodeOptions>(serviceNodesSection);
builder.Services.AddHostedService<TService>()
.AddSingleton<ServiceManager>()
.AddSingleton<ServiceBox>()
.AddSingleton<ServiceCommandHandler, TCommandHandler>();
if (!stateless) builder.Services.AddSingleton<SessionManager>();
return builder;
}
}

View file

@ -0,0 +1,14 @@
using RPG.Network.Proto;
namespace RPG.Services.Core.Network.Attributes;
[AttributeUsage(AttributeTargets.Method)]
public class ServiceCommandAttribute : Attribute
{
public ServiceCommandType CommandType { get; }
public ServiceCommandAttribute(ServiceCommandType commandType)
{
CommandType = commandType;
}
}

View file

@ -0,0 +1,16 @@
using RPG.Network.Proto;
namespace RPG.Services.Core.Network.Command;
public class ServiceCommand
{
public RPGServiceType SenderType { get; }
public ServiceCommandType CommandType { get; }
public ReadOnlyMemory<byte> Body { get; }
public ServiceCommand(RPGServiceType sender, ServiceCommandType commandType, ReadOnlyMemory<byte> body)
{
SenderType = sender;
CommandType = commandType;
Body = body;
}
}

View file

@ -0,0 +1,27 @@
using System.Buffers.Binary;
using RPG.Network.Proto;
namespace RPG.Services.Core.Network.Command;
public static class ServiceCommandEncoder
{
public static ServiceCommand DecodeCommand(ReadOnlyMemory<byte> buffer)
{
ReadOnlySpan<byte> span = buffer.Span;
RPGServiceType senderType = (RPGServiceType)span[0];
ServiceCommandType commandType = (ServiceCommandType)BinaryPrimitives.ReadUInt16BigEndian(span[1..3]);
ReadOnlyMemory<byte> body = buffer.Slice(7, BinaryPrimitives.ReadInt32BigEndian(span[3..7]));
return new(senderType, commandType, body);
}
public static void EncodeCommand(ServiceCommand command, Memory<byte> buffer)
{
Span<byte> span = buffer.Span;
span[0] = (byte)command.SenderType;
BinaryPrimitives.WriteUInt16BigEndian(span[1..3], (ushort)command.CommandType);
BinaryPrimitives.WriteInt32BigEndian(span[3..7], command.Body.Length);
command.Body.CopyTo(buffer[7..]);
}
}

View file

@ -0,0 +1,66 @@
using System.Collections.Immutable;
using System.Linq.Expressions;
using System.Reflection;
using Google.Protobuf;
using Microsoft.Extensions.Logging;
using RPG.Network.Proto;
using RPG.Services.Core.Network.Attributes;
namespace RPG.Services.Core.Network.Command;
public abstract class ServiceCommandHandler
{
private delegate Task HandlerDelegate(ServiceCommand command);
private readonly ImmutableDictionary<ServiceCommandType, HandlerDelegate> _handlers;
private readonly ILogger _logger;
private readonly ServiceBox _services;
public ServiceCommandHandler(ILogger<ServiceCommandHandler> logger, ServiceBox services)
{
_logger = logger;
_services = services;
_handlers = MapHandlers();
}
public async Task HandleAsync(ServiceCommand command)
{
if (_handlers.TryGetValue(command.CommandType, out HandlerDelegate? handler))
{
await handler(command);
}
else
{
_logger.LogWarning("Handler for service command of type {type} not found!", command.CommandType);
}
}
protected void Send<TBody>(ServiceCommandType commandType, TBody body, RPGServiceType target) where TBody : IMessage<TBody>
{
ServiceCommand command = new(_services.CurrentType, commandType, body.ToByteArray());
byte[] buffer = GC.AllocateUninitializedArray<byte>(command.Body.Length + 7);
ServiceCommandEncoder.EncodeCommand(command, buffer);
_services.SendToService(target, buffer);
}
private ImmutableDictionary<ServiceCommandType, HandlerDelegate> MapHandlers()
{
var builder = ImmutableDictionary.CreateBuilder<ServiceCommandType, HandlerDelegate>();
IEnumerable<MethodInfo> methods = GetType().GetMethods().Where(m => m.GetCustomAttribute<ServiceCommandAttribute>() != null);
foreach (MethodInfo method in methods)
{
ServiceCommandAttribute attribute = method.GetCustomAttribute<ServiceCommandAttribute>()!;
Expression self = Expression.Convert(Expression.Constant(this), GetType());
ParameterExpression commandParameter = Expression.Parameter(typeof(ServiceCommand));
MethodCallExpression call = Expression.Call(self, method, commandParameter);
Expression<HandlerDelegate> lambda = Expression.Lambda<HandlerDelegate>(call, commandParameter);
builder.Add(attribute.CommandType, lambda.Compile());
}
return builder.ToImmutable();
}
}

View file

@ -0,0 +1,52 @@
using System.Collections.Immutable;
using Microsoft.Extensions.Options;
using NetMQ;
using NetMQ.Sockets;
using RPG.Network.Proto;
using RPG.Services.Core.Options;
namespace RPG.Services.Core.Network;
public class ServiceBox
{
private readonly IOptions<ServiceNodeOptions> _nodeOptions;
private readonly IOptions<RPGServiceOptions> _serviceOptions;
private ImmutableDictionary<RPGServiceType, NetMQSocket>? _sockets;
public ServiceBox(IOptions<ServiceNodeOptions> nodeOptions, IOptions<RPGServiceOptions> serviceOptions)
{
_nodeOptions = nodeOptions;
_serviceOptions = serviceOptions;
}
public RPGServiceType CurrentType => _serviceOptions.Value.ServiceType;
public void Construct()
{
var builder = ImmutableDictionary.CreateBuilder<RPGServiceType, NetMQSocket>();
foreach (ServiceNodeOptions.Entry entry in _nodeOptions.Value)
{
if (entry.Type == CurrentType) continue;
NetMQSocket socket = new PushSocket($">tcp://{entry.Host}:{entry.Port}");
socket.Options.SendHighWatermark = 10000;
builder.Add(entry.Type, socket);
}
_sockets = builder.ToImmutable();
}
public void SendToService(RPGServiceType serviceType, byte[] data)
{
if (_sockets == null) throw new InvalidOperationException("SendToService called when socket map not constructed!");
if (_sockets.TryGetValue(serviceType, out NetMQSocket? socket))
{
lock (socket)
{
socket.SendFrame(data);
}
}
}
}

View file

@ -0,0 +1,56 @@
using NetMQ;
using NetMQ.Sockets;
using RPG.Services.Core.Network.Command;
using RPG.Services.Core.Options;
namespace RPG.Services.Core.Network;
internal class ServiceEndPoint
{
private readonly NetMQSocket _socket;
private CancellationTokenSource? _receiveCancellation;
public delegate Task CommandEventHandler(ServiceCommand command);
public event CommandEventHandler? OnCommand;
public ServiceEndPoint(ServiceNodeOptions.Entry optionsEntry)
{
_socket = new PullSocket($"@tcp://{optionsEntry.Host}:{optionsEntry.Port}");
_socket.Options.ReceiveHighWatermark = 10000;
}
public void Start()
{
_receiveCancellation = new();
_ = Task.Run(() => Receive(_receiveCancellation.Token));
}
private async Task Receive(CancellationToken cancellationToken)
{
try
{
while (!cancellationToken.IsCancellationRequested)
{
NetMQMessage netMessage = _socket.ReceiveMultipartMessage();
while (!netMessage.IsEmpty)
{
byte[] buffer = netMessage.Pop().Buffer;
if (OnCommand != null)
await OnCommand(ServiceCommandEncoder.DecodeCommand(buffer));
}
}
}
catch
{
if (!_socket.IsDisposed) _socket.Close();
}
}
public async Task StopAsync()
{
if (_receiveCancellation != null)
{
await _receiveCancellation.CancelAsync();
}
}
}

View file

@ -0,0 +1,7 @@
using RPG.Network.Proto;
namespace RPG.Services.Core.Options;
public class RPGServiceOptions
{
public required RPGServiceType ServiceType { get; set; }
}

View file

@ -0,0 +1,17 @@
using RPG.Network.Proto;
namespace RPG.Services.Core.Options;
public class ServiceNodeOptions : List<ServiceNodeOptions.Entry>
{
public class Entry
{
public required RPGServiceType Type { get; set; }
public required string Host { get; set; }
public required int Port { get; set; }
}
public Entry GetEntry(RPGServiceType type)
{
return Find(e => e.Type == type) ?? throw new ArgumentException("Entry not found", nameof(type));
}
}

View file

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="NetMQ" Version="4.0.1.13" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RPG.GameCore\RPG.GameCore.csproj" />
<ProjectReference Include="..\RPG.Network.Proto\RPG.Network.Proto.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,24 @@
using Microsoft.Extensions.Hosting;
namespace RPG.Services.Core;
public abstract class RPGServiceBase : IHostedService
{
private readonly ServiceManager _serviceManager;
public RPGServiceBase(ServiceManager serviceManager)
{
_serviceManager = serviceManager;
}
public virtual Task StartAsync(CancellationToken cancellationToken)
{
_serviceManager.Start();
return Task.CompletedTask;
}
public virtual async Task StopAsync(CancellationToken cancellationToken)
{
await _serviceManager.ShutdownAsync();
}
}

View file

@ -0,0 +1,44 @@
using Microsoft.Extensions.Options;
using RPG.Services.Core.Network;
using RPG.Services.Core.Network.Command;
using RPG.Services.Core.Options;
namespace RPG.Services.Core;
public class ServiceManager
{
private readonly IOptions<ServiceNodeOptions> _nodeOptions;
private readonly IOptions<RPGServiceOptions> _serviceOptions;
private readonly ServiceCommandHandler _handler;
private readonly ServiceBox _serviceBox;
private ServiceEndPoint? _serviceEndPoint;
public ServiceManager(IOptions<ServiceNodeOptions> options, IOptions<RPGServiceOptions> serviceOptions, ServiceCommandHandler commandHandler, ServiceBox serviceBox)
{
_nodeOptions = options;
_serviceOptions = serviceOptions;
_handler = commandHandler;
_serviceBox = serviceBox;
}
public void Start()
{
ServiceNodeOptions nodeOptions = _nodeOptions.Value;
RPGServiceOptions serviceOptions = _serviceOptions.Value;
_serviceBox.Construct();
_serviceEndPoint = new(nodeOptions.GetEntry(serviceOptions.ServiceType));
_serviceEndPoint.OnCommand += _handler.HandleAsync;
_serviceEndPoint.Start();
}
public async Task ShutdownAsync()
{
if (_serviceEndPoint != null)
{
await _serviceEndPoint.StopAsync();
_serviceEndPoint.OnCommand -= _handler.HandleAsync;
}
}
}

View file

@ -0,0 +1,49 @@
using Google.Protobuf;
using RPG.Network.Proto;
using RPG.Services.Core.Network;
using RPG.Services.Core.Network.Command;
namespace RPG.Services.Core.Session;
public abstract class RPGSession : IDisposable
{
private readonly ServiceBox _serviceBox;
public ulong SessionId { get; }
public uint PlayerUid { get; set; }
public RPGSession(ulong sessionId, ServiceBox serviceBox)
{
SessionId = sessionId;
_serviceBox = serviceBox;
}
public void SendToService<TBody>(RPGServiceType target, ServiceCommandType commandType, TBody body) where TBody : IMessage<TBody>
{
ServiceCommand command = new(_serviceBox.CurrentType, commandType, body.ToByteArray());
byte[] commandBuffer = GC.AllocateUninitializedArray<byte>(7 + command.Body.Length);
ServiceCommandEncoder.EncodeCommand(command, commandBuffer);
_serviceBox.SendToService(target, commandBuffer);
}
public void BindService(RPGServiceType service)
{
SendToService(service, ServiceCommandType.BindContainer, new CmdBindContainer
{
SessionId = SessionId,
PlayerUid = PlayerUid
});
}
public void UnbindService(RPGServiceType service, CmdUnbindContainer.Types.UnbindContainerReason reason = CmdUnbindContainer.Types.UnbindContainerReason.Logout)
{
SendToService(service, ServiceCommandType.UnbindContainer, new CmdUnbindContainer
{
SessionId = SessionId,
Reason = reason
});
}
public abstract void Dispose();
}

View file

@ -0,0 +1,52 @@
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace RPG.Services.Core.Session;
public class SessionManager
{
private readonly ConcurrentDictionary<ulong, RPGSession> _sessions;
private readonly IServiceProvider _serviceProvider;
private readonly ILogger _logger;
public SessionManager(IServiceProvider serviceProvider, ILogger<SessionManager> logger)
{
_sessions = [];
_serviceProvider = serviceProvider;
_logger = logger;
}
public TSession? Create<TSession>(ulong id) where TSession : RPGSession
{
if (_sessions.ContainsKey(id)) return null;
TSession session = ActivatorUtilities.CreateInstance<TSession>(_serviceProvider, id);
_sessions[id] = session;
_logger.LogInformation("New session (id={id}) registered", id);
return session;
}
public bool TryGet<TSession>(ulong id, [NotNullWhen(true)] out TSession? session) where TSession : RPGSession
{
if (_sessions.TryGetValue(id, out RPGSession? value))
{
session = (TSession)value;
return true;
}
session = null;
return false;
}
public void Remove(RPGSession session)
{
if (_sessions.TryRemove(session.SessionId, out _))
{
session.Dispose();
_logger.LogInformation("Session with id {id} was unregistered", session.SessionId);
}
}
}

View file

@ -0,0 +1,20 @@
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using RPG.Services.Gameserver.Modules;
namespace RPG.Services.Gameserver.Extensions;
internal static class ServiceCollectionExtensions
{
public static IServiceCollection AddModules(this IServiceCollection services)
{
IEnumerable<Type> types = Assembly.GetExecutingAssembly().GetTypes()
.Where(type => type.IsAssignableTo(typeof(BaseModule)) && !type.IsAbstract);
foreach (Type type in types)
{
services.AddScoped(type);
}
return services;
}
}

View file

@ -0,0 +1,138 @@
using RPG.GameCore.Excel;
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
[GMAlias("adventure")]
internal class AdventureModule : BaseModule
{
private readonly ExcelTables _tables;
public AdventureModule(ExcelTables excelTables)
{
_tables = excelTables;
}
[GMCommand("maze")]
public Task OnGmEnterMaze(PlayerSession session, string[] args)
{
if (args.Length != 1) return Task.CompletedTask;
if (!uint.TryParse(args[0], out uint entryId))
return Task.CompletedTask;
MapEntryRow? entry = _tables.GetExcelRow<MapEntryRow>(ExcelType.MapEntry, entryId);
if (entry == null) return Task.CompletedTask;
Send(session, CmdType.CmdEnterMazeByServerScNotify, new EnterMazeByServerScNotify
{
Maze = new Maze
{
MapEntryId = entry.ID,
Id = entry.PlaneID,
Floor = new MazeFloor
{
FloorId = entry.FloorID,
Scene = new SceneInfo
{
EntryId = entry.ID,
PlaneId = entry.PlaneID,
FloorId = entry.FloorID
}
}
},
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetCurSceneInfoCsReq)]
public Task OnCmdGetCurSceneInfoCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetCurSceneInfoScRsp, new GetCurSceneInfoScRsp
{
Retcode = 0,
Scene = new SceneInfo
{
PlaneId = 20001,
FloorId = 20001001,
EntryId = 2000101,
GameModeType = 1
}
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetMazeMapInfoCsReq)]
public Task OnCmdGetMazeMapInfoCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
GetMazeMapInfoCsReq req = GetMazeMapInfoCsReq.Parser.ParseFrom(body.Span);
Send(session, CmdType.CmdGetMazeMapInfoScRsp, new GetMazeMapInfoScRsp
{
Retcode = 0,
EntryId = req.EntryId,
// TODO:
LightenSectionList = { },
MazeGroupList = { },
MazePropList = { }
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdEnterMazeCsReq)]
public Task OnCmdEnterMazeCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
EnterMazeCsReq req = EnterMazeCsReq.Parser.ParseFrom(body.Span);
MapEntryRow? entry = _tables.GetExcelRow<MapEntryRow>(ExcelType.MapEntry, req.EntryId);
if (entry == null)
{
Send(session, CmdType.CmdEnterMazeScRsp, new EnterMazeScRsp
{
Retcode = Retcode.RET_MAZE_MAP_NOT_EXIST
});
return Task.CompletedTask;
}
Send(session, CmdType.CmdEnterMazeScRsp, new EnterMazeScRsp
{
Retcode = 0,
Maze = new Maze
{
MapEntryId = entry.ID,
Id = entry.PlaneID,
Floor = new MazeFloor
{
FloorId = entry.FloorID,
Scene = new SceneInfo
{
EntryId = entry.ID,
PlaneId = entry.PlaneID,
FloorId = entry.FloorID,
GameModeType = 1
}
}
},
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetCurBattleInfoCsReq)]
public Task OnCmdGetCurBattleInfoCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetCurBattleInfoScRsp, new GetCurBattleInfoScRsp
{
BattleInfo = new(),
LastEndStatus = BattleEndStatus.BattleEndNone
});
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,12 @@
namespace RPG.Services.Gameserver.Modules.Attributes;
[AttributeUsage(AttributeTargets.Class)]
internal class GMAliasAttribute : Attribute
{
public string Alias { get; }
public GMAliasAttribute(string alias)
{
Alias = alias;
}
}

View file

@ -0,0 +1,12 @@
namespace RPG.Services.Gameserver.Modules.Attributes;
[AttributeUsage(AttributeTargets.Method)]
internal class GMCommandAttribute : Attribute
{
public string Command { get; }
public GMCommandAttribute(string command)
{
Command = command;
}
}

View file

@ -0,0 +1,14 @@
using RPG.Network.Proto;
namespace RPG.Services.Gameserver.Modules.Attributes;
[AttributeUsage(AttributeTargets.Method)]
internal class OnCommandAttribute : Attribute
{
public CmdType CmdType { get; }
public OnCommandAttribute(CmdType cmdType)
{
CmdType = cmdType;
}
}

View file

@ -0,0 +1,36 @@
using RPG.GameCore.Excel;
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class AvatarModule : BaseModule
{
private readonly ExcelTables _excelTables;
public AvatarModule(ExcelTables excelTables)
{
_excelTables = excelTables;
}
[OnCommand(CmdType.CmdGetAvatarDataCsReq)]
public Task OnCmdGetAvatarDataCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
GetAvatarDataCsReq req = GetAvatarDataCsReq.Parser.ParseFrom(body.Span);
GetAvatarDataScRsp rsp = new()
{
IsAll = req.IsGetAll
};
rsp.AvatarList.AddRange(_excelTables.GetAllRows(ExcelType.Avatar).Where(row => row.Id is < 1200 or 8001).Select(row => new Avatar
{
BaseAvatarId = row.Id,
Level = 1,
Rank = 6
}));
Send(session, CmdType.CmdGetAvatarDataScRsp, rsp);
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,17 @@
using Google.Protobuf;
using RPG.Network.Proto;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal abstract class BaseModule
{
protected static void Send<TBody>(PlayerSession session, CmdType cmdType, TBody body) where TBody : IMessage<TBody>
{
session.SendToService(RPGServiceType.Gateserver, ServiceCommandType.ForwardGameMessage, new CmdForwardGameMessage
{
SessionId = session.SessionId,
CmdType = (ushort)cmdType,
Payload = body.ToByteString()
});
}
}

View file

@ -0,0 +1,19 @@
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class ChallengeModule : BaseModule
{
[OnCommand(CmdType.CmdGetChallengeCsReq)]
public Task OnCmdGetChallengeCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetChallengeScRsp, new GetChallengeScRsp
{
Retcode = 0,
ChallengeList = { }
});
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,20 @@
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class InventoryModule : BaseModule
{
[OnCommand(CmdType.CmdGetBagCsReq)]
public Task OnCmdGetBagCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetBagScRsp, new GetBagScRsp
{
Retcode = 0,
EquipmentList = { },
MaterialList = { }
});
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,28 @@
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class LoginModule : BaseModule
{
[OnCommand(CmdType.CmdPlayerLoginCsReq)]
public Task OnCmdPlayerLoginCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
PlayerLoginCsReq req = PlayerLoginCsReq.Parser.ParseFrom(body.Span);
Send(session, CmdType.CmdPlayerLoginScRsp, new PlayerLoginScRsp
{
Retcode = 0,
LoginRandom = req.LoginRandom,
Stamina = 180,
ServerTimestampMs = (ulong)DateTimeOffset.Now.ToUnixTimeMilliseconds(),
BasicInfo = new()
{
Level = 5,
Stamina = 180,
Nickname = "KafkaSR"
}
});
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,18 @@
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class MailModule : BaseModule
{
[OnCommand(CmdType.CmdGetMailCsReq)]
public Task OnCmdGetMailCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
Send(session, CmdType.CmdGetMailScRsp, new GetMailScRsp
{
Retcode = 0
});
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,56 @@
using RPG.GameCore.Excel;
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class MissionModule : BaseModule
{
private readonly ExcelTables _excelTables;
public MissionModule(ExcelTables excelTables)
{
_excelTables = excelTables;
}
[OnCommand(CmdType.CmdGetMissionDataCsReq)]
public Task OnCmdGetMissionDataCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
GetMissionDataScRsp rsp = new();
Send(session, CmdType.CmdGetMissionDataScRsp, rsp);
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetMissionStatusCsReq)]
public Task OnCmdGetMissionStatusCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
GetMissionStatusCsReq req = GetMissionStatusCsReq.Parser.ParseFrom(body.Span);
GetMissionStatusScRsp rsp = new();
rsp.FinishedMainMissionIdList.AddRange(_excelTables.GetAllRows(ExcelType.MainMission).Select(row => row.Id));
foreach (uint id in req.SubMissionIdList)
{
rsp.SubMissionStatusList.Add(new Mission
{
Id = id,
Progress = 0,
Status = MissionStatus.MissionFinish
});
}
foreach (uint id in req.MissionEventIdList)
{
rsp.MissionEventStatusList.Add(new Mission
{
Id = id,
Progress = 0,
Status = MissionStatus.MissionFinish
});
}
Send(session, CmdType.CmdGetMissionStatusScRsp, rsp);
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,136 @@
using System.Collections.Immutable;
using System.Linq.Expressions;
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class ModuleManager
{
private delegate Task ReqHandler(PlayerSession session, IServiceProvider serviceProvider, ReadOnlyMemory<byte> body);
private static readonly ImmutableDictionary<CmdType, ReqHandler> s_reqHandlers;
private delegate Task GmCommandHandler(IServiceProvider provider, PlayerSession session, string[] args);
private static readonly ImmutableDictionary<string, ImmutableDictionary<string, GmCommandHandler>> s_gmCommandMap;
private readonly IServiceProvider _serviceProvider;
private readonly ILogger _logger;
static ModuleManager()
{
s_reqHandlers = MapReqHandlers();
s_gmCommandMap = MapGmCommandHandlers();
}
public ModuleManager(IServiceProvider serviceProvider, ILogger<ModuleManager> logger)
{
_serviceProvider = serviceProvider;
_logger = logger;
}
public TModule Get<TModule>() where TModule : BaseModule
{
return _serviceProvider.GetRequiredService<TModule>();
}
public async Task HandleGmCommandAsync(PlayerSession session, string[] args)
{
if (args.Length < 2) return;
if (s_gmCommandMap.TryGetValue(args[0], out var map))
{
if (map.TryGetValue(args[1], out GmCommandHandler? handler))
{
await handler(_serviceProvider, session, args[2..]);
}
}
}
public async Task HandleAsync(PlayerSession session, CmdType cmdType, ReadOnlyMemory<byte> body)
{
if (s_reqHandlers.TryGetValue(cmdType, out var handler))
{
await handler(session, _serviceProvider, body);
_logger.LogInformation("Successfully handled command of type {cmdType}", cmdType);
}
else
{
_logger.LogWarning("Handler for command of type {cmdType} not defined!", cmdType);
}
}
private static ImmutableDictionary<CmdType, ReqHandler> MapReqHandlers()
{
var builder = ImmutableDictionary.CreateBuilder<CmdType, ReqHandler>();
IEnumerable<Type> types = Assembly.GetExecutingAssembly().GetTypes()
.Where(type => type.IsAssignableTo(typeof(BaseModule)) && !type.IsAbstract);
MethodInfo getServiceMethod = typeof(ServiceProviderServiceExtensions).GetMethod("GetRequiredService", [typeof(IServiceProvider)])!;
foreach (Type type in types)
{
IEnumerable<MethodInfo> methods = type.GetMethods()
.Where(method => method.GetCustomAttribute<OnCommandAttribute>() != null);
foreach (MethodInfo method in methods)
{
OnCommandAttribute attribute = method.GetCustomAttribute<OnCommandAttribute>()!;
ParameterExpression sessionParam = Expression.Parameter(typeof(PlayerSession));
ParameterExpression serviceProviderParam = Expression.Parameter(typeof(IServiceProvider));
ParameterExpression bodyParam = Expression.Parameter(typeof(ReadOnlyMemory<byte>));
MethodCallExpression getServiceCall = Expression.Call(getServiceMethod.MakeGenericMethod(type), serviceProviderParam);
MethodCallExpression handlerCall = Expression.Call(getServiceCall, method, sessionParam, bodyParam);
Expression<ReqHandler> lambda = Expression.Lambda<ReqHandler>(handlerCall, sessionParam, serviceProviderParam, bodyParam);
builder.Add(attribute.CmdType, lambda.Compile());
}
}
return builder.ToImmutable();
}
private static ImmutableDictionary<string, ImmutableDictionary<string, GmCommandHandler>> MapGmCommandHandlers()
{
var builder = ImmutableDictionary.CreateBuilder<string, ImmutableDictionary<string, GmCommandHandler>>();
IEnumerable<Type> types = Assembly.GetExecutingAssembly().GetTypes()
.Where(type => type.IsAssignableTo(typeof(BaseModule)) && !type.IsAbstract);
MethodInfo getServiceMethod = typeof(ServiceProviderServiceExtensions).GetMethod("GetRequiredService", [typeof(IServiceProvider)])!;
foreach (Type type in types)
{
GMAliasAttribute? aliasAttribute = type.GetCustomAttribute<GMAliasAttribute>();
if (aliasAttribute == null) continue;
var commands = ImmutableDictionary.CreateBuilder<string, GmCommandHandler>();
IEnumerable<MethodInfo> methods = type.GetMethods()
.Where(method => method.GetCustomAttribute<GMCommandAttribute>() != null);
foreach (MethodInfo method in methods)
{
GMCommandAttribute attribute = method.GetCustomAttribute<GMCommandAttribute>()!;
ParameterExpression serviceProviderParam = Expression.Parameter(typeof(IServiceProvider));
ParameterExpression sessionParam = Expression.Parameter(typeof(PlayerSession));
ParameterExpression argsParam = Expression.Parameter(typeof(string[]));
MethodCallExpression getServiceCall = Expression.Call(getServiceMethod.MakeGenericMethod(type), serviceProviderParam);
MethodCallExpression handlerCall = Expression.Call(getServiceCall, method, sessionParam, argsParam);
Expression<GmCommandHandler> lambda = Expression.Lambda<GmCommandHandler>(handlerCall, serviceProviderParam, sessionParam, argsParam);
commands.Add(attribute.Command, lambda.Compile());
}
builder.Add(aliasAttribute.Alias, commands.ToImmutable());
}
return builder.ToImmutable();
}
}

View file

@ -0,0 +1,143 @@
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class PlayerModule : BaseModule
{
[OnCommand(CmdType.CmdSyncTimeCsReq)]
public Task OnCmdSyncTimeCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
SyncTimeCsReq req = SyncTimeCsReq.Parser.ParseFrom(body.Span);
// TODO: TimeManager
Send(session, CmdType.CmdSyncTimeScRsp, new SyncTimeScRsp
{
ServerTimeMs = (ulong)DateTimeOffset.Now.ToUnixTimeMilliseconds(),
ClientTimeMs = req.ClientTimeMs,
Retcode = 0
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetStaminaExchangeCsReq)]
public Task OnCmdGetStaminaExchangeCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetStaminaExchangeScRsp, new GetStaminaExchangeScRsp());
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetLevelRewardTakenListCsReq)]
public Task OnCmdGetLevelRewardTakenListCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetLevelRewardTakenListScRsp, new GetLevelRewardTakenListScRsp());
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetPrestigeInfoCsReq)]
public Task OnCmdGetPrestigeInfoCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetPrestigeInfoScRsp, new GetPrestigeInfoScRsp
{
PrestigeInfo = new()
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetSpringRecoverDataCsReq)]
public Task OnCmdGetSpringRecoverDataCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetSpringRecoverDataScRsp, new GetSpringRecoverDataScRsp
{
SpringRecoverConfig = new(),
HealPoolInfo = new()
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetHeroBasicTypeInfoCsReq)]
public Task OnCmdGetHeroBasicTypeInfoCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetHeroBasicTypeInfoScRsp, new GetHeroBasicTypeInfoScRsp
{
Gender = Gender.Woman,
CurBasicType = HeroBasicType.GirlWarrior,
BasicTypeInfoList =
{
new HeroBasicTypeInfo
{
BasicType = HeroBasicType.GirlWarrior,
Rank = 1
}
}
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetHeroPathCsReq)]
public Task OnCmdGetHeroPathCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetHeroPathScRsp, new GetHeroPathScRsp());
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetMissionEventDataCsReq)]
public Task OnCmdGetMissionEventDataCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetMissionEventDataScRsp, new GetMissionEventDataScRsp());
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetMazeTimeOfDayCsReq)]
public Task OnCmdGetMazeTimeOfDayCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetMazeTimeOfDayScRsp, new GetMazeTimeOfDayScRsp());
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetDialogueEventDataCsReq)]
public Task OnCmdGetDialogueEventDataCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetDialogueEventDataScRsp, new GetDialogueEventDataScRsp());
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetRogueInfoCsReq)]
public Task OnCmdGetRogueInfoCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetRogueInfoScRsp, new GetRogueInfoScRsp
{
RogueChallengeInfo = new(),
RogueInfo = new()
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetLoginActivityCsReq)]
public Task OnCmdGetLoginActivityCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetLoginActivityScRsp, new GetLoginActivityScRsp());
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetChallengeRaidInfoCsReq)]
public Task OnCmdGetChallengeRaidInfoCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetChallengeRaidInfoScRsp, new GetChallengeRaidInfoScRsp());
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,15 @@
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class QuestModule : BaseModule
{
[OnCommand(CmdType.CmdGetQuestDataCsReq)]
public Task OnCmdGetQuestDataCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetQuestDataScRsp, new GetQuestDataScRsp());
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,18 @@
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class ShopModule : BaseModule
{
[OnCommand(CmdType.CmdGetShopListCsReq)]
public Task OnCmdGetShopListCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetShopListScRsp, new GetShopListScRsp
{
Retcode = 0
});
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,82 @@
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class TeamModule : BaseModule
{
private static readonly uint[] StartingLineup = [1005, 1006, 1013, 8001];
[OnCommand(CmdType.CmdChangeLineupLeaderCsReq)]
public Task OnCmdChangeLineupLeaderCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
ChangeLineupLeaderCsReq req = ChangeLineupLeaderCsReq.Parser.ParseFrom(body.Span);
Send(session, CmdType.CmdChangeLineupLeaderScRsp, new ChangeLineupLeaderScRsp
{
Retcode = 0,
Slot = req.Slot
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetAllLineupDataCsReq)]
public Task OnCmdGetAllLineupDataCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
GetAllLineupDataScRsp rsp = new();
rsp.LineupList.Add(new LineupInfo
{
Mp = 3
});
for (uint i = 0; i < StartingLineup.Length; i++)
{
rsp.LineupList[0].AvatarList.Add(new LineupAvatar
{
Id = StartingLineup[i],
Satiety = 100,
Sp = 10000,
Hp = 10000,
Slot = i,
AvatarType = AvatarType.AvatarFormalType
});
}
Send(session, CmdType.CmdGetAllLineupDataScRsp, rsp);
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetCurLineupDataCsReq)]
public Task OnCmdGetCurLineupDataCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
GetCurLineupDataScRsp rsp = new()
{
Lineup = new LineupInfo
{
Name = "Test Squad",
LeaderSlot = 0,
ExtraLineupType = ExtraLineupType.LineupNone,
Mp = 3
}
};
for (uint i = 0; i < StartingLineup.Length; i++)
{
rsp.Lineup.AvatarList.Add(new LineupAvatar
{
Id = StartingLineup[i],
Satiety = 100,
Sp = 10000,
Hp = 10000,
Slot = i,
AvatarType = AvatarType.AvatarFormalType
});
}
Send(session, CmdType.CmdGetCurLineupDataScRsp, rsp);
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,80 @@
using RPG.GameCore.Excel;
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class TutorialModule : BaseModule
{
private readonly ExcelTables _excelTables;
public TutorialModule(ExcelTables excelTables)
{
_excelTables = excelTables;
}
[OnCommand(CmdType.CmdGetTutorialCsReq)]
public Task OnCmdGetTutorialCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
GetTutorialScRsp rsp = new();
rsp.TutorialList.AddRange(_excelTables.GetAllRows(ExcelType.TutorialData)
.Select(row => new Tutorial
{
Id = row.Id,
Status = TutorialStatus.TutorialFinish
}));
Send(session, CmdType.CmdGetTutorialScRsp, rsp);
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdGetTutorialGuideCsReq)]
public Task OnCmdGetTutorialGuideCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
Send(session, CmdType.CmdGetTutorialGuideScRsp, new GetTutorialGuideScRsp
{
Retcode = 0,
TutorialGuideList = { }
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdUnlockTutorialGuideCsReq)]
public Task OnCmdUnlockTutorialGuideCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
UnlockTutorialGuideCsReq req = UnlockTutorialGuideCsReq.Parser.ParseFrom(body.Span);
Send(session, CmdType.CmdUnlockTutorialGuideScRsp, new UnlockTutorialGuideScRsp
{
Retcode = 0,
TutorialGuide = new TutorialGuide
{
Id = req.GroupId,
Status = TutorialStatus.TutorialUnlock
}
});
return Task.CompletedTask;
}
[OnCommand(CmdType.CmdFinishTutorialGuideCsReq)]
public Task OnCmdFinishTutorialGuideCsReq(PlayerSession session, ReadOnlyMemory<byte> body)
{
FinishTutorialGuideCsReq req = FinishTutorialGuideCsReq.Parser.ParseFrom(body.Span);
Send(session, CmdType.CmdFinishTutorialGuideScRsp, new FinishTutorialGuideScRsp
{
Retcode = 0,
Reward = new(),
TutorialGuide = new TutorialGuide
{
Id = req.GroupId,
Status = TutorialStatus.TutorialFinish
}
});
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,80 @@
using Microsoft.Extensions.Logging;
using RPG.Network.Proto;
using RPG.Services.Core.Network;
using RPG.Services.Core.Network.Attributes;
using RPG.Services.Core.Network.Command;
using RPG.Services.Core.Session;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Network.Command;
internal class GameserverCommandHandler : ServiceCommandHandler
{
private readonly SessionManager _sessionManager;
public GameserverCommandHandler(ILogger<ServiceCommandHandler> logger, ServiceBox services, SessionManager sessionManager) : base(logger, services)
{
_sessionManager = sessionManager;
}
[ServiceCommand(ServiceCommandType.BindContainer)]
public Task OnCmdBindContainer(ServiceCommand command)
{
CmdBindContainer cmdBindContainer = CmdBindContainer.Parser.ParseFrom(command.Body.Span);
PlayerSession? session = _sessionManager.Create<PlayerSession>(cmdBindContainer.SessionId);
if (session == null)
{
Send(ServiceCommandType.BindContainerResult, new CmdBindContainerResult
{
Retcode = 1,
SessionId = cmdBindContainer.SessionId,
ServiceType = RPGServiceType.Gameserver
}, command.SenderType);
return Task.CompletedTask;
}
session.PlayerUid = cmdBindContainer.PlayerUid;
Send(ServiceCommandType.BindContainerResult, new CmdBindContainerResult
{
Retcode = 0,
SessionId = cmdBindContainer.SessionId,
ServiceType = RPGServiceType.Gameserver
}, command.SenderType);
return Task.CompletedTask;
}
[ServiceCommand(ServiceCommandType.UnbindContainer)]
public Task OnCmdUnbindContainer(ServiceCommand command)
{
CmdUnbindContainer cmdUnbindContainer = CmdUnbindContainer.Parser.ParseFrom(command.Body.Span);
if (_sessionManager.TryGet(cmdUnbindContainer.SessionId, out PlayerSession? session))
{
_sessionManager.Remove(session);
}
return Task.CompletedTask;
}
[ServiceCommand(ServiceCommandType.ForwardGameMessage)]
public async Task OnCmdForwardGameMessage(ServiceCommand command)
{
CmdForwardGameMessage cmd = CmdForwardGameMessage.Parser.ParseFrom(command.Body.Span);
if (_sessionManager.TryGet(cmd.SessionId, out PlayerSession? session))
{
await session.HandleGameCommand((ushort)cmd.CmdType, cmd.Payload.Memory);
}
}
[ServiceCommand(ServiceCommandType.GmtalkByMuip)]
public async Task OnCmdGmtalkByMuip(ServiceCommand command)
{
CmdGmtalkByMuip cmd = CmdGmtalkByMuip.Parser.ParseFrom(command.Body.Span);
if (_sessionManager.TryGet(cmd.SessionId, out PlayerSession? session))
{
await session.HandleGmTalkCommand(cmd.Msg);
}
}
}

View file

@ -0,0 +1,26 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using RPG.GameCore.Excel;
using RPG.Services.Core.Extensions;
using RPG.Services.Gameserver.Extensions;
using RPG.Services.Gameserver.Modules;
using RPG.Services.Gameserver.Network.Command;
namespace RPG.Services.Gameserver;
internal static class Program
{
private static async Task Main(string[] args)
{
Console.Title = "KafkaSR | Gameserver";
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
builder.SetupRPGService<RPGGameserver, GameserverCommandHandler>();
builder.Services.AddModules()
.AddScoped<ModuleManager>()
.AddSingleton<ExcelTables>();
await builder.Build().RunAsync();
}
}

View file

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\RPG.Services.Core\RPG.Services.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View file

@ -0,0 +1,19 @@
using RPG.GameCore.Excel;
using RPG.Services.Core;
namespace RPG.Services.Gameserver;
internal class RPGGameserver : RPGServiceBase
{
private readonly ExcelTables _excelTables;
public RPGGameserver(ServiceManager serviceManager, ExcelTables excelTables) : base(serviceManager)
{
_excelTables = excelTables;
}
public override async Task StartAsync(CancellationToken cancellationToken)
{
_excelTables.Load();
await base.StartAsync(cancellationToken);
}
}

Some files were not shown because too many files have changed in this diff Show more