Corrige a 3.4.3 (WotLK Classic + bnet) textos y lógica de expansión
- Plantillas: los textos hardcodeados "WotLK 3.3.5a" pasan a "3.4.3" (title, description, keywords, og:* en head.html; encabezado de la portada). - Expansión: se centraliza en ServerSelection (helper expansion_from_gamebuild + propiedad .expansion) y se reconoce WoW Classic: WotLK Classic 3.4.x (~44832–51536, p.ej. 3.4.3=51505) además de 3.3.5a (12340), y Cataclysm Classic 4.4.x además de 4.3.4 (15595). Se elimina la lógica duplicada de los 4 sitios (api, context_processor, pages x2) que solo mapeaban 12340->WotLK. El ServerSelection de Nova WoW queda en build 51505 (3.4.3) -> etiqueta WotLK, puerto 1119 (bnetserver). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+21
-2
@@ -2,6 +2,22 @@ from django.db import models
|
||||
from django_ckeditor_5.fields import CKEditor5Field
|
||||
|
||||
|
||||
def expansion_from_gamebuild(gamebuild):
|
||||
"""Etiqueta de expansión a partir del build del cliente.
|
||||
|
||||
Reconoce tanto los clientes retail antiguos (3.3.5a=12340, 4.3.4=15595) como
|
||||
los de WoW Classic: WotLK Classic 3.4.x (~44832–51536) y Cataclysm Classic
|
||||
4.4.x (~54332+). Nova WoW corre 3.4.3 (WotLK Classic), luego debe dar 'WotLK'.
|
||||
"""
|
||||
if gamebuild is None:
|
||||
return 'Unknown'
|
||||
if gamebuild == 12340 or 44000 <= gamebuild <= 52000:
|
||||
return 'WotLK'
|
||||
if gamebuild == 15595 or 53000 <= gamebuild <= 60000:
|
||||
return 'Cataclysm'
|
||||
return 'Unknown'
|
||||
|
||||
|
||||
class Noticia(models.Model):
|
||||
titulo = models.CharField(max_length=200)
|
||||
contenido = CKEditor5Field('Contenido', config_name='default')
|
||||
@@ -40,9 +56,12 @@ class ServerSelection(models.Model):
|
||||
port = models.IntegerField()
|
||||
gamebuild = models.IntegerField()
|
||||
|
||||
@property
|
||||
def expansion(self):
|
||||
return expansion_from_gamebuild(self.gamebuild)
|
||||
|
||||
def __str__(self):
|
||||
expansion = 'WotLK' if self.gamebuild == 12340 else 'Cataclysm' if self.gamebuild == 15595 else 'Unknown'
|
||||
return f"{self.name} ({expansion})"
|
||||
return f"{self.name} ({self.expansion})"
|
||||
|
||||
class DownloadClientPage(models.Model):
|
||||
title = models.CharField(max_length=255, default="Descarga del cliente")
|
||||
|
||||
Reference in New Issue
Block a user