Skip to content

Commit 7246f5b

Browse files
committed
[[ LicenseCheck ]] Update the ExternalV1 license check (7.0)
1 parent 319f08a commit 7246f5b

File tree

7 files changed

+418
-198
lines changed

7 files changed

+418
-198
lines changed

engine/src/capsule.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ enum MCCapsuleSectionType
102102
// AL-2015-02-10: [[ Standalone Inclusions ]] Library consists of the mappings from universal names
103103
// of resources to their platform-specific paths relative to the executable.
104104
kMCCapsuleSectionTypeLibrary,
105+
106+
// MW-2016-02-17: [[ LicenseChecks ]] License consists of the array-encoded
107+
// 'revLicenseInfo' array in use at the point the standalone was built.
108+
kMCCapsuleSectionTypeLicense,
105109
};
106110

107111
// Each section begins with a header that defines its type and length. This is

engine/src/deploy.cpp

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,51 @@ static bool MCDeployWriteDefinePrologueSection(const MCDeployParameters& p_param
330330
return MCDeployCapsuleDefine(p_capsule, kMCCapsuleSectionTypePrologue, &t_prologue, sizeof(t_prologue));
331331
}
332332

333+
static bool MCDeployWriteDefineLicenseSection(const MCDeployParameters& p_params, MCDeployCapsuleRef p_capsule)
334+
{
335+
// The edition byte encoding is development/standalone engine pair
336+
// specific.
337+
unsigned char t_edition;
338+
switch(MClicenseparameters . license_class)
339+
{
340+
case kMCLicenseClassNone:
341+
t_edition = 0;
342+
break;
343+
344+
case kMCLicenseClassCommunity:
345+
t_edition = 1;
346+
break;
347+
348+
case kMCLicenseClassCommercial:
349+
t_edition = 2;
350+
break;
351+
352+
case kMCLicenseClassProfessional:
353+
t_edition = 3;
354+
break;
355+
}
356+
357+
return MCDeployCapsuleDefine(p_capsule,
358+
kMCCapsuleSectionTypeLicense,
359+
&t_edition,
360+
sizeof(t_edition));
361+
}
362+
333363
// This method generates the standalone specific capsule elements. This is
334364
// just a Standalone Prologue section at the moment.
335365
static bool MCDeployWriteCapsuleDefineStandaloneSections(const MCDeployParameters& p_params, MCDeployCapsuleRef p_capsule)
336366
{
337367
bool t_success;
338368
t_success = true;
339-
369+
370+
// First emit the prologue.
340371
if (t_success)
341372
t_success = MCDeployWriteDefinePrologueSection(p_params, p_capsule);
342-
373+
374+
// Next emit the license info.
375+
if (t_success)
376+
t_success = MCDeployWriteDefineLicenseSection(p_params, p_capsule);
377+
343378
return t_success;
344379
}
345380

engine/src/executionerrors.h

Lines changed: 103 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,204 +2433,207 @@ enum Exec_errors
24332433
// IM-2013-09-22: [[ FullscreenMode ]]
24342434
// {EE-0800} fullscreenmode: not a valid mode
24352435
EE_STACK_BADFULLSCREENMODE,
2436+
2437+
// IM-2013-12-04: [[ PixelScale ]]
2438+
// {EE-0801} pixelScale: not a valid scale value
2439+
EE_PROPERTY_BADPIXELSCALE,
2440+
2441+
// IM-2014-01-07: [[ StackScale ]]
2442+
// {EE-0802} scaleFactor: not a valid scale value
2443+
EE_STACK_BADSCALEFACTOR,
2444+
2445+
// IM-2014-01-30: [[ HiDPI ]]
2446+
// {EE-0803} pixelScale: the pixelScale property cannot be set on this platform
2447+
EE_PROPERTY_PIXELSCALENOTSUPPORTED,
2448+
2449+
// IM-2014-01-30: [[ HiDPI ]]
2450+
// {EE-0804} usePixelScaling: the usePixelScaling property cannot be set on this platform
2451+
EE_PROPERTY_USEPIXELSCALENOTSUPPORTED,
2452+
2453+
// MM-2014-02-12: [[ SecureSocket ]]
2454+
// {EE-0805} secure: error in socket expression
2455+
EE_SECURE_BADNAME,
2456+
2457+
// PM-2014-04-15: [[Bug 12105]]
2458+
// {EE-0806} paramCount: could not find handler
2459+
EE_PARAMCOUNT_NOHANDLER,
2460+
2461+
// MW-2015-05-28: [[ Bug 12463 ]]
2462+
// {EE-0807} send: too many pending messages
2463+
EE_SEND_TOOMANYPENDING,
2464+
2465+
// MM-2014-06-13: [[ Bug 12567 ]] New variant secure socket <socket> with verification for host <host>
2466+
// {EE-0808} secure: error in host name expression
2467+
EE_SECURE_BADHOST,
2468+
2469+
// MM-2014-06-13: [[ Bug 12567 ]] New variant open socket <socket> with verification for host <host>
2470+
// {EE-0809} open: error in host name expression
2471+
EE_OPEN_BADHOST,
2472+
2473+
// SN-2014-12-15: [[ Bug 14211 ]] Add an error when using a parsed bad extents (such as 'next')
2474+
// {EE-0810} Chunk: bad extents provided
2475+
EE_CHUNK_BADEXTENTS,
2476+
2477+
// {EE-0811} external: unlicensed
2478+
EE_EXTERNAL_UNLICENSED,
24362479

