Updated world service to become a manager of game logic instances for each map.

This commit is contained in:
2025-06-08 16:04:50 -04:00
parent 9088c04bc8
commit 6f18b53913
5 changed files with 302 additions and 9 deletions

52
proto/game_logic.proto Normal file
View File

@@ -0,0 +1,52 @@
syntax = "proto3";
package game_logic;
service GameLogicService {
rpc GetCharacter(CharacterRequest) returns (CharacterResponse);
rpc MoveCharacter(CharacterMoveRequest) returns (CharacterMoveResponse);
rpc GetTargetHp(ObjectHpRequest) returns (ObjectHpResponse);
}
message CharacterRequest {
string token = 1;
string user_id = 2;
string char_id = 3;
string session_id = 4;
}
message CharacterResponse {
int32 count = 1;
}
message CharacterMoveRequest {
string session_id = 1;
uint32 target_id = 2;
float x = 3;
float y = 4;
float z = 5;
}
message CharacterMoveResponse {
int32 id = 1;
int32 target_id = 2;
int32 distance = 3;
float x = 4;
float y = 5;
float z = 6;
}
message AttackRequest {
string session_id = 1;
uint32 target_id = 2;
}
message ObjectHpRequest {
string session_id = 1;
uint32 target_id = 2;
}
message ObjectHpResponse {
uint32 target_id = 1;
int32 hp = 2;
}