Skip to content

Commit

Permalink
Logging manager / breaking manager skeletons for ds2. Fleshed out som…
Browse files Browse the repository at this point in the history
…e protobufs. Turned off disconnect on unhandled message.
  • Loading branch information
TLeonardUK committed Jan 3, 2024
1 parent 686d2ba commit 592fbfc
Show file tree
Hide file tree
Showing 18 changed files with 2,178 additions and 995 deletions.
48 changes: 24 additions & 24 deletions Protobuf/DarkSouls2/DS2_Frpg2PlayerData.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ message EquipmentInfo {
}

message ItemUsingInfo {
optional uint32 unknown_1 = 1;
optional uint32 unknown_2 = 2;
optional uint32 named_ring_god = 1;
optional uint32 using_dried_fingers = 2;
optional uint32 unknown_3 = 3;
optional uint32 unknown_4 = 4;
optional uint32 unknown_5 = 5;
optional uint32 unknown_6 = 6;
optional uint32 guardians_seal = 4;
optional uint32 bell_keepers_seal = 5;
optional uint32 crest_of_the_rat = 6;
optional uint32 unknown_7 = 7;
optional uint32 unknown_8 = 8;
}
Expand Down Expand Up @@ -87,30 +87,30 @@ message PhysicalStatus {
//optional uint32 unknown_3 = 3;
optional uint32 unknown_4 = 4;
optional uint32 unknown_5 = 5;
optional uint32 unknown_6 = 6;
optional uint32 unknown_7 = 7;
optional uint32 attack_strength = 6;
optional uint32 attack_dexterity = 7;
optional uint32 unknown_8 = 8;
optional uint32 unknown_9 = 9;
optional uint32 unknown_10 = 10;
optional uint32 unknown_11 = 11;
optional uint32 unknown_12 = 12;
optional uint32 unknown_13 = 13;
optional uint32 unknown_14 = 14;
optional uint32 unknown_15 = 15;
optional uint32 unknown_16 = 16;
optional uint32 unknown_17 = 17;
optional uint32 unknown_18 = 18;
optional uint32 unknown_19 = 19;
optional uint32 unknown_20 = 20;
optional uint32 unknown_21 = 21;
optional uint32 unknown_22 = 22;
optional uint32 unknown_23 = 23;
optional uint32 physical_defence = 14;
optional uint32 unknown_15 = 15; // changes with int
optional uint32 unknown_16 = 16; // changes with int
optional uint32 unknown_17 = 17; // changes with faith
optional uint32 unknown_18 = 18; // changes with int
optional uint32 unknown_19 = 19; // changes with adaptability
optional uint32 unknown_20 = 20; // changes with faith
optional uint32 petrify_resist = 21;
optional uint32 curse_resist = 22;
optional uint32 agility = 23;
optional float poise = 24;
}

