EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ContractProxy.cpp
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: Captnoord
24  Rewrite: Allan
25 */
26 
27 #include "eve-server.h"
28 
29 #include "PyServiceCD.h"
30 #include "contract/ContractProxy.h"
31 
33 
35 : PyService(mgr, "contractProxy"),
36  m_dispatch(new Dispatcher(this))
37 {
38  _SetCallDispatcher(m_dispatch);
39 
40  PyCallable_REG_CALL(ContractProxy, GetContract);
41  PyCallable_REG_CALL(ContractProxy, CreateContract);
42  PyCallable_REG_CALL(ContractProxy, DeleteContract);
43  PyCallable_REG_CALL(ContractProxy, AcceptContract);
44  PyCallable_REG_CALL(ContractProxy, GetLoginInfo);
45  PyCallable_REG_CALL(ContractProxy, SearchContracts);
46  PyCallable_REG_CALL(ContractProxy, NumOutstandingContracts);
47  PyCallable_REG_CALL(ContractProxy, CollectMyPageInfo);
48  PyCallable_REG_CALL(ContractProxy, GetItemsInStation);
49  PyCallable_REG_CALL(ContractProxy, GetContractListForOwner);
50  PyCallable_REG_CALL(ContractProxy, GetMyExpiredContractList);
51  /*
52  *
53  ret = self.contractSvc.CompleteContract(contractID, const.conStatusFinished)
54  return self.contractSvc.CompleteContract(contractID, const.conStatusRejected)
55  return self.contractSvc.PlaceBid(contractID, bid, forCorp)
56  return self.contractSvc.FinishAuction(contractID, isIssuer)
57  ret = self.contractSvc.SplitStack(stationID, itemID, qty, forCorp, flag)
58  return self.contractSvc.GetItemsInContainer(stationID, containerID, forCorp, flag)
59  return self.contractSvc.GetItemsInStation(stationID, forCorp)
60  return self.contractSvc.DeleteNotification(contractID, forCorp)
61  info = self.contractSvc.GetCourierContractFromItemID(itemID)
62  */
63 }
64 
66 {
67  delete m_dispatch;
68 }
69 
74 PyResult ContractProxy::Handle_SearchContracts(PyCallArgs &call) {
75  /*
76  * ret = sm.ProxySvc('contractProxy').SearchContracts(itemTypes=itemTypes, itemTypeName=itemTypeName, itemCategoryID=itemCategoryID, itemGroupID=itemGroupID, contractType=contractType, securityClasses=securityClasses, locationID=locationID, endLocationID=endLocationID, issuerID=issuerID, minPrice=minPrice, maxPrice=maxPrice, minReward=minReward, maxReward=maxReward, minCollateral=minCollateral, maxCollateral=maxCollateral, minVolume=minVolume, maxVolume=maxVolume, excludeTrade=excludeTrade, excludeMultiple=excludeMultiple, excludeNoBuyout=excludeNoBuyout, availability=availability, description=description, searchHint=searchHint, sortBy=sortBy, sortDir=sortDir, startNum=startNum)
77  * contracts = ret.contracts
78  * numFound = ret.numFound
79  * searchTime = ret.searchTime
80  * maxResults = ret.maxResults
81  *
82  *
83  * AttributeError: 'NoneType' object has no attribute 'contracts'
84  */
85 
86  /* client call....
87  *
88  [PySubStream 359 bytes]
89  [PyTuple 4 items]
90  [PyInt 1]
91  [PyString "SearchContracts"]
92  [PyTuple 0 items]
93  [PyDict 27 kvp]
94  [PyString "itemTypeName"]
95  [PyNone]
96  [PyString "itemCategoryID"]
97  [PyNone]
98  [PyString "description"]
99  [PyNone]
100  [PyString "issuerID"]
101  [PyNone]
102  [PyString "excludeMultiple"]
103  [PyInt 0]
104  [PyString "minCollateral"]
105  [PyNone]
106  [PyString "excludeNoBuyout"]
107  [PyNone]
108  [PyString "securityClasses"]
109  [PyNone]
110  [PyString "maxVolume"]
111  [PyNone]
112  [PyString "endLocationID"]
113  [PyNone]
114  [PyString "maxCollateral"]
115  [PyNone]
116  [PyString "contractType"]
117  [PyInt 10]
118  [PyString "minPrice"]
119  [PyNone]
120  [PyString "availability"]
121  [PyInt 2]
122  [PyString "machoVersion"]
123  [PyInt 1]
124  [PyString "minReward"]
125  [PyNone]
126  [PyString "maxReward"]
127  [PyNone]
128  [PyString "minVolume"]
129  [PyNone]
130  [PyString "sortDir"]
131  [PyInt 0]
132  [PyString "searchHint"]
133  [PyNone]
134  [PyString "startNum"]
135  [PyInt 0]
136  [PyString "maxPrice"]
137  [PyNone]
138  [PyString "itemTypes"]
139  [PyNone]
140  [PyString "itemGroupID"]
141  [PyNone]
142  [PyString "locationID"]
143  [PyNone]
144  [PyString "excludeTrade"]
145  [PyNone]
146  [PyString "sortBy"]
147  [PyInt 0]
148 
149  server return...
150  -- for zero results
151  [PySubStream 76 bytes]
152  [PyObjectData Name: util.KeyVal]
153  [PyDict 4 kvp]
154  [PyString "contracts"]
155  [PyList 0 items]
156  [PyString "numFound"]
157  [PyInt 0]
158  [PyString "searchTime"]
159  [PyIntegerVar 583232]
160  [PyString "maxResults"]
161  [PyInt 1000]
162  -- for a hit
163  [PySubStream 1176 bytes]
164  [PyObjectData Name: util.KeyVal]
165  [PyDict 4 kvp]
166  [PyString "contracts"]
167  [PyList 1 items]
168  [PyObjectData Name: util.KeyVal]
169  [PyDict 12 kvp]
170  [PyString "securityClassEnd"]
171  [PyNone]
172  [PyString "startSolarSystemName"]
173  [PyString "Outuni"]
174  [PyString "items"]
175  [PyList 2 items]
176  [PyPackedRow 52 bytes]
177  ["contractID" => <41239473> [I4]]
178  ["itemID" => <1002299726681> [I8]]
179  ["quantity" => <1> [I4]]
180  ["itemTypeID" => <3732> [I4]]
181  ["inCrate" => <1> [Bool]]
182  ["parentID" => <0> [I8]]
183  ["productivityLevel" => <0> [I4]]
184  ["materialLevel" => <0> [I4]]
185  ["copy" => <0> [Bool]]
186  ["licensedProductionRunsRemaining" => <0> [I4]]
187  ["damage" => <0> [R8]]
188  ["flagID" => <0> [I2]]
189  [PyPackedRow 52 bytes]
190  ["contractID" => <41239473> [I4]]
191  ["itemID" => <1002272878889> [I8]]
192  ["quantity" => <6> [I4]]
193  ["itemTypeID" => <3898> [I4]]
194  ["inCrate" => <1> [Bool]]
195  ["parentID" => <0> [I8]]
196  ["productivityLevel" => <0> [I4]]
197  ["materialLevel" => <0> [I4]]
198  ["copy" => <0> [Bool]]
199  ["licensedProductionRunsRemaining" => <0> [I4]]
200  ["damage" => <0> [R8]]
201  ["flagID" => <0> [I2]]
202  [PyString "bids"]
203  [PyList 0 items]
204  [PyString "contract"]
205  [PyPackedRow 142 bytes]
206  ["contractID" => <41239473> [I4]]
207  ["type" => <1> [UI1]]
208  ["issuerID" => <649670823> [I4]]
209  ["issuerCorpID" => <98038978> [I4]]
210  ["forCorp" => <0> [Bool]]
211  ["availability" => <1> [I4]]
212  ["assigneeID" => <98038978> [I4]]
213  ["acceptorID" => <0> [I4]]
214  ["dateIssued" => <129494703690000000> [FileTime]]
215  ["dateExpired" => <129495567690000000> [FileTime]]
216  ["dateAccepted" => <129494703690000000> [FileTime]]
217  ["numDays" => <0> [I4]]
218  ["dateCompleted" => <129494703690000000> [FileTime]]
219  ["startStationID" => <60006433> [I4]]
220  ["startSolarSystemID" => <30000135> [I4]]
221  ["startRegionID" => <10000002> [I4]]
222  ["endStationID" => <60006433> [I4]]
223  ["endSolarSystemID" => <0> [I4]]
224  ["endRegionID" => <0> [I4]]
225  ["price" => <150000000> [CY]]
226  ["reward" => <0> [CY]]
227  ["collateral" => <0> [CY]]
228  ["title" => <my contract to Munich Lumberjacks> [WStr]]
229  ["description" => <empty string> [WStr]]
230  ["status" => <0> [UI1]]
231  ["crateID" => <1002309375656> [I8]]
232  ["volume" => <6.01> [R8]]
233  ["issuerAllianceID" => <0> [I4]]
234  ["issuerWalletKey" => <0> [I4]]
235  ["acceptorWalletKey" => <0> [I4]]
236  [PyString "itemGroups"]
237  [PyObjectEx Normal]
238  [PyTuple 2 items]
239  [PyToken __builtin__.set]
240  [PyTuple 1 items]
241  [PyList 2 items]
242  [PyInt 266]
243  [PyInt 303]
244  [PyString "securityClassStart"]
245  [PyInt 2]
246  [PyString "startConstellationID"]
247  [PyInt 20000019]
248  [PyString "endConstellationID"]
249  [PyNone]
250  [PyString "itemCategories"]
251  [PyObjectEx Normal]
252  [PyTuple 2 items]
253  [PyToken __builtin__.set]
254  [PyTuple 1 items]
255  [PyList 2 items]
256  [PyInt 16]
257  [PyInt 20]
258  [PyString "itemTypes"]
259  [PyObjectEx Normal]
260  [PyTuple 2 items]
261  [PyToken __builtin__.set]
262  [PyTuple 1 items]
263  [PyList 2 items]
264  [PyInt 3898]
265  [PyInt 3732]
266  [PyString "numBids"]
267  [PyInt 0]
268  [PyString "numFound"]
269  [PyInt 1]
270  [PyString "searchTime"]
271  [PyIntegerVar 552645]
272  [PyString "maxResults"]
273  [PyInt 1000]
274  */
275 
276  sLog.White( "ContractProxy::Handle_SearchContracts()", "size= %u", call.tuple->size() );
277  call.Dump(SERVICE__CALL_DUMP);
278 
279  return nullptr;
280 }
281 
282 PyResult ContractProxy::Handle_CreateContract(PyCallArgs &call) {
283  /*
284  [PySubStream 171 bytes]
285  [PyTuple 4 items]
286  [PyInt 1]
287  [PyString "CreateContract"]
288  [PyTuple 12 items]
289  [PyInt 1]
290  [PyBool True]
291  [PyInt 98038978]
292  [PyInt 1440]
293  [PyInt 0]
294  [PyIntegerVar 60006433]
295  [PyNone]
296  [PyInt 15000]
297  [PyInt 0]
298  [PyInt 0]
299  [PyString "my contract to Munich Lumberjacks"]
300  [PyString ""]
301  [PyDict 6 kvp]
302  [PyString "requestItemTypeList"]
303  [PyList 0 items]
304  [PyString "confirm"]
305  [PyNone]
306  [PyString "forCorp"]
307  [PyBool False]
308  [PyString "flag"]
309  [PyInt 4]
310  [PyString "itemList"]
311  [PyList 2 items]
312  [PyList 2 items]
313  [PyIntegerVar 1002272878889]
314  [PyInt 6]
315  [PyList 2 items]
316  [PyIntegerVar 1002299726681]
317  [PyInt 1]
318  [PyString "machoVersion"]
319  [PyInt 1]
320  */
321 
322 
323  sLog.White( "ContractProxy::Handle_CreateContract()", "size= %u", call.tuple->size() );
324  call.Dump(SERVICE__CALL_DUMP);
325 
326  // returns new contractID
327  return nullptr;
328 }
329 
330 PyResult ContractProxy::Handle_DeleteContract(PyCallArgs &call) {
331  // sends contractID to delete
332  sLog.White( "ContractProxy::Handle_DeleteContract()", "size= %u", call.tuple->size() );
333  call.Dump(SERVICE__CALL_DUMP);
334 
335  /*
336  [PyString "DeleteContract"]
337  [PyTuple 1 items]
338  [PyInt 41239648]
339 
340 
341  [PySubStream 6 bytes]
342  [PyBool True]
343  */
344  return nullptr;
345 }
346 
347 PyResult ContractProxy::Handle_GetContract(PyCallArgs &call) {
348  /*
349  [PySubStream 1103 bytes]
350  [PyObjectData Name: util.KeyVal]
351  [PyDict 11 kvp]
352  [PyString "securityClassEnd"]
353  [PyNone]
354  [PyString "startSolarSystemName"]
355  [PyString "Outuni"]
356  [PyString "items"]
357  [PyList 2 items]
358  [PyPackedRow 52 bytes]
359  ["contractID" => <41239407> [I4]]
360  ["itemID" => <1002299726681> [I8]]
361  ["quantity" => <1> [I4]]
362  ["itemTypeID" => <3732> [I4]]
363  ["inCrate" => <1> [Bool]]
364  ["parentID" => <0> [I8]]
365  ["productivityLevel" => <0> [I4]]
366  ["materialLevel" => <0> [I4]]
367  ["copy" => <0> [Bool]]
368  ["licensedProductionRunsRemaining" => <0> [I4]]
369  ["damage" => <0> [R8]]
370  ["flagID" => <0> [I2]]
371  [PyPackedRow 52 bytes]
372  ["contractID" => <41239407> [I4]]
373  ["itemID" => <1002261932864> [I8]]
374  ["quantity" => <6> [I4]]
375  ["itemTypeID" => <3898> [I4]]
376  ["inCrate" => <1> [Bool]]
377  ["parentID" => <0> [I8]]
378  ["productivityLevel" => <0> [I4]]
379  ["materialLevel" => <0> [I4]]
380  ["copy" => <0> [Bool]]
381  ["licensedProductionRunsRemaining" => <0> [I4]]
382  ["damage" => <0> [R8]]
383  ["flagID" => <0> [I2]]
384  [PyString "bids"]
385  [PyList 0 items]
386  [PyString "contract"]
387  [PyPackedRow 142 bytes]
388  ["contractID" => <41239407> [I4]]
389  ["type" => <1> [UI1]]
390  ["issuerID" => <1661059544> [I4]]
391  ["issuerCorpID" => <98038978> [I4]]
392  ["forCorp" => <0> [Bool]]
393  ["availability" => <1> [I4]]
394  ["assigneeID" => <649670823> [I4]]
395  ["acceptorID" => <0> [I4]]
396  ["dateIssued" => <129494701600000000> [FileTime]]
397  ["dateExpired" => <129495565600000000> [FileTime]]
398  ["dateAccepted" => <129494701600000000> [FileTime]]
399  ["numDays" => <0> [I4]]
400  ["dateCompleted" => <129494701600000000> [FileTime]]
401  ["startStationID" => <60006433> [I4]]
402  ["startSolarSystemID" => <30000135> [I4]]
403  ["startRegionID" => <10000002> [I4]]
404  ["endStationID" => <60006433> [I4]]
405  ["endSolarSystemID" => <0> [I4]]
406  ["endRegionID" => <0> [I4]]
407  ["price" => <0> [CY]]
408  ["reward" => <100000000> [CY]]
409  ["collateral" => <0> [CY]]
410  ["title" => <this is a contract to Rhonin Caldera> [WStr]]
411  ["description" => <empty string> [WStr]]
412  ["status" => <0> [UI1]]
413  ["crateID" => <1002309350211> [I8]]
414  ["volume" => <6.01> [R8]]
415  ["issuerAllianceID" => <0> [I4]]
416  ["issuerWalletKey" => <0> [I4]]
417  ["acceptorWalletKey" => <0> [I4]]
418  [PyString "itemGroups"]
419  [PyObjectEx Normal]
420  [PyTuple 2 items]
421  [PyToken __builtin__.set]
422  [PyTuple 1 items]
423  [PyList 2 items]
424  [PyInt 266]
425  [PyInt 303]
426  [PyString "securityClassStart"]
427  [PyInt 2]
428  [PyString "startConstellationID"]
429  [PyInt 20000019]
430  [PyString "endConstellationID"]
431  [PyNone]
432  [PyString "itemCategories"]
433  [PyObjectEx Normal]
434  [PyTuple 2 items]
435  [PyToken __builtin__.set]
436  [PyTuple 1 items]
437  [PyList 2 items]
438  [PyInt 16]
439  [PyInt 20]
440  [PyString "itemTypes"]
441  [PyObjectEx Normal]
442  [PyTuple 2 items]
443  [PyToken __builtin__.set]
444  [PyTuple 1 items]
445  [PyList 2 items]
446  [PyInt 3898]
447  [PyInt 3732]
448  [PyNone]
449  */
450 
451  sLog.White( "ContractProxy::Handle_GetContract()", "size= %u", call.tuple->size() );
452  call.Dump(SERVICE__CALL_DUMP);
453 
454  return nullptr;
455 }
456 
457 PyResult ContractProxy::Handle_AcceptContract(PyCallArgs &call) {
458  /*
459  [PyPackedRow 142 bytes]
460  ["contractID" => <41239407> [I4]]
461  ["type" => <1> [UI1]]
462  ["issuerID" => <1661059544> [I4]]
463  ["issuerCorpID" => <98038978> [I4]]
464  ["forCorp" => <0> [Bool]]
465  ["availability" => <1> [I4]]
466  ["assigneeID" => <649670823> [I4]]
467  ["acceptorID" => <0> [I4]]
468  ["dateIssued" => <129494701600000000> [FileTime]]
469  ["dateExpired" => <129495565600000000> [FileTime]]
470  ["dateAccepted" => <129494701600000000> [FileTime]]
471  ["numDays" => <0> [I4]]
472  ["dateCompleted" => <129494701600000000> [FileTime]]
473  ["startStationID" => <60006433> [I4]]
474  ["startSolarSystemID" => <30000135> [I4]]
475  ["startRegionID" => <10000002> [I4]]
476  ["endStationID" => <60006433> [I4]]
477  ["endSolarSystemID" => <0> [I4]]
478  ["endRegionID" => <0> [I4]]
479  ["price" => <0> [CY]]
480  ["reward" => <100000000> [CY]]
481  ["collateral" => <0> [CY]]
482  ["title" => <this is a contract to Rhonin Caldera> [WStr]]
483  ["description" => <empty string> [WStr]]
484  ["status" => <0> [UI1]]
485  ["crateID" => <1002309350211> [I8]]
486  ["volume" => <6.01> [R8]]
487  ["issuerAllianceID" => <0> [I4]]
488  ["issuerWalletKey" => <0> [I4]]
489  ["acceptorWalletKey" => <0> [I4]]
490 
491 
492 ==================== Sent from Server 81 bytes
493 
494 [PyObjectData Name: macho.Notification]
495  [PyTuple 6 items]
496  [PyInt 12]
497  [PyObjectData Name: macho.MachoAddress]
498  [PyTuple 4 items]
499  [PyInt 1]
500  [PyInt 699185]
501  [PyNone]
502  [PyNone]
503  [PyObjectData Name: macho.MachoAddress]
504  [PyTuple 4 items]
505  [PyInt 4]
506  [PyString "OnContractAccepted"]
507  [PyList 0 items]
508  [PyString "clientID"]
509  [PyInt 5894042]
510  [PyTuple 1 items]
511  [PyTuple 2 items]
512  [PyInt 0]
513  [PySubStream 15 bytes]
514  [PyTuple 2 items]
515  [PyInt 0]
516  [PyTuple 2 items]
517  [PyInt 1]
518  [PyTuple 1 items]
519  [PyInt 41239473]
520  [PyNone]
521 
522 
523  */
524 
525 
526  sLog.White( "ContractProxy::Handle_AcceptContract()", "size= %u", call.tuple->size() );
527  call.Dump(SERVICE__CALL_DUMP);
528 
529  return nullptr;
530 }
531 
532 
533 PyResult ContractProxy::Handle_GetMyExpiredContractList(PyCallArgs &call) {
534  sLog.White( "ContractProxy::Handle_GetMyExpiredContractList()", "size= %u", call.tuple->size() );
535  call.Dump(SERVICE__CALL_DUMP);
536 /*
537  [PySubStream 530 bytes]
538  [PyObjectData Name: util.KeyVal]
539  [PyDict 3 kvp]
540  [PyString "contracts"]
541  [PyObjectEx Type2]
542  [PyTuple 2 items]
543  [PyTuple 1 items]
544  [PyToken dbutil.CRowset]
545  [PyDict 1 kvp]
546  [PyString "header"]
547  [PyObjectEx Normal]
548  [PyTuple 2 items]
549  [PyToken blue.DBRowDescriptor]
550  [PyTuple 1 items]
551  [PyTuple 28 items]
552  [PyTuple 2 items]
553  [PyString "contractID"]
554  [PyInt 3]
555  [PyTuple 2 items]
556  [PyString "type"]
557  [PyInt 17]
558  [PyTuple 2 items]
559  [PyString "issuerID"]
560  [PyInt 3]
561  [PyTuple 2 items]
562  [PyString "issuerCorpID"]
563  [PyInt 3]
564  [PyTuple 2 items]
565  [PyString "forCorp"]
566  [PyInt 11]
567  [PyTuple 2 items]
568  [PyString "availability"]
569  [PyInt 3]
570  [PyTuple 2 items]
571  [PyString "assigneeID"]
572  [PyInt 3]
573  [PyTuple 2 items]
574  [PyString "acceptorID"]
575  [PyInt 3]
576  [PyTuple 2 items]
577  [PyString "dateIssued"]
578  [PyInt 64]
579  [PyTuple 2 items]
580  [PyString "dateExpired"]
581  [PyInt 64]
582  [PyTuple 2 items]
583  [PyString "dateAccepted"]
584  [PyInt 64]
585  [PyTuple 2 items]
586  [PyString "numDays"]
587  [PyInt 3]
588  [PyTuple 2 items]
589  [PyString "dateCompleted"]
590  [PyInt 64]
591  [PyTuple 2 items]
592  [PyString "startStationID"]
593  [PyInt 3]
594  [PyTuple 2 items]
595  [PyString "startSolarSystemID"]
596  [PyInt 3]
597  [PyTuple 2 items]
598  [PyString "startRegionID"]
599  [PyInt 3]
600  [PyTuple 2 items]
601  [PyString "endStationID"]
602  [PyInt 3]
603  [PyTuple 2 items]
604  [PyString "endSolarSystemID"]
605  [PyInt 3]
606  [PyTuple 2 items]
607  [PyString "endRegionID"]
608  [PyInt 3]
609  [PyTuple 2 items]
610  [PyString "price"]
611  [PyInt 6]
612  [PyTuple 2 items]
613  [PyString "reward"]
614  [PyInt 6]
615  [PyTuple 2 items]
616  [PyString "collateral"]
617  [PyInt 6]
618  [PyTuple 2 items]
619  [PyString "title"]
620  [PyInt 130]
621  [PyTuple 2 items]
622  [PyString "status"]
623  [PyInt 17]
624  [PyTuple 2 items]
625  [PyString "volume"]
626  [PyInt 5]
627  [PyTuple 2 items]
628  [PyString "issuerAllianceID"]
629  [PyInt 3]
630  [PyTuple 2 items]
631  [PyString "issuerWalletKey"]
632  [PyInt 3]
633  [PyTuple 2 items]
634  [PyString "acceptorWalletKey"]
635  [PyInt 3]
636  [PyString "items"]
637  [PyDict 0 kvp]
638  [PyString "bids"]
639  [PyDict 0 kvp]
640  */
641  return nullptr;
642 }
643 
644 PyResult ContractProxy::Handle_NumOutstandingContracts(PyCallArgs &call) {
645  sLog.White( "ContractProxy::Handle_NumOutstandingContracts()", "size= %u", call.tuple->size() );
646  call.Dump(SERVICE__CALL_DUMP);
647  /*
648  [PySubStream 87 bytes]
649  [PyObjectData Name: util.KeyVal]
650  [PyDict 4 kvp]
651  [PyString "nonCorpForMyChar"]
652  [PyInt 0]
653  [PyString "myCorpTotal"]
654  [PyInt 0]
655  [PyString "nonCorpForMyCorp"]
656  [PyInt 0]
657  [PyString "myCharTotal"]
658  [PyInt 0]
659  */
660  return nullptr;
661 }
662 
663 PyResult ContractProxy::Handle_GetItemsInStation(PyCallArgs &call) {
664  sLog.White( "ContractProxy::Handle_GetItemsInStation()", "size= %u", call.tuple->size() );
665  call.Dump(SERVICE__CALL_DUMP);
666 
667  /* client call
668  [PyString "GetItemsInStation"]
669  [PyTuple 2 items]
670  [PyInt 60014683]
671  [PyInt 0]
672 
673  server return
674 
675  [PySubStream 191 bytes]
676  [PyObjectEx Normal]
677  [PyTuple 2 items]
678  [PyToken __builtin__.set]
679  [PyTuple 1 items]
680  [PyList 1 items]
681  [PyPackedRow 36 bytes]
682  ["itemID" => <1262502036> [I8]]
683  ["typeID" => <24702> [I4]]
684  ["ownerID" => <649670823> [I4]]
685  ["locationID" => <60014683> [I8]]
686  ["flagID" => <4> [I2]]
687  ["quantity" => <-1> [I4]]
688  ["groupID" => <419> [I2]]
689  ["categoryID" => <6> [I2]]
690  ["customInfo" => <None> [Str]]
691  */
692  return nullptr;
693 }
694 
695 PyResult ContractProxy::Handle_CollectMyPageInfo(PyCallArgs &call) {
696  sLog.White( "ContractProxy::Handle_CollectMyPageInfo()", "size= %u", call.tuple->size() );
697  call.Dump(SERVICE__CALL_DUMP);
698  /*
699  * [PySubStream 279 bytes]
700  * [PyObjectData Name: util.KeyVal]
701  * [PyDict 11 kvp]
702  * [PyString "numInProgressCorp"]
703  * [PyInt 0]
704  * [PyString "numRequiresAttention"]
705  * [PyInt 0]
706  * [PyString "numBiddingOn"]
707  * [PyInt 0]
708  * [PyString "numRequiresAttentionCorp"]
709  * [PyInt 0]
710  * [PyString "numInProgress"]
711  * [PyInt 0]
712  * [PyString "numBiddingOnCorp"]
713  * [PyInt 0]
714  * [PyString "numOutstandingContractsNonCorp"]
715  * [PyInt 0]
716  * [PyString "outstandingContracts"]
717  * [PyList 0 items]
718  * [PyString "numOutstandingContracts"]
719  * [PyInt 0]
720  * [PyString "numOutstandingContractsForCorp"]
721  * [PyInt 0]
722  * [PyString "numContractsLeftCorp"]
723  * [PyInt 0]
724  */
725  return nullptr;
726 }
727 
728 PyResult ContractProxy::Handle_GetContractListForOwner(PyCallArgs &call) {
729  sLog.White( "ContractProxy::Handle_GetContractListForOwner()", "size= %u", call.tuple->size() );
730  call.Dump(SERVICE__CALL_DUMP);
731  /*
732  * client call....
733  [PyTuple 2 items]
734  [PyInt 0]
735  [PySubStream 73 bytes]
736  [PyTuple 4 items]
737  [PyInt 1]
738  [PyString "GetContractListForOwner"]
739  [PyTuple 4 items]
740  [PyInt 649670823]
741  [PyInt 0]
742  [PyNone]
743  [PyNone]
744  [PyDict 3 kvp]
745  [PyString "num"]
746  [PyInt 100]
747  [PyString "machoVersion"]
748  [PyInt 1]
749  [PyString "startContractID"]
750  [PyNone]
751 
752  server reply...
753  [PySubStream 713 bytes]
754  [PyObjectData Name: util.KeyVal]
755  [PyDict 3 kvp]
756  [PyString "contracts"]
757  [PyObjectEx Type2]
758  [PyTuple 2 items]
759  [PyTuple 1 items]
760  [PyToken dbutil.CRowset]
761  [PyDict 1 kvp]
762  [PyString "header"]
763  [PyObjectEx Normal]
764  [PyTuple 2 items]
765  [PyToken blue.DBRowDescriptor]
766  [PyTuple 1 items]
767  [PyTuple 30 items]
768  [PyTuple 2 items]
769  [PyString "contractID"]
770  [PyInt 3]
771  [PyTuple 2 items]
772  [PyString "type"]
773  [PyInt 17]
774  [PyTuple 2 items]
775  [PyString "issuerID"]
776  [PyInt 3]
777  [PyTuple 2 items]
778  [PyString "issuerCorpID"]
779  [PyInt 3]
780  [PyTuple 2 items]
781  [PyString "forCorp"]
782  [PyInt 11]
783  [PyTuple 2 items]
784  [PyString "availability"]
785  [PyInt 3]
786  [PyTuple 2 items]
787  [PyString "assigneeID"]
788  [PyInt 3]
789  [PyTuple 2 items]
790  [PyString "acceptorID"]
791  [PyInt 3]
792  [PyTuple 2 items]
793  [PyString "dateIssued"]
794  [PyInt 64]
795  [PyTuple 2 items]
796  [PyString "dateExpired"]
797  [PyInt 64]
798  [PyTuple 2 items]
799  [PyString "dateAccepted"]
800  [PyInt 64]
801  [PyTuple 2 items]
802  [PyString "numDays"]
803  [PyInt 3]
804  [PyTuple 2 items]
805  [PyString "dateCompleted"]
806  [PyInt 64]
807  [PyTuple 2 items]
808  [PyString "startStationID"]
809  [PyInt 3]
810  [PyTuple 2 items]
811  [PyString "startSolarSystemID"]
812  [PyInt 3]
813  [PyTuple 2 items]
814  [PyString "startRegionID"]
815  [PyInt 3]
816  [PyTuple 2 items]
817  [PyString "endStationID"]
818  [PyInt 3]
819  [PyTuple 2 items]
820  [PyString "endSolarSystemID"]
821  [PyInt 3]
822  [PyTuple 2 items]
823  [PyString "endRegionID"]
824  [PyInt 3]
825  [PyTuple 2 items]
826  [PyString "price"]
827  [PyInt 6]
828  [PyTuple 2 items]
829  [PyString "reward"]
830  [PyInt 6]
831  [PyTuple 2 items]
832  [PyString "collateral"]
833  [PyInt 6]
834  [PyTuple 2 items]
835  [PyString "title"]
836  [PyInt 130]
837  [PyTuple 2 items]
838  [PyString "status"]
839  [PyInt 17]
840  [PyTuple 2 items]
841  [PyString "volume"]
842  [PyInt 5]
843  [PyTuple 2 items]
844  [PyString "issuerAllianceID"]
845  [PyInt 3]
846  [PyTuple 2 items]
847  [PyString "issuerWalletKey"]
848  [PyInt 3]
849  [PyTuple 2 items]
850  [PyString "acceptorWalletKey"]
851  [PyInt 3]
852  [PyTuple 2 items]
853  [PyString "crateID"]
854  [PyInt 20]
855  [PyTuple 2 items]
856  [PyString "contractID"]
857  [PyInt 3]
858  [PyPackedRow 146 bytes]
859  ["contractID" => <41239648> [I4]]
860  ["type" => <1> [UI1]]
861  ["issuerID" => <649670823> [I4]]
862  ["issuerCorpID" => <98038978> [I4]]
863  ["forCorp" => <0> [Bool]]
864  ["availability" => <1> [I4]]
865  ["assigneeID" => <1661059544> [I4]]
866  ["acceptorID" => <0> [I4]]
867  ["dateIssued" => <129494707760000000> [FileTime]]
868  ["dateExpired" => <129495571760000000> [FileTime]]
869  ["dateAccepted" => <129494707760000000> [FileTime]]
870  ["numDays" => <0> [I4]]
871  ["dateCompleted" => <129494707760000000> [FileTime]]
872  ["startStationID" => <60006433> [I4]]
873  ["startSolarSystemID" => <30000135> [I4]]
874  ["startRegionID" => <10000002> [I4]]
875  ["endStationID" => <60006433> [I4]]
876  ["endSolarSystemID" => <0> [I4]]
877  ["endRegionID" => <0> [I4]]
878  ["price" => <150000000> [CY]]
879  ["reward" => <0> [CY]]
880  ["collateral" => <0> [CY]]
881  ["title" => <quafe!> [WStr]]
882  ["status" => <0> [UI1]]
883  ["volume" => <6> [R8]]
884  ["issuerAllianceID" => <0> [I4]]
885  ["issuerWalletKey" => <0> [I4]]
886  ["acceptorWalletKey" => <0> [I4]]
887  ["crateID" => <1002309425092> [I8]]
888  ["contractID" => <41239648> [I4]]
889  [PyString "items"]
890  [PyDict 1 kvp]
891  [PyInt 41239648]
892  [PyList 1 items]
893  [PyObjectData Name: util.Row]
894  [PyDict 2 kvp]
895  [PyString "header"]
896  [PyList 3 items]
897  [PyString "itemTypeID"]
898  [PyString "quantity"]
899  [PyString "inCrate"]
900  [PyString "line"]
901  [PyList 3 items]
902  [PyInt 3898]
903  [PyInt 6]
904  [PyBool True]
905  [PyString "bids"]
906  [PyDict 0 kvp]
907  */
908  return nullptr;
909 }
910 
911 PyResult ContractProxy::Handle_GetLoginInfo(PyCallArgs &call)
912 {
913  // currently a stub as I need to redesign or change some sub systems for this.
914 
915  /* create needsAttention row descriptor */
916  DBRowDescriptor *needsAttentionHeader = new DBRowDescriptor();
917  needsAttentionHeader->AddColumn( "contractID", DBTYPE_I4);
918  needsAttentionHeader->AddColumn( "", DBTYPE_I4);
919 
920  /* create inProgress row descriptor */
921  DBRowDescriptor *inProgressHeader = new DBRowDescriptor();
922  inProgressHeader->AddColumn( "contractID", DBTYPE_I4 );
923  inProgressHeader->AddColumn( "startStationID", DBTYPE_I4 );
924  inProgressHeader->AddColumn( "endStationID", DBTYPE_I4 );
925  inProgressHeader->AddColumn( "expires", DBTYPE_FILETIME );
926 
927  /* create assignedToMe row descriptor */
928  DBRowDescriptor *assignedToMeHeader = new DBRowDescriptor();
929  assignedToMeHeader->AddColumn( "contractID", DBTYPE_I4);
930  assignedToMeHeader->AddColumn( "issuerID", DBTYPE_I4);
931 
932  CRowSet *needsAttention_rowset = new CRowSet( &needsAttentionHeader );
933  CRowSet *inProgress_rowset = new CRowSet( &inProgressHeader );
934  CRowSet *assignedToMe_rowset = new CRowSet( &assignedToMeHeader );
935 
936  PyDict* args = new PyDict;
937  args->SetItemString( "needsAttention", needsAttention_rowset );
938  args->SetItemString( "inProgress", inProgress_rowset );
939  args->SetItemString( "assignedToMe", assignedToMe_rowset );
940 
941  return new PyObject( "util.KeyVal", args );
942 }
943 
944 /* Description
945  * GetLoginInfo sends back a util.KeyVal PyClass. This class contains 3 entries, those entries are
946  * "needsAttention", "inProgress" and "assignedToMe".
947  *
948  * ------------------
949  * assignedToMe
950  * ------------------
951  * assignedToMe is a pretty obvious packet, it contains rows of userid's and contractid's
952  * that are belonging to the player.
953  *
954  * ------------------
955  * inProgress
956  * ------------------
957  * inProgress is also pretty obvious, it contains rows of contractID, startStationID, endStationID and expires
958  * that marks what contract is in progress.
959  *
960  * ------------------
961  * needsAttention
962  * ------------------
963  * needsAttention contains contracts that need attention, its rather a way to make the journal blink. The
964  * contracts off course are highlighted in the journal.
965  *
966  [PySubStream 273 bytes]
967  [PyObjectData Name: util.KeyVal]
968  [PyDict 3 kvp]
969  [PyString "inProgress"]
970  [PyObjectEx Type2]
971  [PyTuple 2 items]
972  [PyTuple 1 items]
973  [PyToken dbutil.CRowset]
974  [PyDict 1 kvp]
975  [PyString "header"]
976  [PyObjectEx Normal]
977  [PyTuple 2 items]
978  [PyToken blue.DBRowDescriptor]
979  [PyTuple 1 items]
980  [PyTuple 4 items]
981  [PyTuple 2 items]
982  [PyString "contractID"]
983  [PyInt 3]
984  [PyTuple 2 items]
985  [PyString "startStationID"]
986  [PyInt 3]
987  [PyTuple 2 items]
988  [PyString "endStationID"]
989  [PyInt 3]
990  [PyTuple 2 items]
991  [PyString "expires"]
992  [PyInt 64]
993  [PyString "needsAttention"]
994  [PyObjectEx Type2]
995  [PyTuple 2 items]
996  [PyTuple 1 items]
997  [PyToken dbutil.CRowset]
998  [PyDict 1 kvp]
999  [PyString "header"]
1000  [PyObjectEx Normal]
1001  [PyTuple 2 items]
1002  [PyToken blue.DBRowDescriptor]
1003  [PyTuple 1 items]
1004  [PyTuple 2 items]
1005  [PyTuple 2 items]
1006  [PyString "contractID"]
1007  [PyInt 3]
1008  [PyTuple 2 items]
1009  [PyString ""]
1010  [PyInt 3]
1011  [PyString "assignedToMe"]
1012  [PyObjectEx Type2]
1013  [PyTuple 2 items]
1014  [PyTuple 1 items]
1015  [PyToken dbutil.CRowset]
1016  [PyDict 1 kvp]
1017  [PyString "header"]
1018  [PyObjectEx Normal]
1019  [PyTuple 2 items]
1020  [PyToken blue.DBRowDescriptor]
1021  [PyTuple 1 items]
1022  [PyTuple 2 items]
1023  [PyTuple 2 items]
1024  [PyString "contractID"]
1025  [PyInt 3]
1026  [PyTuple 2 items]
1027  [PyString "issuerID"]
1028  [PyInt 3]
1029 */
Dispatcher *const m_dispatch
Python's dictionary.
Definition: PyRep.h:719
size_t size() const
Definition: PyRep.h:591
void AddColumn(const char *name, DBTYPE type)
Definition: PyDatabase.cpp:96
PyCallable_Make_InnerDispatcher(ContractProxy) ContractProxy
* args
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Python object.
Definition: PyRep.h:826
Python object "blue.DBRowDescriptor".
Definition: PyDatabase.h:41
Python object "dbutil.CRowset".
Definition: PyDatabase.h:124
Dispatcher *const m_dispatch
Definition: ContractProxy.h:40
#define PyCallable_REG_CALL(c, m)
Definition: PyServiceCD.h:78
void Dump(LogType type) const
Definition: PyCallable.cpp:81
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812
PyTuple * tuple
Definition: PyCallable.h:50