File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public class KBEMain : MonoBehaviour
21
21
public string persistentDataPath = "Application.persistentDataPath" ;
22
22
public bool syncPlayer = true ;
23
23
public int threadUpdateHZ = 10 ;
24
+ public int serverHeartbeatTick = 15 ;
24
25
public int SEND_BUFFER_MAX = ( int ) KBEngine . NetworkInterface . TCP_PACKET_MAX ;
25
26
public int RECV_BUFFER_MAX = ( int ) KBEngine . NetworkInterface . TCP_PACKET_MAX ;
26
27
public bool useAliasEntityID = true ;
@@ -62,6 +63,7 @@ public virtual void initKBEngine()
62
63
63
64
args . syncPlayer = syncPlayer ;
64
65
args . threadUpdateHZ = threadUpdateHZ ;
66
+ args . serverHeartbeatTick = serverHeartbeatTick ;
65
67
args . useAliasEntityID = useAliasEntityID ;
66
68
args . isOnInitCallPropertysSetMethods = isOnInitCallPropertysSetMethods ;
67
69
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ public void sendTick()
324
324
// 更新玩家的位置与朝向到服务端
325
325
updatePlayerToServer ( ) ;
326
326
327
- if ( span . Seconds > 15 )
327
+ if ( span . Seconds > _args . serverHeartbeatTick )
328
328
{
329
329
span = _lastTickCBTime - _lastTickTime ;
330
330
Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ public class KBEngineArgs
46
46
// 线程主循环处理频率
47
47
public int threadUpdateHZ = 10 ;
48
48
49
+ // 心跳频率(tick数)
50
+ public int serverHeartbeatTick = 15 ;
51
+
49
52
public int getRecvBufferSize ( )
50
53
{
51
54
return ( int ) RECV_BUFFER_MAX ;
You can’t perform that action at this time.
0 commit comments