Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# ChangeLog

## [1.0.7] - 2024-10-22

### Added
- Player.inertia_final_point, PenaltyKickState.cycle, self.get_safety_dash_power.

### Fixed
-

### Changed
-

### Engineers
- [SoroushMazloum](https://github.com/SoroushMazloum)

=======

## [1.0.6] - 2024-10-19

### Added
Expand Down
5 changes: 4 additions & 1 deletion idl/grpc/service.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// version 1.6
// version 1.7

syntax = "proto3";

Expand Down Expand Up @@ -110,6 +110,7 @@ message PenaltyKickState {
int32 our_score = 5;
int32 their_score = 6;
bool is_kick_taker = 7;
int32 cycle = 8;
}

message Player {
Expand Down Expand Up @@ -143,6 +144,7 @@ message Player {
int32 ball_reach_steps = 28;
bool is_tackling = 29;
int32 type_id = 30;
RpcVector2D inertia_final_point = 31;
}

message Self {
Expand Down Expand Up @@ -187,6 +189,7 @@ message Self {
CardType card = 39;
int32 catch_time = 40;
float effort = 41;
float get_safety_dash_power = 42;
}

enum InterceptActionType {
Expand Down
11 changes: 7 additions & 4 deletions idl/thrift/soccer_service.thrift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// version 1.6
// version 1.7

namespace cpp soccer
namespace py soccer
Expand Down Expand Up @@ -112,7 +112,8 @@ struct PenaltyKickState {
4: i32 their_taker_counter,
5: i32 our_score,
6: i32 their_score,
7: bool is_kick_taker
7: bool is_kick_taker,
8: i32 cycle
}

struct Player {
Expand Down Expand Up @@ -145,7 +146,8 @@ struct Player {
27: double angle_from_ball,
28: i32 ball_reach_steps,
29: bool is_tackling,
30: i32 type_id
30: i32 type_id,
31: RpcVector2D inertia_final_point
}

struct Self {
Expand Down Expand Up @@ -189,7 +191,8 @@ struct Self {
38: double stamina_capacity,
39: CardType card,
40: i32 catch_time,
41: double effort
41: double effort,
42: double get_safety_dash_power
}

enum InterceptActionType {
Expand Down
4 changes: 3 additions & 1 deletion src/grpc-client/state_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ protos::Self *StateGenerator::convertSelf(const rcsc::SelfObject &self, const rc
res->set_card(convertCardType(self.card()));
res->set_catch_time(self.catchTime().cycle());
res->set_effort(static_cast<float>(self.effort()));
res->set_get_safety_dash_power(static_cast<float>(self.getSafetyDashPower(rcsc::ServerParam::i().maxDashPower())));
return res;
}

Expand Down Expand Up @@ -246,7 +247,7 @@ protos::PenaltyKickState *StateGenerator::convertPenaltyKickState(const rcsc::Wo
res->set_our_score(state->ourScore());
res->set_their_score(state->theirScore());
res->set_is_kick_taker(state->isKickTaker(wm.ourSide(), wm.self().unum()));

res->set_cycle(state->time().cycle());
return res;
}

Expand Down Expand Up @@ -288,6 +289,7 @@ void StateGenerator::updatePlayerObject(protos::Player *p, const rcsc::PlayerObj
p->set_ball_reach_steps(player->ballReachStep());
p->set_is_tackling(player->isTackling());
p->set_type_id(player->playerTypePtr()->id());
p->set_allocated_inertia_final_point(convertVector2D(player->inertiaFinalPoint()));
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/thrift-client/thrift_state_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ soccer::Self ThriftStateGenerator::convertSelf(const rcsc::SelfObject &self, con
res.card = convertCardType(self.card());
res.catch_time = self.catchTime().cycle();
res.effort = static_cast<float>(self.effort());
res.get_safety_dash_power = static_cast<float>(self.getSafetyDashPower(rcsc::ServerParam::i().maxDashPower()));
return res;
}

Expand Down Expand Up @@ -255,7 +256,7 @@ soccer::PenaltyKickState ThriftStateGenerator::convertPenaltyKickState(const rcs
res.our_score = state->ourScore();
res.their_score = state->theirScore();
res.is_kick_taker = state->isKickTaker(wm.ourSide(), wm.self().unum());

res.cycle = state->time().cycle();
return res;
}

Expand Down Expand Up @@ -304,6 +305,7 @@ void ThriftStateGenerator::updatePlayerObject(soccer::Player & p, const rcsc::Pl
{
p.type_id = player->playerTypePtr()->id();
}
p.inertia_final_point = convertVector2D(player->inertiaFinalPoint());
}

/**
Expand Down