#author("2023-12-30T12:28:35+00:00","default:iseki","iseki") #author("2023-12-30T12:28:44+00:00","default:iseki","iseki") ** Events and delegate functions [#ddbad7ff] - 略号 -- MM -> Money Module, MS -> Money Server, VW -> Viewer -- RS -> Region(Robust) Server, US -> User(Robust) Server, SC -> External Script -- AS -> Aurora Server *** Events [#p437f4da] **** MoneyTransferRequest [#m289cd83] - 他のアバターへの直接的な支払い,ギフト (Gift: 5001) - event MoneyTransferRequest OnMoneyTransferRequest; (IClientAPI.cs) - MM.MoneyTransferRequest() は MoneyTransferArgs と Scene を生成して MM.MoneyTransferAction() を起動している. MM.MoneyTransferRequest() -> MM.MoneyTransferAction() -> MM.TransferMoney() => XML RPC to MS ("TransferMoney") - オブジェクトを経由した,他のアバターへの間接的な支払い (PayObject: 5008) - LSL の money イベントが発生する MM.MoneyTransferRequest() -> MM.MoneyTransferAction() -> MM.TransferMoney() => XML RPC to MS ("TransferMoney") **** EconomyDataRequest [#w1e4235c] - event EconomyDataRequest OnEconomyDataRequest; (IClientAPI.cs) **** MoneyBalanceRequest [#f5c63c00] - event MoneyBalanceRequest OnMoneyBalanceRequest; (IClientAPI.cs) **** ParcelBuy [#b4471bdf] - event ParcelBuy OnParcelBuy; (IClientAPI.cs) **** ParcelBuyPass [#u466718e] - event ParcelBuyPass OnParcelBuyPass; (IClientAPI.cs) **** RequestPayPrice [#s5ddf548] - event RequestPayPrice OnRequestPayPrice; (IClientAPI.cs) **** OnObjectBuy [#ef8a0c53] - オブジェクト購入時に発生 (コピー,オリジナル,コンテンツ) (PayObject: 5008) - event ObjectBuy OnObjectBuy; (IClientAPI.cs) - ObjectBuy(), BuyObject() は Aurora/Modules/World/Entities/BuySell/BuySellModule.cs で定義 ObjectBuy() -> MM.Transfer() => XML RPC to MS ("TransferMoney") -> BuyObject() **** BuyObjectInventory [#t5e25a35] - event BuyObjectInventory OnBuyObjectInventory; (IClientAPI.cs) **** LandBuy [#be10ec33] - event LandBuy OnValidateBuyLan; (ISceneEntity.cs) ** Calling Sequence of Functions [#l66a8cdf] *** LSL [#bf809af9] **** llGiveMoney() [#s5a527b3] - Code: ObjectPays (5009) MM.ObjectGiveMoney() -> MM.TransferMoney() => XML RPC to MS ("TransferMoney") -> MM.ForceTransferMoney() => XML RPC to MS ("ForceTransferMoney") *** Buy Money from System [#h61acd3d] - Code: BuyMoney (5010) 1. VW => XML RPC to helper SC ("getCurrencyQuote") => Response to VW 2. VW => XML RPC to helper SC ("buyCurrency") -> SC.add_money() => XML RPC("AddBankerMoney") => MM => XML RPC("AddBankerMoney") => MS => Response to VW - [[XML>../../currency.php#ad93a73d]] *** Buy Land [#n4a0df9d] - Code: LandSale (5002) - OnParcelBuy event, ProcessParcelBuy() は Aurora の Land/ParcelManagementModule.cs で定義 1. VW => XML RPC to helper SC ("preflightBuyLandPrep") => Response to VW 2. OnParcelBuy event -> ProcessParcelBuy() -> MM.TransferMoney() => XML RPC to MS ("TransferMoney") *** Upload Inventory [#of53fb6b] 1. event -> AS.NewAgentInventoryRequest() -> AS.RequestUploadCovered() => XML RPC to RS ("UploadCovered") 2. event -> AS.UploadCompleteHandler() -> AS.RequestUploadCharge() => XML RPC to RS ("UploadCharge") - TCP: OpenSim/Services/CapsService/CAPModules/InventoryCAPS.cs: NewAgentInventoryRequest() - TCP: OpenSim/Services/CapsService/CAPModules/InventoryCAPS.cs: UploadCompleteHandler() - UDP: OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs: HandleUDPUploadRequest() - %%OpenSim/Services/CapsService/CAPModules/InventoryCAPS.cs: NewAgentInventoryRequest()%% - %%OpenSim/Services/CapsService/CAPModules/InventoryCAPS.cs: HandleInventoryItemCreate()%% ---- - Aurora-Sim では seed_capability として Robust サーバ(Aurora.Server)が指定される( OpenSim では Regionサーバ) - 従って,Uoload では Regionサーバでイベントが発生せず,Robustサーバ(Aurora.Server) でイベントが発生する. + Robust サーバ(Aurora.Server) に MoneyModule をロードする. -- 通常のモジュールの読み込みとしては? -- OpenSim/Services/XXX/ にプログラムを作って,サービスとしてロードさせる.サービスは AuroraServerConfig/Main.ini の [Handlers]セクションで指定. -- 詳細不明で断念. + seed_capability を強制的に Regionサーバにする. -- OpenSim/Services/LLLoginService/LLLoginResponse.cs での LLLoginResponseクラスのコンストラクタ LLLoginResponse(...) で SeedCapability = destination.ServerURI + CapsUtil.GetCapsSeedPath(aCircuit.CapsPath); を追加する. -- 上記の手法により,seed_capability を強制的に Regionサーバにすることは可能. -- この場合,OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs: HandleUDPUploadRequest() がトリガーされる. -- ただし,Regionサーバで Capabilityが定義されないため,Assetの Uploadの通信が UDPとなる(遅い!!)-> 断念. -- 因みに,OpenSim ではこの部分には FillOutSeedCap() という関数が使用されている. FillOutSeedCap(aCircuit, destination, clientIP); private void FillOutSeedCap(AgentCircuitData aCircuit, GridRegion destination, IPEndPoint ipepClient) { SeedCapability = destination.ServerURI + CapsUtil.GetCapsSeedPath(aCircuit.CapsPath); } + Robust サーバ(Aurora.Server) から Regionサーバの MoneyModule を呼び出す. -- penSim/Services/CapsService/CAPModules/InventoryCAPS.cs 内でトリガーされる関数から XML RPCを使用して Regionサーバにアクセス. -- この手法を採用!! *** Create Group [#h4ccd93a] event -> CreateGroup() -> MM.AmountCharge() -> MM.ApplyCharge() -> MM.PayMoneyCharge() => XML RPC to MS ("PayMoneyCharge") - OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs: CreateGroup() *** XML RPC (from MoneyServer): [#q1135f89] XML RPC from MS ("OnMoneyTransfered") => MM.OnMoneyTransferedHandler() -> money() event XML RPC from MS ("UpdateBalance") => MM.BalanceUpdateHandler() => Notify to VW *** XML RPC (from external script) [#z94867d7] XML RPC from SC ("UpdateBalance") => MM.BalanceUpdateHandler() => Notify to VW XML RPC from SC ("GetBalance") => MM.GetBalanceHandler() => XML RPC to MS ("GetBalance") => Response to SC XML RPC from SC ("UserAlert") => MM.UserAlertHandler() => Message to VW - SC.AddBankerMoney: Transaction Type is BuyMoney (5010) - SC.SendMoney: Transaction Type is ReferBonus (5003) XML RPC from SC ("AddBankerMoney") => MM.AddBankerMoneyHandler() -> MM.AddBankerMoney() => XML RPC to MS ("AddBankerMoney") => MS.handleAddBankerMoney() XML RPC from SC ("SendMoney") => MM.SendMoneyHandler() -> MM.SendMoney() => XML RPC to MS ("SendMoney") *** XML RPC (from Aurora.Server) [#m1c47cbe] XML RPC from AS ("UploadCovered") => MM.UploadCoveredHandler() => XML RPC to MS ("GetBalance") XML RPC from AS ("UploadCharge") => MM.UploadChargeHandler() => XML RPC to MS ("PayMoneyCharge") #br