Пример #1
0
        void DataReceivedMsg(object sender, DPlay.ReceiveEventArgs e)
        {
            // We've received data, process it

            MessageType msg = (MessageType)e.Message.ReceiveData.Read(typeof(MessageType));

            switch (msg)
            {
            case MessageType.SendMessage:
                playerId = e.Message.SenderID;
                float x  = (float)e.Message.ReceiveData.Read(typeof(float));
                float y  = (float)e.Message.ReceiveData.Read(typeof(float));
                float z  = (float)e.Message.ReceiveData.Read(typeof(float));
                float x2 = (float)e.Message.ReceiveData.Read(typeof(float));
                float y2 = (float)e.Message.ReceiveData.Read(typeof(float));
                float z2 = (float)e.Message.ReceiveData.Read(typeof(float));
                float w  = (float)e.Message.ReceiveData.Read(typeof(float));
                aplane.Translate(playerId, x, y, z, x2, y2, z2, w);
                map.Translate(playerId, x, y, z);
                break;
            }
            e.Message.ReceiveData.Dispose();             // Don't need the data anymore
        }
Пример #2
0
 protected void raise_Receive(object i1, Microsoft.DirectX.DirectPlay.ReceiveEventArgs i2)
 {
     throw new NotImplementedException();
 }