EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RamProxyService.h
Go to the documentation of this file.
1 /*
2  ------------------------------------------------------------------------------------
3  LICENSE:
4  ------------------------------------------------------------------------------------
5  This file is part of EVEmu: EVE Online Server Emulator
6  Copyright 2006 - 2021 The EVEmu Team
7  For the latest information visit https://evemu.dev
8  ------------------------------------------------------------------------------------
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License along with
19  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20  Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21  http://www.gnu.org/copyleft/lesser.txt.
22  ------------------------------------------------------------------------------------
23  Author: Zhur
24  Updates: Allan
25 */
26 
27 #ifndef __RAM_PROXY_SERVICE__H__
28 #define __RAM_PROXY_SERVICE__H__
29 
30 #include "PyService.h"
31 
32 
33 class RamProxyService : public PyService {
34 public:
36  virtual ~RamProxyService();
37 
38 private:
39  class Dispatcher;
40  Dispatcher *const m_dispatch;
41 
42  PyCallable_DECL_CALL(GetJobs2);
43  PyCallable_DECL_CALL(InstallJob);
44  PyCallable_DECL_CALL(CompleteJob);
45  PyCallable_DECL_CALL(AssemblyLinesGet);
46  PyCallable_DECL_CALL(AssemblyLinesSelect);
47  PyCallable_DECL_CALL(GetRelevantCharSkills);
48  PyCallable_DECL_CALL(AssemblyLinesSelectCorp);
49  PyCallable_DECL_CALL(AssemblyLinesSelectPublic);
50  PyCallable_DECL_CALL(AssemblyLinesSelectPrivate);
51  PyCallable_DECL_CALL(AssemblyLinesSelectAlliance);
52  PyCallable_DECL_CALL(UpdateAssemblyLineConfigurations);
53 
54 };
55 
56 #endif
57 
58 /* InstallJob data
59  *
60  *
61  * if needInputFlag:
62  * ownerInput, flagInput = quoteData.ownerInputAndflagInput
63  * else:
64  * ownerInput, flagInput = None, const.flagNone
65  * if needOutputFlag:
66  * ownerOutput, flagOutput = quoteData.ownerOutputAndflagOutput
67  * else:
68  * ownerOutput, flagOutput = None, const.flagNone
69  * settings.user.ui.Set('rmInputCombo', (ownerInput, flagInput))
70  * settings.user.ui.Set('rmOutputCombo', (ownerOutput, flagOutput))
71  * if util.IsStation(quoteData.containerID):
72  * invLocationGroupID = const.groupStation
73  * elif quoteData.containerID == session.shipid:
74  * invLocationGroupID = [const.groupSolarSystem, const.groupStation][session.locationid == session.stationid]
75  * else:
76  * invLocationGroupID = const.groupSolarSystem
77  * invLocation = []
78  * if ownerInput == session.charid:
79  * if flagInput == const.flagCargo:
80  * invLocation = [session.locationid, invLocationGroupID]
81  * bomLocationData = [[session.locationid, invLocationGroupID], [[quoteData.containerID, session.charid, flagInput]], []]
82  * elif flagInput == const.flagHangar:
83  * invLocation = [quoteData.containerID, invLocationGroupID]
84  * bomLocationData = [[quoteData.containerID, invLocationGroupID], [[quoteData.containerID, session.charid, flagInput]], []]
85  * else:
86  * raise UserError('RamInstalledItemBadLocation')
87  * elif ownerInput == session.corpid:
88  * if flagInput == const.flagCargo:
89  * raise UserError('RamCorpInstalledItemNotInCargo')
90  * elif flagInput in (const.flagHangar,
91  * const.flagCorpSAG2,
92  * const.flagCorpSAG3,
93  * const.flagCorpSAG4,
94  * const.flagCorpSAG5,
95  * const.flagCorpSAG6,
96  * const.flagCorpSAG7):
97  * if not quoteData.containerID:
98  * raise UserError('RamPleasePickAnInstalltion')
99  * if util.IsStation(quoteData.containerID):
100  * offices = sm.GetService('corp').GetMyCorporationsOffices().SelectByUniqueColumnValues('stationID', [quoteData.containerID])
101  * officeFolderID = None
102  * officeID = None
103  * if offices and len(offices):
104  * for office in offices:
105  * if quoteData.containerID == office.stationID:
106  * officeFolderID = office.officeFolderID
107  * officeID = office.officeID
108  *
109  * if officeID is None:
110  * raise UserError('RamCorpBOMItemNoSuchOffice', {'location': quoteData.containerID})
111  * invLocation = [quoteData.containerID, const.groupStation]
112  * path = []
113  * path.append([quoteData.containerID, const.ownerStation, 0])
114  * path.append([officeFolderID, session.corpid, const.flagHangar])
115  * path.append([officeID, session.corpid, flagInput])
116  * bomLocationData = [invLocation, path, []]
117  * elif util.IsSolarSystem(quoteData.containerLocationID):
118  * invLocation = [quoteData.containerLocationID, const.groupSolarSystem]
119  * path = []
120  * path.append([quoteData.containerID, session.corpid, flagInput])
121  * bomLocationData = [invLocation, path, []]
122  * else:
123  * raise UserError('RamPleasePickAnInstalltion')
124  * else:
125  * raise UserError('RamNotYourItemToInstall')
126  * else:
127  * bomLocationData = None
128  * if not needInputFlag:
129  * if ownerID in (session.charid, session.corpid):
130  * invLocation = [quoteData.containerID, invLocationGroupID]
131  * bomLocationData = [[quoteData.containerID, invLocationGroupID], [[const.flagNone]], []]
132  * if bomLocationData is None:
133  * raise UserError('RamNotYourItemToInstall')
134  * installedItemLocationData = sm.GetService('manufacturing').GetPathToItem(quoteData.blueprint)
135  * installationLocationData = [invLocation, [], [quoteData.containerID]]
136  * installationLocationData[2].append(quoteData.assemblyLineID)
137  * calculateQuoteLabel = localization.GetByLabel('UI/ScienceAndIndustry/ScienceAndIndustryWindow/CalculatingQuote')
138  * gettingQuoteLabel = localization.GetByLabel('UI/ScienceAndIndustry/ScienceAndIndustryWindow/GettingQuoteFromInstallation')
139  * sm.GetService('loading').ProgressWnd(calculateQuoteLabel, gettingQuoteLabel, 1, 3)
140  * blue.pyos.synchro.SleepWallclock(0)
141  * quote = None
142  * try:
143  * job = sm.ProxySvc('ramProxy').InstallJob(installationLocationData, installedItemLocationData, bomLocationData, flagOutput, quoteData.buildRuns, quoteData.activityID, quoteData.licensedProductionRuns, not quoteData.ownerFlag, 'blah', quoteOnly=1, installedItem=quoteData.blueprint, maxJobStartTime=quoteData.assemblyLine.nextFreeTime + 1 * MIN, inventionItems=quoteData.inventionItems, inventionOutputItemID=quoteData.inventionItems.outputType)
144  * quote = job.quote
145  * if job.installedItemID:
146  * quoteData.blueprint.itemID = job.installedItemID
147  * installedItemLocationData[2] = [job.installedItemID]
148  * except UserError as e:
149  * cancelingQuoteLabel = localization.GetByLabel('UI/ScienceAndIndustry/ScienceAndIndustryWindow/CancellingQuote')
150  * quoteNotAcceptedLabel = localization.GetByLabel('UI/ScienceAndIndustry/ScienceAndIndustryWindow/QuoteNotAccepted')
151  * sm.GetService('loading').ProgressWnd(cancelingQuoteLabel, quoteNotAcceptedLabel, 1, 1)
152  * raise
153  */
154 
155 /* personal job
156  * 21:48:04 [Service] ramProxy::InstallJob()
157  * 21:48:04 [ManufDump] RamProxyService::Handle_InstallJob() - size 9
158  * 21:48:04 [ManufDump] Call Arguments:
159  * 21:48:04 [ManufDump] Tuple: 9 elements
160  * 21:48:04 [ManufDump] [ 0] List: 3 elements AssemblyLineData
161  * 21:48:04 [ManufDump] [ 0] [ 0] List: 2 elements location,
162  * 21:48:04 [ManufDump] [ 0] [ 0] [ 0] Integer: 60014140 lineLocationID (station, ss, ship)
163  * 21:48:04 [ManufDump] [ 0] [ 0] [ 1] Integer: 15 lineLocationGroupID
164  * 21:48:04 [ManufDump] [ 0] [ 1] List: Empty [], (empty)
165  * 21:48:04 [ManufDump] [ 0] [ 2] List: 2 elements container
166  * 21:48:04 [ManufDump] [ 0] [ 2] [ 0] Integer: 60014140 lineContainerID
167  * 21:48:04 [ManufDump] [ 0] [ 2] [ 1] Integer: 117701 AssemblyLineID
168  * 21:48:04 [ManufDump] [ 1] List: 3 elements bpData
169  * 21:48:04 [ManufDump] [ 1] [ 0] List: 2 elements bpLocationData,
170  * 21:48:04 [ManufDump] [ 1] [ 0] [ 0] Integer: 60014140 bpLocationID
171  * 21:48:04 [ManufDump] [ 1] [ 0] [ 1] Integer: 15 bpLocationGroupID
172  * 21:48:04 [ManufDump] [ 1] [ 1] List: 1 elements bpLocPath
173  * 21:48:04 [ManufDump] [ 1] [ 1] [ 0] List: 3 elements bp PathElement
174  * 21:48:04 [ManufDump] [ 1] [ 1] [ 0] [ 0] Integer: 60014140 locationID
175  * 21:48:04 [ManufDump] [ 1] [ 1] [ 0] [ 1] Integer: 90000000 ownerID
176  * 21:48:04 [ManufDump] [ 1] [ 1] [ 0] [ 2] Integer: 4 flagID
177  * 21:48:04 [ManufDump] [ 1] [ 2] List: 1 elements bpItemData
178  * 21:48:04 [ManufDump] [ 1] [ 2] [ 0] Integer: 140024212 bpItemID
179  * 21:48:04 [ManufDump] [ 2] List: 3 elements bomData (personal)
180  * 21:48:04 [ManufDump] [ 2] [ 0] List: 2 elements bomLocation,
181  * 21:48:04 [ManufDump] [ 2] [ 0] [ 0] Integer: 60014140 bomLocationID
182  * 21:48:04 [ManufDump] [ 2] [ 0] [ 1] Integer: 15 bomLocationGroupID
183  * 21:48:04 [ManufDump] [ 2] [ 1] List: 1 elements bomLocPath
184  * 21:48:04 [ManufDump] [ 2] [ 1] [ 0] List: 3 elements bom PathElement
185  * 21:48:04 [ManufDump] [ 2] [ 1] [ 0] [ 0] Integer: 60014140 locationID
186  * 21:48:04 [ManufDump] [ 2] [ 1] [ 0] [ 1] Integer: 90000000 ownerID
187  * 21:48:04 [ManufDump] [ 2] [ 1] [ 0] [ 2] Integer: 4 flagID
188  * 21:48:04 [ManufDump] [ 2] [ 2] List: Empty empty in station
189  * 21:48:04 [ManufDump] [ 3] Integer: 4 outputFlag
190  * 21:48:04 [ManufDump] [ 4] Integer: 10 jobRuns
191  * 21:48:04 [ManufDump] [ 5] Integer: 1 activityID
192  * 21:48:04 [ManufDump] [ 6] Integer: 0 copyRuns (populated on copy)
193  * 21:48:04 [ManufDump] [ 7] Boolean: false isCorpJob
194  * 21:48:04 [ManufDump] [ 8] String: 'blah' this is hard-coded in client
195  */
196 /* corp job
197  * 00:32:22 [Service] ramProxy::InstallJob()
198  * 00:32:22 [ManufDump] RamProxyService::Handle_InstallJob() - size 9
199  * 00:32:22 [ManufDump] Call Arguments:
200  * 00:32:22 [ManufDump] Tuple: 9 elements
201  * 00:32:22 [ManufDump] [ 0] List: 3 elements AssemblyLineData
202  * 00:32:22 [ManufDump] [ 0] [ 0] List: 2 elements location
203  * 00:32:22 [ManufDump] [ 0] [ 0] [ 0] Integer: 60014140 lineLocationID (station, ss, ship)
204  * 00:32:22 [ManufDump] [ 0] [ 0] [ 1] Integer: 15 lineLocationGroupID
205  * 00:32:22 [ManufDump] [ 0] [ 1] List: Empty [], (empty)
206  * 00:32:22 [ManufDump] [ 0] [ 2] List: 2 elements container
207  * 00:32:22 [ManufDump] [ 0] [ 2] [ 0] Integer: 60014140 lineContainerID
208  * 00:32:22 [ManufDump] [ 0] [ 2] [ 1] Integer: 117703 AssemblyLineID
209  * 00:32:22 [ManufDump] [ 1] List: 3 elements bpData
210  * 00:32:22 [ManufDump] [ 1] [ 0] List: 2 elements bpLocationData
211  * 00:32:22 [ManufDump] [ 1] [ 0] [ 0] Integer: 60014140 bpLocationID
212  * 00:32:22 [ManufDump] [ 1] [ 0] [ 1] Integer: 15 bpLocationGroupID
213  * 00:32:22 [ManufDump] [ 1] [ 1] List: 3 elements bpLocPath PathElement
214  * 00:32:22 [ManufDump] [ 1] [ 1] [ 0] List: 3 elements pathLocationData
215  * 00:32:22 [ManufDump] [ 1] [ 1] [ 0] [ 0] Integer: 60014140 pathLocationID
216  * 00:32:22 [ManufDump] [ 1] [ 1] [ 0] [ 1] Integer: 4 pathFlagID/ownerStation
217  * 00:32:22 [ManufDump] [ 1] [ 1] [ 0] [ 2] Integer: 0 zero
218  * 00:32:22 [ManufDump] [ 1] [ 1] [ 1] List: 3 elements officeLocationData
219  * 00:32:22 [ManufDump] [ 1] [ 1] [ 1] [ 0] Integer: 66014140 officeFolderID
220  * 00:32:22 [ManufDump] [ 1] [ 1] [ 1] [ 1] Integer: 98000001 officeLocCorpID
221  * 00:32:22 [ManufDump] [ 1] [ 1] [ 1] [ 2] Integer: 4 officeLocFlagID
222  * 00:32:22 [ManufDump] [ 1] [ 1] [ 2] List: 3 elements officeData
223  * 00:32:22 [ManufDump] [ 1] [ 1] [ 2] [ 0] Integer: 100000000 officeID
224  * 00:32:22 [ManufDump] [ 1] [ 1] [ 2] [ 1] Integer: 98000001 officeCorpID
225  * 00:32:22 [ManufDump] [ 1] [ 1] [ 2] [ 2] Integer: 4 officeFlagID
226  * 00:32:22 [ManufDump] [ 1] [ 2] List: 1 elements bpItemData
227  * 00:32:22 [ManufDump] [ 1] [ 2] [ 0] Integer: 140024209 bpItemID
228  * 00:32:22 [ManufDump] [ 2] List: 3 elements bomData (corp)
229  * 00:32:22 [ManufDump] [ 2] [ 0] List: 2 elements bomLocation
230  * 00:32:22 [ManufDump] [ 2] [ 0] [ 0] Integer: 60014140 bomLocationID
231  * 00:32:22 [ManufDump] [ 2] [ 0] [ 1] Integer: 15 bomLocationGroupID
232  * 00:32:22 [ManufDump] [ 2] [ 1] List: 3 elements bomLocPath PathElement
233  * 00:32:22 [ManufDump] [ 2] [ 1] [ 0] List: 3 elements pathLocationData
234  * 00:32:22 [ManufDump] [ 2] [ 1] [ 0] [ 0] Integer: 60014140 pathLocationID
235  * 00:32:22 [ManufDump] [ 2] [ 1] [ 0] [ 1] Integer: 4 pathFlagID
236  * 00:32:22 [ManufDump] [ 2] [ 1] [ 0] [ 2] Integer: 0 zero
237  * 00:32:22 [ManufDump] [ 2] [ 1] [ 1] List: 3 elements officeLocationData
238  * 00:32:22 [ManufDump] [ 2] [ 1] [ 1] [ 0] Integer: 66014140 officeFolderID
239  * 00:32:22 [ManufDump] [ 2] [ 1] [ 1] [ 1] Integer: 98000001 officeLocCorpID
240  * 00:32:22 [ManufDump] [ 2] [ 1] [ 1] [ 2] Integer: 4 officeLocFlagID
241  * 00:32:22 [ManufDump] [ 2] [ 1] [ 2] List: 3 elements officeData
242  * 00:32:22 [ManufDump] [ 2] [ 1] [ 2] [ 0] Integer: 100000000 officeID
243  * 00:32:22 [ManufDump] [ 2] [ 1] [ 2] [ 1] Integer: 98000001 officeCorpID
244  * 00:32:22 [ManufDump] [ 2] [ 1] [ 2] [ 2] Integer: 4 officeFlagID
245  * 00:32:22 [ManufDump] [ 2] [ 2] List: Empty empty for station
246  * 00:32:22 [ManufDump] [ 3] Integer: 4 outputFlag
247  * 00:32:22 [ManufDump] [ 4] Integer: 10 jobRuns
248  * 00:32:22 [ManufDump] [ 5] Integer: 1 activityID
249  * 00:32:22 [ManufDump] [ 6] Integer: 0 copyRuns (populated on copy)
250  * 00:32:22 [ManufDump] [ 7] Boolean: true isCorpJob
251  * 00:32:22 [ManufDump] [ 8] String: 'blah'
252  */
RamProxyService(PyServiceMgr *mgr)
Dispatcher *const m_dispatch
PyCallable_DECL_CALL(GetJobs2)
virtual ~RamProxyService()