cloudnativegame / kruise-game-open-match-director Goto Github PK
View Code? Open in Web Editor NEWOpensource cloudnative game matching service for openkruisegame.
License: Apache License 2.0
Opensource cloudnative game matching service for openkruisegame.
License: Apache License 2.0
当前director默认支持一种游戏的游戏服筛选。现在提出一种支持多个游戏的director方案,来支持集群中部署多种游戏服。
新增名为 game_name
的 profile,pool filter为string类型。例如,集群中存在三种游戏:football、basketball、tennis,director将生成以下profile:
p := []*pb.MatchProfile{
{
Name: "football",
Pools: []*pb.Pool{
{
Name: "game_name",
StringEqualsFilters: []*pb.StringEqualsFilter{
{
StringArg: "game_name",
Value: "football",
},
},
},
},
},
{
Name: "basketball",
Pools: []*pb.Pool{
{
Name: "game_name",
StringEqualsFilters: []*pb.StringEqualsFilter{
{
StringArg: "game_name",
Value: "basketball",
},
},
},
},
},
{
Name: "tennis",
Pools: []*pb.Pool{
{
Name: "game_name",
StringEqualsFilters: []*pb.StringEqualsFilter{
{
StringArg: "game_name",
Value: "tennis",
},
},
},
},
},
}
这里的game_name
对应在Kubernetes集群中的GameServerSet的名称。若希望返回正确结果,集群中应存在名为football、basketball、tennis的gss对象。
mmf 根据pool来筛选ticket与backfill
game frontend创建ticket时带上相应的searchField,例如希望匹配足球游戏时,ticket创建所示:
&pb.Ticket{
SearchFields: &pb.SearchFields{
StringArgs: map[string]string{
"game_name": "football",
},
},
}
当存在玩家间允许异步进入房间,或是允许玩家退出补位的情况时,需要利用Open Match Backfill机制实现上述功能。
pb.Backfill{
SearchFields: &pb.SearchFields{
Tags: []string{"game.kruise.io/connected"},
},
Extensions: map[string]*anypb.Any{
"game.kruise.io/connection": any,
},
}
director fetch Match时若出现Backfill,则查看该Backfill是否已经分配过,若分配过,则将match的tickets assign 对应连接信息;若未分配过,则新分配gs给match的tickets。
存在以下情况,进入匹配后对局(Match)信息需要反馈给玩家客户端或游戏大厅。例如,一个对局中存在多个队伍,每个队伍的对应的玩家ID情况需要在Assignment所表示,以便玩家客户端或游戏大厅watch Assignment时可以及时获取对应信息。然而,该类信息通常由匹配逻辑决定,匹配结果的产物是Match,因此需要一种协议,将Match中的extensions透传至Assignment。
Director会将match对象所有的extensions透传至Assignment. 因此对于开发者,在编写match function时,将希望被玩家客户端或游戏大厅的新增信息记录在match的extensions即可。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.