コード例 #1
0
ファイル: DtmClientTest.cs プロジェクト: todoasap/CEX-NET
        /// <summary>
        /// Fires when a packet containing an identity is received, the args contain the id
        /// </summary>
        private void OnIdentityReceived(object owner, DtmIdentityArgs args)
        {
            //MZ@20190707
            if (args.Message == DtmExchangeFlags.Auth) // || args.Message == DtmExchangeFlags.Sync)
            {
                var authorizedClient = _myIdentity.VerifyTestIdentityPacket(args.DtmID.Identity, "DMTServerTEST001");
                if (!authorizedClient)
                {
                    // TODO: Handle better!
                    throw new Exception("Unauthorized server!");
                }
            }

            Console.WriteLine(CON_TITLE + String.Format("Client received an identity packet: {0}", IdToString(args.DtmID.Identity)));
        }
コード例 #2
0
 /// <summary>
 /// Fires when a packet containing an identity is received, the args contain the id
 /// </summary>
 private void OnIdentityReceived(object owner, DtmIdentityArgs args)
 {
     Console.WriteLine(CON_TITLE + String.Format("Server received an identity packet: {0}", IdToString(args.DtmID.Identity)));
 }