/// <summary> /// </summary> public SMSMSG() { var username = "******"; var password = "******"; var postUp = "211.147.239.62:9070"; var postDl = "211.147.239.62:9080"; if (ConfigurationManager.AppSettings["sms_username"] != null) { username = ConfigurationManager.AppSettings["sms_username"]; } if (ConfigurationManager.AppSettings["sms_password"] != null) { password = ConfigurationManager.AppSettings["sms_password"]; } if (ConfigurationManager.AppSettings["sms_post_up"] != null) { postUp = ConfigurationManager.AppSettings["sms_post_up"]; } if (ConfigurationManager.AppSettings["sms_post_dl"] != null) { postDl = ConfigurationManager.AppSettings["sms_post_dl"]; } _postMsg = new PostMsg(); //设置账号 _postMsg.SetUser(username, password); //设置上行网关 _postMsg.SetMOAddress(postUp.Split(':')[0], Convert.ToInt32(postUp.Split(':')[1]), LinkType.SHORTLINK); //设置下行网关 _postMsg.SetGateWay(postDl.Split(':')[0], Convert.ToInt32(postDl.Split(':')[1]), LinkType.SHORTLINK); }
/************************/ /*** Public Functions ***/ /************************/ /// <summary> /// Receive() - Receiver of posted message. /// </summary> /// <param name="message"></param> public void Receive(PostMsg message) { switch (message.Type) { case PostType.CREATE_SPITE_TAB: CreateEditSprite("New Sprite"); break; } }
/************************/ /*** Public Functions ***/ /************************/ /// <summary> /// Receive() - /// </summary> /// <param name="message"></param> public void Receive(PostMsg message) { switch (message.Type) { case PostType.DISPLAY_MESSAGE: WriteMsg((string)message.Dto); break; } }
public void Send(byte[] data, int size, INetworkAddress address) { var postMsg = new PostMsg(); postMsg.m_timeToSend = Time.time + m_delay; postMsg.m_data = new byte[size]; postMsg.m_address = address; System.Array.Copy(data, postMsg.m_data, size); m_postMsgQueue.Enqueue(postMsg); }
/************************/ /*** Public Functions ***/ /************************/ /// <summary> /// Receive() - /// </summary> /// <param name="message"></param> public void Receive(PostMsg message) { switch (message.Type) { case PostType.CREATE_PROJECT: CreateNewProject(); break; case PostType.CREATE_SPITE_TAB: CreateStaticObject(); break; } }
public bool Init() { postMsg = new PostMsg(); return(SetUser(Config.UserName, Config.Pwd) && SetMOAddress(Config.CmIp, Config.CmPort) && SetGateWay(Config.DlIp, Config.DlPort)); }