From cab03a228d82aff8cdfea74c18f13560744d31bf Mon Sep 17 00:00:00 2001
From: shangfengh <3495281661@qq.com>
Date: Sat, 15 Oct 2022 00:49:27 +0800
Subject: [PATCH 01/15] chore:add logic/Preparation/Utility
---
logic/Preparation/Utility/Debugger.cs | 14 ++++
logic/Preparation/Utility/EnumType.cs | 96 +++++++++++++++++++++++++
logic/Preparation/Utility/MapEncoder.cs | 17 +++++
logic/Preparation/Utility/Tools.cs | 20 ++++++
logic/Preparation/Utility/Vector.cs | 57 +++++++++++++++
logic/Preparation/Utility/XYPosition.cs | 49 +++++++++++++
6 files changed, 253 insertions(+)
create mode 100644 logic/Preparation/Utility/Debugger.cs
create mode 100644 logic/Preparation/Utility/EnumType.cs
create mode 100644 logic/Preparation/Utility/MapEncoder.cs
create mode 100644 logic/Preparation/Utility/Tools.cs
create mode 100644 logic/Preparation/Utility/Vector.cs
create mode 100644 logic/Preparation/Utility/XYPosition.cs
diff --git a/logic/Preparation/Utility/Debugger.cs b/logic/Preparation/Utility/Debugger.cs
new file mode 100644
index 0000000..282d9b3
--- /dev/null
+++ b/logic/Preparation/Utility/Debugger.cs
@@ -0,0 +1,14 @@
+using System;
+
+namespace Preparation.Utility
+{
+ public class Debugger
+ {
+ static public void Output(object current, string str)
+ {
+#if DEBUG
+ Console.WriteLine(current.GetType() + " " + current.ToString() + " " + str);
+#endif
+ }
+ }
+}
diff --git a/logic/Preparation/Utility/EnumType.cs b/logic/Preparation/Utility/EnumType.cs
new file mode 100644
index 0000000..5dfb8cc
--- /dev/null
+++ b/logic/Preparation/Utility/EnumType.cs
@@ -0,0 +1,96 @@
+
+namespace Preparation.Utility
+{
+ ///
+ /// 存放所有用到的枚举类型
+ ///
+ public enum GameObjType
+ {
+ Null = 0,
+ Character = 1,
+ Prop = 2,
+ PickedProp = 3,
+ Bullet = 4,
+ BombedBullet = 5,
+
+ Wall = 6,
+ Grass = 7,
+ Generator = 8, // 发电机
+ BirthPoint = 9,
+ Exit = 10,
+ EmergencyExit = 11,
+ OutOfBoundBlock = 12, // 范围外
+ }
+ public enum ShapeType
+ {
+ Null = 0,
+ Circle = 1, // 子弹和人物为圆形,格子为方形
+ Square = 2
+ }
+ public enum PlaceType // 位置标志,包括陆地(一般默认为陆地,如墙体等),草丛。游戏中每一帧都要刷新各个物体的该属性
+ {
+ Null = 0,
+ Land = 1,
+ Grass1 = 2,
+ Grass2 = 3,
+ Grass3 = 4,
+ Grass4 = 5,
+ Grass5 = 6,
+ }
+ public enum BulletType // 子弹类型
+ {
+ Null = 0,
+ OrdinaryBullet = 1, // 普通子弹
+ AtomBomb = 2, // 原子弹
+ FastBullet = 3, // 快速子弹
+ LineBullet = 4 // 直线子弹
+ }
+ public enum PropType // 道具类型
+ {
+ Null = 0,
+ addSpeed = 1,
+ addLIFE = 2,
+ Shield = 3,
+ Spear = 4,
+ Gem = 5, // 新增:宝石
+ }
+ public enum PassiveSkillType // 被动技能
+ {
+ Null = 0,
+ RecoverAfterBattle = 1,
+ SpeedUpWhenLeavingGrass = 2,
+ Vampire = 3,
+ PSkill3 = 4,
+ PSkill4 = 5,
+ PSkill5 = 6
+ }
+ public enum ActiveSkillType // 主动技能
+ {
+ Null = 0,
+ BecomeVampire = 1,
+ BecomeAssassin = 2,
+ NuclearWeapon = 3,
+ SuperFast = 4,
+ ASkill4 = 5,
+ ASkill5 = 6
+ }
+ public enum BuffType // buff
+ {
+ Null = 0,
+ AddSpeed = 1,
+ AddLIFE = 2,
+ Shield = 3,
+ Spear = 4
+ }
+ public enum GameObjIdx
+ {
+ None = 0,
+ Player = 1,
+ Bullet = 2,
+ Prop = 3,
+ Gem = 4,
+ Map = 5,
+ BombedBullet = 6,
+ PickedProp = 7
+ }
+}
diff --git a/logic/Preparation/Utility/MapEncoder.cs b/logic/Preparation/Utility/MapEncoder.cs
new file mode 100644
index 0000000..d8e2c4e
--- /dev/null
+++ b/logic/Preparation/Utility/MapEncoder.cs
@@ -0,0 +1,17 @@
+using System;
+
+namespace Preparation.Utility
+{
+ public class MapEncoder
+ {
+ static public char Dec2Hex(int d)
+ {
+ return char.Parse(d.ToString("X"));
+ }
+ static public int Hex2Dec(char h)
+ {
+ string hexabet = "0123456789ABCDEF";
+ return hexabet.IndexOf(h);
+ }
+ }
+}
diff --git a/logic/Preparation/Utility/Tools.cs b/logic/Preparation/Utility/Tools.cs
new file mode 100644
index 0000000..78ee847
--- /dev/null
+++ b/logic/Preparation/Utility/Tools.cs
@@ -0,0 +1,20 @@
+using System;
+
+namespace Preparation.Utility
+{
+ public static class Tools
+ {
+ public static double CorrectAngle(double angle) // 将幅角转化为主值0~2pi
+ {
+ if (double.IsNaN(angle) || double.IsInfinity(angle))
+ {
+ return 0.0;
+ }
+ while (angle < 0)
+ angle += 2 * Math.PI;
+ while (angle >= 2 * Math.PI)
+ angle -= 2 * Math.PI;
+ return angle;
+ }
+ }
+}
diff --git a/logic/Preparation/Utility/Vector.cs b/logic/Preparation/Utility/Vector.cs
new file mode 100644
index 0000000..50614f0
--- /dev/null
+++ b/logic/Preparation/Utility/Vector.cs
@@ -0,0 +1,57 @@
+using System;
+
+namespace Preparation.Utility
+{
+ public struct Vector
+ {
+ public double angle;
+ public double length;
+
+ public static XYPosition VectorToXY(Vector v)
+ {
+ return new XYPosition((int)(v.length * Math.Cos(v.angle)), (int)(v.length * Math.Sin(v.angle)));
+ }
+ public Vector2 ToVector2()
+ {
+ return new Vector2((int)(this.length * Math.Cos(this.angle)), (int)(this.length * Math.Sin(this.angle)));
+ }
+ public static Vector XYToVector(double x, double y)
+ {
+ return new Vector(Math.Atan2(y, x), Math.Sqrt((x * x) + (y * y)));
+ }
+ public Vector(double angle, double length)
+ {
+ if (length < 0)
+ {
+ angle += Math.PI;
+ length = -length;
+ }
+ this.angle = Tools.CorrectAngle(angle);
+ this.length = length;
+ }
+ }
+
+ public struct Vector2
+ {
+ public double x;
+ public double y;
+ public Vector2(double x, double y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+
+ public static double operator*(Vector2 v1, Vector2 v2)
+ {
+ return (v1.x * v2.x) + (v1.y * v2.y);
+ }
+ public static Vector2 operator +(Vector2 v1, Vector2 v2)
+ {
+ return new Vector2(v1.x + v2.x, v1.y + v2.y);
+ }
+ public static Vector2 operator -(Vector2 v1, Vector2 v2)
+ {
+ return new Vector2(v1.x - v2.x, v1.y - v2.y);
+ }
+ }
+}
diff --git a/logic/Preparation/Utility/XYPosition.cs b/logic/Preparation/Utility/XYPosition.cs
new file mode 100644
index 0000000..55647ec
--- /dev/null
+++ b/logic/Preparation/Utility/XYPosition.cs
@@ -0,0 +1,49 @@
+using System;
+
+namespace Preparation.Utility
+{
+ public struct XYPosition
+ {
+ public int x;
+ public int y;
+ public XYPosition(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+ public override string ToString()
+ {
+ return "(" + x.ToString() + "," + y.ToString() + ")";
+ }
+ public static XYPosition operator +(XYPosition p1, XYPosition p2)
+ {
+ return new XYPosition(p1.x + p2.x, p1.y + p2.y);
+ }
+ public static XYPosition operator -(XYPosition p1, XYPosition p2)
+ {
+ return new XYPosition(p1.x - p2.x, p1.y - p2.y);
+ }
+ public static double Distance(XYPosition p1, XYPosition p2)
+ {
+ return Math.Sqrt(((long)(p1.x - p2.x) * (p1.x - p2.x)) + ((long)(p1.y - p2.y) * (p1.y - p2.y)));
+ }
+ /*public static XYPosition[] GetSquareRange(uint edgeLen) // 从THUAI4的BULLET.CS移植而来,不知还有用否
+ {
+ XYPosition[] range = new XYPosition[edgeLen * edgeLen];
+ int offset = (int)(edgeLen >> 1);
+ for (int i = 0; i < (int)edgeLen; ++i)
+ {
+ for (int j = 0; j < (int)edgeLen; ++j)
+ {
+ range[i * edgeLen + j].x = i - offset;
+ range[i * edgeLen + j].y = j - offset;
+ }
+ }
+ return range;
+ }*/
+ public Vector2 ToVector2()
+ {
+ return new Vector2(this.x, this.y);
+ }
+ }
+}
From 1616030e5a20b3bcca7a510bcc4b06a67ea510ab Mon Sep 17 00:00:00 2001
From: shangfengh <3495281661@qq.com>
Date: Sat, 15 Oct 2022 11:46:15 +0800
Subject: [PATCH 02/15] chore: add logic/Preparation/Interface
---
logic/Preparation/Interface/ICharacter.cs | 11 ++++++
logic/Preparation/Interface/IGameObj.cs | 20 +++++++++++
logic/Preparation/Interface/IMap.cs | 18 ++++++++++
logic/Preparation/Interface/IMoveable.cs | 36 +++++++++++++++++++
.../Preparation/Interface/IObjOfCharacter.cs | 9 +++++
logic/Preparation/Interface/ITimer.cs | 9 +++++
6 files changed, 103 insertions(+)
create mode 100644 logic/Preparation/Interface/ICharacter.cs
create mode 100644 logic/Preparation/Interface/IGameObj.cs
create mode 100644 logic/Preparation/Interface/IMap.cs
create mode 100644 logic/Preparation/Interface/IMoveable.cs
create mode 100644 logic/Preparation/Interface/IObjOfCharacter.cs
create mode 100644 logic/Preparation/Interface/ITimer.cs
diff --git a/logic/Preparation/Interface/ICharacter.cs b/logic/Preparation/Interface/ICharacter.cs
new file mode 100644
index 0000000..a708e00
--- /dev/null
+++ b/logic/Preparation/Interface/ICharacter.cs
@@ -0,0 +1,11 @@
+using System;
+using Preparation.Utility;
+
+namespace Preparation.Interface
+{
+ public interface ICharacter : IGameObj
+ {
+ public long TeamID { get; }
+ public int HP { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/logic/Preparation/Interface/IGameObj.cs b/logic/Preparation/Interface/IGameObj.cs
new file mode 100644
index 0000000..a32a1c5
--- /dev/null
+++ b/logic/Preparation/Interface/IGameObj.cs
@@ -0,0 +1,20 @@
+using Preparation.Utility;
+
+namespace Preparation.Interface
+{
+ public interface IGameObj
+ {
+ public GameObjType Type { get; set; }
+ public long ID { get; }
+ public XYPosition Position { get; } // if Square, Pos equals the center
+ public double FacingDirection { get; }
+ public bool IsRigid { get; }
+ public ShapeType Shape { get; }
+ public bool CanMove { get; set; }
+ public bool IsMoving { get; set; }
+ public bool IsResetting { get; set; } // reviving
+ public bool IsAvailable { get; }
+ public int Radius { get; } // if Square, Radius equals half length of one side
+ public PlaceType Place { get; set; }
+ }
+}
diff --git a/logic/Preparation/Interface/IMap.cs b/logic/Preparation/Interface/IMap.cs
new file mode 100644
index 0000000..0d781b3
--- /dev/null
+++ b/logic/Preparation/Interface/IMap.cs
@@ -0,0 +1,18 @@
+using System.Collections.Generic;
+using System.Threading;
+using Preparation.Utility;
+
+namespace Preparation.Interface
+{
+ public interface IMap
+ {
+ ITimer Timer { get; }
+
+ // the two dicts must have same keys
+ Dictionary> GameObjDict { get; }
+ Dictionary GameObjLockDict { get; }
+
+ public bool IsOutOfBound(IGameObj obj);
+ public IOutOfBound GetOutOfBound(XYPosition pos); // 返回新建的一个OutOfBound对象
+ }
+}
diff --git a/logic/Preparation/Interface/IMoveable.cs b/logic/Preparation/Interface/IMoveable.cs
new file mode 100644
index 0000000..000a534
--- /dev/null
+++ b/logic/Preparation/Interface/IMoveable.cs
@@ -0,0 +1,36 @@
+using System;
+using Preparation.Utility;
+
+namespace Preparation.Interface
+{
+ public interface IMoveable : IGameObj
+ {
+ object MoveLock { get; }
+ public int MoveSpeed { get; }
+ public long Move(Vector moveVec);
+ // protected bool IgnoreCollide(IGameObj targetObj); // 忽略碰撞,在具体类中实现
+ public bool WillCollideWith(IGameObj? targetObj, XYPosition nextPos) // 检查下一位置是否会和目标物碰撞
+ {
+ if (targetObj == null)
+ return false;
+ // 会移动的只有子弹和人物,都是Circle
+ if (!targetObj.IsRigid || targetObj.ID == ID)
+ return false;
+ // if (IgnoreCollide(targetObj)) return false;
+ if (targetObj.Shape == ShapeType.Circle)
+ {
+ return XYPosition.Distance(nextPos, targetObj.Position) < targetObj.Radius + Radius;
+ }
+ else // Square
+ {
+ long deltaX = Math.Abs(nextPos.x - targetObj.Position.x), deltaY = Math.Abs(nextPos.y - targetObj.Position.y);
+ if (deltaX >= targetObj.Radius + Radius || deltaY >= targetObj.Radius + Radius)
+ return false;
+ if (deltaX < targetObj.Radius || deltaY < targetObj.Radius)
+ return true;
+ else
+ return ((long)(deltaX - targetObj.Radius) * (deltaX - targetObj.Radius)) + ((long)(deltaY - targetObj.Radius) * (deltaY - targetObj.Radius)) <= (long)Radius * (long)Radius;
+ }
+ }
+ }
+}
diff --git a/logic/Preparation/Interface/IObjOfCharacter.cs b/logic/Preparation/Interface/IObjOfCharacter.cs
new file mode 100644
index 0000000..92c5e40
--- /dev/null
+++ b/logic/Preparation/Interface/IObjOfCharacter.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace Preparation.Interface
+{
+ public interface IObjOfCharacter : IGameObj
+ {
+ ICharacter? Parent { get; set; }
+ }
+}
diff --git a/logic/Preparation/Interface/ITimer.cs b/logic/Preparation/Interface/ITimer.cs
new file mode 100644
index 0000000..bdcdcbc
--- /dev/null
+++ b/logic/Preparation/Interface/ITimer.cs
@@ -0,0 +1,9 @@
+
+namespace Preparation.Interface
+{
+ public interface ITimer
+ {
+ bool IsGaming { get; }
+ public bool StartGame(int timeInMilliseconds);
+ }
+}
From 8c975d57a112337f94e63082bd32fefd6454669b Mon Sep 17 00:00:00 2001
From: shangfengh <3495281661@qq.com>
Date: Sat, 15 Oct 2022 12:02:37 +0800
Subject: [PATCH 03/15] add logic/Preparation/GameData
---
logic/Preparation/GameData/GameData.cs | 77 ++++++++++++++++++++++++++
1 file changed, 77 insertions(+)
create mode 100644 logic/Preparation/GameData/GameData.cs
diff --git a/logic/Preparation/GameData/GameData.cs b/logic/Preparation/GameData/GameData.cs
new file mode 100644
index 0000000..2d13d58
--- /dev/null
+++ b/logic/Preparation/GameData/GameData.cs
@@ -0,0 +1,77 @@
+using Preparation.Utility;
+
+namespace Preparation.GameData
+{
+ public static class GameData
+ {
+#region 基本常数与常方法
+ public const int numOfPosGridPerCell = 1000; // 每格的【坐标单位】数
+ public const int numOfStepPerSecond = 20; // 每秒行走的步数
+ public const int lengthOfMap = 50000; // 地图长度
+ public const int rows = 50; // 行数
+ public const int cols = 50; // 列数
+ public const long gameDuration = 600000; // 游戏时长600000ms = 10min
+ public const long frameDuration = 50; // 每帧时长
+
+ public const int MinSpeed = 1; // 最小速度
+ public const int MaxSpeed = int.MaxValue; // 最大速度
+
+ public static XYPosition GetCellCenterPos(int x, int y) // 求格子的中心坐标
+ {
+ XYPosition ret = new((x * numOfPosGridPerCell) + (numOfPosGridPerCell / 2), (y * numOfPosGridPerCell) + (numOfPosGridPerCell / 2));
+ return ret;
+ }
+ public static int PosGridToCellX(XYPosition pos) // 求坐标所在的格子的x坐标
+ {
+ return pos.x / numOfPosGridPerCell;
+ }
+ public static int PosGridToCellY(XYPosition pos) // 求坐标所在的格子的y坐标
+ {
+ return pos.y / numOfPosGridPerCell;
+ }
+ public static bool IsInTheSameCell(XYPosition pos1, XYPosition pos2)
+ {
+ return PosGridToCellX(pos1) == PosGridToCellX(pos2) && PosGridToCellY(pos1) == PosGridToCellY(pos2);
+ }
+#endregion
+#region 角色相关
+ ///
+ /// 玩家相关
+ ///
+ public const int characterRadius = numOfPosGridPerCell / 2; // 人物半径
+ public const int basicAp = 3000; // 初始攻击力
+ public const int basicHp = 6000; // 初始血量
+ public const int basicCD = 3000; // 初始子弹冷却
+ public const int basicBulletNum = 3; // 基本初始子弹量
+ public const int MinAP = 0; // 最小攻击力
+ public const int MaxAP = int.MaxValue; // 最大攻击力
+ public const double basicAttackRange = 9000; // 基本攻击范围
+ public const double basicBulletBombRange = 3000; // 基本子弹爆炸范围
+ public const int basicMoveSpeed = 3000; // 基本移动速度,单位:s-1
+ public const int basicBulletMoveSpeed = 3000; // 基本子弹移动速度,单位:s-1
+ public const int characterMaxSpeed = 12000; // 最大速度
+ public const int addScoreWhenKillOneLevelPlayer = 30; // 击杀一级角色获得的加分
+ public const int commonSkillCD = 30000; // 普通技能标准冷却时间
+ public const int commonSkillTime = 10000; // 普通技能标准持续时间
+ public const int bulletRadius = 200; // 默认子弹半径
+ public const int reviveTime = 30000; // 复活时间
+ public const int shieldTimeAtBirth = 3000; // 复活时的护盾时间
+ public const int gemToScore = 4; // 一个宝石的标准加分
+ ///
+ /// 道具相关
+ ///
+ public const int MinPropTypeNum = 1;
+ public const int MaxPropTypeNum = 10;
+ public const int PropRadius = numOfPosGridPerCell / 2;
+ public const int PropMoveSpeed = 3000;
+ public const int PropMaxMoveDistance = 15 * numOfPosGridPerCell;
+ public const int MaxGemSize = 5; // 随机生成的宝石最大size
+ public const long GemProduceTime = 10000;
+ public const long PropProduceTime = 10000;
+ public const int PropDuration = 10000;
+#endregion
+#region 游戏帧相关
+ public const long checkInterval = 50; // 检查位置标志、补充子弹的帧时长
+#endregion
+ }
+}
From 2b47e6091addd99b073dac74fa92b1c2cf3a66ce Mon Sep 17 00:00:00 2001
From: DragonAura
Date: Sat, 15 Oct 2022 15:04:57 +0800
Subject: [PATCH 04/15] chore : add receive message interface
---
CAPI/proto/Message2Clients.grpc.pb.cc | 130 +++++-
CAPI/proto/Message2Clients.grpc.pb.h | 548 +++++++++++++++++++++----
CAPI/proto/Message2Clients.pb.cc | 391 +++++++++++++++++-
CAPI/proto/Message2Clients.pb.h | 333 ++++++++++++++-
dependency/proto/Message2Clients.proto | 11 +-
5 files changed, 1308 insertions(+), 105 deletions(-)
diff --git a/CAPI/proto/Message2Clients.grpc.pb.cc b/CAPI/proto/Message2Clients.grpc.pb.cc
index 8e33e9d..85ea789 100644
--- a/CAPI/proto/Message2Clients.grpc.pb.cc
+++ b/CAPI/proto/Message2Clients.grpc.pb.cc
@@ -29,6 +29,8 @@ namespace protobuf
"/protobuf.AvailableService/UseProp",
"/protobuf.AvailableService/UseSkill",
"/protobuf.AvailableService/SendMessage",
+ "/protobuf.AvailableService/HaveMessage",
+ "/protobuf.AvailableService/GetMessage",
"/protobuf.AvailableService/FixMachine",
"/protobuf.AvailableService/SaveHuman",
"/protobuf.AvailableService/Attack",
@@ -53,13 +55,15 @@ namespace protobuf
rpcmethod_UseProp_(AvailableService_method_names[3], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_UseSkill_(AvailableService_method_names[4], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_SendMessage_(AvailableService_method_names[5], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
- rpcmethod_FixMachine_(AvailableService_method_names[6], options.suffix_for_stats(), ::grpc::internal::RpcMethod::BIDI_STREAMING, channel),
- rpcmethod_SaveHuman_(AvailableService_method_names[7], options.suffix_for_stats(), ::grpc::internal::RpcMethod::BIDI_STREAMING, channel),
- rpcmethod_Attack_(AvailableService_method_names[8], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
- rpcmethod_CarryHuman_(AvailableService_method_names[9], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
- rpcmethod_ReleaseHuman_(AvailableService_method_names[10], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
- rpcmethod_HangHuman_(AvailableService_method_names[11], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
- rpcmethod_Escape_(AvailableService_method_names[12], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
+ rpcmethod_HaveMessage_(AvailableService_method_names[6], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
+ rpcmethod_GetMessage_(AvailableService_method_names[7], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
+ rpcmethod_FixMachine_(AvailableService_method_names[8], options.suffix_for_stats(), ::grpc::internal::RpcMethod::BIDI_STREAMING, channel),
+ rpcmethod_SaveHuman_(AvailableService_method_names[9], options.suffix_for_stats(), ::grpc::internal::RpcMethod::BIDI_STREAMING, channel),
+ rpcmethod_Attack_(AvailableService_method_names[10], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
+ rpcmethod_CarryHuman_(AvailableService_method_names[11], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
+ rpcmethod_ReleaseHuman_(AvailableService_method_names[12], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
+ rpcmethod_HangHuman_(AvailableService_method_names[13], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
+ rpcmethod_Escape_(AvailableService_method_names[14], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
{
}
@@ -223,6 +227,62 @@ namespace protobuf
return result;
}
+ ::grpc::Status AvailableService::Stub::HaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::protobuf::BoolRes* response)
+ {
+ return ::grpc::internal::BlockingUnaryCall<::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_HaveMessage_, context, request, response);
+ }
+
+ void AvailableService::Stub::async::HaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, std::function f)
+ {
+ ::grpc::internal::CallbackUnaryCall<::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_HaveMessage_, context, request, response, std::move(f));
+ }
+
+ void AvailableService::Stub::async::HaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor)
+ {
+ ::grpc::internal::ClientCallbackUnaryFactory::Create<::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_HaveMessage_, context, request, response, reactor);
+ }
+
+ ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AvailableService::Stub::PrepareAsyncHaveMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ return ::grpc::internal::ClientAsyncResponseReaderHelper::Create<::protobuf::BoolRes, ::protobuf::IDMsg, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_HaveMessage_, context, request);
+ }
+
+ ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AvailableService::Stub::AsyncHaveMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ auto* result =
+ this->PrepareAsyncHaveMessageRaw(context, request, cq);
+ result->StartCall();
+ return result;
+ }
+
+ ::grpc::Status AvailableService::Stub::GetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::protobuf::MsgRes* response)
+ {
+ return ::grpc::internal::BlockingUnaryCall<::protobuf::IDMsg, ::protobuf::MsgRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetMessage_, context, request, response);
+ }
+
+ void AvailableService::Stub::async::GetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::MsgRes* response, std::function f)
+ {
+ ::grpc::internal::CallbackUnaryCall<::protobuf::IDMsg, ::protobuf::MsgRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetMessage_, context, request, response, std::move(f));
+ }
+
+ void AvailableService::Stub::async::GetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::MsgRes* response, ::grpc::ClientUnaryReactor* reactor)
+ {
+ ::grpc::internal::ClientCallbackUnaryFactory::Create<::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetMessage_, context, request, response, reactor);
+ }
+
+ ::grpc::ClientAsyncResponseReader<::protobuf::MsgRes>* AvailableService::Stub::PrepareAsyncGetMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ return ::grpc::internal::ClientAsyncResponseReaderHelper::Create<::protobuf::MsgRes, ::protobuf::IDMsg, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetMessage_, context, request);
+ }
+
+ ::grpc::ClientAsyncResponseReader<::protobuf::MsgRes>* AvailableService::Stub::AsyncGetMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ auto* result =
+ this->PrepareAsyncGetMessageRaw(context, request, cq);
+ result->StartCall();
+ return result;
+ }
+
::grpc::ClientReaderWriter<::protobuf::IDMsg, ::protobuf::BoolRes>* AvailableService::Stub::FixMachineRaw(::grpc::ClientContext* context)
{
return ::grpc::internal::ClientReaderWriterFactory<::protobuf::IDMsg, ::protobuf::BoolRes>::Create(channel_.get(), rpcmethod_FixMachine_, context);
@@ -491,6 +551,34 @@ namespace protobuf
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[6],
+ ::grpc::internal::RpcMethod::NORMAL_RPC,
+ new ::grpc::internal::RpcMethodHandler(
+ [](AvailableService::Service* service,
+ ::grpc::ServerContext* ctx,
+ const ::protobuf::IDMsg* req,
+ ::protobuf::BoolRes* resp)
+ {
+ return service->HaveMessage(ctx, req, resp);
+ },
+ this
+ )
+ ));
+ AddMethod(new ::grpc::internal::RpcServiceMethod(
+ AvailableService_method_names[7],
+ ::grpc::internal::RpcMethod::NORMAL_RPC,
+ new ::grpc::internal::RpcMethodHandler(
+ [](AvailableService::Service* service,
+ ::grpc::ServerContext* ctx,
+ const ::protobuf::IDMsg* req,
+ ::protobuf::MsgRes* resp)
+ {
+ return service->GetMessage(ctx, req, resp);
+ },
+ this
+ )
+ ));
+ AddMethod(new ::grpc::internal::RpcServiceMethod(
+ AvailableService_method_names[8],
::grpc::internal::RpcMethod::BIDI_STREAMING,
new ::grpc::internal::BidiStreamingHandler(
[](AvailableService::Service* service,
@@ -503,7 +591,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
- AvailableService_method_names[7],
+ AvailableService_method_names[9],
::grpc::internal::RpcMethod::BIDI_STREAMING,
new ::grpc::internal::BidiStreamingHandler(
[](AvailableService::Service* service,
@@ -516,7 +604,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
- AvailableService_method_names[8],
+ AvailableService_method_names[10],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler(
[](AvailableService::Service* service,
@@ -530,7 +618,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
- AvailableService_method_names[9],
+ AvailableService_method_names[11],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler(
[](AvailableService::Service* service,
@@ -544,7 +632,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
- AvailableService_method_names[10],
+ AvailableService_method_names[12],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler(
[](AvailableService::Service* service,
@@ -558,7 +646,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
- AvailableService_method_names[11],
+ AvailableService_method_names[13],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler(
[](AvailableService::Service* service,
@@ -572,7 +660,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
- AvailableService_method_names[12],
+ AvailableService_method_names[14],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler(
[](AvailableService::Service* service,
@@ -639,6 +727,22 @@ namespace protobuf
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
+ ::grpc::Status AvailableService::Service::HaveMessage(::grpc::ServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
+ {
+ (void)context;
+ (void)request;
+ (void)response;
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+
+ ::grpc::Status AvailableService::Service::GetMessage(::grpc::ServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::MsgRes* response)
+ {
+ (void)context;
+ (void)request;
+ (void)response;
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+
::grpc::Status AvailableService::Service::FixMachine(::grpc::ServerContext* context, ::grpc::ServerReaderWriter<::protobuf::BoolRes, ::protobuf::IDMsg>* stream)
{
(void)context;
diff --git a/CAPI/proto/Message2Clients.grpc.pb.h b/CAPI/proto/Message2Clients.grpc.pb.h
index 4dc2515..60af0ca 100644
--- a/CAPI/proto/Message2Clients.grpc.pb.h
+++ b/CAPI/proto/Message2Clients.grpc.pb.h
@@ -103,6 +103,24 @@ namespace protobuf
{
return std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>>(PrepareAsyncSendMessageRaw(context, request, cq));
}
+ virtual ::grpc::Status HaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::protobuf::BoolRes* response) = 0;
+ std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>> AsyncHaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ return std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>>(AsyncHaveMessageRaw(context, request, cq));
+ }
+ std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>> PrepareAsyncHaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ return std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>>(PrepareAsyncHaveMessageRaw(context, request, cq));
+ }
+ virtual ::grpc::Status GetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::protobuf::MsgRes* response) = 0;
+ std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::MsgRes>> AsyncGetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ return std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::MsgRes>>(AsyncGetMessageRaw(context, request, cq));
+ }
+ std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::MsgRes>> PrepareAsyncGetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ return std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::MsgRes>>(PrepareAsyncGetMessageRaw(context, request, cq));
+ }
std::unique_ptr<::grpc::ClientReaderWriterInterface<::protobuf::IDMsg, ::protobuf::BoolRes>> FixMachine(::grpc::ClientContext* context)
{
return std::unique_ptr<::grpc::ClientReaderWriterInterface<::protobuf::IDMsg, ::protobuf::BoolRes>>(FixMachineRaw(context));
@@ -193,6 +211,10 @@ namespace protobuf
virtual void UseSkill(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) = 0;
virtual void SendMessage(::grpc::ClientContext* context, const ::protobuf::SendMsg* request, ::protobuf::BoolRes* response, std::function) = 0;
virtual void SendMessage(::grpc::ClientContext* context, const ::protobuf::SendMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) = 0;
+ virtual void HaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, std::function) = 0;
+ virtual void HaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) = 0;
+ virtual void GetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::MsgRes* response, std::function) = 0;
+ virtual void GetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::MsgRes* response, ::grpc::ClientUnaryReactor* reactor) = 0;
virtual void FixMachine(::grpc::ClientContext* context, ::grpc::ClientBidiReactor<::protobuf::IDMsg, ::protobuf::BoolRes>* reactor) = 0;
// 若正常修复且未被打断则返回修复成功,位置错误/被打断则返回修复失败,下同
virtual void SaveHuman(::grpc::ClientContext* context, ::grpc::ClientBidiReactor<::protobuf::IDMsg, ::protobuf::BoolRes>* reactor) = 0;
@@ -231,6 +253,10 @@ namespace protobuf
virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* PrepareAsyncUseSkillRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* AsyncSendMessageRaw(::grpc::ClientContext* context, const ::protobuf::SendMsg& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* PrepareAsyncSendMessageRaw(::grpc::ClientContext* context, const ::protobuf::SendMsg& request, ::grpc::CompletionQueue* cq) = 0;
+ virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* AsyncHaveMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) = 0;
+ virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* PrepareAsyncHaveMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) = 0;
+ virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::MsgRes>* AsyncGetMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) = 0;
+ virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::MsgRes>* PrepareAsyncGetMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientReaderWriterInterface<::protobuf::IDMsg, ::protobuf::BoolRes>* FixMachineRaw(::grpc::ClientContext* context) = 0;
virtual ::grpc::ClientAsyncReaderWriterInterface<::protobuf::IDMsg, ::protobuf::BoolRes>* AsyncFixMachineRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0;
virtual ::grpc::ClientAsyncReaderWriterInterface<::protobuf::IDMsg, ::protobuf::BoolRes>* PrepareAsyncFixMachineRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0;
@@ -309,6 +335,24 @@ namespace protobuf
{
return std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>>(PrepareAsyncSendMessageRaw(context, request, cq));
}
+ ::grpc::Status HaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::protobuf::BoolRes* response) override;
+ std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>> AsyncHaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ return std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>>(AsyncHaveMessageRaw(context, request, cq));
+ }
+ std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>> PrepareAsyncHaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ return std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>>(PrepareAsyncHaveMessageRaw(context, request, cq));
+ }
+ ::grpc::Status GetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::protobuf::MsgRes* response) override;
+ std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::MsgRes>> AsyncGetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ return std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::MsgRes>>(AsyncGetMessageRaw(context, request, cq));
+ }
+ std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::MsgRes>> PrepareAsyncGetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
+ {
+ return std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::MsgRes>>(PrepareAsyncGetMessageRaw(context, request, cq));
+ }
std::unique_ptr<::grpc::ClientReaderWriter<::protobuf::IDMsg, ::protobuf::BoolRes>> FixMachine(::grpc::ClientContext* context)
{
return std::unique_ptr<::grpc::ClientReaderWriter<::protobuf::IDMsg, ::protobuf::BoolRes>>(FixMachineRaw(context));
@@ -393,6 +437,10 @@ namespace protobuf
void UseSkill(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) override;
void SendMessage(::grpc::ClientContext* context, const ::protobuf::SendMsg* request, ::protobuf::BoolRes* response, std::function) override;
void SendMessage(::grpc::ClientContext* context, const ::protobuf::SendMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) override;
+ void HaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, std::function) override;
+ void HaveMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) override;
+ void GetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::MsgRes* response, std::function) override;
+ void GetMessage(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::MsgRes* response, ::grpc::ClientUnaryReactor* reactor) override;
void FixMachine(::grpc::ClientContext* context, ::grpc::ClientBidiReactor<::protobuf::IDMsg, ::protobuf::BoolRes>* reactor) override;
void SaveHuman(::grpc::ClientContext* context, ::grpc::ClientBidiReactor<::protobuf::IDMsg, ::protobuf::BoolRes>* reactor) override;
void Attack(::grpc::ClientContext* context, const ::protobuf::AttackMsg* request, ::protobuf::BoolRes* response, std::function) override;
@@ -442,6 +490,10 @@ namespace protobuf
::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* PrepareAsyncUseSkillRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AsyncSendMessageRaw(::grpc::ClientContext* context, const ::protobuf::SendMsg& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* PrepareAsyncSendMessageRaw(::grpc::ClientContext* context, const ::protobuf::SendMsg& request, ::grpc::CompletionQueue* cq) override;
+ ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AsyncHaveMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) override;
+ ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* PrepareAsyncHaveMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) override;
+ ::grpc::ClientAsyncResponseReader<::protobuf::MsgRes>* AsyncGetMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) override;
+ ::grpc::ClientAsyncResponseReader<::protobuf::MsgRes>* PrepareAsyncGetMessageRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientReaderWriter<::protobuf::IDMsg, ::protobuf::BoolRes>* FixMachineRaw(::grpc::ClientContext* context) override;
::grpc::ClientAsyncReaderWriter<::protobuf::IDMsg, ::protobuf::BoolRes>* AsyncFixMachineRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override;
::grpc::ClientAsyncReaderWriter<::protobuf::IDMsg, ::protobuf::BoolRes>* PrepareAsyncFixMachineRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override;
@@ -464,6 +516,8 @@ namespace protobuf
const ::grpc::internal::RpcMethod rpcmethod_UseProp_;
const ::grpc::internal::RpcMethod rpcmethod_UseSkill_;
const ::grpc::internal::RpcMethod rpcmethod_SendMessage_;
+ const ::grpc::internal::RpcMethod rpcmethod_HaveMessage_;
+ const ::grpc::internal::RpcMethod rpcmethod_GetMessage_;
const ::grpc::internal::RpcMethod rpcmethod_FixMachine_;
const ::grpc::internal::RpcMethod rpcmethod_SaveHuman_;
const ::grpc::internal::RpcMethod rpcmethod_Attack_;
@@ -488,6 +542,8 @@ namespace protobuf
virtual ::grpc::Status UseProp(::grpc::ServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response);
virtual ::grpc::Status UseSkill(::grpc::ServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response);
virtual ::grpc::Status SendMessage(::grpc::ServerContext* context, const ::protobuf::SendMsg* request, ::protobuf::BoolRes* response);
+ virtual ::grpc::Status HaveMessage(::grpc::ServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response);
+ virtual ::grpc::Status GetMessage(::grpc::ServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::MsgRes* response);
virtual ::grpc::Status FixMachine(::grpc::ServerContext* context, ::grpc::ServerReaderWriter<::protobuf::BoolRes, ::protobuf::IDMsg>* stream);
// 若正常修复且未被打断则返回修复成功,位置错误/被打断则返回修复失败,下同
virtual ::grpc::Status SaveHuman(::grpc::ServerContext* context, ::grpc::ServerReaderWriter<::protobuf::BoolRes, ::protobuf::IDMsg>* stream);
@@ -666,6 +722,62 @@ namespace protobuf
}
};
template
+ class WithAsyncMethod_HaveMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithAsyncMethod_HaveMessage()
+ {
+ ::grpc::Service::MarkMethodAsync(6);
+ }
+ ~WithAsyncMethod_HaveMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status HaveMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ void RequestHaveMessage(::grpc::ServerContext* context, ::protobuf::IDMsg* request, ::grpc::ServerAsyncResponseWriter<::protobuf::BoolRes>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
+ {
+ ::grpc::Service::RequestAsyncUnary(6, context, request, response, new_call_cq, notification_cq, tag);
+ }
+ };
+ template
+ class WithAsyncMethod_GetMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithAsyncMethod_GetMessage()
+ {
+ ::grpc::Service::MarkMethodAsync(7);
+ }
+ ~WithAsyncMethod_GetMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status GetMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::MsgRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ void RequestGetMessage(::grpc::ServerContext* context, ::protobuf::IDMsg* request, ::grpc::ServerAsyncResponseWriter<::protobuf::MsgRes>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
+ {
+ ::grpc::Service::RequestAsyncUnary(7, context, request, response, new_call_cq, notification_cq, tag);
+ }
+ };
+ template
class WithAsyncMethod_FixMachine : public BaseClass
{
private:
@@ -676,7 +788,7 @@ namespace protobuf
public:
WithAsyncMethod_FixMachine()
{
- ::grpc::Service::MarkMethodAsync(6);
+ ::grpc::Service::MarkMethodAsync(8);
}
~WithAsyncMethod_FixMachine() override
{
@@ -690,7 +802,7 @@ namespace protobuf
}
void RequestFixMachine(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter<::protobuf::BoolRes, ::protobuf::IDMsg>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncBidiStreaming(6, context, stream, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncBidiStreaming(8, context, stream, new_call_cq, notification_cq, tag);
}
};
template
@@ -704,7 +816,7 @@ namespace protobuf
public:
WithAsyncMethod_SaveHuman()
{
- ::grpc::Service::MarkMethodAsync(7);
+ ::grpc::Service::MarkMethodAsync(9);
}
~WithAsyncMethod_SaveHuman() override
{
@@ -718,7 +830,7 @@ namespace protobuf
}
void RequestSaveHuman(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter<::protobuf::BoolRes, ::protobuf::IDMsg>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncBidiStreaming(7, context, stream, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncBidiStreaming(9, context, stream, new_call_cq, notification_cq, tag);
}
};
template
@@ -732,7 +844,7 @@ namespace protobuf
public:
WithAsyncMethod_Attack()
{
- ::grpc::Service::MarkMethodAsync(8);
+ ::grpc::Service::MarkMethodAsync(10);
}
~WithAsyncMethod_Attack() override
{
@@ -746,7 +858,7 @@ namespace protobuf
}
void RequestAttack(::grpc::ServerContext* context, ::protobuf::AttackMsg* request, ::grpc::ServerAsyncResponseWriter<::protobuf::BoolRes>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncUnary(8, context, request, response, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag);
}
};
template
@@ -760,7 +872,7 @@ namespace protobuf
public:
WithAsyncMethod_CarryHuman()
{
- ::grpc::Service::MarkMethodAsync(9);
+ ::grpc::Service::MarkMethodAsync(11);
}
~WithAsyncMethod_CarryHuman() override
{
@@ -774,7 +886,7 @@ namespace protobuf
}
void RequestCarryHuman(::grpc::ServerContext* context, ::protobuf::IDMsg* request, ::grpc::ServerAsyncResponseWriter<::protobuf::BoolRes>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncUnary(9, context, request, response, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncUnary(11, context, request, response, new_call_cq, notification_cq, tag);
}
};
template
@@ -788,7 +900,7 @@ namespace protobuf
public:
WithAsyncMethod_ReleaseHuman()
{
- ::grpc::Service::MarkMethodAsync(10);
+ ::grpc::Service::MarkMethodAsync(12);
}
~WithAsyncMethod_ReleaseHuman() override
{
@@ -802,7 +914,7 @@ namespace protobuf
}
void RequestReleaseHuman(::grpc::ServerContext* context, ::protobuf::IDMsg* request, ::grpc::ServerAsyncResponseWriter<::protobuf::BoolRes>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag);
}
};
template
@@ -816,7 +928,7 @@ namespace protobuf
public:
WithAsyncMethod_HangHuman()
{
- ::grpc::Service::MarkMethodAsync(11);
+ ::grpc::Service::MarkMethodAsync(13);
}
~WithAsyncMethod_HangHuman() override
{
@@ -830,7 +942,7 @@ namespace protobuf
}
void RequestHangHuman(::grpc::ServerContext* context, ::protobuf::IDMsg* request, ::grpc::ServerAsyncResponseWriter<::protobuf::BoolRes>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncUnary(11, context, request, response, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncUnary(13, context, request, response, new_call_cq, notification_cq, tag);
}
};
template
@@ -844,7 +956,7 @@ namespace protobuf
public:
WithAsyncMethod_Escape()
{
- ::grpc::Service::MarkMethodAsync(12);
+ ::grpc::Service::MarkMethodAsync(14);
}
~WithAsyncMethod_Escape() override
{
@@ -858,10 +970,10 @@ namespace protobuf
}
void RequestEscape(::grpc::ServerContext* context, ::protobuf::IDMsg* request, ::grpc::ServerAsyncResponseWriter<::protobuf::BoolRes>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncUnary(14, context, request, response, new_call_cq, notification_cq, tag);
}
};
- typedef WithAsyncMethod_AddPlayer>>>>>>>>>>>> AsyncService;
+ typedef WithAsyncMethod_AddPlayer>>>>>>>>>>>>>> AsyncService;
template
class WithCallbackMethod_AddPlayer : public BaseClass
{
@@ -1089,6 +1201,84 @@ namespace protobuf
}
};
template
+ class WithCallbackMethod_HaveMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithCallbackMethod_HaveMessage()
+ {
+ ::grpc::Service::MarkMethodCallback(6, new ::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
+ { return this->HaveMessage(context, request, response); }));
+ }
+ void SetMessageAllocatorFor_HaveMessage(
+ ::grpc::MessageAllocator<::protobuf::IDMsg, ::protobuf::BoolRes>* allocator
+ )
+ {
+ ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(6);
+ static_cast<::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>*>(handler)
+ ->SetMessageAllocator(allocator);
+ }
+ ~WithCallbackMethod_HaveMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status HaveMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ virtual ::grpc::ServerUnaryReactor* HaveMessage(
+ ::grpc::CallbackServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::BoolRes* /*response*/
+ )
+ {
+ return nullptr;
+ }
+ };
+ template
+ class WithCallbackMethod_GetMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithCallbackMethod_GetMessage()
+ {
+ ::grpc::Service::MarkMethodCallback(7, new ::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::MsgRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::MsgRes* response)
+ { return this->GetMessage(context, request, response); }));
+ }
+ void SetMessageAllocatorFor_GetMessage(
+ ::grpc::MessageAllocator<::protobuf::IDMsg, ::protobuf::MsgRes>* allocator
+ )
+ {
+ ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(7);
+ static_cast<::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::MsgRes>*>(handler)
+ ->SetMessageAllocator(allocator);
+ }
+ ~WithCallbackMethod_GetMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status GetMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::MsgRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ virtual ::grpc::ServerUnaryReactor* GetMessage(
+ ::grpc::CallbackServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::MsgRes* /*response*/
+ )
+ {
+ return nullptr;
+ }
+ };
+ template
class WithCallbackMethod_FixMachine : public BaseClass
{
private:
@@ -1099,7 +1289,7 @@ namespace protobuf
public:
WithCallbackMethod_FixMachine()
{
- ::grpc::Service::MarkMethodCallback(6, new ::grpc::internal::CallbackBidiHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context)
+ ::grpc::Service::MarkMethodCallback(8, new ::grpc::internal::CallbackBidiHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context)
{ return this->FixMachine(context); }));
}
~WithCallbackMethod_FixMachine() override
@@ -1130,7 +1320,7 @@ namespace protobuf
public:
WithCallbackMethod_SaveHuman()
{
- ::grpc::Service::MarkMethodCallback(7, new ::grpc::internal::CallbackBidiHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context)
+ ::grpc::Service::MarkMethodCallback(9, new ::grpc::internal::CallbackBidiHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context)
{ return this->SaveHuman(context); }));
}
~WithCallbackMethod_SaveHuman() override
@@ -1161,14 +1351,14 @@ namespace protobuf
public:
WithCallbackMethod_Attack()
{
- ::grpc::Service::MarkMethodCallback(8, new ::grpc::internal::CallbackUnaryHandler<::protobuf::AttackMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::AttackMsg* request, ::protobuf::BoolRes* response)
- { return this->Attack(context, request, response); }));
+ ::grpc::Service::MarkMethodCallback(10, new ::grpc::internal::CallbackUnaryHandler<::protobuf::AttackMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::AttackMsg* request, ::protobuf::BoolRes* response)
+ { return this->Attack(context, request, response); }));
}
void SetMessageAllocatorFor_Attack(
::grpc::MessageAllocator<::protobuf::AttackMsg, ::protobuf::BoolRes>* allocator
)
{
- ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(8);
+ ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(10);
static_cast<::grpc::internal::CallbackUnaryHandler<::protobuf::AttackMsg, ::protobuf::BoolRes>*>(handler)
->SetMessageAllocator(allocator);
}
@@ -1200,14 +1390,14 @@ namespace protobuf
public:
WithCallbackMethod_CarryHuman()
{
- ::grpc::Service::MarkMethodCallback(9, new ::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
- { return this->CarryHuman(context, request, response); }));
+ ::grpc::Service::MarkMethodCallback(11, new ::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
+ { return this->CarryHuman(context, request, response); }));
}
void SetMessageAllocatorFor_CarryHuman(
::grpc::MessageAllocator<::protobuf::IDMsg, ::protobuf::BoolRes>* allocator
)
{
- ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(9);
+ ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(11);
static_cast<::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>*>(handler)
->SetMessageAllocator(allocator);
}
@@ -1239,14 +1429,14 @@ namespace protobuf
public:
WithCallbackMethod_ReleaseHuman()
{
- ::grpc::Service::MarkMethodCallback(10, new ::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
+ ::grpc::Service::MarkMethodCallback(12, new ::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
{ return this->ReleaseHuman(context, request, response); }));
}
void SetMessageAllocatorFor_ReleaseHuman(
::grpc::MessageAllocator<::protobuf::IDMsg, ::protobuf::BoolRes>* allocator
)
{
- ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(10);
+ ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(12);
static_cast<::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>*>(handler)
->SetMessageAllocator(allocator);
}
@@ -1278,14 +1468,14 @@ namespace protobuf
public:
WithCallbackMethod_HangHuman()
{
- ::grpc::Service::MarkMethodCallback(11, new ::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
+ ::grpc::Service::MarkMethodCallback(13, new ::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
{ return this->HangHuman(context, request, response); }));
}
void SetMessageAllocatorFor_HangHuman(
::grpc::MessageAllocator<::protobuf::IDMsg, ::protobuf::BoolRes>* allocator
)
{
- ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(11);
+ ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(13);
static_cast<::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>*>(handler)
->SetMessageAllocator(allocator);
}
@@ -1317,14 +1507,14 @@ namespace protobuf
public:
WithCallbackMethod_Escape()
{
- ::grpc::Service::MarkMethodCallback(12, new ::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
+ ::grpc::Service::MarkMethodCallback(14, new ::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
{ return this->Escape(context, request, response); }));
}
void SetMessageAllocatorFor_Escape(
::grpc::MessageAllocator<::protobuf::IDMsg, ::protobuf::BoolRes>* allocator
)
{
- ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(12);
+ ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(14);
static_cast<::grpc::internal::CallbackUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>*>(handler)
->SetMessageAllocator(allocator);
}
@@ -1345,7 +1535,7 @@ namespace protobuf
return nullptr;
}
};
- typedef WithCallbackMethod_AddPlayer>>>>>>>>>>>> CallbackService;
+ typedef WithCallbackMethod_AddPlayer>>>>>>>>>>>>>> CallbackService;
typedef CallbackService ExperimentalCallbackService;
template
class WithGenericMethod_AddPlayer : public BaseClass
@@ -1492,6 +1682,54 @@ namespace protobuf
}
};
template
+ class WithGenericMethod_HaveMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithGenericMethod_HaveMessage()
+ {
+ ::grpc::Service::MarkMethodGeneric(6);
+ }
+ ~WithGenericMethod_HaveMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status HaveMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ };
+ template
+ class WithGenericMethod_GetMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithGenericMethod_GetMessage()
+ {
+ ::grpc::Service::MarkMethodGeneric(7);
+ }
+ ~WithGenericMethod_GetMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status GetMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::MsgRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ };
+ template
class WithGenericMethod_FixMachine : public BaseClass
{
private:
@@ -1502,7 +1740,7 @@ namespace protobuf
public:
WithGenericMethod_FixMachine()
{
- ::grpc::Service::MarkMethodGeneric(6);
+ ::grpc::Service::MarkMethodGeneric(8);
}
~WithGenericMethod_FixMachine() override
{
@@ -1526,7 +1764,7 @@ namespace protobuf
public:
WithGenericMethod_SaveHuman()
{
- ::grpc::Service::MarkMethodGeneric(7);
+ ::grpc::Service::MarkMethodGeneric(9);
}
~WithGenericMethod_SaveHuman() override
{
@@ -1550,7 +1788,7 @@ namespace protobuf
public:
WithGenericMethod_Attack()
{
- ::grpc::Service::MarkMethodGeneric(8);
+ ::grpc::Service::MarkMethodGeneric(10);
}
~WithGenericMethod_Attack() override
{
@@ -1574,7 +1812,7 @@ namespace protobuf
public:
WithGenericMethod_CarryHuman()
{
- ::grpc::Service::MarkMethodGeneric(9);
+ ::grpc::Service::MarkMethodGeneric(11);
}
~WithGenericMethod_CarryHuman() override
{
@@ -1598,7 +1836,7 @@ namespace protobuf
public:
WithGenericMethod_ReleaseHuman()
{
- ::grpc::Service::MarkMethodGeneric(10);
+ ::grpc::Service::MarkMethodGeneric(12);
}
~WithGenericMethod_ReleaseHuman() override
{
@@ -1622,7 +1860,7 @@ namespace protobuf
public:
WithGenericMethod_HangHuman()
{
- ::grpc::Service::MarkMethodGeneric(11);
+ ::grpc::Service::MarkMethodGeneric(13);
}
~WithGenericMethod_HangHuman() override
{
@@ -1646,7 +1884,7 @@ namespace protobuf
public:
WithGenericMethod_Escape()
{
- ::grpc::Service::MarkMethodGeneric(12);
+ ::grpc::Service::MarkMethodGeneric(14);
}
~WithGenericMethod_Escape() override
{
@@ -1828,6 +2066,62 @@ namespace protobuf
}
};
template
+ class WithRawMethod_HaveMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithRawMethod_HaveMessage()
+ {
+ ::grpc::Service::MarkMethodRaw(6);
+ }
+ ~WithRawMethod_HaveMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status HaveMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ void RequestHaveMessage(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter<::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
+ {
+ ::grpc::Service::RequestAsyncUnary(6, context, request, response, new_call_cq, notification_cq, tag);
+ }
+ };
+ template
+ class WithRawMethod_GetMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithRawMethod_GetMessage()
+ {
+ ::grpc::Service::MarkMethodRaw(7);
+ }
+ ~WithRawMethod_GetMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status GetMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::MsgRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ void RequestGetMessage(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter<::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
+ {
+ ::grpc::Service::RequestAsyncUnary(7, context, request, response, new_call_cq, notification_cq, tag);
+ }
+ };
+ template
class WithRawMethod_FixMachine : public BaseClass
{
private:
@@ -1838,7 +2132,7 @@ namespace protobuf
public:
WithRawMethod_FixMachine()
{
- ::grpc::Service::MarkMethodRaw(6);
+ ::grpc::Service::MarkMethodRaw(8);
}
~WithRawMethod_FixMachine() override
{
@@ -1852,7 +2146,7 @@ namespace protobuf
}
void RequestFixMachine(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter<::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncBidiStreaming(6, context, stream, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncBidiStreaming(8, context, stream, new_call_cq, notification_cq, tag);
}
};
template
@@ -1866,7 +2160,7 @@ namespace protobuf
public:
WithRawMethod_SaveHuman()
{
- ::grpc::Service::MarkMethodRaw(7);
+ ::grpc::Service::MarkMethodRaw(9);
}
~WithRawMethod_SaveHuman() override
{
@@ -1880,7 +2174,7 @@ namespace protobuf
}
void RequestSaveHuman(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter<::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncBidiStreaming(7, context, stream, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncBidiStreaming(9, context, stream, new_call_cq, notification_cq, tag);
}
};
template
@@ -1894,7 +2188,7 @@ namespace protobuf
public:
WithRawMethod_Attack()
{
- ::grpc::Service::MarkMethodRaw(8);
+ ::grpc::Service::MarkMethodRaw(10);
}
~WithRawMethod_Attack() override
{
@@ -1908,7 +2202,7 @@ namespace protobuf
}
void RequestAttack(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter<::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncUnary(8, context, request, response, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag);
}
};
template
@@ -1922,7 +2216,7 @@ namespace protobuf
public:
WithRawMethod_CarryHuman()
{
- ::grpc::Service::MarkMethodRaw(9);
+ ::grpc::Service::MarkMethodRaw(11);
}
~WithRawMethod_CarryHuman() override
{
@@ -1936,7 +2230,7 @@ namespace protobuf
}
void RequestCarryHuman(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter<::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncUnary(9, context, request, response, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncUnary(11, context, request, response, new_call_cq, notification_cq, tag);
}
};
template
@@ -1950,7 +2244,7 @@ namespace protobuf
public:
WithRawMethod_ReleaseHuman()
{
- ::grpc::Service::MarkMethodRaw(10);
+ ::grpc::Service::MarkMethodRaw(12);
}
~WithRawMethod_ReleaseHuman() override
{
@@ -1964,7 +2258,7 @@ namespace protobuf
}
void RequestReleaseHuman(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter<::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag);
}
};
template
@@ -1978,7 +2272,7 @@ namespace protobuf
public:
WithRawMethod_HangHuman()
{
- ::grpc::Service::MarkMethodRaw(11);
+ ::grpc::Service::MarkMethodRaw(13);
}
~WithRawMethod_HangHuman() override
{
@@ -1992,7 +2286,7 @@ namespace protobuf
}
void RequestHangHuman(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter<::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncUnary(11, context, request, response, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncUnary(13, context, request, response, new_call_cq, notification_cq, tag);
}
};
template
@@ -2006,7 +2300,7 @@ namespace protobuf
public:
WithRawMethod_Escape()
{
- ::grpc::Service::MarkMethodRaw(12);
+ ::grpc::Service::MarkMethodRaw(14);
}
~WithRawMethod_Escape() override
{
@@ -2020,7 +2314,7 @@ namespace protobuf
}
void RequestEscape(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter<::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag)
{
- ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag);
+ ::grpc::Service::RequestAsyncUnary(14, context, request, response, new_call_cq, notification_cq, tag);
}
};
template
@@ -2210,6 +2504,68 @@ namespace protobuf
}
};
template
+ class WithRawCallbackMethod_HaveMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithRawCallbackMethod_HaveMessage()
+ {
+ ::grpc::Service::MarkMethodRawCallback(6, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
+ { return this->HaveMessage(context, request, response); }));
+ }
+ ~WithRawCallbackMethod_HaveMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status HaveMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ virtual ::grpc::ServerUnaryReactor* HaveMessage(
+ ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/
+ )
+ {
+ return nullptr;
+ }
+ };
+ template
+ class WithRawCallbackMethod_GetMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithRawCallbackMethod_GetMessage()
+ {
+ ::grpc::Service::MarkMethodRawCallback(7, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
+ { return this->GetMessage(context, request, response); }));
+ }
+ ~WithRawCallbackMethod_GetMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status GetMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::MsgRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ virtual ::grpc::ServerUnaryReactor* GetMessage(
+ ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/
+ )
+ {
+ return nullptr;
+ }
+ };
+ template
class WithRawCallbackMethod_FixMachine : public BaseClass
{
private:
@@ -2220,7 +2576,7 @@ namespace protobuf
public:
WithRawCallbackMethod_FixMachine()
{
- ::grpc::Service::MarkMethodRawCallback(6, new ::grpc::internal::CallbackBidiHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context)
+ ::grpc::Service::MarkMethodRawCallback(8, new ::grpc::internal::CallbackBidiHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context)
{ return this->FixMachine(context); }));
}
~WithRawCallbackMethod_FixMachine() override
@@ -2251,7 +2607,7 @@ namespace protobuf
public:
WithRawCallbackMethod_SaveHuman()
{
- ::grpc::Service::MarkMethodRawCallback(7, new ::grpc::internal::CallbackBidiHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context)
+ ::grpc::Service::MarkMethodRawCallback(9, new ::grpc::internal::CallbackBidiHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context)
{ return this->SaveHuman(context); }));
}
~WithRawCallbackMethod_SaveHuman() override
@@ -2282,8 +2638,8 @@ namespace protobuf
public:
WithRawCallbackMethod_Attack()
{
- ::grpc::Service::MarkMethodRawCallback(8, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
- { return this->Attack(context, request, response); }));
+ ::grpc::Service::MarkMethodRawCallback(10, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
+ { return this->Attack(context, request, response); }));
}
~WithRawCallbackMethod_Attack() override
{
@@ -2313,8 +2669,8 @@ namespace protobuf
public:
WithRawCallbackMethod_CarryHuman()
{
- ::grpc::Service::MarkMethodRawCallback(9, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
- { return this->CarryHuman(context, request, response); }));
+ ::grpc::Service::MarkMethodRawCallback(11, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
+ { return this->CarryHuman(context, request, response); }));
}
~WithRawCallbackMethod_CarryHuman() override
{
@@ -2344,7 +2700,7 @@ namespace protobuf
public:
WithRawCallbackMethod_ReleaseHuman()
{
- ::grpc::Service::MarkMethodRawCallback(10, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
+ ::grpc::Service::MarkMethodRawCallback(12, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
{ return this->ReleaseHuman(context, request, response); }));
}
~WithRawCallbackMethod_ReleaseHuman() override
@@ -2375,7 +2731,7 @@ namespace protobuf
public:
WithRawCallbackMethod_HangHuman()
{
- ::grpc::Service::MarkMethodRawCallback(11, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
+ ::grpc::Service::MarkMethodRawCallback(13, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
{ return this->HangHuman(context, request, response); }));
}
~WithRawCallbackMethod_HangHuman() override
@@ -2406,7 +2762,7 @@ namespace protobuf
public:
WithRawCallbackMethod_Escape()
{
- ::grpc::Service::MarkMethodRawCallback(12, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
+ ::grpc::Service::MarkMethodRawCallback(14, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response)
{ return this->Escape(context, request, response); }));
}
~WithRawCallbackMethod_Escape() override
@@ -2562,6 +2918,60 @@ namespace protobuf
virtual ::grpc::Status StreamedSendMessage(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::SendMsg, ::protobuf::BoolRes>* server_unary_streamer) = 0;
};
template
+ class WithStreamedUnaryMethod_HaveMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithStreamedUnaryMethod_HaveMessage()
+ {
+ ::grpc::Service::MarkMethodStreamed(6, new ::grpc::internal::StreamedUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* streamer)
+ { return this->StreamedHaveMessage(context, streamer); }));
+ }
+ ~WithStreamedUnaryMethod_HaveMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable regular version of this method
+ ::grpc::Status HaveMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ // replace default version of method with streamed unary
+ virtual ::grpc::Status StreamedHaveMessage(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* server_unary_streamer) = 0;
+ };
+ template
+ class WithStreamedUnaryMethod_GetMessage : public BaseClass
+ {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service* /*service*/)
+ {
+ }
+
+ public:
+ WithStreamedUnaryMethod_GetMessage()
+ {
+ ::grpc::Service::MarkMethodStreamed(7, new ::grpc::internal::StreamedUnaryHandler<::protobuf::IDMsg, ::protobuf::MsgRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::MsgRes>* streamer)
+ { return this->StreamedGetMessage(context, streamer); }));
+ }
+ ~WithStreamedUnaryMethod_GetMessage() override
+ {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable regular version of this method
+ ::grpc::Status GetMessage(::grpc::ServerContext* /*context*/, const ::protobuf::IDMsg* /*request*/, ::protobuf::MsgRes* /*response*/) override
+ {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ // replace default version of method with streamed unary
+ virtual ::grpc::Status StreamedGetMessage(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::MsgRes>* server_unary_streamer) = 0;
+ };
+ template
class WithStreamedUnaryMethod_Attack : public BaseClass
{
private:
@@ -2572,8 +2982,8 @@ namespace protobuf
public:
WithStreamedUnaryMethod_Attack()
{
- ::grpc::Service::MarkMethodStreamed(8, new ::grpc::internal::StreamedUnaryHandler<::protobuf::AttackMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::AttackMsg, ::protobuf::BoolRes>* streamer)
- { return this->StreamedAttack(context, streamer); }));
+ ::grpc::Service::MarkMethodStreamed(10, new ::grpc::internal::StreamedUnaryHandler<::protobuf::AttackMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::AttackMsg, ::protobuf::BoolRes>* streamer)
+ { return this->StreamedAttack(context, streamer); }));
}
~WithStreamedUnaryMethod_Attack() override
{
@@ -2599,8 +3009,8 @@ namespace protobuf
public:
WithStreamedUnaryMethod_CarryHuman()
{
- ::grpc::Service::MarkMethodStreamed(9, new ::grpc::internal::StreamedUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* streamer)
- { return this->StreamedCarryHuman(context, streamer); }));
+ ::grpc::Service::MarkMethodStreamed(11, new ::grpc::internal::StreamedUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* streamer)
+ { return this->StreamedCarryHuman(context, streamer); }));
}
~WithStreamedUnaryMethod_CarryHuman() override
{
@@ -2626,7 +3036,7 @@ namespace protobuf
public:
WithStreamedUnaryMethod_ReleaseHuman()
{
- ::grpc::Service::MarkMethodStreamed(10, new ::grpc::internal::StreamedUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* streamer)
+ ::grpc::Service::MarkMethodStreamed(12, new ::grpc::internal::StreamedUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* streamer)
{ return this->StreamedReleaseHuman(context, streamer); }));
}
~WithStreamedUnaryMethod_ReleaseHuman() override
@@ -2653,7 +3063,7 @@ namespace protobuf
public:
WithStreamedUnaryMethod_HangHuman()
{
- ::grpc::Service::MarkMethodStreamed(11, new ::grpc::internal::StreamedUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* streamer)
+ ::grpc::Service::MarkMethodStreamed(13, new ::grpc::internal::StreamedUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* streamer)
{ return this->StreamedHangHuman(context, streamer); }));
}
~WithStreamedUnaryMethod_HangHuman() override
@@ -2680,7 +3090,7 @@ namespace protobuf
public:
WithStreamedUnaryMethod_Escape()
{
- ::grpc::Service::MarkMethodStreamed(12, new ::grpc::internal::StreamedUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* streamer)
+ ::grpc::Service::MarkMethodStreamed(14, new ::grpc::internal::StreamedUnaryHandler<::protobuf::IDMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* streamer)
{ return this->StreamedEscape(context, streamer); }));
}
~WithStreamedUnaryMethod_Escape() override
@@ -2696,7 +3106,7 @@ namespace protobuf
// replace default version of method with streamed unary
virtual ::grpc::Status StreamedEscape(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* server_unary_streamer) = 0;
};
- typedef WithStreamedUnaryMethod_Move>>>>>>>>> StreamedUnaryService;
+ typedef WithStreamedUnaryMethod_Move>>>>>>>>>>> StreamedUnaryService;
template
class WithSplitStreamingMethod_AddPlayer : public BaseClass
{
@@ -2725,7 +3135,7 @@ namespace protobuf
virtual ::grpc::Status StreamedAddPlayer(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer<::protobuf::PlayerMsg, ::protobuf::MessageToClient>* server_split_streamer) = 0;
};
typedef WithSplitStreamingMethod_AddPlayer SplitStreamedService;
- typedef WithSplitStreamingMethod_AddPlayer>>>>>>>>>> StreamedService;
+ typedef WithSplitStreamingMethod_AddPlayer>>>>>>>>>>>> StreamedService;
};
} // namespace protobuf
diff --git a/CAPI/proto/Message2Clients.pb.cc b/CAPI/proto/Message2Clients.pb.cc
index ff9754d..812953d 100644
--- a/CAPI/proto/Message2Clients.pb.cc
+++ b/CAPI/proto/Message2Clients.pb.cc
@@ -269,8 +269,31 @@ namespace protobuf
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BoolResDefaultTypeInternal _BoolRes_default_instance_;
+ constexpr MsgRes::MsgRes(
+ ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized
+ ) :
+ message_received_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string),
+ from_player_id_(int64_t{0}),
+ have_message_(false)
+ {
+ }
+ struct MsgResDefaultTypeInternal
+ {
+ constexpr MsgResDefaultTypeInternal() :
+ _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{})
+ {
+ }
+ ~MsgResDefaultTypeInternal()
+ {
+ }
+ union
+ {
+ MsgRes _instance;
+ };
+ };
+ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MsgResDefaultTypeInternal _MsgRes_default_instance_;
} // namespace protobuf
-static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_Message2Clients_2eproto[9];
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_Message2Clients_2eproto[10];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_Message2Clients_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_Message2Clients_2eproto = nullptr;
@@ -379,6 +402,15 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::protobuf::BoolRes, act_success_),
+ ~0u, // no _has_bits_
+ PROTOBUF_FIELD_OFFSET(::protobuf::MsgRes, _internal_metadata_),
+ ~0u, // no _extensions_
+ ~0u, // no _oneof_case_
+ ~0u, // no _weak_field_map_
+ ~0u, // no _inlined_string_donated_
+ PROTOBUF_FIELD_OFFSET(::protobuf::MsgRes, have_message_),
+ PROTOBUF_FIELD_OFFSET(::protobuf::MsgRes, from_player_id_),
+ PROTOBUF_FIELD_OFFSET(::protobuf::MsgRes, message_received_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, -1, sizeof(::protobuf::MessageOfHuman)},
@@ -390,6 +422,7 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB
{79, -1, -1, sizeof(::protobuf::MessageToClient)},
{89, -1, -1, sizeof(::protobuf::MoveRes)},
{97, -1, -1, sizeof(::protobuf::BoolRes)},
+ {104, -1, -1, sizeof(::protobuf::MsgRes)},
};
static ::PROTOBUF_NAMESPACE_ID::Message const* const file_default_instances[] = {
@@ -402,6 +435,7 @@ static ::PROTOBUF_NAMESPACE_ID::Message const* const file_default_instances[] =
reinterpret_cast(&::protobuf::_MessageToClient_default_instance_),
reinterpret_cast(&::protobuf::_MoveRes_default_instance_),
reinterpret_cast(&::protobuf::_BoolRes_default_instance_),
+ reinterpret_cast(&::protobuf::_MsgRes_default_instance_),
};
const char descriptor_table_protodef_Message2Clients_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
@@ -442,24 +476,29 @@ const char descriptor_table_protodef_Message2Clients_2eproto[] PROTOBUF_SECTION_
"+\n\013map_massage\030\004 \001(\0132\026.protobuf.MessageO"
"fMap\"5\n\007MoveRes\022\024\n\014actual_speed\030\001 \001(\003\022\024\n"
"\014actual_angle\030\002 \001(\001\"\036\n\007BoolRes\022\023\n\013act_su"
- "ccess\030\001 \001(\0102\247\005\n\020AvailableService\022=\n\tAddP"
- "layer\022\023.protobuf.PlayerMsg\032\031.protobuf.Me"
- "ssageToClient0\001\022,\n\004Move\022\021.protobuf.MoveM"
- "sg\032\021.protobuf.MoveRes\0220\n\010PickProp\022\021.prot"
- "obuf.PickMsg\032\021.protobuf.BoolRes\022-\n\007UsePr"
- "op\022\017.protobuf.IDMsg\032\021.protobuf.BoolRes\022."
- "\n\010UseSkill\022\017.protobuf.IDMsg\032\021.protobuf.B"
- "oolRes\0223\n\013SendMessage\022\021.protobuf.SendMsg"
- "\032\021.protobuf.BoolRes\0224\n\nFixMachine\022\017.prot"
- "obuf.IDMsg\032\021.protobuf.BoolRes(\0010\001\0223\n\tSav"
- "eHuman\022\017.protobuf.IDMsg\032\021.protobuf.BoolR"
- "es(\0010\001\0220\n\006Attack\022\023.protobuf.AttackMsg\032\021."
- "protobuf.BoolRes\0220\n\nCarryHuman\022\017.protobu"
- "f.IDMsg\032\021.protobuf.BoolRes\0222\n\014ReleaseHum"
- "an\022\017.protobuf.IDMsg\032\021.protobuf.BoolRes\022/"
- "\n\tHangHuman\022\017.protobuf.IDMsg\032\021.protobuf."
- "BoolRes\022,\n\006Escape\022\017.protobuf.IDMsg\032\021.pro"
- "tobuf.BoolResb\006proto3";
+ "ccess\030\001 \001(\010\"P\n\006MsgRes\022\024\n\014have_message\030\001 "
+ "\001(\010\022\026\n\016from_player_id\030\002 \001(\003\022\030\n\020message_r"
+ "eceived\030\003 \001(\t2\213\006\n\020AvailableService\022=\n\tAd"
+ "dPlayer\022\023.protobuf.PlayerMsg\032\031.protobuf."
+ "MessageToClient0\001\022,\n\004Move\022\021.protobuf.Mov"
+ "eMsg\032\021.protobuf.MoveRes\0220\n\010PickProp\022\021.pr"
+ "otobuf.PickMsg\032\021.protobuf.BoolRes\022-\n\007Use"
+ "Prop\022\017.protobuf.IDMsg\032\021.protobuf.BoolRes"
+ "\022.\n\010UseSkill\022\017.protobuf.IDMsg\032\021.protobuf"
+ ".BoolRes\0223\n\013SendMessage\022\021.protobuf.SendM"
+ "sg\032\021.protobuf.BoolRes\0221\n\013HaveMessage\022\017.p"
+ "rotobuf.IDMsg\032\021.protobuf.BoolRes\022/\n\nGetM"
+ "essage\022\017.protobuf.IDMsg\032\020.protobuf.MsgRe"
+ "s\0224\n\nFixMachine\022\017.protobuf.IDMsg\032\021.proto"
+ "buf.BoolRes(\0010\001\0223\n\tSaveHuman\022\017.protobuf."
+ "IDMsg\032\021.protobuf.BoolRes(\0010\001\0220\n\006Attack\022\023"
+ ".protobuf.AttackMsg\032\021.protobuf.BoolRes\0220"
+ "\n\nCarryHuman\022\017.protobuf.IDMsg\032\021.protobuf"
+ ".BoolRes\0222\n\014ReleaseHuman\022\017.protobuf.IDMs"
+ "g\032\021.protobuf.BoolRes\022/\n\tHangHuman\022\017.prot"
+ "obuf.IDMsg\032\021.protobuf.BoolRes\022,\n\006Escape\022"
+ "\017.protobuf.IDMsg\032\021.protobuf.BoolResb\006pro"
+ "to3";
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* const descriptor_table_Message2Clients_2eproto_deps[2] = {
&::descriptor_table_Message2Server_2eproto,
&::descriptor_table_MessageType_2eproto,
@@ -468,13 +507,13 @@ static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_Message2Cli
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_Message2Clients_2eproto = {
false,
false,
- 2181,
+ 2363,
descriptor_table_protodef_Message2Clients_2eproto,
"Message2Clients.proto",
&descriptor_table_Message2Clients_2eproto_once,
descriptor_table_Message2Clients_2eproto_deps,
2,
- 9,
+ 10,
schemas,
file_default_instances,
TableStruct_Message2Clients_2eproto::offsets,
@@ -3831,6 +3870,311 @@ namespace protobuf
);
}
+ // ===================================================================
+
+ class MsgRes::_Internal
+ {
+ public:
+ };
+
+ MsgRes::MsgRes(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) :
+ ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned)
+ {
+ SharedCtor();
+ if (!is_message_owned)
+ {
+ RegisterArenaDtor(arena);
+ }
+ // @@protoc_insertion_point(arena_constructor:protobuf.MsgRes)
+ }
+ MsgRes::MsgRes(const MsgRes& from) :
+ ::PROTOBUF_NAMESPACE_ID::Message()
+ {
+ _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+ message_received_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ message_received_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (!from._internal_message_received().empty())
+ {
+ message_received_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_message_received(), GetArenaForAllocation());
+ }
+ ::memcpy(&from_player_id_, &from.from_player_id_, static_cast(reinterpret_cast(&have_message_) - reinterpret_cast(&from_player_id_)) + sizeof(have_message_));
+ // @@protoc_insertion_point(copy_constructor:protobuf.MsgRes)
+ }
+
+ inline void MsgRes::SharedCtor()
+ {
+ message_received_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ message_received_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ ::memset(reinterpret_cast(this) + static_cast(reinterpret_cast(&from_player_id_) - reinterpret_cast(this)), 0, static_cast(reinterpret_cast(&have_message_) - reinterpret_cast(&from_player_id_)) + sizeof(have_message_));
+ }
+
+ MsgRes::~MsgRes()
+ {
+ // @@protoc_insertion_point(destructor:protobuf.MsgRes)
+ if (GetArenaForAllocation() != nullptr)
+ return;
+ SharedDtor();
+ _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+ }
+
+ inline void MsgRes::SharedDtor()
+ {
+ GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+ message_received_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ }
+
+ void MsgRes::ArenaDtor(void* object)
+ {
+ MsgRes* _this = reinterpret_cast(object);
+ (void)_this;
+ }
+ void MsgRes::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*)
+ {
+ }
+ void MsgRes::SetCachedSize(int size) const
+ {
+ _cached_size_.Set(size);
+ }
+
+ void MsgRes::Clear()
+ {
+ // @@protoc_insertion_point(message_clear_start:protobuf.MsgRes)
+ uint32_t cached_has_bits = 0;
+ // Prevent compiler warnings about cached_has_bits being unused
+ (void)cached_has_bits;
+
+ message_received_.ClearToEmpty();
+ ::memset(&from_player_id_, 0, static_cast(reinterpret_cast(&have_message_) - reinterpret_cast(&from_player_id_)) + sizeof(have_message_));
+ _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+ }
+
+ const char* MsgRes::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx)
+ {
+#define CHK_(x) \
+ if (PROTOBUF_PREDICT_FALSE(!(x))) \
+ goto failure
+ while (!ctx->Done(&ptr))
+ {
+ uint32_t tag;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+ switch (tag >> 3)
+ {
+ // bool have_message = 1;
+ case 1:
+ if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8))
+ {
+ have_message_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ CHK_(ptr);
+ }
+ else
+ goto handle_unusual;
+ continue;
+ // int64 from_player_id = 2;
+ case 2:
+ if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16))
+ {
+ from_player_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ CHK_(ptr);
+ }
+ else
+ goto handle_unusual;
+ continue;
+ // string message_received = 3;
+ case 3:
+ if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26))
+ {
+ auto str = _internal_mutable_message_received();
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "protobuf.MsgRes.message_received"));
+ CHK_(ptr);
+ }
+ else
+ goto handle_unusual;
+ continue;
+ default:
+ goto handle_unusual;
+ } // switch
+ handle_unusual:
+ if ((tag == 0) || ((tag & 7) == 4))
+ {
+ CHK_(ptr);
+ ctx->SetLastTag(tag);
+ goto message_done;
+ }
+ ptr = UnknownFieldParse(
+ tag,
+ _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+ ptr,
+ ctx
+ );
+ CHK_(ptr != nullptr);
+ } // while
+ message_done:
+ return ptr;
+ failure:
+ ptr = nullptr;
+ goto message_done;
+#undef CHK_
+ }
+
+ uint8_t* MsgRes::_InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream
+ ) const
+ {
+ // @@protoc_insertion_point(serialize_to_array_start:protobuf.MsgRes)
+ uint32_t cached_has_bits = 0;
+ (void)cached_has_bits;
+
+ // bool have_message = 1;
+ if (this->_internal_have_message() != 0)
+ {
+ target = stream->EnsureSpace(target);
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_have_message(), target);
+ }
+
+ // int64 from_player_id = 2;
+ if (this->_internal_from_player_id() != 0)
+ {
+ target = stream->EnsureSpace(target);
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_from_player_id(), target);
+ }
+
+ // string message_received = 3;
+ if (!this->_internal_message_received().empty())
+ {
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+ this->_internal_message_received().data(), static_cast(this->_internal_message_received().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "protobuf.MsgRes.message_received"
+ );
+ target = stream->WriteStringMaybeAliased(
+ 3, this->_internal_message_received(), target
+ );
+ }
+
+ if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields()))
+ {
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+ _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream
+ );
+ }
+ // @@protoc_insertion_point(serialize_to_array_end:protobuf.MsgRes)
+ return target;
+ }
+
+ size_t MsgRes::ByteSizeLong() const
+ {
+ // @@protoc_insertion_point(message_byte_size_start:protobuf.MsgRes)
+ size_t total_size = 0;
+
+ uint32_t cached_has_bits = 0;
+ // Prevent compiler warnings about cached_has_bits being unused
+ (void)cached_has_bits;
+
+ // string message_received = 3;
+ if (!this->_internal_message_received().empty())
+ {
+ total_size += 1 +
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+ this->_internal_message_received()
+ );
+ }
+
+ // int64 from_player_id = 2;
+ if (this->_internal_from_player_id() != 0)
+ {
+ total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_from_player_id());
+ }
+
+ // bool have_message = 1;
+ if (this->_internal_have_message() != 0)
+ {
+ total_size += 1 + 1;
+ }
+
+ return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
+ }
+
+ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MsgRes::_class_data_ = {
+ ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+ MsgRes::MergeImpl};
+ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MsgRes::GetClassData() const
+ {
+ return &_class_data_;
+ }
+
+ void MsgRes::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from)
+ {
+ static_cast(to)->MergeFrom(
+ static_cast(from)
+ );
+ }
+
+ void MsgRes::MergeFrom(const MsgRes& from)
+ {
+ // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MsgRes)
+ GOOGLE_DCHECK_NE(&from, this);
+ uint32_t cached_has_bits = 0;
+ (void)cached_has_bits;
+
+ if (!from._internal_message_received().empty())
+ {
+ _internal_set_message_received(from._internal_message_received());
+ }
+ if (from._internal_from_player_id() != 0)
+ {
+ _internal_set_from_player_id(from._internal_from_player_id());
+ }
+ if (from._internal_have_message() != 0)
+ {
+ _internal_set_have_message(from._internal_have_message());
+ }
+ _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+ }
+
+ void MsgRes::CopyFrom(const MsgRes& from)
+ {
+ // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MsgRes)
+ if (&from == this)
+ return;
+ Clear();
+ MergeFrom(from);
+ }
+
+ bool MsgRes::IsInitialized() const
+ {
+ return true;
+ }
+
+ void MsgRes::InternalSwap(MsgRes* other)
+ {
+ using std::swap;
+ auto* lhs_arena = GetArenaForAllocation();
+ auto* rhs_arena = other->GetArenaForAllocation();
+ _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+ &message_received_,
+ lhs_arena,
+ &other->message_received_,
+ rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+ PROTOBUF_FIELD_OFFSET(MsgRes, have_message_) + sizeof(MsgRes::have_message_) - PROTOBUF_FIELD_OFFSET(MsgRes, from_player_id_)>(
+ reinterpret_cast(&from_player_id_),
+ reinterpret_cast(&other->from_player_id_)
+ );
+ }
+
+ ::PROTOBUF_NAMESPACE_ID::Metadata MsgRes::GetMetadata() const
+ {
+ return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+ &descriptor_table_Message2Clients_2eproto_getter, &descriptor_table_Message2Clients_2eproto_once, file_level_metadata_Message2Clients_2eproto[9]
+ );
+ }
+
// @@protoc_insertion_point(namespace_scope)
} // namespace protobuf
PROTOBUF_NAMESPACE_OPEN
@@ -3879,6 +4223,11 @@ PROTOBUF_NOINLINE ::protobuf::BoolRes* Arena::CreateMaybeMessage<::protobuf::Boo
{
return Arena::CreateMessageInternal<::protobuf::BoolRes>(arena);
}
+template<>
+PROTOBUF_NOINLINE ::protobuf::MsgRes* Arena::CreateMaybeMessage<::protobuf::MsgRes>(Arena* arena)
+{
+ return Arena::CreateMessageInternal<::protobuf::MsgRes>(arena);
+}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
diff --git a/CAPI/proto/Message2Clients.pb.h b/CAPI/proto/Message2Clients.pb.h
index 82549e9..1538456 100644
--- a/CAPI/proto/Message2Clients.pb.h
+++ b/CAPI/proto/Message2Clients.pb.h
@@ -48,7 +48,7 @@ struct TableStruct_Message2Clients_2eproto
{
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[9] PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+ static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[10] PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
static const uint32_t offsets[];
@@ -83,6 +83,9 @@ namespace protobuf
class MoveRes;
struct MoveResDefaultTypeInternal;
extern MoveResDefaultTypeInternal _MoveRes_default_instance_;
+ class MsgRes;
+ struct MsgResDefaultTypeInternal;
+ extern MsgResDefaultTypeInternal _MsgRes_default_instance_;
} // namespace protobuf
PROTOBUF_NAMESPACE_OPEN
template<>
@@ -103,6 +106,8 @@ template<>
::protobuf::MessageToClient* Arena::CreateMaybeMessage<::protobuf::MessageToClient>(Arena*);
template<>
::protobuf::MoveRes* Arena::CreateMaybeMessage<::protobuf::MoveRes>(Arena*);
+template<>
+::protobuf::MsgRes* Arena::CreateMaybeMessage<::protobuf::MsgRes>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace protobuf
{
@@ -2372,6 +2377,221 @@ namespace protobuf
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_Message2Clients_2eproto;
};
+ // -------------------------------------------------------------------
+
+ class MsgRes final :
+ public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MsgRes) */
+ {
+ public:
+ inline MsgRes() :
+ MsgRes(nullptr)
+ {
+ }
+ ~MsgRes() override;
+ explicit constexpr MsgRes(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
+
+ MsgRes(const MsgRes& from);
+ MsgRes(MsgRes&& from) noexcept
+ :
+ MsgRes()
+ {
+ *this = ::std::move(from);
+ }
+
+ inline MsgRes& operator=(const MsgRes& from)
+ {
+ CopyFrom(from);
+ return *this;
+ }
+ inline MsgRes& operator=(MsgRes&& from) noexcept
+ {
+ if (this == &from)
+ return *this;
+ if (GetOwningArena() == from.GetOwningArena()
+#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+ && GetOwningArena() != nullptr
+#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
+ )
+ {
+ InternalSwap(&from);
+ }
+ else
+ {
+ CopyFrom(from);
+ }
+ return *this;
+ }
+
+ static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor()
+ {
+ return GetDescriptor();
+ }
+ static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor()
+ {
+ return default_instance().GetMetadata().descriptor;
+ }
+ static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection()
+ {
+ return default_instance().GetMetadata().reflection;
+ }
+ static const MsgRes& default_instance()
+ {
+ return *internal_default_instance();
+ }
+ static inline const MsgRes* internal_default_instance()
+ {
+ return reinterpret_cast(
+ &_MsgRes_default_instance_
+ );
+ }
+ static constexpr int kIndexInFileMessages =
+ 9;
+
+ friend void swap(MsgRes& a, MsgRes& b)
+ {
+ a.Swap(&b);
+ }
+ inline void Swap(MsgRes* other)
+ {
+ if (other == this)
+ return;
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() != nullptr &&
+ GetOwningArena() == other->GetOwningArena())
+ {
+#else // PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() == other->GetOwningArena())
+ {
+#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
+ InternalSwap(other);
+ }
+ else
+ {
+ ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+ }
+ }
+ void UnsafeArenaSwap(MsgRes* other)
+ {
+ if (other == this)
+ return;
+ GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+ InternalSwap(other);
+ }
+
+ // implements Message ----------------------------------------------
+
+ MsgRes* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final
+ {
+ return CreateMaybeMessage(arena);
+ }
+ using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
+ void CopyFrom(const MsgRes& from);
+ using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
+ void MergeFrom(const MsgRes& from);
+
+ private:
+ static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+
+ public:
+ PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+ bool IsInitialized() const final;
+
+ size_t ByteSizeLong() const final;
+ const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+ uint8_t* _InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream
+ ) const final;
+ int GetCachedSize() const final
+ {
+ return _cached_size_.Get();
+ }
+
+ private:
+ void SharedCtor();
+ void SharedDtor();
+ void SetCachedSize(int size) const final;
+ void InternalSwap(MsgRes* other);
+
+ private:
+ friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+ static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName()
+ {
+ return "protobuf.MsgRes";
+ }
+
+ protected:
+ explicit MsgRes(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false);
+
+ private:
+ static void ArenaDtor(void* object);
+ inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+
+ public:
+ static const ClassData _class_data_;
+ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* GetClassData() const final;
+
+ ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
+
+ // nested types ----------------------------------------------------
+
+ // accessors -------------------------------------------------------
+
+ enum : int
+ {
+ kMessageReceivedFieldNumber = 3,
+ kFromPlayerIdFieldNumber = 2,
+ kHaveMessageFieldNumber = 1,
+ };
+ // string message_received = 3;
+ void clear_message_received();
+ const std::string& message_received() const;
+ template
+ void set_message_received(ArgT0&& arg0, ArgT... args);
+ std::string* mutable_message_received();
+ PROTOBUF_NODISCARD std::string* release_message_received();
+ void set_allocated_message_received(std::string* message_received);
+
+ private:
+ const std::string& _internal_message_received() const;
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_message_received(const std::string& value);
+ std::string* _internal_mutable_message_received();
+
+ public:
+ // int64 from_player_id = 2;
+ void clear_from_player_id();
+ int64_t from_player_id() const;
+ void set_from_player_id(int64_t value);
+
+ private:
+ int64_t _internal_from_player_id() const;
+ void _internal_set_from_player_id(int64_t value);
+
+ public:
+ // bool have_message = 1;
+ void clear_have_message();
+ bool have_message() const;
+ void set_have_message(bool value);
+
+ private:
+ bool _internal_have_message() const;
+ void _internal_set_have_message(bool value);
+
+ public:
+ // @@protoc_insertion_point(class_scope:protobuf.MsgRes)
+
+ private:
+ class _Internal;
+
+ template
+ friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+ typedef void InternalArenaConstructable_;
+ typedef void DestructorSkippable_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr message_received_;
+ int64_t from_player_id_;
+ bool have_message_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ friend struct ::TableStruct_Message2Clients_2eproto;
+ };
// ===================================================================
// ===================================================================
@@ -3895,6 +4115,115 @@ namespace protobuf
// @@protoc_insertion_point(field_set:protobuf.BoolRes.act_success)
}
+ // -------------------------------------------------------------------
+
+ // MsgRes
+
+ // bool have_message = 1;
+ inline void MsgRes::clear_have_message()
+ {
+ have_message_ = false;
+ }
+ inline bool MsgRes::_internal_have_message() const
+ {
+ return have_message_;
+ }
+ inline bool MsgRes::have_message() const
+ {
+ // @@protoc_insertion_point(field_get:protobuf.MsgRes.have_message)
+ return _internal_have_message();
+ }
+ inline void MsgRes::_internal_set_have_message(bool value)
+ {
+ have_message_ = value;
+ }
+ inline void MsgRes::set_have_message(bool value)
+ {
+ _internal_set_have_message(value);
+ // @@protoc_insertion_point(field_set:protobuf.MsgRes.have_message)
+ }
+
+ // int64 from_player_id = 2;
+ inline void MsgRes::clear_from_player_id()
+ {
+ from_player_id_ = int64_t{0};
+ }
+ inline int64_t MsgRes::_internal_from_player_id() const
+ {
+ return from_player_id_;
+ }
+ inline int64_t MsgRes::from_player_id() const
+ {
+ // @@protoc_insertion_point(field_get:protobuf.MsgRes.from_player_id)
+ return _internal_from_player_id();
+ }
+ inline void MsgRes::_internal_set_from_player_id(int64_t value)
+ {
+ from_player_id_ = value;
+ }
+ inline void MsgRes::set_from_player_id(int64_t value)
+ {
+ _internal_set_from_player_id(value);
+ // @@protoc_insertion_point(field_set:protobuf.MsgRes.from_player_id)
+ }
+
+ // string message_received = 3;
+ inline void MsgRes::clear_message_received()
+ {
+ message_received_.ClearToEmpty();
+ }
+ inline const std::string& MsgRes::message_received() const
+ {
+ // @@protoc_insertion_point(field_get:protobuf.MsgRes.message_received)
+ return _internal_message_received();
+ }
+ template
+ inline PROTOBUF_ALWAYS_INLINE void MsgRes::set_message_received(ArgT0&& arg0, ArgT... args)
+ {
+ message_received_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation());
+ // @@protoc_insertion_point(field_set:protobuf.MsgRes.message_received)
+ }
+ inline std::string* MsgRes::mutable_message_received()
+ {
+ std::string* _s = _internal_mutable_message_received();
+ // @@protoc_insertion_point(field_mutable:protobuf.MsgRes.message_received)
+ return _s;
+ }
+ inline const std::string& MsgRes::_internal_message_received() const
+ {
+ return message_received_.Get();
+ }
+ inline void MsgRes::_internal_set_message_received(const std::string& value)
+ {
+ message_received_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+ }
+ inline std::string* MsgRes::_internal_mutable_message_received()
+ {
+ return message_received_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+ }
+ inline std::string* MsgRes::release_message_received()
+ {
+ // @@protoc_insertion_point(field_release:protobuf.MsgRes.message_received)
+ return message_received_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+ }
+ inline void MsgRes::set_allocated_message_received(std::string* message_received)
+ {
+ if (message_received != nullptr)
+ {
+ }
+ else
+ {
+ }
+ message_received_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), message_received, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (message_received_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()))
+ {
+ message_received_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ // @@protoc_insertion_point(field_set_allocated:protobuf.MsgRes.message_received)
+ }
+
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
@@ -3914,6 +4243,8 @@ namespace protobuf
// -------------------------------------------------------------------
+ // -------------------------------------------------------------------
+
// @@protoc_insertion_point(namespace_scope)
} // namespace protobuf
diff --git a/dependency/proto/Message2Clients.proto b/dependency/proto/Message2Clients.proto
index 0017aa3..ec6beea 100755
--- a/dependency/proto/Message2Clients.proto
+++ b/dependency/proto/Message2Clients.proto
@@ -90,6 +90,13 @@ message BoolRes // 用于只需要判断执行操作是否成功的行为,如
bool act_success = 1;
}
+message MsgRes // 用于获取队友发来的消息
+{
+ bool have_message = 1; // 是否有待接收的消息
+ int64 from_player_id = 2;
+ string message_received = 3;
+}
+
service AvailableService
{
// 游戏开局调用一次的服务
@@ -101,6 +108,8 @@ service AvailableService
rpc UseProp(IDMsg) returns (BoolRes);
rpc UseSkill(IDMsg) returns (BoolRes);
rpc SendMessage(SendMsg) returns (BoolRes);
+ rpc HaveMessage(IDMsg) returns (BoolRes);
+ rpc GetMessage(IDMsg) returns (MsgRes);
rpc FixMachine(stream IDMsg) returns (stream BoolRes); // 若正常修复且未被打断则返回修复成功,位置错误/被打断则返回修复失败,下同
rpc SaveHuman(stream IDMsg) returns (stream BoolRes);
rpc Attack (AttackMsg) returns (BoolRes);
@@ -108,5 +117,5 @@ service AvailableService
rpc ReleaseHuman (IDMsg) returns (BoolRes);
rpc HangHuman (IDMsg) returns (BoolRes);
rpc Escape (IDMsg) returns (BoolRes);
-
+
}
\ No newline at end of file
From 250af1de52291c1b1170ff190dc9f9d4d5d4b5c3 Mon Sep 17 00:00:00 2001
From: shangfengh <3495281661@qq.com>
Date: Sat, 15 Oct 2022 15:18:54 +0800
Subject: [PATCH 05/15] fix: logic/Preparation/.../Imoveable.cs reuse
IgnoreCollide
---
logic/Preparation/Interface/IMoveable.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/logic/Preparation/Interface/IMoveable.cs b/logic/Preparation/Interface/IMoveable.cs
index 000a534..bc16f5b 100644
--- a/logic/Preparation/Interface/IMoveable.cs
+++ b/logic/Preparation/Interface/IMoveable.cs
@@ -8,7 +8,7 @@ namespace Preparation.Interface
object MoveLock { get; }
public int MoveSpeed { get; }
public long Move(Vector moveVec);
- // protected bool IgnoreCollide(IGameObj targetObj); // 忽略碰撞,在具体类中实现
+ protected bool IgnoreCollide(IGameObj targetObj); // 忽略碰撞,在具体类中实现
public bool WillCollideWith(IGameObj? targetObj, XYPosition nextPos) // 检查下一位置是否会和目标物碰撞
{
if (targetObj == null)
@@ -16,7 +16,8 @@ namespace Preparation.Interface
// 会移动的只有子弹和人物,都是Circle
if (!targetObj.IsRigid || targetObj.ID == ID)
return false;
- // if (IgnoreCollide(targetObj)) return false;
+ if (IgnoreCollide(targetObj))
+ return false;
if (targetObj.Shape == ShapeType.Circle)
{
return XYPosition.Distance(nextPos, targetObj.Position) < targetObj.Radius + Radius;
From 64892b68903d471f767fc3f45ebace25801d4a34 Mon Sep 17 00:00:00 2001
From: DragonAura
Date: Sat, 15 Oct 2022 15:59:08 +0800
Subject: [PATCH 06/15] chore: add temp CMakeLists
---
CAPI/CMakeLists.txt | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 CAPI/CMakeLists.txt
diff --git a/CAPI/CMakeLists.txt b/CAPI/CMakeLists.txt
new file mode 100644
index 0000000..6741c18
--- /dev/null
+++ b/CAPI/CMakeLists.txt
@@ -0,0 +1,26 @@
+# 临时CMakeLists,仅供本地调试用
+cmake_minimum_required(VERSION 3.5)
+
+project(THUAI6_CAPI VERSION 1.0)
+
+set(CMAKE_CXX_STANDARD 17)
+
+aux_source_directory(./API/src CPP_LIST)
+aux_source_directory(./proto PROTO_CPP_LIST)
+
+find_package(Protobuf CONFIG REQUIRED)
+find_package(gRPC CONFIG REQUIRED)
+
+message(STATUS "Using protobuf ${Protobuf_VERSION}")
+message(STATUS "Using gRPC ${gRPC_VERSION}")
+
+add_executable(capi ${CPP_LIST} ${PROTO_CPP_LIST})
+
+target_include_directories(capi PUBLIC ${PROJECT_SOURCE_DIR}/proto ${PROJECT_SOURCE_DIR}/API/include)
+
+target_link_libraries(capi
+protobuf::libprotobuf
+gRPC::grpc
+gRPC::grpc++_reflection
+gRPC::grpc++
+)
\ No newline at end of file
From a8b9e253f44de35837a5c1593873145e2c61ebbc Mon Sep 17 00:00:00 2001
From: DragonAura
Date: Sat, 15 Oct 2022 16:10:37 +0800
Subject: [PATCH 07/15] chore: edit .gitignore
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index d497d0a..490019b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
# .vs, .vscode must be ignored
.vs/
.vscode/
+CAPI/build
From 84fc6ec4c58afbd9a9a4a195bf6d2c5f1339aae2 Mon Sep 17 00:00:00 2001
From: DragonAura
Date: Sat, 15 Oct 2022 19:38:11 +0800
Subject: [PATCH 08/15] chore: add structures.h and API.h(unfinished)
---
CAPI/API/include/API.h | 154 ++++++++++++++++++++++++
CAPI/API/include/structures.h | 151 +++++++++++++++++++++++
CAPI/proto/Message2Clients.pb.cc | 158 +++++++++++++++++--------
CAPI/proto/Message2Clients.pb.h | 72 +++++++++++
dependency/proto/Message2Clients.proto | 2 +
5 files changed, 487 insertions(+), 50 deletions(-)
create mode 100644 CAPI/API/include/API.h
create mode 100644 CAPI/API/include/structures.h
diff --git a/CAPI/API/include/API.h b/CAPI/API/include/API.h
new file mode 100644
index 0000000..9a2c9e1
--- /dev/null
+++ b/CAPI/API/include/API.h
@@ -0,0 +1,154 @@
+#pragma once
+#ifndef API_H
+#define API_H
+
+#ifdef _MSC_VER
+#pragma warning(disable : 4996)
+#endif
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "structures.h"
+
+const constexpr int num_of_grid_per_cell = 1000;
+
+class ILogic
+{
+ // API中依赖Logic的部分
+
+public:
+ // 获取服务器发来的所有消息,要注意线程安全问题
+ virtual protobuf::MessageToClient GetFullMessage() = 0;
+
+ // 供IAPI使用的操作相关的部分
+ virtual bool Move(protobuf::MoveMsg) = 0;
+ virtual bool PickProp(protobuf::PickMsg) = 0;
+ virtual bool UseProp(protobuf::IDMsg) = 0;
+ virtual bool UseSkill(protobuf::IDMsg) = 0;
+ virtual void SendMessage(protobuf::SendMsg) = 0;
+ virtual bool HaveMessage(protobuf::IDMsg) = 0;
+ virtual protobuf::MsgRes GetMessage(protobuf::IDMsg) = 0;
+
+ virtual bool Escape(protobuf::IDMsg) = 0;
+
+ // 说明:双向stream由三个函数共同实现,两个记录开始和结束,结果由Logic里的私有的成员变量记录,获得返回值则另调函数
+ virtual bool StartFixMachine(protobuf::IDMsg) = 0;
+ virtual bool EndFixMachine(protobuf::IDMsg) = 0;
+ virtual bool GetFixStatus() = 0;
+
+ virtual bool StartSaveHuman(protobuf::IDMsg) = 0;
+ virtual bool EndSaveHuman(protobuf::IDMsg) = 0;
+ virtual bool GetSaveStatus() = 0;
+
+ virtual bool Attack(protobuf::AttackMsg) = 0;
+ virtual bool CarryHuman(protobuf::IDMsg) = 0;
+ virtual bool ReleaseHuman(protobuf::IDMsg) = 0;
+ virtual bool HangHuman(protobuf::IDMsg) = 0;
+
+ virtual bool WaitThread() = 0;
+
+ virtual int GetCounter() = 0;
+};
+
+class IAPI
+{
+public:
+ // 选手可执行的操作,应当保证所有函数的返回值都应当为std::future,例如下面的移动函数:
+ // 指挥本角色进行移动,`timeInMilliseconds` 为移动时间,单位为毫秒;`angleInRadian` 表示移动的方向,单位是弧度,使用极坐标——竖直向下方向为 x 轴,水平向右方向为 y 轴
+ virtual std::future Move(uint32_t timeInMilliseconds, double angleInRadian) = 0;
+
+ // 向特定方向移动
+ virtual std::future MoveRight(uint32_t timeInMilliseconds) = 0;
+ virtual std::future MoveUp(uint32_t timeInMilliseconds) = 0;
+ virtual std::future MoveLeft(uint32_t timeInMilliseconds) = 0;
+ virtual std::future MoveDown(uint32_t timeInMilliseconds) = 0;
+
+ // 捡道具、使用技能
+ virtual std::future PickProp() = 0;
+ virtual std::future UseProp() = 0;
+ virtual std::future UseSkill() = 0;
+
+ // 发送信息、接受信息
+ virtual std::future SendMessage(int, std::string) = 0;
+ [[nodiscard]] virtual std::future HaveMessage() = 0;
+ [[nodiscard]] virtual std::future> GetMessage() = 0;
+
+ // 等待下一帧
+ virtual std::future Wait() = 0;
+
+ // 获取视野内可见的人类/屠夫的信息
+ [[nodiscard]] virtual std::vector> GetHuman() const = 0;
+ [[nodiscard]] virtual std::vector> GetButcher() const = 0;
+
+ // 获取视野内可见的道具信息
+ [[nodiscard]] virtual std::vector> GetProps() const = 0;
+
+ // 获取地图信息,视野外的地图统一为Land
+ [[nodiscard]] virtual std::array, 50> GetFullMap() const = 0;
+ [[nodiscard]] virtual THUAI6::PlaceType GetPlaceType(int32_t CellX, int32_t CellY) const = 0;
+
+ // 获取所有玩家的GUID
+ [[nodiscard]] virtual const std::vector GetPlayerGUIDs() const = 0;
+
+ // 获取游戏目前所进行的帧数
+ [[nodiscard]] virtual int GetFrameCount() const = 0;
+
+ /*****选手可能用的辅助函数*****/
+
+ // 获取指定格子中心的坐标
+ [[nodiscard]] static inline int CellToGrid(int cell) noexcept
+ {
+ return cell * num_of_grid_per_cell + num_of_grid_per_cell / 2;
+ }
+
+ // 获取指定坐标点所位于的格子的 X 序号
+ [[nodiscard]] static inline int GridToCell(int grid) noexcept
+ {
+ return grid / num_of_grid_per_cell;
+ }
+
+ IAPI(ILogic& logic) :
+ logic(logic)
+ {
+ }
+
+ virtual ~IAPI()
+ {
+ }
+
+protected:
+ ILogic& logic;
+};
+
+class IHumanAPI : public IAPI
+{
+public:
+ virtual std::future StartFixMachine() = 0;
+ virtual std::future EndFixMachine() = 0;
+ virtual std::future GetFixStatus() = 0;
+ virtual std::future StartSaveHuman() = 0;
+ virtual std::future EndSaveHuman() = 0;
+ virtual std::future GetSaveStatus() = 0;
+ virtual std::future Escape() = 0;
+ [[nodiscard]] virtual std::shared_ptr GetSelfInfo() const = 0;
+};
+
+class IButcherAPI : public IAPI
+{
+public:
+ virtual std::future Attack(double angleInRadian) = 0;
+ virtual std::future CarryHuman() = 0;
+ virtual std::future ReleaseHuman() = 0;
+ virtual std::future HangHuman() = 0;
+ [[nodiscard]] virtual std::shared_ptr GetSelfInfo() const = 0;
+};
+
+#endif
\ No newline at end of file
diff --git a/CAPI/API/include/structures.h b/CAPI/API/include/structures.h
new file mode 100644
index 0000000..06dd24c
--- /dev/null
+++ b/CAPI/API/include/structures.h
@@ -0,0 +1,151 @@
+#pragma once
+#ifndef STRUCTURES_H
+#define STRUCTURES_H
+
+#include
+#include
+#include