Example #1
0
    public void InitView(GameObject gameObject)
    {
        //templet
        m_mediator = new PVPPanelMediator(this);
        App.Facade.RegisterMediator(m_mediator);
        m_proxy    = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
        m_pvpProxy = App.Facade.RetrieveProxy("PVPProxy") as PVPProxy;
        InitUIBinder(gameObject);

        m_piece.SetActive(false);
        m_ready.onClick.AddListener(OnReadyClick);
        m_test.onClick.AddListener(OnRoundStart);
        m_Undo.onClick.AddListener(OnUndoClick);
        App.Facade.RegisterCommand(NotificationConstant.PlayerReady, () => new PlayerReadyCommand());
        App.Facade.RegisterCommand(NotificationConstant.DoMove, () => new DoMoveCommand());
        App.Facade.RegisterCommand(NotificationConstant.EndTurn, () => new EndTurnCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerMutually, () => new PlayerMutuallyCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerMutuallyFeedback, () => new PlayerMutuallyFeedbackCommand());

        App.NetworkManager.RegisterPushCall(Config.PushMessage.OtherMove, ShowOtherMove);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.OnePlayerReady, OnOnePlayerReady);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerNotReady, OnPlayerNotReady);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerReadyFinish, OnReadyFinish);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayNext, OnNextPlay);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerEnd, OnGameOver);

        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerUndoPush, OnPlayerUndoPush);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerUndoInfoPush, OnPlayerUndoInfoPush);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerNotAgreePush, OnPlayerNotAgreePush);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayUndoNextPush, OnPlayUndoNextPush);
    }
Example #2
0
        public ActionResult Index()
        {
            where_model wm = new where_model();

            wm.userid = UserID;
            LoginUser_Info loginuser = UserDataProxy.LoginUser_Info_GetModel(wm);

            wm.kid = loginuser.kid;
            Kin_Sms sms = SmsDataProxy.Kin_Sms_GetModel(wm);

            if (loginuser.kid <= 0)
            {
                return(RedirectToAction("NoJoinGarten", "SendMessage"));
            }
            ViewData["uid"]           = UserID;
            ViewData["kid"]           = loginuser.kid;
            ViewData["smsLen"]        = loginuser.smsLen;
            ViewData["smscnt"]        = sms.totalcount;
            ViewData["sendcnt"]       = sms.sendcount;
            ViewData["openWebSms"]    = loginuser.openWebSms;
            ViewData["auditSms"]      = loginuser.auditSms;
            ViewData["appAuditSms"]   = loginuser.appAuditSms;
            ViewData["onlySendChild"] = loginuser.onlySendChild;
            ViewData["role"]          = Request["role"] ?? "1";
            return(View());
        }
Example #3
0
    public override void Execute(INotification notification)
    {
        string userName = notification.Body.ToString();

        m_userProxy = Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
        Debug.Log("LoginCommand Execute!");
        Request(userName);
    }
Example #4
0
 public void InitView(GameObject gameObject)
 {
     m_object = gameObject;
     InitUIBinder(gameObject);
     m_mediator = new MessagePanelMediator(this);
     App.Facade.RegisterMediator(m_mediator);
     m_proxy = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
 }
Example #5
0
    public void InitView(GameObject gameObject)
    {
        m_object = gameObject;
        InitUIBinder(gameObject);
        m_mediator = new TipsPanelMediator(this);
        App.Facade.RegisterMediator(m_mediator);
        m_proxy = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;

        m_BottomButton.onClick.AddListener(OnCloseButtonClick);
    }
Example #6
0
        public SystemControl(LogControl log)
        {
            userProxy       = new UserDataProxy();
            this.logControl = log;
            var ServiceTimer = new System.Timers.Timer();

            ServiceTimer.Enabled  = true;
            ServiceTimer.Interval = (1000 * 60 * 60 * 24 * 7);//once a week
            ServiceTimer.Elapsed += new System.Timers.ElapsedEventHandler(DivideStart);
        }
Example #7
0
    public void InitView(GameObject gameObject)
    {
        m_object = gameObject;
        InitUIBinder(gameObject);
        m_mediator = new UserSimpleInfoPanelMediator(this);
        App.Facade.RegisterMediator(m_mediator);
        m_proxy = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;

        m_UserButton.onClick.AddListener(OnUserButtonClick);
        m_RankButton.onClick.AddListener(OnRankButtonClick);
    }
