static void CargarEscenarios(SessionInstance Session, string[,] Parameters) { if (Session.User != null) { if (Session.User.Sala != null) { return; } new Thread(() => Packet_154_32(Session)).Start(); FlowerHandler.Noticia(Session); } }
protected static bool ComprarVip(SessionInstance Session, UserInstance User, ServerMessage server, int type) { if (User.vip == 0) { using (mysql client = new mysql()) { switch (type) { case 1: if (User.oro >= 10000) { User.vip_double = Time.GetCurrentAndAdd(AddType.Meses, 1); User.end_vip = Convert.ToString(DateTime.Now.AddMonths(1)); UserManager.Creditos(User, true, false, 10000); FlowerHandler.BoomBangTeam(Session, "¡Felicidades " + Session.User.nombre + " Ahora eres un habitante de BurBian! \r\rTe notificaremos cuando tu suscripción termine faltando 15 días para que puedas renovar tu Membresía."); server.AppendParameter(1); server.AppendParameter(User.end_vip); } else { server.AppendParameter(0); return(false); } break; case 2: if (User.oro >= 25000) { User.vip_double = Time.GetCurrentAndAdd(AddType.Meses, 3); User.end_vip = Convert.ToString(DateTime.Now.AddMonths(3)); UserManager.Creditos(User, true, false, 25000); FlowerHandler.BoomBangTeam(Session, "¡Felicidades " + Session.User.nombre + " Ahora eres un habitante de BurBian! \r\rTe notificaremos cuando tu suscripción termine faltando 15 días para que puedas renovar tu Membresía."); server.AppendParameter(1); server.AppendParameter(User.end_vip); } else { server.AppendParameter(0); return(false); } break; case 3: if (User.oro >= 45000) { User.vip_double = Time.GetCurrentAndAdd(AddType.Meses, 6); User.end_vip = Convert.ToString(DateTime.Now.AddMonths(6)); UserManager.Creditos(User, true, false, 45000); FlowerHandler.BoomBangTeam(Session, "¡Felicidades " + Session.User.nombre + " Ahora eres un habitante de BurBian! \r\rTe notificaremos cuando tu suscripción termine faltando 15 días para que puedas renovar tu Membresía."); server.AppendParameter(1); server.AppendParameter(User.end_vip); } else { server.AppendParameter(0); return(false); } break; } client.SetParameter("id", User.id); client.SetParameter("vip_double", User.vip_double); client.SetParameter("end_vip", User.end_vip); client.ExecuteNonQuery("UPDATE usuarios SET vip = @vip_double, end_vip = @end_vip WHERE id = @id"); return(true); } } return(false); }