Skip to content

Commit

Permalink
提高容错性 改为joyEnableCCPK
Browse files Browse the repository at this point in the history
  • Loading branch information
lunzhiPenxil committed Aug 27, 2022
1 parent df686e3 commit 68a3400
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion OlivaDiceJoy/msgCustom.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
dictConsoleSwitchTemplate = {
'default' : {
'joyPokeMode': 0,
'joyEnableChance': 0
'joyEnableCCPK': 0
}
}

Expand Down
18 changes: 13 additions & 5 deletions OlivaDiceJoy/msgReply.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import hashlib
import time
import traceback
from functools import wraps

def unity_init(plugin_event, Proc):
Expand Down Expand Up @@ -330,7 +331,7 @@ def msg_func(data:str, valDict:dict):
if 'vPluginEvent' in valDict['vValDict']:
plugin_event = valDict['vValDict']['vPluginEvent']
flag_need = OlivaDiceCore.console.getConsoleSwitchByHash(
'joyEnableChance',
'joyEnableCCPK',
bot_hash
)
if flag_need == 1 and plugin_event != None:
Expand Down Expand Up @@ -359,8 +360,15 @@ def chance_custom_msg(plugin_event:OlivOS.API.Event, data:str, valDict:dict):
ChanceCustom.replyCore.getValDict(chance_valDict, plugin_event, OlivaDiceJoy.data.globalProc, event_name)
chance_valDict['innerVal']['bot_hash'] = plugin_event.bot_info.hash
chance_valDict['innerVal']['bot_hash_self'] = plugin_event.bot_info.hash
msg = ChanceCustom.replyReg.replyValueRegTotal(
data,
chance_valDict
)
try:
msg = ChanceCustom.replyReg.replyValueRegTotal(
data,
chance_valDict
)
except:
msg = data
OlivaDiceJoy.data.globalProc.log(3, traceback.format_exc(), [
('OlivaDice', 'default'),
('joyCCPK', 'default')
])
return msg

0 comments on commit 68a3400

Please sign in to comment.