@@ -108,7 +108,7 @@ def handlePkt(self, code, b, pktData):
108
108
self .match .broadBin (0x10 , Buffer ().writeInt16 (self .id ).write (pktData ).writeInt16 (self .skin ))
109
109
110
110
elif code == 0x11 : # KILL_PLAYER_OBJECT
111
- if self .dead :
111
+ if self .dead or self . win :
112
112
return
113
113
114
114
self .dead = True
@@ -138,7 +138,7 @@ def handlePkt(self, code, b, pktData):
138
138
self .match .broadPlayerUpdate (self , pktData )
139
139
140
140
elif code == 0x13 : # PLAYER_OBJECT_EVENT
141
- if self .dead :
141
+ if self .dead or self . win :
142
142
return
143
143
144
144
type = b .readInt8 ()
@@ -168,15 +168,22 @@ def handlePkt(self, code, b, pktData):
168
168
self .client .startDCTimer (120 )
169
169
170
170
pos = self .match .getWinners ()
171
- if self .server .discordWebhook is not None and pos == 1 and not self .match .private :
172
- name = self .name
173
- # We already filter players that have a squad so...
174
- if len (self .team ) == 0 and self .server .checkCurse (self .name ):
175
- name = "[ censored ]"
176
- embed = DiscordEmbed (description = '**%s** has achieved **#1** victory royale!' % name , color = 0xffff00 )
177
- self .server .discordWebhook .add_embed (embed )
178
- self .server .discordWebhook .execute ()
179
- self .server .discordWebhook .remove_embed (0 )
171
+ try :
172
+ # Maybe this should be assynchronous?
173
+ if self .server .discordWebhook is not None and pos == 1 and not self .match .private :
174
+ name = self .name
175
+ # We already filter players that have a squad so...
176
+ if len (self .team ) == 0 and self .server .checkCurse (self .name ):
177
+ name = "[ censored ]"
178
+ embed = DiscordEmbed (description = '**%s** has achieved **#1** victory royale!' % name , color = 0xffff00 )
179
+ self .server .discordWebhook .add_embed (embed )
180
+ self .server .discordWebhook .execute ()
181
+ self .server .discordWebhook .remove_embed (0 )
182
+ except :
183
+ pass
184
+
185
+ # Make sure that everyone knows that the player is at the axe
186
+ self .match .broadPlayerUpdate (self , self .lastUpdatePkt )
180
187
181
188
self .match .broadBin (0x18 , Buffer ().writeInt16 (self .id ).writeInt8 (pos ).writeInt8 (0 ))
182
189
0 commit comments