Example #8
0
    public void InitView(GameObject gameObject)
    {
        InitUIBinder(gameObject);
        m_BottomButton.onClick.AddListener(OnConfirmClick);
        m_agree.onClick.AddListener(OnAgreeClick);
        m_disagree.onClick.AddListener(OnDisagreeClick);

        m_object   = gameObject;
        m_mediator = new MutuallySelectPanelMediator(this);
        App.Facade.RegisterMediator(m_mediator);
        m_proxy = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
    }
Example #9
0
    public void InitView(GameObject gameObject)
    {
        m_object = gameObject;
        InitUIBinder(gameObject);
        m_mediator = new RankListPanelMediator(this);
        App.Facade.RegisterMediator(m_mediator);
        m_proxy    = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
        m_pvpProxy = App.Facade.RetrieveProxy("PVPProxy") as PVPProxy;
        m_Close.onClick.AddListener(OnCloseButtonClick);

        App.Facade.RegisterCommand(NotificationConstant.ShowRankList, () => new ShowRankListCommand());
    }
Example #10
0
    public override void Execute(INotification notification)
    {
        UserDataProxy proxy    = Facade.RetrieveProxy(UserDataProxy.NAME) as UserDataProxy;
        string        message  = notification.Body.ToString();
        int           split    = message.IndexOf("/");
        string        email    = message.Substring(0, split);
        string        password = message.Substring(split);

        proxy.SetProperty(email, password);

        NetManager.Instance.Send(notification.Body);
    }
Example #11
0
 public void InitView(GameObject gameObject)
 {
     //templet
     m_mediator = new PVEPanelMediator(this);
     App.Facade.RegisterMediator(m_mediator);
     m_proxy    = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
     m_pveProxy = App.Facade.RetrieveProxy("PVEProxy") as PVEProxy;
     InitUIBinder(gameObject);
     m_chess.SetActive(false);
     m_ready.onClick.AddListener(OnReadyClick);
     m_test.onClick.AddListener(OnUndoClick);
     m_Undo.onClick.AddListener(OnRoundStart);
 }
Example #12
0
    public void InitView(GameObject gameObject)
    {
        InitUIBinder(gameObject);
        m_BottomButton.onClick.AddListener(OnConfirmClick);
        m_N.onClick.AddListener(OnNClick);
        m_R.onClick.AddListener(OnRClick);
        m_B.onClick.AddListener(OnBClick);
        m_Q.onClick.AddListener(OnQClick);

        m_object   = gameObject;
        m_mediator = new TypeSelectPanelMediator(this);
        m_pvpProxy = new PVPProxy();
        m_pveProxy = new PVEProxy();
        App.Facade.RegisterMediator(m_mediator);
        m_proxy = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
    }
Example #13
0
    public void InitView(GameObject gameObject)
    {
        //templet
        m_mediator = new PVP02PanelMediator(this);
        App.Facade.RegisterMediator(m_mediator);
        m_proxy    = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
        m_pvpProxy = App.Facade.RetrieveProxy("PVP02Proxy") as PVP02Proxy;
        InitUIBinder(gameObject);
        m_modelClick.pvp02Panel = this;

        m_piece.SetActive(false);
        m_ready.onClick.AddListener(OnReadyClick);
        m_P.onClick.AddListener(OnPClick);
        m_N.onClick.AddListener(OnNClick);
        m_R.onClick.AddListener(OnRClick);
        m_B.onClick.AddListener(OnBClick);
        m_Q.onClick.AddListener(OnQClick);
        m_SelectCloce.onClick.AddListener(OnSelectCloseClick);
        m_Item1.onClick.AddListener(OnItem1Click);
        m_Item2.onClick.AddListener(OnItem2Click);
        m_Item3.onClick.AddListener(OnItem3Click);
        m_Item4.onClick.AddListener(OnItem4Click);
        m_SelfSay.onClick.AddListener(OnSayClick);
        m_EndTurn.onClick.AddListener(OnEndTurnClick);
        m_BottomToggle.onValueChanged.AddListener(OnBottomToggleClick);

        App.Facade.RegisterCommand(NotificationConstant.NewEndTurn, () => new NewEndTurnCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerReady, () => new PlayerReadyCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerActive, () => new PlayerActiveCommand());
        App.Facade.RegisterCommand(NotificationConstant.EndTurn, () => new EndTurnCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerMutually, () => new PlayerMutuallyCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerMutuallyFeedback, () => new PlayerMutuallyFeedbackCommand());
        App.Facade.RegisterCommand(NotificationConstant.PlayerChat, () => new PlayerChatCommand());

        App.NetworkManager.RegisterPushCall(Config.PushMessage.NewServerBattleMesPush, ShowOtherActive);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.OnePlayerReady, OnOnePlayerReady);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerNotReady, OnPlayerNotReady);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerReadyFinish, OnReadyFinish);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayNext, OnNextPlay);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerEnd, OnGameOver);

        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerCanNextPush, OnCanNextPush);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerCanPaintingPush, OnOtherEndTurnPush);
        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerPaintingOverPush, OnRoundStartPush);

        App.NetworkManager.RegisterPushCall(Config.PushMessage.PlayerChatPush, OnPlayerChatPush);
    }
