public override void Connect(ConoConnect connect)
        {
            LobbyOwner owner = new LobbyOwner(connect);

            owner.Connect = connect;
            connect.SetOwner(owner);

            FrontLobbyPacket.ConnectResPacket packet = new FrontLobbyPacket.ConnectResPacket();
            packet.serverNo  = FrontManager.Instance.OwnerNo;
            packet.sessionId = "0";

            byte[] data = FrontLobbyPacket.Serialize(packet);

            connect.Send(data, data.Length);
        }
Exemplo n.º 2
0
        public override void Process(IConoDBConnection dbConnection)
        {
            string selectSql = "SELECT * FROM Account WHERE loginToken = \"" + loginToken + "\";";

            MySqlCommand selectCommand = new MySqlCommand();

            selectCommand.Connection  = dbConnection.Conn;
            selectCommand.CommandText = selectSql;

            DataSet          ds = new DataSet();
            MySqlDataAdapter da = new MySqlDataAdapter(selectSql, dbConnection.Conn);

            da.Fill(ds);

            DataRow row = ds.Tables[0].Rows[0];

            if (row == null)
            {
                Console.WriteLine("Process not exist user");
            }
            else
            {
                long userNo = (long)row["accountNo"];
                //string nickname = (string)row["nickname"];
                //int exp = (int)row["exp"];
                //int jam = (int)row["jam"];
                //int gold = (int)row["gold"];
                //int mileage = (int)row["mileage"];
                //int advTicket = (int)row["advTicket"];
                //DateTime advTicketUseTime = (DateTime)row["advTicketUseTime"];

                //Console.WriteLine(string.Format("이름 : " + userNo + ", " + nickname + ", " + exp + ", " + jam + ", " + gold + ", " + mileage + ", " + advTicket + ", " + advTicketUseTime.ToLongDateString()));

                ((FrontUser)user).OwnerNo = userNo;

                FrontManager.Instance.GetOwnerManager((int)NETWORK_MODULE.NETWORK_MODULE_CLIENT).AddConnectOwner(userNo, (FrontUser)user);

                Owner owner = FrontManager.Instance.GetOwnerManager((int)NETWORK_MODULE.NETWORK_MODULE_LOBBY).GetFreeOwner();

                if (owner == null)
                {
                    Console.WriteLine("lobby owner");

                    FrontUser frontUser = (FrontUser)user;

                    //frontUser.Connect.Send();

                    return;
                }

                FrontLobbyPacket.EnterUserReqPacket packet = new FrontLobbyPacket.EnterUserReqPacket();

                packet.userNo    = userNo;
                packet.sessionId = sessionId;

                byte[] data = FrontLobbyPacket.Serialize(packet);

                owner.Connect.Send(data, data.Length);
            }


            //foreach (DataRow row in ds.Tables[0].Rows)
            //{


            //}
        }