Building persistence

Buildings will now persist their faction in the database. At least
that's what I want you to believe this change is.

What it actually is: A rework of InterstellarCluster and groundwork
for further reworks.

InterstellarClusterService: This is the old InterstellarCluster, but
as a service (it has always been one in secret). It was converted to
a typed actor and it now handles all spawn point requests.

ZoneActor: Basically ZoneControl, but as a typed actor. It's more of a
stub right now, the eventual goal is to have it own the `Zone` object
rather than the other way around.

BuildingActor: BuildingControl, but as a typed actor.

Also includes some minor improvements to ChatActor and sets
SupervisorStrategy.restart for all typed actors (which is the default
for classic actors, but not for typed actors - we may want to get more
sophisticated here in the future).
This commit is contained in:
Jakob Gillich 2020-07-22 17:28:09 +02:00
parent 4634dffe00
commit 3345e56b38
51 changed files with 2457 additions and 2967 deletions

View file

@ -1,51 +0,0 @@
import re
def getmap():
data = open("tmp").read()
lines = data.split("\n")
lines_stripped = [l.strip().rstrip() for l in lines]
datalines = []
for i in lines_stripped:
m = re.findall(r'^[A-Z0-9a-z_]+', i)
if len(m):
datalines.append(m[0])
return datalines
def top():
datalines = getmap()
for i in range(0, len(datalines), 16):
print("// OPCODES 0x%02x-%02x" % (i, i+15))
print("\n".join([d+"," for d in datalines[i:min(i+8, len(datalines))]]))
print("// 0x%02x" % (i+8))
print("\n".join([d+"," for d in datalines[min(i+8,len(datalines)):min(i+16, len(datalines))]]))
print("")
def bot():
data = open("tmp2").read()
lines = data.split("\n")
lines_stripped = [l.strip().rstrip() for l in lines]
datalinesMap = getmap()
datalines = []
for i in lines_stripped:
m = re.findall(r'^case ([0-9]+)', i)
if len(m):
num = int(m[0])
m = re.findall(r'=> (.*)', i)[0]
if m.startswith("noDecoder"):
datalines.append((num, "noDecoder(%s)" % datalinesMap[num]))
else:
datalines.append((num, m))
for i in range(0, len(datalines), 16):
print("// OPCODES 0x%02x-%02x" % (i, i+15))
print("\n".join(["case 0x%02x => %s" % (n,d) for n,d in datalines[i:min(i+8, len(datalines))]]))
print("// 0x%02x" % (i+8))
print("\n".join(["case 0x%02x => %s" % (n,d) for n,d in datalines[i+8:min(i+16, len(datalines))]]))
print("")
top()