2437-
// {EE-0801} Import: no image selected, or image not open
2480+
// {EE-0812} Import: no image selected, or image not open
24382481
EE_IMPORT_NOSELECTED,
24392482

2440-
// {EE-802} Resolve image: error in source expression
2483+
// {EE-0813} Resolve image: error in source expression
24412484
EE_RESOLVE_IMG_BADEXP,
24422485

2443-
// {EE-803} Internal BSDiff: error in old file expression
2486+
// {EE-0814} Internal BSDiff: error in old file expression
24442487
EE_INTERNAL_BSDIFF_BADOLD,
24452488

2446-
// {EE-804} Internal BSDiff: error in new file expression
2489+
// {EE-0815} Internal BSDiff: error in new file expression
24472490
EE_INTERNAL_BSDIFF_BADNEW,
24482491

2449-
// {EE-805} Internal BSDiff: error in patch filename expression
2492+
// {EE-0816} Internal BSDiff: error in patch filename expression
24502493
EE_INTERNAL_BSDIFF_BADPATCH,
24512494

2452-
// {EE-806} Internal Bootstrap: error in stack file
2495+
// {EE-0817} Internal Bootstrap: error in stack file
24532496
EE_INTERNAL_BOOTSTRAP_BADSTACK,
24542497

2455-
// {EE-807} IDE script configure: error in settings expression
2498+
// {EE-0818} IDE script configure: error in settings expression
24562499
EE_IDE_BADARRAY,
24572500

2458-
// {EE-808} IDE script replace: error in text expression
2501+
// {EE-0819} IDE script replace: error in text expression
24592502
EE_IDE_BADTEXT,
24602503

2461-
// {EE-809} IDE script classify: error in script expression
2504+
// {EE-0820} IDE script classify: error in script expression
24622505
EE_IDE_BADSCRIPT,
24632506

2464-
// {EE-810} IDE filter control: error in pattern expression
2507+
// {EE-0821} IDE filter control: error in pattern expression
24652508
EE_IDE_BADPATTERN,
24662509

2467-
// {EE-811} Engine PutInto: error in variable expression
2510+
// {EE-0822} Engine PutInto: error in variable expression
24682511
EE_ENGINE_PUT_BADVARIABLE,
24692512

2470-
// {EE-812} Engine DeleteVariableChunk: error in expression
2513+
// {EE-0823} Engine DeleteVariableChunk: error in expression
24712514
EE_ENGINE_DELETE_BADVARCHUNK,
24722515

2473-
// {EE-813} IDE Extract: error in segment expression
2516+
// {EE-0824} IDE Extract: error in segment expression
24742517
EE_IDE_EXTRACT_BADSEGMENT,
24752518

2476-
// {EE-814} IDE Extract: error in section name expression
2519+
// {EE-0825} IDE Extract: error in section name expression
24772520
EE_IDE_EXTRACT_BADSECTION,
24782521

2479-
// {EE-815} IDE Extract: error in filename expression
2522+
// {EE-0826} IDE Extract: error in filename expression
24802523
EE_IDE_EXTRACT_BADFILENAME,
24812524

2482-
// {EE-816} MCInternalPayloadPatch: error in output filename expression
2525+
// {EE-0827} MCInternalPayloadPatch: error in output filename expression
24832526
EE_OUTPUT_BADFILENAME,
24842527

2485-
// {EE-817} MCInternalListTasksWithModule: error in module expression
2528+
// {EE-0828} MCInternalListTasksWithModule: error in module expression
24862529
EE_INTERNAL_TASKS_BADMODULE,
24872530

2488-
// {EE-818} MCInternalCanDeleteFile: error in filename expression
2531+
// {EE-0829} MCInternalCanDeleteFile: error in filename expression
24892532
EE_INTERNAL_DELETE_BADFILENAME,
24902533

2491-
// {EE-819} MCInternalCanDeleteKey: error in key expression
2534+
// {EE-0830} MCInternalCanDeleteKey: error in key expression
24922535
EE_INTERNAL_DELETE_BADKEY,
24932536

