Exemplo n.º 1
0
        private void addObserver(GameClient c, string tableId)
        {
            //if (c.isLoggedIn()) {
            int tid;

            try {
                tid = int.Parse(tableId);
            }
            catch (Exception) {
                c.sendMessage(Message.BAD_MESSAGE);
                return;
            }
            if (tables.ContainsKey(tid))
            {
                GameTable t = tables[tid];
                //c.leaveLobby();
                //alertLeaveLobby(c);
                c.observeTable(tid);
                //give the player the latest update about the table its about to observe.
                sayWhoOnTbl(c, tid);
                t.addObserver(c);
            }
            else
            {
                c.sendMessage(Message.TBL_NOT_EXIST);
            }
            //} c.sendMessage(Message.LOGIN_FAIL);
        }
Exemplo n.º 2
0
 private void addObserver(GameClient c, string tableId)
 {
     //if (c.isLoggedIn()) {
         int tid;
         try {
             tid = int.Parse(tableId);
         }
         catch (Exception) {
             c.sendMessage(Message.BAD_MESSAGE);
             return;
         }
         if (tables.ContainsKey(tid)) {
             GameTable t = tables[tid];
             //c.leaveLobby();
             //alertLeaveLobby(c);
             c.observeTable(tid);
             //give the player the latest update about the table its about to observe.
             sayWhoOnTbl(c, tid);
             t.addObserver(c);
         }
         else c.sendMessage(Message.TBL_NOT_EXIST);
     //} c.sendMessage(Message.LOGIN_FAIL);
 }