message PlayerLocation {
optional uint32 online_area_id = 1;
optional uint32 unknown_2 = 2; // 1074321607, 3225573558, 1078414675,
optional uint32 cell_id = 2; // 1074321607, 3225573558, 1078414675,
optional uint32 unknown_3 = 3; // 0, 101640, 103130, 103110, 103120,
optional Vector position = 4;
optional float unknown_5 = 5; // 1074321607, 3225573558, 1078414675
Expand All @@ -123,23 +123,23 @@ message PlayerStatus_Phantom_leave_at {

message PlayerStatus {
optional string name = 1;
optional uint32 unknown_2 = 2; // 10, 2
optional uint32 archetype = 2;
optional uint32 covenant = 3;
optional uint32 unknown_4 = 4; // 1, 0
optional uint32 unknown_5 = 5; // 0, 1, 2
optional uint32 unknown_6 = 6; // 0
optional uint32 unknown_7 = 7;
optional uint32 sitting_at_bonfire = 7;
optional PlayerStatus_Phantom_leave_at phantom_leave_at = 8;
optional uint32 disable_cross_region_play = 9;
optional uint32 character_id = 10;
optional uint32 unknown_11 = 11; // 0, 1
repeated uint32 unknown_12 = 12; // 50350000, 50360000, 50370000, 50380000
optional uint32 human_effigy_burnt = 11;
repeated uint32 played_online_areas = 12;
optional uint32 unknown_13 = 13;
optional uint32 unknown_14 = 14;
optional uint32 soul_level = 15;
optional uint32 unknown_16 = 16;
optional uint32 unknown_17 = 17;
optional uint32 unknown_18 = 18;
optional uint32 play_time_seconds = 18;
optional uint32 soul_memory = 19;
optional uint32 unknown_20 = 20;
optional string unknown_21 = 21;
Expand All @@ -157,7 +157,7 @@ message StatsInfo_Bonfire_levels {
message StatsInfo {
optional uint32 unknown_1 = 1;
optional uint32 unknown_2 = 2;
optional uint32 unknown_3 = 3;
optional uint32 sinner_points = 3;
repeated StatsInfo_Bonfire_levels bonfire_levels = 4;
optional uint32 unknown_5 = 5;
repeated PhantomTypeCount phantom_type_count_6 = 6;
Expand Down
48 changes: 27 additions & 21 deletions Protobuf/DarkSouls2/DS2_Frpg2RequestMessage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ import "DS2_Frpg2PlayerData.proto";
// The message-id thats recieved on the reliable udp message layer is always 0x0320, and the first
// field is read to disambiguate the actual message.
enum PushMessageId {

// TODO: These all look wrong judging from the actual code reading them.
// Need rechecking.
PushID_PushRequestRemoveSign = 0x039D;
PushID_PushRequestSummonSign = 0x039B;
PushID_PushRequestRejectSign = 0x039C;
Expand Down Expand Up @@ -444,17 +441,27 @@ message RequestNotifyOfflineDeathCountResponse {
// Game Server Messages - Summon Signs
// ------------------------------------------------------------------------------------------------------------

enum SummonErrorId {
SummonErrorId_NoLongerBeSummonable = 0;
SummonErrorId_SignAlreadyUsed = 1;
SummonErrorId_SignHasDisappeared = 2;
};

message MatchingParameter {
required uint32 unknown_1 = 1; // 20200
required uint32 soul_level = 2; // 36, 127, 18, 41, 26, 838, 49, 13, 28, 1, 34
required uint32 clear_count = 3; // 1
required uint32 unknown_4 = 4; // 77
// Possible values:
// region
// nat type

required uint32 calibration_version = 1; // 20200
required uint32 soul_level = 2;
required uint32 clear_count = 3;
required uint32 unknown_4 = 4; // 77, 154, 231, 693 77 Seems to change in tandem with clear_count
required uint32 covenant = 6; // 4, 2, 0, 6, 7
required uint32 unknown_7 = 7; // 2
required uint32 unknown_8 = 8; // 1
required uint32 disable_cross_region_play = 9; // 1
required uint32 unknown_7 = 7; // 2 nat type?
required uint32 disable_cross_region_play = 8; // 1
required uint32 unknown_9 = 9; // 1 region?
required uint32 unknown_10 = 10; // 0, 1
required uint32 unknown_11 = 11; // 0
required uint32 name_engraved_ring = 11;
required uint32 soul_memory = 12;
}

Expand Down Expand Up @@ -482,7 +489,7 @@ message PushRequestRejectSign {

// Based on ghidra, investigate further.
required SignInfo sign_info = 2;
required int64 player_id = 3;
required SummonErrorId error = 3;
required string player_steam_id = 4;
}

Expand Down Expand Up @@ -521,17 +528,15 @@ message RequestGetSignListResponse {
}

message RequestRejectSign {
// Based on ghidra, investigate further.
/*
required uint64 player_id = 1; // 0
required bytes player_steam_id = 2; // 2
required uint64 sign_id = 3; // 0
required bytes field_4 = 4; // 2
*/
required int64 online_area_id = 1; // 10190000
required int64 sign_id = 2; // 1001
required SummonErrorId error = 3; // 2
required int64 unknown_4 = 4; // 2
required int64 cell_id = 5; // 4294966272
}

message RequestRejectSignResponse {
// TODO
// Never recieved.
}

message RequestRemoveSign {
Expand Down Expand Up @@ -714,7 +719,8 @@ message RequestBreakInTargetResponse {
message RequestGetBreakInTargetList {
required uint32 online_area_id = 1; // 10100000
required uint32 field_2 = 2; // 101030, 101910
required MatchingParameter matching_parameter = 3;
required uint32 field_3 = 3; // 5
required MatchingParameter matching_parameter = 4;
required uint32 unknown_5 = 5; // 0
}

Expand Down
5 changes: 5 additions & 0 deletions Source/Injector/Config/BuildConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ class BuildConfig
// Writes out all protobufs to a temporary folder
inline static const bool WRITE_OUT_PROTOBUFS = false;

#ifdef _DEBUG
// Writes out all the decoded format of all protobufs encountered so far.
inline static const bool WRITE_OUT_DECODED_PROTOBUFS = true;
#else
// Writes out all the decoded format of all protobufs encountered so far.
inline static const bool WRITE_OUT_DECODED_PROTOBUFS = false;
#endif

// Writes out all protobufs to a temporary folder
inline static const char* TEMP_LOG_FOLDER = "Z:/ds3os/Temp/ProtobufDump";
Expand Down
5 changes: 3 additions & 2 deletions Source/Loader/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,9 @@ private void OnLoaded(object sender, EventArgs e)
minimumPlayersBox.Value = ProgramSettings.Default.minimum_players;
ServerConfigList.FromJson(ProgramSettings.Default.server_config_json, out ServerList);
IgnoreInputChanges = false;

#if DEBUG

ProgramSettings.Default.Reset();
#if false//DEBUG
ProgramSettings.Default.master_server_url = "http://127.0.0.1:50020";
#endif

Expand Down
4 changes: 4 additions & 0 deletions Source/Server.DarkSouls2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ SET(SOURCES
Server/GameService/GameManagers/Bloodstain/DS2_BloodstainManager.h
Server/GameService/GameManagers/Signs/DS2_SignManager.cpp
Server/GameService/GameManagers/Signs/DS2_SignManager.h
Server/GameService/GameManagers/BreakIn/DS2_BreakInManager.cpp
Server/GameService/GameManagers/BreakIn/DS2_BreakInManager.h
Server/GameService/GameManagers/Logging/DS2_LoggingManager.cpp
Server/GameService/GameManagers/Logging/DS2_LoggingManager.h

Server/GameService/Utils/DS2_GameIds.h
Server/GameService/Utils/DS2_CellAndAreaId.h
Expand Down
Loading

0 comments on commit 592fbfc

Please sign in to comment.