Exemplo n.º 1
0
    void Start()
    {
        m_Sender = new SendBroadcast();
        m_Sender.Start(6666);
        m_Reciver = new ReciveBroadcast();
        m_Reciver.Start(6688);

        m_GameNet = new LanSocket.Client();

        m_GameServerIP = "";

        m_bReady    = false;
        m_BroadTime = 0.0f;

        EventDispathBase.g_MaxEventNum = (int)NetMsgID.NET_MSG_END;
        m_Msg = new ClientEventDispath();
        m_Msg.RegistEvent((int)NetMsgID.S2C_SEND_ANIMAL_DATA, Action_S2C_SEND_ANIMAL_DATA);
    }
Exemplo n.º 2
0
    void Start()
    {
        m_Destroy = false;
        //广播
        m_Reciver = new ReciveBroadcast();
        m_Reciver.Start(6666);
        m_Sender = new SendBroadcast();
        m_Sender.Start(6688);

        //游戏网络
        m_GameNet = new LanSocket.Server();
        m_GameNet.Start(8888);

        m_AudioData   = new byte[44100000];
        m_AudioOffset = 0;
        m_AudioLen    = 0;

        m_ClientMsg = new ServerEventDispath();
        m_ClientMsg.RegistEvent((int)NetMsgID.C2S_ASK_SEND_AUDIO_BEGIN, Action_C2S_ASK_SEND_AUDIO_BEGIN);
        m_ClientMsg.RegistEvent((int)NetMsgID.C2S_ASK_SEND_AUDIO, Action_C2S_ASK_SEND_AUDIO);
        m_ClientMsg.RegistEvent((int)NetMsgID.C2S_ASK_SEND_AUDIO_END, Action_C2S_ASK_SEND_AUDIO_END);
    }