示例#1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="AI.AIEntityContext"/> class.
		/// </summary>
		public AIEntityContext (BaseUnitEntity owner)
		{
			PlayerMgr 	= GameEngine.GetSingleton ().QueryPlugin<PlayerManager> ();
			MonsterMgr 	= GameEngine.GetSingleton ().QueryPlugin<MonsterManager> ();
			Session 	= GameEngine.GetSingleton ().QueryPlugin<LogicPlugin> ();
			
			// bind behaviour owner
			Owner 			= owner;
		}
示例#2
0
	/// <summary>
	/// Awake this instance.
	/// </summary>
	protected virtual void Awake()
	{
		m_ResourceManager = GameEngine.GetSingleton ().QueryPlugin<IResourceManager> ();
		if (!m_ResourceManager)
			throw new System.NullReferenceException ();

		m_Logic = GameEngine.GetSingleton().QueryPlugin<LogicPlugin>();
		if (!m_Logic)
			throw new System.NullReferenceException();

		// register main player create factory
		m_PlayerManager 	= GameEngine.GetSingleton ().QueryPlugin<PlayerManager> ();
		m_MonsterManager 	= GameEngine.GetSingleton ().QueryPlugin<MonsterManager> ();
	}
示例#3
0
	/// <summary>
	/// Awake this instance.
	/// </summary>
	protected void 		Awake()
	{
		m_pLogic = GameEngine.GetSingleton ().QueryPlugin<LogicPlugin> ();
		if (m_pLogic)
		{
			m_pLogic.RegisterPackageFactory(TcpEvent.CMD_REPLY_CHARACTER_LIST, 
			                                new DefaultNetMessageFactory<TcpEvent.SCNetCharacterListReply>());
			m_pLogic.RegisterPackageFactory(TcpEvent.CMD_REPLY_ERROR, 
			                                new DefaultNetMessageFactory<TcpEvent.SCNetErrorReply>());
		}

		// register session local event
		SubscribeEvent (ITcpSession.TCP_CONNECTFINISH, 	OnTcpConnectFinish);
		SubscribeEvent (ITcpSession.TCP_DISCONNECTED, 	OnTcpConnectError);
		SubscribeEvent (ITcpSession.TCP_CONNECTERROR, 	OnTcpDisconnected);
	}
        /// <summary>
        /// Saves the Recipient List selection of the user
        /// </summary>
        protected override ValidationResult SaveUI()
        {
            ValidationResult result = base.ValidateUI();

            if (result.IsValid)
            {
                // Get list status
                IRestResponse <ListDataResponse> response = this.GetListResponse("CheckListStatus");

                if (response.Data.success)
                {
                    LogicPlugin.RecipientListDescription = response.Data.list_name;                     // Set recipient list name for future use (use unique names)
                    LogicPlugin.RecipientListStatus      = uStoreStatus.StrStatus.UnderConstruction;    // Used for delayed Recipient Lists that fetched after order submission.
                    LogicPlugin.NumberOfRecipients       = response.Data.list_count;
                    LogicPlugin.SelectionXML             = ConfigUtils.CreateSelectionXml(response.Data.list_id.ToString(), response.Data.list_quid, response.Data.list_count, response.Data.sample_count, response.Data.sample_info);

                    // Create sample recipient list records for proofing

                    // XML Format
                    //
                    // Important: Must contain <RecipitentList></RecipitentList>
                    // for each record. The spelling is wrong but required
                    //
                    // <?xml version=\"1.0\" encoding=\"utf-16\"?>
                    // <NewDataSet><RecipitentList><first>John</first></RecipitentList></NewDataSet>
                    XmlDocument document = new XmlDocument();
                    document.LoadXml("<?xml version=\"1.0\" encoding=\"utf-16\"?><NewDataSet><RecipitentList><first>John</first><last>Sample1</last><address>1111 Street Name</address><city>Any City</city><state>ST</state><zip>11111</zip><imbarcode>FADATFAFDDFTAAFDTFDTDFDTATDDTTTTAFFTTADTAAFTAAFDTAAADTFATDDFFDDAD</imbarcode><endorse>*************SCH 5-DIGIT 11111</endorse></RecipitentList><RecipitentList><first>John</first><last>Sample2</last><address>2222 Street Name</address><city>Any City</city><state>ST</state><zip>22222</zip><imbarcode>FADATFAFDDFTAAFDTFDTDFDTATDDTTTTAFFTTADTAAFTAAFDTAAADTFATDDFFDDAD</imbarcode><endorse>*************SCH 5-DIGIT 11111</endorse></RecipitentList><RecipitentList><first>John</first><last>Sample3</last><address>3333 Street Name</address><city>Any City</city><state>ST</state><zip>33333</zip><imbarcode>FADATFAFDDFTAAFDTFDTDFDTATDDTTTTAFFTTADTAAFTAAFDTAAADTFATDDFFDDAD</imbarcode><endorse>*************SCH 5-DIGIT 11111</endorse></RecipitentList><RecipitentList><first>John</first><last>Sample4</last><address>4444 Street Name</address><city>Any City</city><state>ST</state><zip>44444</zip><imbarcode>FADATFAFDDFTAAFDTFDTDFDTATDDTTTTAFFTTADTAAFTAAFDTAAADTFATDDFFDDAD</imbarcode><endorse>*************SCH 5-DIGIT 11111</endorse></RecipitentList><RecipitentList><first>John</first><last>Sample5</last><address>5555 Street Name</address><city>Any City</city><state>ST</state><zip>55555</zip><imbarcode>FADATFAFDDFTAAFDTFDTDFDTATDDTTTTAFFTTADTAAFTAAFDTAAADTFATDDFFDDAD</imbarcode><endorse>*************SCH 5-DIGIT 11111</endorse></RecipitentList></NewDataSet>");

                    // Setting recipient list data
                    LogicPlugin.RecipientListXML = document;

                    // Save the recipient list to the uStore system
                    LogicPlugin.SaveRecipientList();
                }
                else
                {
                    result.IsValid = false;
                }
            }

            return(result);
        }
示例#5
0
	/// <summary>
	/// Awake this instance.
	/// </summary>
	protected virtual void Awake ()
	{
		m_Plugin = GameEngine.GetSingleton ().QueryPlugin<LogicPlugin> ();
		if (!m_Plugin)
			throw new System.NullReferenceException ();
	}