Thread: "Database node not owned" error
-
December 9th, 2012, 04:46 #11
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,563
OOB = out of band. It's a networking terminology used to denote a channel containing control information rather than data. In the case of FG, it's for messages between client and server not destined for the chat window.
Basically, the OOB mechanism is used to pass a LUA table from client to host on an init roll. When the host delivers message to self, it's just like it received one from client.
You don't need the whole "action" framework, just the OOB manager and making the right calls to the OOB Manager to generate and handle the OOB messages.
Looking at the current 3.5E ruleset:
C:\Users\John\AppData\Roaming\Fantasy Grounds II\rulesets\3.5E\base.xml
Code:Line 138: <script name="OOBManager" file="scripts/manager_oob.lua" />
Code:function onInit() OOBManager.registerOOBMsgHandler(OOB_MSGTYPE_APPLYINIT, handleApplyInit); ActionsManager.registerActionIcon("init", "action_roll"); ActionsManager.registerModHandler("init", modRoll); ActionsManager.registerResultHandler("init", onResolve); end function handleApplyInit(msgOOB) local nTotal = tonumber(msgOOB.nTotal) or 0; DB.setValue(msgOOB.sSourceCTNode .. ".initresult", "number", nTotal); end function notifyApplyInit(rSource, nTotal) if not rSource then return; end local msgOOB = {}; msgOOB.type = OOB_MSGTYPE_APPLYINIT; msgOOB.nTotal = nTotal; msgOOB.sSourceCTNode = rSource.sCTNode; Comm.deliverOOBMessage(msgOOB, ""); end
Code:function onResolve(rSource, rTarget, rRoll) local rMessage = ActionsManager.createActionMessage(rSource, rRoll); Comm.deliverChatMessage(rMessage); local nTotal = ActionsManager.total(rRoll); notifyApplyInit(rSource, nTotal); end
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks