qifun / scala-bcp

Apache License 2.0
3 stars 5 forks source link

允许BCP的用户调整性能参数 #10

Open Atry opened 10 years ago

Atry commented 10 years ago

目前BCP的所有性能参数都在 https://github.com/qifun/scala-bcp/blob/master/src/main/scala/com/qifun/bcp/Bcp.scala 中作为全局常量存在,所以BCP的用户无法修改性能参数。

这些性能参数应当改为BcpSession中的protected def,供不同需求的游戏以及测试用例修改。

例如:

protected def heartBeatDelay = 3.seconds
Atry commented 10 years ago

主要原因是在评测中发现心跳包占用开销比例较大。如果某个游戏对实时性要求不高,应增加心跳包的发送间隔。

Atry commented 10 years ago

增加了一条例外规则,以允许给这种非final属性提供默认值。

https://bitbucket.org/qforce/qforce.bitbucket.org/wiki/%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83#markdown-header-_2