コード例 #1
0
        private Wind.Comm.Expo4.Message buildRequest()
        {
            UserPolicyData policyData = new UserPolicyData();

            policyData.UserID     = UserID;
            policyData.OfferTime  = dtAutoBid.Value.Minute;
            policyData.OfferTime += dtAutoBid.Value.Second / 100.0;

            policyData.PriceMarkup = tbIncPrice.Text.Trim();

            policyData.Submit400  = dtAutoCommit400.Value.Second;
            policyData.Submit400 += Convert.ToInt32(tbAutoCommitMS400.Text) / 1000.0;

            policyData.Submit500  = dtAutoCommit500.Value.Second;
            policyData.Submit500 += Convert.ToInt32(tbAutoCommitMS500.Text) / 1000.0;

            policyData.SubmitForce  = dtAutoCommit2.Value.Second;
            policyData.SubmitForce += Convert.ToInt32(tbAutoCommitMS2.Text) / 1000.0;
            policyData.ServerIP     = "";

            Wind.Comm.Expo4.Message msg = new Wind.Comm.Expo4.Message();
            msg.SetCommand(3100, UserAdmin.CHANGEPOLICYMSGID);
            MessageV2BuilderHelper helper = new MessageV2BuilderHelper();

            helper.WriteString(AdminUserID);
            helper.WriteUserPolicyData2Msg(policyData);
            msg.setMsgBody(helper.GetMsgBody());

            return(msg);
        }
コード例 #2
0
        public bool loginToServer(string userID)
        {
            if (_logined)
            {
                return(true);
            }
            if (_UIControl.SyncCheckUserExists(userID))
            {
                return(false);
            }
            if (_PolicyBroadcastThread != null)
            {
                return(false);
            }


            _PolicyBroadcastThread = new Thread((obj) => {
                while (true)
                {
                    UserPolicyData policyData = new UserPolicyData();
                    policyData.UserID         = obj as string;
                    _UIControl.SyncGetSelfPolicyData(ref policyData);
                    _UIControl.SyncUpdatePolicyList(ref policyData);
                    //Console.WriteLine(policyData.ToString());
                    Message msg = new Message();
                    msg.SetCommand(3100, LOGMSGID);
                    MessageV2BuilderHelper helper = new MessageV2BuilderHelper();
                    helper.WriteUserPolicyData2Msg(policyData);
                    msg.setMsgBody(helper.GetMsgBody());
                    _server.conBroadcast(msg, PacketHeader.ExpoDealType.InterGroup);
                    //Thread.Sleep(500);
                    if (_policySyncWaitEvent.WaitOne(1000))
                    {
                        //收到信号退出当前线程
                        return;
                    }
                }
            });
            _PolicyBroadcastThread.Start(userID);
            _userID  = userID;
            _logined = true;

            return(_logined);
        }