Example #1
0
        public void GateBroadcastMsg <T>(Int16 cmd, T pbMsgData) where T : pb::IMessage, new()
        {
            GateBroadcastMsgToSessionReq msgToSession = new GateBroadcastMsgToSessionReq()
            {
                Cmd = (Int16)cmd, Body = Util.Pb2Byte(pbMsgData)
            };

            m_ffrpc.Call(m_strDefaultGate, msgToSession);
        }
Example #2
0
        public void BroadcastPlayerMsg <T>(Pbmsg.ServerCmdDef cmd, T pbMsgData) where T : pb::IMessage, new()
        {
            GateBroadcastMsgToSessionReq msgToSession = new GateBroadcastMsgToSessionReq()
            {
                Cmd = (Int16)cmd, Body = Util.Pb2String(pbMsgData)
            };

            m_ffrpc.Call(m_strDefaultGate, msgToSession);
        }
Example #3
0
 //! 广播消息给所有的client
 public EmptyMsgRet BroadcastMsgToSession(GateBroadcastMsgToSessionReq reqMsg)
 {
     byte[] dataBody = reqMsg.Body;
     foreach (var cinfo in m_dictClients.Values)
     {
         FFNet.SendMsg(cinfo.sockObj, (UInt16)reqMsg.Cmd, dataBody);
     }
     return(m_msgEmpty);
 }