Beispiel #1
0
        // 处理接受的广播消息
        public static void HandleMessage(byte[] body)
        {
            var bst = Pb.DecodeBst(body);

            BroadcastCallback handler = null;

            BroadcastHandlers.TryGetValue(bst.BstWrap2.Type, out handler);

            handler?.Invoke(bst, bst.BstWrap1.Seq);
        }
Beispiel #2
0
 // 设置广播回调
 public void SetBroadcastHandler(ServerSendClientBstWrap2Type type, BroadcastCallback handler)
 {
     BroadcastHandlers.Add(type, handler);
     bdhandlers.Add(type);
 }