示例#1
0
        protected void InitDirectPlay()
        {
            // create a direct play connection
            dpc = new DPlay.Client();

            DPlay.ApplicationDescription appdesc = new DPlay.ApplicationDescription();
            appdesc.GuidApplication = new Guid("B32DD425-DB33-4f9c-972F-C68269C409F6");

            DPlay.Address dpa  = new DPlay.Address(hoststring, 895);
            DPlay.Address dpdi = new DPlay.Address();

            dpdi.ServiceProvider = DPlay.Address.ServiceProviderTcpIp;

            // Set up our event handlers
            dpc.ConnectComplete += new DPlay.ConnectCompleteEventHandler(this.ConnectComplete);

            //		dpc.ConnectComplete += new ConnectCompleteEventHandler(this.ConnectComplete);
            dpc.Receive += new DPlay.ReceiveEventHandler(this.DataReceivedMsg);
            //		dpc.SessionTerminated += new SessionTerminatedEventHandler(this.SessionLost);

            dpc.Connect(appdesc, dpa, dpdi, null, 0);
        }
示例#2
0
        protected void StartServer()
        {
            // create a direct play server connection
            dps = new DPlay.Server();
            DPlay.ApplicationDescription appdesc = new DPlay.ApplicationDescription();
            appdesc.GuidApplication = new Guid("B32DD425-DB33-4f9c-972F-C68269C409F6");
            appdesc.MaxPlayers      = 0;
            appdesc.SessionName     = "AWarServer";
            appdesc.Flags           = DPlay.SessionFlags.ClientServer | DPlay.SessionFlags.NoDpnServer;

            DPlay.Address dpa = new DPlay.Address("192.168.1.5", 895);

            // Add our event handlers
            //		dps.PlayerDestroyed += new PlayerDestroyedEventHandler(this.DestroyPlayerMsg);
            //		dps.Receive += new DPlay.ReceiveEventHandler(this.Receive);

            //		dps.Receive+=new DPlay.ReceiveEventHandler(this.Receive);
            //		dps.IndicateConnect+=new DPlay.IndicateConnectEventHandler(this.ConnectComplete);

            dps.Receive += new DPlay.ReceiveEventHandler(this.DataReceivedMsg);

            dps.Host(appdesc, dpa);
        }
示例#3
0
文件: Client.cs 项目: rbernon/monoDX
 public void FindHosts(ApplicationDescription applicationDescription, Address hostAddress, Address deviceInformation, NetworkPacket userEnumData, int count, int retryInterval, int timeOut, FindHostsFlags flags, out int asyncHandle)
 {
     throw new NotImplementedException();
 }
示例#4
0
文件: Client.cs 项目: rbernon/monoDX
 public void Connect(ApplicationDescription applicationDescription, Address hostAddress, Address deviceInformation, NetworkPacket userConnectData, out int asyncHandle, Microsoft.DirectX.DirectPlay.ConnectFlags flags)
 {
     throw new NotImplementedException();
 }
示例#5
0
文件: Peer.cs 项目: rbernon/monoDX
 public void Connect(ApplicationDescription applicationDescription, Address hostAddress, Address deviceInformation, NetworkPacket userConnectData, Microsoft.DirectX.DirectPlay.ConnectFlags flags, object playerContext, object userContext)
 {
     throw new NotImplementedException();
 }
示例#6
0
文件: Peer.cs 项目: rbernon/monoDX
 public void Host(ApplicationDescription applicationDescription, Address deviceAddress)
 {
     throw new NotImplementedException();
 }
示例#7
0
文件: Peer.cs 项目: rbernon/monoDX
 public void Host(ApplicationDescription applicationDescription, Address deviceAddress, object playerContext)
 {
     throw new NotImplementedException();
 }