Skip to content

Commit

Permalink
Fix a sign bug causing the client to be unable to parse the GetSignLi…
Browse files Browse the repository at this point in the history
…st response when empty.
  • Loading branch information
TLeonardUK committed Jan 30, 2022
1 parent df7bf0b commit 7fe95db
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 51 deletions.
46 changes: 23 additions & 23 deletions Protobuf/Frpg2RequestMessage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ message RequestUpdateLoginPlayerCharacterResponse {

message RequestUpdatePlayerStatus {
required bytes status = 1;
//required Frpg2PlayerData.AllStatus status = 1;
}

message RequestUpdatePlayerStatusResponse {
Expand Down Expand Up @@ -672,32 +671,33 @@ message GetSignResult {
}

message SignInfo {
required uint32 player_id = 1;
required uint32 sign_id = 2;
required uint32 player_id = 1; // index=1 type=0
required uint32 sign_id = 2; // index=2 type=0
}

message SignData {
required SignInfo sign_info = 1;
required uint32 online_area_id = 2;
required MatchingParameter matching_parameter = 3;
required bytes player_struct = 4;
required string steam_id = 5; // sometimes a steamid, sometimes a 3 value substruct
required uint32 is_red_sign = 6; // I *think* this is correct, needs further testing.
required SignInfo sign_info = 1; // index=1 type=2
required uint32 online_area_id = 2; // index=2 type=0
required MatchingParameter matching_parameter = 3; // index=3 type=2
required bytes player_struct = 4; // index=4 type=2
required string steam_id = 5; // index=5 type=2 // sometimes a steamid, sometimes a 3 value substruct
required uint32 is_red_sign = 6; // index=6 type=0 // I *think* this is correct, needs further testing.
}

message MatchingParameter {
required uint32 unknown_id_1 = 1; // 1350000
required uint32 unknown_id_2 = 2; // 2
required uint32 unknown_id_3 = 3; // 1,0
required uint32 unknown_id_4 = 4; // 1
required uint32 unknown_id_5 = 5; // 0
required uint32 soul_level = 6;
required uint32 soul_memory = 7;
optional string unknown_string = 8;
required uint32 unknown_id_9 = 9; // 0, 1, 7
required string password = 10;
required Covenant covenant = 11;
required uint32 weapon_level = 14;
required uint32 unknown_id_1 = 1; // 1350000 // index=1 type=0
required uint32 unknown_id_2 = 2; // 2 // index=2 type=0
required uint32 unknown_id_3 = 3; // 1,0 // index=3 type=0
required uint32 unknown_id_4 = 4; // 1 // index=4 type=0
required uint32 unknown_id_5 = 5; // 0 // index=5 type=0
required uint32 soul_level = 6; // index=6 type=0
required uint32 soul_memory = 7; // index=7 type=0
optional string unknown_string = 8; // Not in code?
required uint32 unknown_id_9 = 9; // 0, 1, 7 // index=9 type=0
required string password = 10; // index=10 type=2
required Covenant covenant = 11; // index=11 type=0
required uint32 weapon_level = 14; // index=14 type=0
optional string unknown_id_15 = 15; // index=15 type=2
}

message SignGetFlags {
Expand All @@ -721,7 +721,7 @@ message RequestGetSignList {
}

message RequestGetSignListResponse {
optional GetSignResult get_sign_result = 1;
required GetSignResult get_sign_result = 1;
}

message RequestCreateSign {
Expand Down Expand Up @@ -1478,7 +1478,7 @@ enum QuickMatchResult{
QuickMatchResult_Win = 0;
QuickMatchResult_Lose = 1;
QuickMatchResult_Draw = 2;
QuickMatchResult_Disconnect = 3; // Needs confirmation.
QuickMatchResult_Disconnect = 3;
}

message RequestSendQuickMatchResult {
Expand Down
49 changes: 45 additions & 4 deletions Source/Server/Protobuf/Frpg2RequestMessage.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 93 additions & 2 deletions Source/Server/Protobuf/Frpg2RequestMessage.pb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Source/Server/Server/AuthService/AuthClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ bool AuthClient::Poll()
// and return our internal IP address.
if (Connection->GetAddress().IsPrivateNetwork())
{
LogS(GetName().c_str(), "Directing auth client to our private ip as appears to be on private subnet.");
ServerIP = Service->GetServer()->GetPrivateIP().ToString();
LogS(GetName().c_str(), "Directing auth client to our private ip (%s) as appears to be on private subnet.", ServerIP.c_str());
}

Frpg2GameServerInfo GameInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ MessageHandleResult SignManager::Handle_RequestGetSignList(GameClient* Client, c
std::vector<std::shared_ptr<SummonSign>> AreaSigns = LiveCache.GetRecentSet(AreaId, GatherCount, [this, &Player, &Request](const std::shared_ptr<SummonSign>& Sign) {
return CanMatchWith(Request->matching_parameter(), Sign->MatchingParameters, Sign->IsRedSign);
});

Frpg2RequestMessage::GetSignResult* SignResult = Response.mutable_get_sign_result();

for (std::shared_ptr<SummonSign>& Sign : AreaSigns)
{
// Filter players own signs.
Expand All @@ -144,13 +147,13 @@ MessageHandleResult SignManager::Handle_RequestGetSignList(GameClient* Client, c
// If client already has sign data we only need to return a limited set of data.
if (ClientExistingSignId.count(Sign->SignId) > 0)
{
Frpg2RequestMessage::SignInfo* SignInfo = Response.mutable_get_sign_result()->add_sign_info_without_data();
Frpg2RequestMessage::SignInfo* SignInfo = SignResult->add_sign_info_without_data();
SignInfo->set_player_id(Sign->PlayerId);
SignInfo->set_sign_id(Sign->SignId);
}
else
{
Frpg2RequestMessage::SignData* SignData = Response.mutable_get_sign_result()->add_sign_data();
Frpg2RequestMessage::SignData* SignData = SignResult->add_sign_data();
SignData->mutable_sign_info()->set_player_id(Sign->PlayerId);
SignData->mutable_sign_info()->set_sign_id(Sign->SignId);
SignData->set_online_area_id((uint32_t)Sign->OnlineAreaId);
Expand Down
Loading

0 comments on commit 7fe95db

Please sign in to comment.