Example #14
0
    private UserDataProxy m_proxy;//todo

    public void InitView(GameObject gameObject)
    {
        Debug.Log("login panel Inited");
        m_mediator = new LoginPanelMediator(this);
        m_proxy    = new UserDataProxy();
        App.Facade.RegisterMediator(m_mediator);
        App.Facade.RegisterProxy(m_proxy);

        m_ip       = gameObject.transform.Find("m_IP").gameObject.GetComponent <InputField>();
        m_port     = gameObject.transform.Find("m_Port").gameObject.GetComponent <InputField>();
        m_userName = gameObject.transform.Find("m_UserName").gameObject.GetComponent <InputField>();
        m_login    = gameObject.transform.Find("m_Login").gameObject.GetComponent <Button>();

        m_login.onClick.AddListener(OnLoginClick);

        App.Facade.RegisterCommand(NotificationConstant.LobbyConnect, () => new LobbyConnectCommand());
        App.Facade.RegisterCommand(NotificationConstant.Login, () => new LoginCommand());
    }
Example #15
0
    public void InitView(GameObject gameObject, Piece pieceData, int roundNum, bool pve = false)
    {
        isPVE        = pve;
        m_gameObject = gameObject;
        m_roundNum   = roundNum;
        //m_gameObject.transform.localRotation = Quaternion.Euler(0, 180, 0);
        m_Attack    = gameObject.transform.Find("m_Attack").gameObject;
        m_UserProxy = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
        m_pvpProxy  = App.Facade.RetrieveProxy("PVP02Proxy") as PVP02Proxy;
        selfColor   = m_pvpProxy.GetSelfColor();
        m_type      = pieceData.type;
        pieceColor  = pieceData.color;
        InitPieceShow(pieceData);
        m_name     = m_X + "_" + m_Z + "_" + m_roundNum;
        m_mediator = new PieceItem02Mediator(this, m_name);
        App.Facade.RegisterMediator(m_mediator);
        m_mediator.InitPieceData(pieceData);

        OpenView();
    }
        public void Initialize()
        {
            proxy          = new GameDataProxy(gameCenter);
            _userDataProxy = new UserDataProxy();
            user1          = new User(1, "test1", "mo", "1234", 0, 5000, "*****@*****.**");
            user2          = new User(2, "test2", "no", "1234", 0, 5000, "*****@*****.**");
            user3          = new User(3, "test3", "3test", "1234", 0, 5000, "*****@*****.**");
            _userDataProxy.AddNewUser(user1);
            _userDataProxy.AddNewUser(user2);
            _userDataProxy.AddNewUser(user3);
            useCommunication     = false;
            roomID               = 9999;
            players              = new List <Player>();
            player1              = new Player(user1, 1000, roomID);
            player1.RoundChipBet = 22;
            players.Add(player1);
            Decorator deco = SetDecoratoresNoLimitWithSpectatores();

            gameRoom = new GameRoom(players, roomID, deco, gameCenter, logControl, replayManager, ses);
        }
