差分
0ヴ (トーク) による版 174 を取り消し
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/src_ruby/dodontof/dice_adapter.rb
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/src_ruby/dodontof/dice_adapter.rb
ダイスロールと関係していることがすぐに分かるファイル名だが、実は大部分は独自の表からの情報の読み出しやファイル管理の処理となっている。
=== L7-L10:<code>DiceAdapter#initialize</code> ===
=== L7-L10:<code>DiceAdapter#initialize</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/src_ruby/dodontof/dice_adapter.rb#L36-L45
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/src_ruby/dodontof/dice_adapter.rb#L36-L45
独自の表について、ゲームタイプ(ゲームの識別子)および含まれるコマンドの情報を返す。<code>CgiDiceBot#getGameCommandInfos</code> を経由して <code>TableFileData#getGameCommandInfos</code> を呼び出している。
<syntaxhighlight lang="ruby">
<syntaxhighlight lang="ruby">
return commandInfos
return commandInfos
end
</syntaxhighlight>
=== L47-L63:<code>DiceAdapter#getBotTableInfosFromDir</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/src_ruby/dodontof/dice_adapter.rb#L47-L63
独自の表についての情報を取得する。<code>getGameCommandInfos</code> と似ているが、こちらの方が返される情報が詳しい?
<syntaxhighlight lang="ruby">
def getBotTableInfosFromDir
@logger.debug(@dir, 'getBotTableInfosFromDir dir')
require 'TableFileData'
isLoadCommonTable = false
tableFileData = TableFileData.new( isLoadCommonTable )
tableFileData.setDir(@dir, @diceBotTablePrefix)
tableInfos = tableFileData.getAllTableInfo
@logger.debug(tableInfos, "getBotTableInfosFromDir tableInfos")
tableInfos.sort!{|a, b| a["command"].to_i <=> b["command"].to_i}
@logger.debug(tableInfos, 'getBotTableInfosFromDir result tableInfos')
return tableInfos
end
</syntaxhighlight>
=== L65-L84:<code>DiceAdapter#addBotTableMain</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/src_ruby/dodontof/dice_adapter.rb#L65-L84
独自の表のファイルを保存する。
<syntaxhighlight lang="ruby">
def addBotTableMain(params)
@logger.debug("addBotTableMain Begin")
DodontoF::Utils.makeDir(@dir)
require 'TableFileData'
resultText = 'OK'
begin
creator = TableFileCreator.new(@dir, @diceBotTablePrefix, params)
creator.execute
rescue Exception => e
@logger.exception(e)
resultText = getLanguageKey( e.to_s )
end
@logger.debug(resultText, "addBotTableMain End resultText")
return resultText
end
</syntaxhighlight>
=== L86-L103:<code>DiceAdapter#changeBotTableMain</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/src_ruby/dodontof/dice_adapter.rb#L86-L103
独自の表のファイルを更新する。
<syntaxhighlight lang="ruby">
def changeBotTableMain(params)
@logger.debug("changeBotTableMain Begin")
require 'TableFileData'
resultText = 'OK'
begin
creator = TableFileEditer.new(@dir, @diceBotTablePrefix, params)
creator.execute
rescue Exception => e
@logger.exception(e)
resultText = getLanguageKey( e.to_s )
end
@logger.debug(resultText, "changeBotTableMain End resultText")
return resultText
end
</syntaxhighlight>
=== L105-L135:<code>DiceAdapter#removeBotTableMain</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/src_ruby/dodontof/dice_adapter.rb#L86-L103
独自の表のファイルを削除する。
<syntaxhighlight lang="ruby">
def removeBotTableMain(params)
@logger.debug("removeBotTableMain Begin")
command = params["command"]
require 'TableFileData'
isLoadCommonTable = false
tableFileData = TableFileData.new( isLoadCommonTable )
tableFileData.setDir(@dir, @diceBotTablePrefix)
tableInfos = tableFileData.getAllTableInfo
tableInfo = tableInfos.find{|i| i["command"] == command}
@logger.debug(tableInfo, "tableInfo")
return if( tableInfo.nil? )
fileName = tableInfo["fileName"]
@logger.debug(fileName, "fileName")
return if( fileName.nil? )
@logger.debug("isFile exist?")
return unless( File.exist?(fileName) )
begin
File.delete(fileName)
rescue Exception => e
@logger.exception(e)
end
@logger.debug("removeBotTableMain End")
end
end
</syntaxhighlight>
</syntaxhighlight>
<code>getDiceBotExtraTableDirName</code>([https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3727-L3729 L3727-L3729])では、<code>getRoomLocalSpaceDirName</code>([https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3262-L3265 L3262-L3265])、<code>getRoomLocalSpaceDirNameByRoomNo</code>([https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3267-L3273 L3267-L3273])を経由して、<code>$imageUploadDir</code> の中の部屋固有のディレクトリを返す。
<code>getDiceBotExtraTableDirName</code>([https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3727-L3729 L3727-L3729])では、<code>getRoomLocalSpaceDirName</code>([https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3262-L3265 L3262-L3265])、<code>getRoomLocalSpaceDirNameByRoomNo</code>([https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3267-L3273 L3267-L3273])を経由して、<code>$imageUploadDir</code> の中の部屋固有のディレクトリを返す。
=== L1193-L1210:<code>getWebIfServerInfo</code> ===
=== L1193-L1210:<code>DodontoFServer#getWebIfServerInfo</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L1193-L1210
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L1193-L1210
</syntaxhighlight>
</syntaxhighlight>
=== L2090:<code>getLoginInfo</code> ===
=== L2090:<code>DodontoFServer#getLoginInfo</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2090
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2090
</syntaxhighlight>
</syntaxhighlight>
=== L2266-L2280:<code>getDiceBotInfos</code> ===
=== L2266-L2280:<code>DodontoFServer#getDiceBotInfos</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2266-L2280
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2266-L2280
</syntaxhighlight>
</syntaxhighlight>
=== L2542-2556:<code>save</code>, <code>getDiceTableData</code> ===
=== L2542-2556:<code>DodontoFServer#save</code>, <code>getDiceTableData</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2542-2556
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2542-2556
</syntaxhighlight>
</syntaxhighlight>
=== L2806-L2817:<code>getBotTableInfos</code> ===
=== L2806-L2817:<code>DodontoFServer#getBotTableInfos</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2806-L2817
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2806-L2817
</syntaxhighlight>
</syntaxhighlight>
=== L2819-L2835:<code>addBotTable</code> ===
=== L2819-L2835:<code>DodontoFServer#addBotTable</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2819-L2835
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2819-L2835
</syntaxhighlight>
</syntaxhighlight>
=== L2837-L2849:<code>changeBotTable</code> ===
=== L2837-L2849:<code>DodontoFServer#changeBotTable</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2837-L2849
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2837-L2849
</syntaxhighlight>
</syntaxhighlight>
=== L2851-L2855:<code>removeBotTable</code> ===
=== L2851-L2855:<code>DodontoFServer#removeBotTable</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2851-L2855
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L2851-L2855
</syntaxhighlight>
</syntaxhighlight>
=== L3458-L3459:<code>loadSaveFileDataFilterByTargets</code> ===
=== L3458-L3459:<code>DodontoFServer#loadSaveFileDataFilterByTargets</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3458-L3459
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3458-L3459
</syntaxhighlight>
</syntaxhighlight>
=== L3511-L3531:<code>loadDiceBotTable</code>, <code>getDiceBotTableString</code> ===
=== L3511-L3531:<code>DodontoFServer#loadDiceBotTable</code>, <code>DodontoFServer#getDiceBotTableString</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3511-L3531
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3511-L3531
</syntaxhighlight>
</syntaxhighlight>
=== L3632-L3657:<code>sendDiceBotChatMessage</code> ===
=== L3632-L3657:<code>DodontoFServer#sendDiceBotChatMessage</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3632-L3657
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3632-L3657
</syntaxhighlight>
</syntaxhighlight>
=== L3659-L3669:<code>getDiceBotRepeatCount</code> ===
=== L3659-L3669:<code>DodontoFServer#getDiceBotRepeatCount</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3659-L3669
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3659-L3669
</syntaxhighlight>
</syntaxhighlight>
=== L3672-L3709:<code>sendDiceBotChatMessageOnece</code> ===
=== L3672-L3709:<code>DodontoFServer#sendDiceBotChatMessageOnece</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3672-L3709
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3672-L3709
</syntaxhighlight>
</syntaxhighlight>
=== L3672-L3725:<code>getRollDiceResult</code> ===
=== L3672-L3725:<code>DodontoFServer#getRollDiceResult</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3672-L3709
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3672-L3709
</syntaxhighlight>
</syntaxhighlight>
=== L3732-L3762:<code>getRolledMessage</code> ===
=== L3732-L3762:<code>DodontoFServer#getRolledMessage</code> ===
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3732-L3709
https://github.com/torgtaitai/DodontoF/blob/d3e4cc374885986efc761cfabbb19e4b35e815e0/DodontoFServer.rb#L3732-L3709