blob: 994d692e7faf16dba5f1fecc973b9f0597938274 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# What is the essence of an MMO?
* Let a lot of players move at the same time in the world
* Let a lot of players make interactions with each other at the same time
* A game
> A game where a lot of things happen at once, and where there is a lot of communication between the backend and frontend.
# Stack
* A game: [Phaser3, een javascript/typescript framework](https://phaser.io/phaser3)
* A lot of communication: Websockets met [Jetty](https://en.wikipedia.org/wiki/Jetty_(web_server)) en [Javascript](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)
* Doing a lot of things at once: [Java Akka](https://doc.akka.io/docs/akka/current/typed/interaction-patterns.html#interaction-patterns), [Java Akka Docs](https://doc.akka.io/api/akka/current/akka/actor/typed/javadsl/index.html), strongly typed actor systeem
## Diagram
```
| .
| /|\
\|/ |
. |
┌───────────────┐
│AkkamonSession/│
│Websocket │
└───────────────┘
| |
| |
Map<SceneId, -> . . <- Map<TrainerID, AkkamonSession/Websocket>
AkkamonSession/Websocket> | |
┌─────────┐
│Messaging│
│Engine │
└─────────┘
* Requests | . * HeartBeats
* HeartBeat \|/ /|\ * Responses to Requests
pongs . |
┌────────────────────────────────────────────────────────────────┐
│Domain Actors ┌─────┐ │
│ │Nexus│ │
│ └─────┘ │
│ / | │
│ . . <- Map<sceneId, actor> │
│ | | │
│ ┌─────┐ │
│ │Scene│ ... │
│ └─────┘ │
│ / | │
│ . . <- Map<TrainerID, actor> │
│ | | │
│ ┌──────────┐ │
│ │ Trainer │ ... │
│ └──────────┘ │
└────────────────────────────────────────────────────────────────┘
```
|