Skip to content

Commit

Permalink
初始化项目
Browse files Browse the repository at this point in the history
  • Loading branch information
lunzhiPenxil committed Dec 29, 2023
1 parent 1c41c20 commit 26b0caf
Show file tree
Hide file tree
Showing 12 changed files with 1,717 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
PACK_NAME: ""
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Pack
run: |
if [ ! $PACK_NAME ]; then
PACK_NAME=${GITHUB_REPOSITORY##*/}
fi
echo "PACK_NAME=$PACK_NAME" >> $GITHUB_ENV
cd $PACK_NAME
zip -r ../$PACK_NAME.opk ./
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: ${{ env.PACK_NAME }}.opk
- name: Release
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GH_TOKEN }}
files: ${{ env.PACK_NAME }}.opk
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GNU AFFERO GENERAL PUBLIC LICENSE
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007

Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Expand Down
661 changes: 661 additions & 0 deletions OlivaStoryCore/LICENSE

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions OlivaStoryCore/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- encoding: utf-8 -*-
'''
_______________________ _________________________________________
__ __ \__ /____ _/_ | / /__ |__ __ \___ _/_ ____/__ ____/
_ / / /_ / __ / __ | / /__ /| |_ / / /__ / _ / __ __/
/ /_/ /_ /____/ / __ |/ / _ ___ | /_/ /__/ / / /___ _ /___
\____/ /_____/___/ _____/ /_/ |_/_____/ /___/ \____/ /_____/
@File : __init__.py
@Author : lunzhiPenxil仑质
@Contact : [email protected]
@License : AGPL
@Copyright : (C) 2020-2021, OlivOS-Team
@Desc : None
'''

import OlivaDiceCore
from . import main
from . import storyEngine
from . import msgReply
from . import msgCustom
from . import msgCustomManager
from . import data
from . import userConfig
18 changes: 18 additions & 0 deletions OlivaStoryCore/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name" : "OlivaStory核心模块",
"author" : "lunzhiPenxil",
"namespace" : "OlivaStoryCore",
"message_mode" : "old_string",
"info" : "本模块为OlivaStory的核心模块,实现了文游引擎的主要功能。",
"version" : "3.0.0",
"svn" : 1,
"compatible_svn" : 101,
"priority" : 20045,
"support" : [
{
"sdk" : "all",
"platform" : "all",
"model" : "all"
}
]
}
24 changes: 24 additions & 0 deletions OlivaStoryCore/data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- encoding: utf-8 -*-
'''
_______________________ _________________________________________
__ __ \__ /____ _/_ | / /__ |__ __ \___ _/_ ____/__ ____/
_ / / /_ / __ / __ | / /__ /| |_ / / /__ / _ / __ __/
/ /_/ /_ /____/ / __ |/ / _ ___ | /_/ /__/ / / /___ _ /___
\____/ /_____/___/ _____/ /_/ |_/_____/ /___/ \____/ /_____/
@File : data.py
@Author : lunzhiPenxil仑质
@Contact : [email protected]
@License : AGPL
@Copyright : (C) 2020-2021, OlivOS-Team
@Desc : None
'''


OlivaStoryCore_ver = '3.0.0'
OlivaStoryCore_svn = 1
OlivaStoryCore_ver_short = '%s(%s)' % (str(OlivaStoryCore_ver), str(OlivaStoryCore_svn))

dataDirRoot = './plugin/data/OlivaStory'

gProc = None
37 changes: 37 additions & 0 deletions OlivaStoryCore/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- encoding: utf-8 -*-
'''
_______________________ _________________________________________
__ __ \__ /____ _/_ | / /__ |__ __ \___ _/_ ____/__ ____/
_ / / /_ / __ / __ | / /__ /| |_ / / /__ / _ / __ __/
/ /_/ /_ /____/ / __ |/ / _ ___ | /_/ /__/ / / /___ _ /___
\____/ /_____/___/ _____/ /_/ |_/_____/ /___/ \____/ /_____/
@File : main.py
@Author : lunzhiPenxil仑质
@Contact : [email protected]
@License : AGPL
@Copyright : (C) 2020-2021, OlivOS-Team
@Desc : None
'''

import OlivOS
import OlivaStoryCore
import OlivaDiceCore

class Event(object):
def init(plugin_event, Proc):
OlivaStoryCore.msgReply.unity_init(plugin_event, Proc)

def init_after(plugin_event, Proc):
OlivaDiceCore.crossHook.dictHookList['model'].append(['OlivaStoryCore', OlivaStoryCore.data.OlivaStoryCore_ver_short])
OlivaStoryCore.msgReply.data_init(plugin_event, Proc)
OlivaStoryCore.storyEngine.data_init(plugin_event, Proc)

def private_message(plugin_event, Proc):
OlivaStoryCore.msgReply.unity_reply(plugin_event, Proc)

def group_message(plugin_event, Proc):
OlivaStoryCore.msgReply.unity_reply(plugin_event, Proc)

