public void IsLoggedInTest()
 {
     Zone_ConnecterExtendData target = new Zone_ConnecterExtendData(); // TODO: 初始化为适当的值
     bool expected = false; // TODO: 初始化为适当的值
     bool actual;
     target.IsLoggedIn = expected;
     actual = target.IsLoggedIn;
     Assert.AreEqual( expected, actual );
     Assert.Inconclusive( "验证此测试方法的正确性。" );
 }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="newNetState"></param>
        private void ConnecterIniNetState(object sender, NetStateInitEventArgs netStateInit)
        {
            if (netStateInit.NetStateInit != null && netStateInit.NetStateInit.World == m_World)
            {
                // 初始化客户端
                Zone_ConnecterExtendData extendData = new Zone_ConnecterExtendData();

                // 保存扩展的数据到NetState
                netStateInit.NetStateInit.RegisterComponent <Zone_ConnecterExtendData>(Zone_ConnecterExtendData.COMPONENT_ID, extendData);

                // 获取包的长度
                netStateInit.NetStateInit.ReceiveBuffer.ThreadEventPacketLength += new EventHandler <PacketLengthInfoEventArgs>(this.GetPacketLength);

                // 连接的时候启动登陆ZoneCluster服务
                netStateInit.NetStateInit.EventConnect += new EventHandler <NetStateConnectEventArgs>(this.OnLoginZoneCluster);
            }
            else
            {
                throw new Exception("ZoneCluster.ConnecterIniNetState(...) - newNetState == null || newNetState.ExtendData != null || netStateInit.NetStateInit.World != m_World error!");
            }
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="netState"></param>
        /// <param name="packetReader"></param>
        internal static void Zone_HandlerLoginZoneClusterResult(NetState netState, PacketReader packetReader)
        {
            Zone_ConnecterExtendData extendData = netState.GetComponent <Zone_ConnecterExtendData>(Zone_ConnecterExtendData.COMPONENT_ID);

            if (extendData == null)
            {
                throw new Exception("Zone_PacketHandlers.Zone_HandlerLoginZoneClusterResult(...) - extendData == null error!");
            }

            if (extendData.IsLoggedIn == true)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "Zone_PacketHandlers.Zone_HandlerLoginZoneClusterResult(...) - extendData.IsLoggedIn == true error!");
                return;
            }

            LoginZoneClusterResult loginZoneClusterResult = LoginZoneClusterResult.GetLoginZoneClusterResult(packetReader);

            if (loginZoneClusterResult.IsCheckPass)
            {
                LOGs.WriteLine(LogMessageType.MSG_INFO, "ZoneWorld:登陆ZoneCluster服务器 成功!");

                extendData.IsLoggedIn = true;
            }
        }
 public void Zone_ConnecterExtendDataConstructorTest()
 {
     Zone_ConnecterExtendData target = new Zone_ConnecterExtendData();
     Assert.Inconclusive( "TODO: 实现用来验证目标的代码" );
 }