Example #17
0
    public void InitView(GameObject gameObject)
    {
        Debug.Log("Lobby Panel Inited");
        m_object = gameObject;
        InitUIBinder(gameObject);
        m_mediator = new LobbyPanelMediator(this);
        m_pvpProxy = App.Facade.RetrieveProxy("PVPProxy") as PVPProxy;
        if (m_pvpProxy == null)
        {
            m_pvpProxy = new PVPProxy();
            App.Facade.RegisterProxy(m_pvpProxy);
        }
        m_pvp02Proxy = App.Facade.RetrieveProxy("PVP02Proxy") as PVP02Proxy;
        if (m_pvp02Proxy == null)
        {
            m_pvp02Proxy = new PVP02Proxy();
            App.Facade.RegisterProxy(m_pvp02Proxy);
        }

        m_pveProxy = App.Facade.RetrieveProxy("PVEProxy") as PVEProxy;
        if (m_pveProxy == null)
        {
            m_pveProxy = new PVEProxy();
            App.Facade.RegisterProxy(m_pveProxy);
        }

        App.Facade.RegisterMediator(m_mediator);
        m_proxy = App.Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;

        m_PVP.onClick.AddListener(OnPVPClick);
        m_PVE.onClick.AddListener(OnPVEClick);
        m_PVP02.onClick.AddListener(OnPVP02Click);
        m_PVP02Local.onClick.AddListener(OnPVP02LocalClick);
        m_Easy.onClick.AddListener(OnEasyClick);
        m_Hard.onClick.AddListener(OnHardClick);
        m_Normal.onClick.AddListener(OnNormalClick);
        m_cancel.onClick.AddListener(OnCancelClick);
        App.Facade.RegisterCommand(NotificationConstant.Match, () => new MatchCommand());
        App.Facade.RegisterCommand(NotificationConstant.CancelMatch, () => new CancelMatchCommand());
        App.NetworkManager.RegisterPushCall(Config.PushMessage.MatchSuccess, OnMatchSuccess);
    }
Example #18
0
        public void Initialize()
        {
            proxy          = new GameDataProxy(gameCenter);
            _userDataProxy = new UserDataProxy();
            user1          = new User(1, "test1", "mo", "1234", 0, 5000, "*****@*****.**");
            user2          = new User(2, "test2", "no", "1234", 0, 5000, "*****@*****.**");
            user3          = new User(3, "test3", "3test", "1234", 0, 5000, "*****@*****.**");
            _userDataProxy.AddNewUser(user1);
            _userDataProxy.AddNewUser(user2);
            _userDataProxy.AddNewUser(user3);
            useCommunication     = false;
            roomID               = 9999;
            players              = new List <Player>();
            player1              = new Player(user1, 1000, roomID);
            player1.RoundChipBet = 22;
            players.Add(player1);
            Decorator deco = SetDecoratoresNoLimitWithSpectatores();

            gameRoom = new GameRoom(players, roomID, deco, gameCenter, logControl, replayManager, ses);
            Card        c1     = new Card(Suits.Clubs, 1);
            Card        c2     = new Card(Suits.Clubs, 2);
            List <Card> pCards = new List <Card>();

            pCards.Add(c1);
            pCards.Add(c2);
            long sid = 1;

            msg = new GameDataCommMessage(gameRoom.GetPlayersInRoom().First().user.Id(), gameRoom.Id, sid, new Card(Suits.Diamonds, 1), new Card(Suits.Diamonds, 2),
                                          pCards, 3, 4, new List <string>(), new List <string>(), "", "", "", true, "", "", 1,
                                          new CommunicationMessage.ActionType(), "Flop", "");
            var ob = new List <Tuple <CommunicationMessage, bool, bool, TexasHoldemShared.CommMessages.ServerToClient.ResponeCommMessage> >();

            res = new ResponeCommMessage(1, 1, true, msg);
            var t = new Tuple <CommunicationMessage, bool, bool, TexasHoldemShared.CommMessages.ServerToClient.ResponeCommMessage>(msg, false, false, res);

            ob.Add(t);
            rn = new ResponseNotifier(ob, cl);
        }
Example #19
0
        //get amout won, inc winCounter + update point + check if the user is now the highest player
        public bool Win(int amount)
        {
            bool toReturn;

            try
            {
                user.IncWinNum();
                user.UpdateHighestCashInGame(amount);
                user.UpdateTotalProfit(amount);
                TotalChip += amount;
                int newPoint = GetNewPoint();
                user.EditUserPoints(newPoint);
                UserDataProxy p = new UserDataProxy();
                this.user.EditUserPoints(newPoint);
                p.EditUserPoints(user.Id(), newPoint);
                toReturn = true;
            }
            catch (Exception e)
            {
                toReturn = false;
            }
            return(toReturn);
        }