2494-
// {EE-820} MCHandler: error in expression
2537+
// {EE-0831} MCHandler: error in expression
24952538
EE_HANDLER_BADEXP,
24962539

2497-
// {EE-0821} textDecode: bad data expression
2540+
// {EE-0832} textDecode: bad data expression
24982541
EE_TEXTDECODE_BADDATA,
24992542

2500-
// {EE-0822} textDecode: bad text encoding expression
2543+
// {EE-0833} textDecode: bad text encoding expression
25012544
EE_TEXTDECODE_BADENCODING,
25022545

2503-
// {EE-0823} textDecode: could not decode data
2546+
// {EE-0834} textDecode: could not decode data
25042547
EE_TEXTDECODE_FAILED,
25052548

2506-
// {EE-0824} textEncode: bad text expression
2549+
// {EE-0835} textEncode: bad text expression
25072550
EE_TEXTENCODE_BADTEXT,
25082551

2509-
// {EE-0825} textEncode: bad text encoding expression
2552+
// {EE-0836} textEncode: bad text encoding expression
25102553
EE_TEXTENCODE_BADENCODING,
25112554

2512-
// {EE-0826} textEncode: could not encode text
2555+
// {EE-0837} textEncode: could not encode text
25132556
EE_TEXTENCODE_FAILED,
25142557

2515-
// {EE-0827} normalizeText: bad normal form
2558+
// {EE-0838} normalizeText: bad normal form
25162559
EE_NORMALIZETEXT_BADFORM,
25172560

2518-
// {EE-0828} normalizeText: bad text expression
2561+
// {EE-0839} normalizeText: bad text expression
25192562
EE_NORMALIZETEXT_BADTEXT,
25202563

2521-
// {EE-0829} codepointProperty: bad codepoint
2564+
// {EE-0840} codepointProperty: bad codepoint
25222565
EE_CODEPOINTPROPERTY_BADCODEPOINT,
25232566

2524-
// {EE-0830} codepointProperty: bad property name
2567+
// {EE-0841} codepointProperty: bad property name
25252568
EE_CODEPOINTPROPERTY_BADPROPERTY,
25262569

2527-
// IM-2013-12-04: [[ PixelScale ]]
2528-
// {EE-0831} pixelScale: not a valid scale value
2529-
EE_PROPERTY_BADPIXELSCALE,
2570+
// SN-2014-05-06: [[ Bug 12360 ]]
2571+
// {EE-0842} open: bad text encoding
2572+
EE_OPEN_BADENCODING,
25302573

2531-
// IM-2014-01-07: [[ StackScale ]]
2532-
// {EE-0832} scaleFactor: not a valid scale value
2533-
EE_STACK_BADSCALEFACTOR,
2534-
2535-
// IM-2014-01-30: [[ HiDPI ]]
2536-
// {EE-0833} pixelScale: the pixelScale property cannot be set on this platform
2537-
EE_PROPERTY_PIXELSCALENOTSUPPORTED,
2538-
2539-
// IM-2014-01-30: [[ HiDPI ]]
2540-
// {EE-0834} usePixelScaling: the usePixelScaling property cannot be set on this platform
2541-
EE_PROPERTY_USEPIXELSCALENOTSUPPORTED,
2542-
2543-
// MM-2014-02-12: [[ SecureSocket ]]
2544-
// {EE-0835} secure: error in socket expression
2545-
EE_SECURE_BADNAME,
2546-
2547-
// PM-2014-04-15: [[Bug 12105]]
2548-
// {EE-0836} paramCount: could not find handler
2549-
EE_PARAMCOUNT_NOHANDLER,
2550-
2551-
// SN-2014-05-06: [[ Bug 12360 ]]
2552-
// {EE-0837} open: bad text encoding
2553-
EE_OPEN_BADENCODING,
2554-
2555-
// {EE-0838} open: unsupported encoding
2556-
EE_OPEN_UNSUPPORTED_ENCODING,
2557-
2558-
// MW-2015-05-28: [[ Bug 12463 ]]
2559-
// {EE-0839} send: too many pending messages
2560-
EE_SEND_TOOMANYPENDING,
2561-
2562-
// MM-2014-06-13: [[ Bug 12567 ]] New variant secure socket <socket> with verification for host <host>
2563-
// {EE-0840} secure: error in host name expression
2564-
EE_SECURE_BADHOST,
2574+
// {EE-0843} open: unsupported encoding
2575+
EE_OPEN_UNSUPPORTED_ENCODING,
25652576