def poke(plugin_event, Proc):
pass
45 changes: 45 additions & 0 deletions OlivaStoryCore/msgCustom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- encoding: utf-8 -*-
'''
_______________________ _________________________________________
__ __ \__ /____ _/_ | / /__ |__ __ \___ _/_ ____/__ ____/
_ / / /_ / __ / __ | / /__ /| |_ / / /__ / _ / __ __/
/ /_/ /_ /____/ / __ |/ / _ ___ | /_/ /__/ / / /___ _ /___
\____/ /_____/___/ _____/ /_/ |_/_____/ /___/ \____/ /_____/
@File : msgCustom.py
@Author : lunzhiPenxil仑质
@Contact : [email protected]
@License : AGPL
@Copyright : (C) 2020-2021, OlivOS-Team
@Desc : None
'''

import OlivOS
import OlivaDiceCore
import OlivaStoryCore

dictConsoleSwitchTemplate = {
'default' : {}
}

dictStrCustomDict = {}

dictStrCustom = {
'strStoryCoreStoryTall': '{tStoryCoreResult}\n\n{tStoryCoreSelection}',
'strStoryCoreStoryTallNone': '故事不存在',
'strStoryCoreStoryTallBreak': '故事中断了',
'strStoryCoreStoryTallEnd': '故事结束了'
}

dictStrConst = {}

dictGValue = {}

dictTValue = {
'tStoryCoreResult': 'N/A',
'tStoryCoreSelection': 'N/A'
}

dictHelpDocTemp = {}

dictUserConfigNoteDefault = {}
45 changes: 45 additions & 0 deletions OlivaStoryCore/msgCustomManager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- encoding: utf-8 -*-
'''
_______________________ _________________________________________
__ __ \__ /____ _/_ | / /__ |__ __ \___ _/_ ____/__ ____/
_ / / /_ / __ / __ | / /__ /| |_ / / /__ / _ / __ __/
/ /_/ /_ /____/ / __ |/ / _ ___ | /_/ /__/ / / /___ _ /___
\____/ /_____/___/ _____/ /_/ |_/_____/ /___/ \____/ /_____/
@File : msgCustomManager.py
@Author : lunzhiPenxil仑质
@Contact : [email protected]
@License : AGPL
@Copyright : (C) 2020-2021, OlivOS-Team
@Desc : None
'''

import OlivOS
import OlivaDiceCore
import OlivaStoryCore

import os
import json

def initMsgCustom(bot_info_dict):
for bot_info_dict_this in bot_info_dict:
if bot_info_dict_this not in OlivaDiceCore.msgCustom.dictStrCustomDict:
OlivaDiceCore.msgCustom.dictStrCustomDict[bot_info_dict_this] = {}
for dictStrCustom_this in OlivaStoryCore.msgCustom.dictStrCustom:
if dictStrCustom_this not in OlivaDiceCore.msgCustom.dictStrCustomDict[bot_info_dict_this]:
OlivaDiceCore.msgCustom.dictStrCustomDict[bot_info_dict_this][dictStrCustom_this] = OlivaStoryCore.msgCustom.dictStrCustom[dictStrCustom_this]
for dictHelpDoc_this in OlivaStoryCore.msgCustom.dictHelpDocTemp:
if dictHelpDoc_this not in OlivaDiceCore.helpDocData.dictHelpDoc[bot_info_dict_this]:
OlivaDiceCore.helpDocData.dictHelpDoc[bot_info_dict_this][dictHelpDoc_this] = OlivaStoryCore.msgCustom.dictHelpDocTemp[dictHelpDoc_this]
OlivaDiceCore.msgCustom.dictStrConst.update(OlivaStoryCore.msgCustom.dictStrConst)
OlivaDiceCore.msgCustom.dictGValue.update(OlivaStoryCore.msgCustom.dictGValue)
OlivaDiceCore.msgCustom.dictTValue.update(OlivaStoryCore.msgCustom.dictTValue)
OlivaDiceCore.userConfig.dictUserConfigNoteDefault.update(OlivaStoryCore.msgCustom.dictUserConfigNoteDefault)
for dictConsoleSwitchTemplate_this in OlivaStoryCore.msgCustom.dictConsoleSwitchTemplate:
if dictConsoleSwitchTemplate_this in OlivaDiceCore.console.dictConsoleSwitchTemplate:
OlivaDiceCore.console.dictConsoleSwitchTemplate[dictConsoleSwitchTemplate_this].update(
OlivaStoryCore.msgCustom.dictConsoleSwitchTemplate[dictConsoleSwitchTemplate_this]
)
OlivaDiceCore.console.initConsoleSwitchByBotDict(bot_info_dict)
OlivaDiceCore.console.readConsoleSwitch()
OlivaDiceCore.console.saveConsoleSwitch()
Loading

0 comments on commit 26b0caf

Please sign in to comment.