linux学习记录(thrift) 10.10

发布时间 2023-10-10 16:52:18作者: 长大想当太空人

 

 

 

做一个游戏匹配系统

1、定义接口

2、server

3、cilent

thrift:跨语言的服务部署框架,rpc框架,远程函数调用

 

任务:

实现游戏节点,匹配节点(两个服务,match_system文件,game文件,thrift文件存所有thrift接口)

游戏节点到匹配系统的有向边(实现match_client端、实现match_server端)

匹配节点到数据存储的有向边(实现save_client端,server端已经实现)

 

match.thrift

先声明命名空间:namespace cpp match_service

声明User结构体:

```

struct User{
  1: i32 id,
  2: string name,
  3: i32 score
 }

```