2566-
// MM-2014-06-13: [[ Bug 12567 ]] New variant open socket <socket> with verification for host <host>
2567-
// {EE-0841} open: error in host name expression
2568-
EE_OPEN_BADHOST,
2569-
25702577
// AL-2014-10-17: [[ BiDi ]] Returns the result of applying the bi-directional algorithm to text
2571-
// {EE-0842} bidiDirection: error in source expression
2578+
// {EE-0844} bidiDirection: error in source expression
25722579
EE_BIDIDIRECTION_BADSOURCE,
2573-
2574-
// MW-2014-10-23: Improve the error message you get from 'start using <name>'
2575-
// {EE-0843} start: script of specified stack won't compile
2576-
EE_START_WONTCOMPILE,
2577-
2578-
// SN-2014-12-16: [[ Bug 14181 ]] hostnameToAddress should have no message on server
2579-
// {EE-0844} hostnameToAddress: callbacks are not allowed on server
2580-
EE_HOSTNAME_BADMESSAGE,
2580+
2581+
// MW-2014-10-23: Improve the error message you get from 'start using <name>'
2582+
// {EE-0845} start: script of specified stack won't compile
2583+
EE_START_WONTCOMPILE,
2584+
2585+
// SN-2014-12-16: [[ Bug 14181 ]] hostnameToAddress should have no message on server
2586+
// {EE-0846} hostnameToAddress: callbacks are not allowed on server
2587+
EE_HOSTNAME_BADMESSAGE,
25812588

2582-
// SN-2014-12-15: [[ Bug 14211 ]] Add an error when using a parsed bad extents (such as 'next')
2583-
// {EE-0845} Chunk: bad extents provided
2584-
EE_CHUNK_BADEXTENTS,
2585-
2586-
// {EE-0846} Error evaluating expression
2589+
// {EE-0847} Error evaluating expression
25872590
EE_EXPR_EVALERROR,
25882591

2589-
// {EE-0847} Property: value is not a character
2592+
// {EE-0848} Property: value is not a character
25902593
EE_PROPERTY_NAC,
25912594

2592-
// {EE-0848} Property: value is not a string
2595+
// {EE-0849} Property: value is not a string
25932596
EE_PROPERTY_NAS,
25942597

2595-
// {EE-0849} Property: value is not a color
2598+
// {EE-0850} Property: value is not a color
25962599
EE_PROPERTY_NOTACOLOR,
25972600

2598-
// {EE-0850} Property: value is not a rectangle
2601+
// {EE-0851} Property: value is not a rectangle
25992602
EE_PROPERTY_NOTARECT,
26002603

2601-
// {EE-0851} Property: value is not a point
2604+
// {EE-0852} Property: value is not a point
26022605
EE_PROPERTY_NOTAPOINT,
26032606

2604-
// {EE-0852} Property: value is not a pair of integers
2607+
// {EE-0853} Property: value is not a pair of integers
26052608
EE_PROPERTY_NOTAINTPAIR,
26062609

2607-
// {EE-0853} Property: value is not a quadruple of integers
2610+
// {EE-0854} Property: value is not a quadruple of integers
26082611
EE_PROPERTY_NOTAINTQUAD,
26092612

2610-
// {EE-0854} Property: invalid enumeration value
2613+
// {EE-0855} Property: invalid enumeration value
26112614
EE_PROPERTY_BADENUMVALUE,
26122615

2613-
// {EE-0855} Backdrop: invalid value
2616+
// {EE-0856} Backdrop: invalid value
26142617
EE_BACKDROP_INVALIDVALUE,
26152618

2616-
// {EE-0856} Property: value is not an array
2619+
// {EE-0857} Property: value is not an array
26172620
EE_PROPERTY_NOTANARRAY,
26182621

2619-
// {EE-0857} MCInternalPayloadPatch: error in patch item expression
2622+
// {EE-0858} MCInternalPayloadPatch: error in patch item expression
26202623
EE_INTERNAL_PATCH_BADITEM,
26212624

2622-
// {EE-0858} MCInternalPayloadPatch: error in base item expression
2625+
// {EE-0859} MCInternalPayloadPatch: error in base item expression
26232626
EE_INTERNAL_BASE_BADITEM,
26242627

26252628
// MDW-2014-09-28: [[ feature_floor ]]
2626-
// {EE-0859} floor: bad parameter
2629+
// {EE-0860} floor: bad parameter
26272630
EE_FLOOR_BADSOURCE,
26282631

26292632
// MDW-2014-09-28: [[ feature_floor ]]
2630-
// {EE-0860} ceil: bad parameter
2633+
// {EE-0861} ceil: bad parameter
26312634
EE_CEIL_BADSOURCE,
26322635

2633-
// {EE-861} commandArguments: bad parameter
2636+
// {EE-0862} commandArguments: bad parameter
26342637
EE_COMMANDARGUMENTS_BADPARAM,
26352638
};
26362639

0 commit comments

Comments
 (0)