This repository has been archived by the owner on Sep 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
/
NetworkingPlan.txt
158 lines (133 loc) · 3.42 KB
/
NetworkingPlan.txt
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
Sledge Networking Plan
----------------------
## Technology
- TODO: Find more options
- http://www.networkcomms.net/ (older GPL version available http://www.networkcomms.net/download/gpl/)
## Client/Server
- Map "owner" serves as the host
- Publishes an IP (discoverable? lobby system? passwords? url protocol?) that clients can connect to
- Clients can be "read only" or "read/write"
- "Spectator" mode? (follow host's camera?)
## Ancillary systems
- Chat functionality?
- Login?
## Architecture
IAction (OR INetworkAction : IAction?)
:: IsNetworkable() - If IAction is used instead of INetworkAction
:: GetAffectedObjectIDs() - Conflict detection
Performing: Can always perform an action
Undo/Redo: Can only undo/redo if the objects have not been modified by anyone else between the perform/undo action and the undo/redo action
:: NetworkSerialise();
:: NetworkDeserialise();
When sending across the network:
CLIENT SERVER
Perform action
IsNetworkable = true
Lock control
o = NetworkSerialise(a) --> a = NetworkDeserialise(o)
PerformAction(a)
PerformAction(a) <-- SendToClients(a)
Control returns
## Map editing
### Included in network updates
- MapObjects
- Entities
- *
- Groups
- *
- Operations
- *
- Visgroups
- CreateEditDelete
- EditObjectVisgroups
### Excluded from network updates (except if spectating?)
- MapObjects
- Selection
- *
- Visgroups
- QuickHideObjects
- QuickShowObjects
- ShowAllVisgroups
- ToggleVisgroup
## Communication
MapObjects > Entities > EditEntityData
Perform: Replace entity data for a number of entities
Reverse: Replace entity data for a number of entities
Data:
[
long ID
Dictionary<string, string> EntityData
]
MapObjects > Groups > GroupAction
Perform: Insert a group node between a number of items and their parents
Reverse: Create a group node and assign its children to its parent
Data:
[
MapObject GroupObject
long[] ChildIDs
]
MapObjects > Groups > UngroupAction
Same as GroupAction, in reverse
MapObjects > Operations > Carve
MapObjects > Operations > Clip
MapObjects > Operations > Create
MapObjects > Operations > Delete
MapObjects > Operations > Edit
MapObjects > Operations > MakeHollow
All inherit from:
MapObjects > Operations > CreateEditDelete
Perform: Create objects and assign them parents
Edit parents with some operation: transform (align, snap to grid, transform) or copy properties (pretty much just used in the VM tool)
Delete objects and possibly their parents if they are empty
Reverse: Same, in reverse
Data:
Created [
long ParentID
MapObject CreatedObject
]
Edited [
long ID
Transformation Transform
MapObject CopyProperties
]
Deleted [
long ID
]
MapObjects > Operations > Reparent
Perform: Change an object's parent
Reverse: Same
Data:
[
long ID
long ParentID
]
MapObjects > Operations > EditFace
Perform: Edit a face (not yet serialisable)
Data:
[
long SolidID
long FaceID
???
]
Visgroups > CreateEditDeleteVisgroups
Perform: Create, edit, and delete visgroups
Data:
Created [
Visgroup Visgroup
long[] ObjectIDs
]
Edited [
int VisgroupID
string Name
Color Colour
]
Deleted [
int VisgroupID
]
Visgroups > EditObjectVisgroups
Perform: Change many objects' assigned visgroups
Data:
long ObjectIDs
int[] VisgroupIDsToAdd
int[] VisgroupIDsToRemove