Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: MuOnlineHttpApi – Monitoreo de eventos PvP en tiempo real vía HTTP  (Visto 575 veces)

0 Miembros and 2 Guests are viewing this topic.

Online Xysad Posteado: March 02, 2026, 09:53:58 PM

  • Php Coder
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 296
  • Gracias recibida: 1568
  • ar
Hola comunidad,

Presentamos MuOnlineHttpApi, un proyecto que permite monitorear PvP en tiempo real desde MU Online. Cada kill/death se registra en memoria y se expone vía HTTP para que un frontend pueda mostrarlo al instante.

Cómo funciona (diagrama de flujo):
GameServer: detecta un evento PvP
→ HttpApi: procesa y guarda el evento en memoria
→ Servidor HTTP: escucha en el puerto 8080
→ Frontend / App: consulta /events y muestra PvP en tiempo real
Nota: La API escucha en todas las interfaces disponibles, por lo que puede ser accesible desde otras PCs si el puerto está abierto y configurado correctamente. Para producción conviene agregar seguridad (token, IPs permitidas, HTTPS).

Ejemplo de JSON entregado por la API:
Code: [Select]
{
  "events": [
    { "killerName": "DarkKnight", "deadName": "ElfArcher" },
    { "killerName": "MagicWizard", "deadName": "SoulMaster" }
  ]
}

Video demo:


Link del proyecto:


Gracias :D <3


Offline NghienMU #1 Posteado: March 02, 2026, 11:13:06 PM

  • 0 puntos por ventas
  • *
  • Rank: Liga mayor
  • Posts: 197
  • Gracias recibida: 63
  • vn

Gracias:


Online Xysad #2 Posteado: March 02, 2026, 11:25:09 PM

  • Php Coder
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 296
  • Gracias recibida: 1568
  • ar
What about security?

Good question. Right now the API is intentionally minimal because it was designed as an internal event layer for a future external client (web/app companion), not as a public-facing service.
For production use, it should be placed behind a firewall and extended with authentication (token/API key), IP filtering and optionally HTTPS.
This release focuses on the in-memory PvP event architecture; security hardening would be the next step depending on deployment scenario.


Offline dizzys #3 Posteado: March 03, 2026, 07:39:36 AM

  • 0 puntos por ventas
  • *
  • Rank: Usuario activo
  • Posts: 74
  • Gracias recibida: 11
  • be
What about security?

Good question. Right now the API is intentionally minimal because it was designed as an internal event layer for a future external client (web/app companion), not as a public-facing service.
For production use, it should be placed behind a firewall and extended with authentication (token/API key), IP filtering and optionally HTTPS.
This release focuses on the in-memory PvP event architecture; security hardening would be the next step depending on deployment scenario.

I really not sure why you do it like this? Why just dont add new table in SQL 'KillLogs' and DataServer save there all kills/death..


Offline cepo #4 Posteado: March 03, 2026, 10:50:26 AM

  • Web Developer
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 265
  • Gracias recibida: 2558
  • ar
What about security?

Good question. Right now the API is intentionally minimal because it was designed as an internal event layer for a future external client (web/app companion), not as a public-facing service.
For production use, it should be placed behind a firewall and extended with authentication (token/API key), IP filtering and optionally HTTPS.
This release focuses on the in-memory PvP event architecture; security hardening would be the next step depending on deployment scenario.

I really not sure why you do it like this? Why just dont add new table in SQL 'KillLogs' and DataServer save there all kills/death..

is just another way to do, i think is fine

Gracias:


Online Xysad #5 Posteado: March 03, 2026, 11:31:22 AM | Modificado: March 03, 2026, 11:43:30 AM by Xysad

  • Php Coder
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 296
  • Gracias recibida: 1568
  • ar
What about security?

Good question. Right now the API is intentionally minimal because it was designed as an internal event layer for a future external client (web/app companion), not as a public-facing service.
For production use, it should be placed behind a firewall and extended with authentication (token/API key), IP filtering and optionally HTTPS.
This release focuses on the in-memory PvP event architecture; security hardening would be the next step depending on deployment scenario.

I really not sure why you do it like this? Why just dont add new table in SQL 'KillLogs' and DataServer save there all kills/death..

This is not a replacement for SQL logging. It’s an in-memory event layer designed for real-time consumption (dashboard, overlay, mobile companion app, etc.).

If you kill a character right now, can you see that reflected immediately in the database without logout?
For example, if you run this in SQL Server while both characters are still online:
Code: [Select]
SELECT Name, PkCount
FROM Character
WHERE Name= 'NombreJugador'

Does PkCount update instantly after the kill?

In most MU setups, character data is flushed to the database on logout, not in real time. That means the DB is not a live event source — it’s a persistence layer.

HttpApi works directly at the GameServer memory level. The moment the PvP event happens, it’s available via HTTP. No logout. No waiting for DataServer sync. No polling delays.

That’s the architectural difference:
SQL is persistence.
HttpApi is real-time runtime event exposure.

Both can coexist, but they solve different problems.


Offline Odisk #6 Posteado: March 03, 2026, 12:27:11 PM

  • MAESTRO

  • Colaborador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 960
  • Gracias recibida: 15939
  • pr
What about security?

lo mejor que se puede hacer en este caso es modificar Api usuario contraseña y token's  si lo quieres llevar mas alla puedes usarlos que las consultas tengan que tener un cert

one day

Offline sanlp #7 Posteado: March 03, 2026, 06:48:22 PM

  • 0 puntos por ventas
  • *
  • Rank: Usuario activo
  • Posts: 65
  • Gracias recibida: 12
  • ar
Excelente, voy a agregar los post de los player. Muy bueno.

Gracias:


Online Xysad #8 Posteado: March 03, 2026, 07:35:26 PM

  • Php Coder
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 296
  • Gracias recibida: 1568
  • ar
Excelente, voy a agregar los post de los player. Muy bueno.

Avisa si lagea el cliente o consume ram el gs :d


Offline truongtienhp #9 Posteado: March 03, 2026, 10:43:37 PM

  • 0 puntos por ventas
  • *
  • Rank: Usuario activo
  • Posts: 68
  • Gracias recibida: 36
That's a good idea, but I do other way.
I output the gameserver/log/log_pk/2026-03-04.txt file from the server side, and then the web browser read that file directly.
This allows reading from multiple servers in real-time.


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
1 Replies
3322 Views
Last post November 13, 2016, 06:46:17 PM
by Hector
3 Replies
2603 Views
Last post April 08, 2018, 02:52:50 PM
by Maribao
3 Replies
3612 Views
Last post July 09, 2018, 04:28:52 PM
by 4RM4G3D0N
0 Replies
704 Views
Last post December 23, 2020, 05:43:41 PM
by epa123