forked from kaansoral/adventureland
-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.py
202 lines (187 loc) · 6.96 KB
/
models.py
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
from config import *
from functions import *
class User(ndb.Expando):
name=ndb.StringProperty()
email=ndb.StringProperty(repeated=True)
password=ndb.StringProperty(indexed=False)
credits=ndb.IntegerProperty(default=0)
created=ndb.DateTimeProperty(auto_now_add=True)
banned=ndb.BooleanProperty(default=False)
referrer=ndb.StringProperty()
timezone=ndb.IntegerProperty(default=0) #0-23 utc offset
cash=ndb.IntegerProperty(default=0)
worth=ndb.IntegerProperty(default=0) #total gold worth - including characters
language=ndb.StringProperty(default="en")
platform=ndb.StringProperty() # web, steam, mas
pid=ndb.StringProperty() # platform id
info=ndb.PickleProperty()
guild=ndb.StringProperty()
server=ndb.StringProperty()#for "The Bank" [02/09/16]
friends=ndb.StringProperty(repeated=True)
#online=ndb.BooleanProperty(default=False)
last_online=ndb.DateTimeProperty(auto_now_add=True)
cli_time=ndb.DateTimeProperty()
to_backup=ndb.BooleanProperty(default=False)
popularity=ndb.FloatProperty(default=0.0)
#utilities
random_number=ndb.IntegerProperty() #for cron scaling
has_scatter=ndb.BooleanProperty(indexed=False)
k=k_factory; _pre_put_hook=pre_put_hook
class Guild(ndb.Expando):
realm=ndb.StringProperty(default="main")
name=ndb.StringProperty()
short=ndb.StringProperty()
members=ndb.StringProperty(repeated=True)
created=ndb.DateTimeProperty(auto_now_add=True)
info=ndb.PickleProperty()
server=ndb.StringProperty()
last_sync=ndb.DateTimeProperty(auto_now_add=True)
to_backup=ndb.BooleanProperty(default=False)
popularity=ndb.FloatProperty(default=0.0)
#utilities
random_number=ndb.IntegerProperty() #for cron scaling
has_scatter=ndb.BooleanProperty(indexed=False)
k=k_factory; _pre_put_hook=pre_put_hook
class Character(ndb.Expando):
realm=ndb.StringProperty(default="main")
name=ndb.StringProperty()
type=ndb.StringProperty()
level=ndb.IntegerProperty(default=1)
worth=ndb.IntegerProperty(default=0) #total gold worth
xp=ndb.IntegerProperty(default=0)
owner=ndb.StringProperty()
referrer=ndb.StringProperty()
created=ndb.DateTimeProperty(auto_now_add=True)
platform=ndb.StringProperty() # web, steam, mas
pid=ndb.StringProperty() # platform id
info=ndb.PickleProperty()
private=ndb.BooleanProperty(default=False)
online=ndb.BooleanProperty(default=False)
server=ndb.StringProperty()
guild=ndb.StringProperty()
friends=ndb.StringProperty(repeated=True)
last_sync=ndb.DateTimeProperty(auto_now_add=True)
last_online=ndb.DateTimeProperty(auto_now_add=True)
to_backup=ndb.BooleanProperty(default=False)
popularity=ndb.FloatProperty(default=0.0)
#utilities
random_number=ndb.IntegerProperty() #for cron scaling
has_scatter=ndb.BooleanProperty(indexed=False)
k=k_factory; _pre_put_hook=pre_put_hook
class Server(ndb.Expando):
created=ndb.DateTimeProperty(auto_now_add=True)
last_update=ndb.DateTimeProperty(auto_now_add=True)
online=ndb.BooleanProperty(default=False)
gameplay=ndb.StringProperty(default="normal")
realm=ndb.StringProperty(default="main")
name=ndb.StringProperty()
region=ndb.StringProperty()
actual_ip=ndb.StringProperty()
ip=ndb.StringProperty()
port=ndb.IntegerProperty()
version=ndb.StringProperty()
info=ndb.PickleProperty()
#utilities
k=k_factory; _pre_put_hook=pre_put_hook
class Message(ndb.Expando):
created=ndb.DateTimeProperty(auto_now_add=True)
owner=ndb.StringProperty()
author=ndb.StringProperty() #player.owner
fro=ndb.StringProperty()
to=ndb.StringProperty(repeated=True)
type=ndb.StringProperty() # ambient, private, party, server
server=ndb.StringProperty()
info=ndb.PickleProperty()
#utilities
k=k_factory; _pre_put_hook=pre_put_hook
class Mail(ndb.Expando):
created=ndb.DateTimeProperty(auto_now_add=True)
owner=ndb.StringProperty(repeated=True)
read=ndb.BooleanProperty(default=False)
item=ndb.BooleanProperty(default=False); taken=ndb.BooleanProperty(default=False)
fro=ndb.StringProperty()
to=ndb.StringProperty()
type=ndb.StringProperty() # system, mail
info=ndb.PickleProperty()
#utilities
k=k_factory; _pre_put_hook=pre_put_hook
class Event(ndb.Expando):
created=ndb.DateTimeProperty(auto_now_add=True)
expire_at=ndb.DateTimeProperty()
tag=ndb.StringProperty(repeated=True)
item_id=ndb.StringProperty()
type=ndb.StringProperty()
info=ndb.PickleProperty()
#utilities
k=k_factory; _pre_put_hook=pre_put_hook
class Backup(ndb.Expando):
backup_item_id=ndb.StringProperty()
backup_created=ndb.DateTimeProperty(auto_now_add=True)
expire_at=ndb.DateTimeProperty()
backup_info=ndb.PickleProperty()
info=ndb.PickleProperty()
#utilities
random_number=ndb.IntegerProperty()
has_scatter=ndb.BooleanProperty(indexed=False)
k=k_factory; _pre_put_hook=pre_put_hook
class Map(ndb.Expando):
created=ndb.DateTimeProperty(auto_now_add=True)
updated=ndb.DateTimeProperty(auto_now_add=True)
player=ndb.BooleanProperty(default=False)
info=ndb.PickleProperty()
#utilities
k=k_factory; _pre_put_hook=pre_put_hook
class InfoElement(ndb.Expando):
created=ndb.DateTimeProperty(auto_now_add=True)
info=ndb.PickleProperty()
#utilities
random_number=ndb.IntegerProperty() #for cron scaling
has_scatter=ndb.BooleanProperty(indexed=False)
k=k_factory; _pre_put_hook=pre_put_hook
class Upload(ndb.Expando):
created=ndb.DateTimeProperty(auto_now_add=True)
type=ndb.StringProperty(default="photo")
info=ndb.PickleProperty()
#utilities
k=k_factory; _pre_put_hook=pre_put_hook
class IP(ndb.Expando):
created=ndb.DateTimeProperty(auto_now_add=True)
info=ndb.PickleProperty()
users=ndb.StringProperty(repeated=True)
characters=ndb.StringProperty(repeated=True)
random_id=ndb.StringProperty()
referrer=ndb.StringProperty()
exception=ndb.BooleanProperty(default=False)
last_exception=ndb.DateTimeProperty()
#utilities
random_number=ndb.IntegerProperty() #for cron scaling
has_scatter=ndb.BooleanProperty(indexed=False)
k=k_factory; _pre_put_hook=pre_put_hook
class Marker(ndb.Expando):
pass #just to mark things
class MarkedPhrase(ndb.Expando):
type=ndb.StringProperty()
phrase=ndb.StringProperty()
owner=ndb.StringProperty()
created=ndb.DateTimeProperty(auto_now_add=True)
#utilities
random_number=ndb.IntegerProperty() #for cron scaling
has_scatter=ndb.BooleanProperty(indexed=False)
k=k_factory; _pre_put_hook=pre_put_hook
class Player(ndb.Expando): #forgot what this was even for, it's unused [19/09/18] - to make User high level, and Player realm based, bank is on the Player entity [19/11/18]
realm=ndb.StringProperty(default="main")
name=ndb.StringProperty()
credits=ndb.IntegerProperty(default=0)
created=ndb.DateTimeProperty(auto_now_add=True)
referrer=ndb.StringProperty()
timezone=ndb.IntegerProperty(default=0) #0-23 utc offset
cash=ndb.IntegerProperty(default=0)
info=ndb.PickleProperty()
server=ndb.StringProperty()#for "The Bank" [02/09/16]
friends=ndb.StringProperty(repeated=True)
#online=ndb.BooleanProperty(default=False)
last_online=ndb.DateTimeProperty(auto_now_add=True)
#utilities
random_number=ndb.IntegerProperty() #for cron scaling
has_scatter=ndb.BooleanProperty(indexed=False)
k=k_factory; _pre_put_hook=pre_put_hook