Example #20
0
 public override void Execute(INotification notification)
 {
     Request();
     m_pvpProxy  = Facade.RetrieveProxy("PVPProxy") as PVPProxy;
     m_userProxy = Facade.RetrieveProxy("UserDataProxy") as UserDataProxy;
 }
Example #21
0
 public UserServiceHandler(GameCenter game, SystemControl system)
 {
     _sc            = system;
     _userDataProxy = new UserDataProxy();
 }
Example #22
0
 public LoginPanelMediator(object viewComponent) : base(NAME, viewComponent)
 {
     ((LoginPanelView)ViewComponent).loginBtn.onClick.AddListener(OnClickLogin);
     userDataProxy = Facade.RetrieveProxy(UserDataProxy.NAME) as UserDataProxy;
 }
Example #23
0
        private string GetSendUserList(int kid, string ulist, ref int sendtype /*, int type, out string reccid*/)
        {
            string reccid        = "";
            string recuserid     = "";
            bool   sendWithClass = true;

            switch (sendtype)
            {
            //发送方式(0按小朋友,1按老师,2按年级,3按班级,4按部门,5按职位)
            case 1:
            case 2:
                recuserid = ulist.Replace('$', ',');
                break;

            case 0:
                string[]      personlist = ulist.Split('$');
                StringBuilder clslist    = new StringBuilder();
                StringBuilder userlist   = new StringBuilder();
                foreach (string per in personlist)
                {
                    if (per == "" || per.EndsWith("|") == false)
                    {
                        continue;
                    }

                    string[] arr        = per.Split('|');
                    string   cid        = arr[0];
                    string   isall      = arr[1];
                    int      startIndex = cid.Length + 2;
                    string   userids    = per.Substring(startIndex);
                    if (isall == "1")
                    {
                        clslist.AppendFormat("{0},", cid);
                    }
                    else
                    {
                        sendWithClass = false;
                        userlist.Append(userids.Replace('|', ','));
                    }
                }
                reccid = clslist.ToString();
                if (sendWithClass)
                {
                    recuserid = reccid;
                    sendtype  = 3;
                }
                else
                {
                    //1:APP短信,2:平台短信
                    if (/*type == 2 &&*/ reccid != "")
                    {
                        string uids = UserDataProxy.GetUseridStr(reccid);
                        userlist.Append(uids);
                    }
                    recuserid = userlist.ToString();
                }
                break;

            default: break;
            }

            return(recuserid);
        }
Example #24
0
        /// <summary>
        /// 发送消息/通知界面
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            where_model wm = new where_model();

            wm.userid = UserID;
            LoginUser_Info loginuser = UserDataProxy.LoginUser_Info_GetModel(wm);

            wm.kid = loginuser.kid;

            if (loginuser.kid <= 0)
            {
                return(RedirectToAction("NoJoinGarten"));
            }

            //&cid=44146&touid=222323&realname=xx 可以在学生通讯录里进入到发通知界面,并选择这个小朋友
            int cid = 0;

            if (Request.QueryString["cid"] != null)
            {
                cid = int.Parse(Request.QueryString["cid"]);
            }

            int touid = 0;

            if (Request.QueryString["touid"] != null)
            {
                touid = int.Parse(Request.QueryString["touid"]);
            }

            string realname = "";

            if (Request.QueryString["realname"] != null)
            {
                realname = Request.QueryString["realname"];
            }

            IList <Grade_Info>   gradelist = UserDataProxy.Grade_Info_GetList(wm);
            IList <Teacher_Info> tealist   = UserDataProxy.TeacherInfo_GetListV2(wm);

            ViewData["loginuser"] = loginuser;
            ViewData["gradelist"] = gradelist;
            ViewData["tealist"]   = tealist;
            ViewData["kid"]       = loginuser.kid;

            string ulist      = "";
            string selecttype = loginuser.usertype > 1 ? "teachers02" : "teachers";

            if (touid > 0)
            {
                ulist      = string.Format("${0}|0|{1}|", cid, touid);
                selecttype = loginuser.usertype > 1 ? "grades02" : "grades";
            }
            ViewData["touid"]      = touid;
            ViewData["uid"]        = UserID;
            ViewData["realname"]   = realname;
            ViewData["ulist"]      = ulist;
            ViewData["selecttype"] = selecttype;

            Kin_Sms sms = SmsDataProxy.Kin_Sms_GetModel(wm);

            ViewData["sms"] = sms;

            return(View());
        }