1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
use std::cmp::PartialEq;

use endio::{Deserialize, Serialize};
use lu_packets_derive::{GameMessage, GmParam, VariantTests};

use crate::common::{ObjId, OBJID_EMPTY};

use crate::world::{Lot, LOT_NULL, Quaternion, Vector3};
use crate::world::amf3::Amf3;
pub use super::{EquipInventory, InventoryType, KillType, UnEquipInventory, MissionState, PetNotificationType, MoveItemInInventory, MoveInventoryBatch, RemoveItemFromInventory, SetIgnoreProjectileCollision, ModifyPlayerZoneStatistic};
use super::{GmString, GmWString};

#[derive(Debug, Deserialize, PartialEq, Serialize)]
pub struct SubjectGameMessage {
	pub subject_id: ObjId,
	pub message: GameMessage,
}

#[derive(Debug, Deserialize, PartialEq, Serialize, VariantTests)]
#[repr(u16)]
pub enum GameMessage {
	RequestDie(RequestDie) = 38,
	PlayEmote(PlayEmote) = 41,
	ControlBehaviors(ControlBehaviors) = 48,
	StartSkill(StartSkill) = 119,
	CasterDead(CasterDead) = 120,
	VerifyAck(VerifyAck) = 121,
	SelectSkill(SelectSkill) = 124,
	PickupCurrency(PickupCurrency) = 137,
	PickupItem(PickupItem) = 139,
	RequestResurrect = 159,
	PopEquippedItemsState = 192,
	RebuildCancel(RebuildCancel) = 209,
	MoveItemInInventory(MoveItemInInventory) = 224,
	RemoveItemFromInventory(RemoveItemFromInventory) = 230,
	EquipInventory(EquipInventory) = 231,
	UnEquipInventory(UnEquipInventory) = 233,
	RespondToMission(RespondToMission) = 249,
	ServerTerminateInteraction(ServerTerminateInteraction) = 358,
	RequestUse(RequestUse) = 364,
	BuyFromVendor(BuyFromVendor) = 373,
	SellToVendor(SellToVendor) = 374,
	CancelDonationOnPlayer = 379,
	AcknowledgePossession(AcknowledgePossession) = 391,
	RequestActivityExit(RequestActivityExit) = 404,
	ShootingGalleryFire(ShootingGalleryFire) = 411,
	RequestVendorStatusUpdate = 416,
	ClientItemConsumed(ClientItemConsumed) = 428,
	UpdateShootingGalleryRotation(UpdateShootingGalleryRotation) = 448,
	SetTooltipFlag(SetTooltipFlag) = 469,
	SetFlag(SetFlag) = 471,
	HasBeenCollected(HasBeenCollected) = 486,
	DespawnPet(DespawnPet) = 499,
	PlayerLoaded(PlayerLoaded) = 505,
	RequestLinkedMission(RequestLinkedMission) = 515,
	MissionDialogueOk(MissionDialogueOk) = 520,
	MessageBoxRespond(MessageBoxRespond) = 530,
	ChoiceBoxRespond(ChoiceBoxRespond) = 531,
	UseNonEquipmentItem(UseNonEquipmentItem) = 603,
	FetchModelMetadataRequest(FetchModelMetadataRequest) = 638,
	CommandPet(CommandPet) = 640,
	RequestActivitySummaryLeaderboardData(RequestActivitySummaryLeaderboardData) = 648,
	NotifyPet(NotifyPet) = 660,
	StartServerPetMinigameTimer = 662,
	ClientExitTamingMinigame(ClientExitTamingMinigame) = 663,
	PetTamingMinigameResult(PetTamingMinigameResult) = 667,
	NotifyTamingBuildSuccess(NotifyTamingBuildSuccess) = 673,
	RequestSetPetName(RequestSetPetName) = 683,
	CinematicUpdate(CinematicUpdate) = 764,
	FireEventServerSide(FireEventServerSide) = 770,
	QueryPropertyData = 717,
	PropertyEditorBegin(PropertyEditorBegin) = 724,
	PropertyEditorEnd = 725,
	RequestPlatformResync = 760,
	ToggleGhostReferenceOverride(ToggleGhostReferenceOverride) = 767,
	SetGhostReferencePosition(SetGhostReferencePosition) = 768,
	UpdateModelFromClient(UpdateModelFromClient) = 793,
	DeleteModelFromClient(DeleteModelFromClient) = 794,
	EnterProperty1(EnterProperty1) = 840,
	PropertyEntranceSync(PropertyEntranceSync) = 842,
	ParseChatMessage(ParseChatMessage) = 850,
	SetMissionTypeState(SetMissionTypeState) = 851,
	UpdatePropertyOrModelForFilterCheck(UpdatePropertyOrModelForFilterCheck) = 863,
	ClientTradeRequest(ClientTradeRequest) = 868,
	ClientTradeCancel = 878,
	ClientTradeAccept(ClientTradeAccept) = 880,
	ReadyForUpdates(ReadyForUpdates) = 888,
	SetLastCustomBuild(SetLastCustomBuild) = 890,
	SetIgnoreProjectileCollision(SetIgnoreProjectileCollision) = 903,
	PropertyModerationAction(PropertyModerationAction) = 915,
	BounceNotification(BounceNotification) = 932,
	MoveInventoryBatch(MoveInventoryBatch) = 957,
	SetBbbAutosave(SetBbbAutosave) = 996,
	BbbLoadItemRequest(BbbLoadItemRequest) = 1000,
	BbbSaveRequest(BbbSaveRequest) = 1001,
	BbbResetMetadataSourceItem = 1004,
	ZoneSummaryDismissed(ZoneSummaryDismissed) = 1044,
	ModifyPlayerZoneStatistic(ModifyPlayerZoneStatistic) = 1046,
	ActivityStateChangeRequest(ActivityStateChangeRequest) = 1053,
	StartBuildingWithItem(StartBuildingWithItem) = 1057,
	DoneArrangingWithItem(DoneArrangingWithItem) = 1063,
	SetBuildMode(SetBuildMode) = 1068,
	BuildModeSet(BuildModeSet) = 1069,
	BuildExitConfirmation(BuildExitConfirmation) = 1072,
	MoveItemBetweenInventoryTypes(MoveItemBetweenInventoryTypes) = 1093,
	MissionDialogueCancelled(MissionDialogueCancelled) = 1129,
	ModuleAssemblyQueryData = 1132,
	SyncSkill(SyncSkill) = 1145,
	RequestServerProjectileImpact(RequestServerProjectileImpact) = 1148,
	ToggleSendingPositionUpdates(ToggleSendingPositionUpdates) = 1166,
	PlacePropertyModel(PlacePropertyModel) = 1170,
	ReportBug(ReportBug) = 1198,
	RequestSmashPlayer = 1202,
	ResyncEquipment = 1238,
	RacingPlayerInfoResetFinished(RacingPlayerInfoResetFinished) = 1255,
	VehicleSetWheelLockState(VehicleSetWheelLockState) = 1273,
	PropertyContentsFromClient(PropertyContentsFromClient) = 1305,
	VehicleNotifyServerAddPassiveBoostAction = 1342,
	VehicleNotifyServerRemovePassiveBoostAction = 1343,
	ZonePropertyModelRotated(ZonePropertyModelRotated) = 1370,
	ZonePropertyModelRemovedWhileEquipped(ZonePropertyModelRemovedWhileEquipped) = 1371,
	ZonePropertyModelEquipped(ZonePropertyModelEquipped) = 1372,
	RacingClientReady(RacingClientReady) = 1393,
	ResetPropertyBehaviors(ResetPropertyBehaviors) = 1406,
	SetConsumableItem(SetConsumableItem) = 1409,
	UsedInformationPlaque(UsedInformationPlaque) = 1419,
	ActivateBrickMode(ActivateBrickMode) = 1438,
	CancelRailMovement(CancelRailMovement) = 1474,
	ClientRailMovementReady = 1476,
	PlayerRailArrivedNotification(PlayerRailArrivedNotification) = 1477,
	RequestRailActivatorState = 1479,
	ModifyGhostingDistance(ModifyGhostingDistance) = 1485,
	ModularAssemblyNifCompleted(ModularAssemblyNifCompleted) = 1498,
	GetHotPropertyData = 1511,
	UpdatePropertyPerformanceCost(UpdatePropertyPerformanceCost) = 1547,
	SetEmotesEnabled(SetEmotesEnabled) = 1577,
	VehicleNotifyHitImaginationServer(VehicleNotifyHitImaginationServer) = 1606,
	CelebrationCompleted = 1632,
	RequestMoveItemBetweenInventoryTypes(RequestMoveItemBetweenInventoryTypes) = 1666,
	NotifyServerLevelProcessingComplete = 1734,
	ServerCancelMoveSkill = 1746,
	DismountComplete(DismountComplete) = 1756,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RequestDie {
	pub unknown: bool,
	pub death_type: GmWString,
	pub direction_relative_angle_xz: f32,
	pub direction_relative_angle_y: f32,
	pub direction_relative_force: f32,
	#[default(KillType::Violent)]
	pub kill_type: KillType,
	pub killer_id: ObjId,
	pub loot_owner_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PlayEmote {
	pub emote_id: i32,
	pub target_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ControlBehaviors {
	pub args: Amf3,
	pub command: GmString,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct StartSkill {
	#[default(false)]
	pub used_mouse: bool,
	#[default(OBJID_EMPTY)]
	pub consumable_item_id: ObjId,
	#[default(0.0)]
	pub caster_latency: f32,
	#[default(0)]
	pub cast_type: i32, // todo: type
	#[default(Vector3::ZERO)]
	pub last_clicked_posit: Vector3,
	pub optional_originator_id: ObjId,
	#[default(OBJID_EMPTY)]
	pub optional_target_id: ObjId,
	#[default(Quaternion::IDENTITY)]
	pub originator_rot: Quaternion,
	pub bitstream: Vec<u8>,
	pub skill_id: u32, // todo: type
	#[default(0)]
	pub skill_handle: u32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct CasterDead {
	#[default(OBJID_EMPTY)]
	pub caster: ObjId,
	#[default(0)]
	pub skill_handle: u32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct VerifyAck {
	#[default(false)]
	pub different: bool,
	pub bitstream: Vec<u8>,
	#[default(0)]
	pub handle: u32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SelectSkill {
	#[default(false)]
	pub from_skill_set: bool,
	pub skill_id: i32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PickupCurrency {
	pub currency: u32,
	pub position: Vector3,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PickupItem {
	pub loot_object_id: ObjId,
	pub player_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RebuildCancel {
	pub early_release: bool,
	pub user_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RespondToMission {
	pub mission_id: i32,
	pub player_id: ObjId,
	pub receiver: ObjId,
	#[default(LOT_NULL)]
	pub reward_item: Lot,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ServerTerminateInteraction {
	pub obj_id_terminator: ObjId,
	pub terminate_type: TerminateType,
}

#[derive(Debug, Deserialize, Serialize, PartialEq, GmParam)]
#[repr(u32)]
pub enum TerminateType {
	Range,
	User,
	FromInteraction,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RequestUse {
	pub is_multi_interact_use: bool,
	pub multi_interact_id: u32,
	pub multi_interact_type: InteractionType,
	pub object: ObjId,
	#[default(false)]
	pub secondary: bool,
}

#[derive(Debug, Deserialize, Serialize, PartialEq, GmParam)]
#[repr(u32)]
pub enum InteractionType {
	MissionOfferer,
	Vendor,
	ItemRecipe,
	ItemForge,
	Script = 999,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct BuyFromVendor {
	#[default(false)]
	pub confirmed: bool,
	#[default(1)]
	pub count: i32, // todo: unsigned?
	pub item: Lot,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SellToVendor {
	#[default(1)]
	pub count: i32, // todo: unsigned?
	pub item_obj_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct AcknowledgePossession {
	#[default(OBJID_EMPTY)]
	pub possessed_obj_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RequestActivityExit {
	pub user_cancel: bool,
	pub user_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ShootingGalleryFire {
	pub target_pos: Vector3,
	pub w: f32,
	pub x: f32,
	pub y: f32,
	pub z: f32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ClientItemConsumed {
	pub item: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct UpdateShootingGalleryRotation {
	pub angle: f32,
	pub facing: Vector3,
	pub muzzle_pos: Vector3,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SetTooltipFlag {
	pub flag: bool,
	pub tool_tip: i32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SetFlag {
	pub flag: bool,
	pub flag_id: i32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct HasBeenCollected {
	pub player_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct DespawnPet {
	pub delete_pet: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PlayerLoaded {
	pub player_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RequestLinkedMission {
	pub player_id: ObjId,
	pub mission_id: i32,
	pub mission_offered: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct MissionDialogueOk {
	pub is_complete: bool,
	pub mission_state: MissionState,
	pub mission_id: i32,
	pub responder: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct MessageBoxRespond {
	pub button: i32,
	pub identifier: GmWString,
	pub user_data: GmWString,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ChoiceBoxRespond {
	pub button_identifier: GmWString,
	pub button: i32,
	pub identifier: GmWString,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct UseNonEquipmentItem {
	pub item_to_use: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct FetchModelMetadataRequest {
	pub context: i32,
	pub object_id: ObjId,
	pub requestor_id: ObjId,
	pub ug_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct CommandPet {
	pub generic_pos_info: Vector3,
	pub obj_id_source: ObjId,
	pub pet_command_type: i32,
	pub type_id: i32,
	#[default(false)]
	pub override_obey: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RequestActivitySummaryLeaderboardData {
	#[default(0)]
	pub game_id: i32,
	#[default(QueryType::TopCharacter)]
	pub query_type: QueryType,
	#[default(10)]
	pub results_end: i32,
	#[default(0)]
	pub results_start: i32,
	pub target: ObjId,
	pub weekly: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct NotifyPet {
	pub obj_id_source: ObjId,
	pub obj_to_notify_pet_about: ObjId,
	pub pet_notification_type: PetNotificationType,
}

#[derive(Debug, Deserialize, Serialize, PartialEq, GmParam)]
#[repr(u32)]
pub enum QueryType {
	TopAll,
	TopCharacter,
	TopSocial,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ClientExitTamingMinigame {
	#[default(true)]
	pub voluntary_exit: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PetTamingMinigameResult {
	pub success: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct NotifyTamingBuildSuccess {
	pub build_position: Vector3,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RequestSetPetName {
	pub name: GmWString,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct CinematicUpdate {
	#[default(CinematicEvent::Started)]
	pub event: CinematicEvent,
	#[default(-1.0)]
	pub overall_time: f32,
	pub path_name: GmWString,
	#[default(-1.0)]
	pub path_time: f32,
	#[default(-1)]
	pub waypoint: i32,
}

#[derive(Debug, Deserialize, Serialize, PartialEq, GmParam)]
#[repr(u32)]
pub enum CinematicEvent {
	Started,
	Waypoint,
	Ended,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct FireEventServerSide {
	pub args: GmWString,
	#[default(-1)]
	pub param1: i32,
	#[default(-1)]
	pub param2: i32,
	#[default(-1)]
	pub param3: i32,
	pub sender_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PropertyEditorBegin {
	#[default(0)]
	pub distance_type: i32,
	#[default(OBJID_EMPTY)]
	pub property_object_id: ObjId,
	#[default(1)]
	pub start_mode: i32,
	#[default(0)]
	pub start_paused: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ToggleGhostReferenceOverride {
	#[default(false)]
	pub ref_override: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SetGhostReferencePosition {
	pub pos: Vector3,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct UpdateModelFromClient {
	pub model_id: ObjId,
	pub position: Vector3,
	#[default(Quaternion::IDENTITY)]
	pub rotation: Quaternion,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct DeleteModelFromClient {
	#[default(OBJID_EMPTY)]
	pub model_id: ObjId,
	#[default(DeleteReason::PickingModelUp)]
	pub reason: DeleteReason,
}

#[derive(Debug, Deserialize, Serialize, PartialEq, GmParam)]
#[repr(u32)]
pub enum DeleteReason {
	PickingModelUp,
	ReturningModelToInventory,
	BreakingModelApart,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct EnterProperty1 {
	pub index: i32,
	#[default(true)]
	pub return_to_zone: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PropertyEntranceSync {
	pub include_null_address: bool,
	pub include_null_description: bool,
	pub players_own: bool,
	pub update_ui: bool,
	pub num_results: i32,
	pub reputation_time: i32,
	pub sort_method: i32,
	pub start_index: i32,
	pub filter_text: GmString,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ParseChatMessage {
	pub client_state: i32,
	pub string: GmWString,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SetMissionTypeState {
	#[default(MissionLockState::New)]
	pub state: MissionLockState,
	pub mission_subtype: GmString,
	pub mission_type: GmString,
}

#[derive(Debug, Deserialize, Serialize, PartialEq, GmParam)]
#[repr(u32)]
pub enum MissionLockState {
	Locked,
	New,
	Unlocked,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct UpdatePropertyOrModelForFilterCheck {
	pub is_property: bool,
	pub ugc_id: ObjId,
	pub player_id: ObjId,
	pub world_id: ObjId,
	pub new_description: GmWString,
	pub new_name: GmWString,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ClientTradeRequest {
	#[default(false)]
	pub need_invite_pop_up: bool,
	pub invitee: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ClientTradeAccept {
	#[default(false)]
	pub first: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ReadyForUpdates {
	pub object_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SetLastCustomBuild {
	pub tokenized_lot_list: GmWString,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PropertyModerationAction {
	#[default(0)]
	pub character_id: ObjId,
	pub info: GmWString,
	#[default(-1)]
	pub new_moderation_status: i32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct BounceNotification {
	pub obj_id_bounced: ObjId,
	pub obj_id_bouncer: ObjId,
	pub success: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SetBbbAutosave {
	pub lxfml_data_compressed: Vec<u8>,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct BbbLoadItemRequest {
	pub item_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct BbbSaveRequest {
	pub local_id: ObjId,
	pub lxfml_data_compressed: Vec<u8>,
	pub time_taken_in_ms: u32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ZoneSummaryDismissed {
	pub player_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ActivityStateChangeRequest {
	pub obj_id: ObjId,
	pub num_value_1: i32,
	pub num_value_2: i32,
	pub string_value: GmWString,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct StartBuildingWithItem {
	#[default(true)]
	pub first_time: bool,
	pub success: bool,
	pub source_bag: InventoryType,
	pub source_id: ObjId,
	pub source_lot: Lot,
	pub source_type: i32,
	pub target_id: ObjId,
	pub target_lot: Lot,
	pub target_pos: Vector3,
	pub target_type: i32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct DoneArrangingWithItem {
	pub new_source_bag: InventoryType,
	pub new_source_id: ObjId,
	pub new_source_lot: Lot,
	pub new_source_type: i32,
	pub new_target_id: ObjId,
	pub new_target_lot: Lot,
	pub new_target_type: i32,
	pub new_target_pos: Vector3,
	pub old_item_bag: InventoryType,
	pub old_item_id: ObjId,
	pub old_item_lot: Lot,
	pub old_item_type: i32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SetBuildMode {
	pub start: bool,
	#[default(-1)]
	pub distance_type: i32,
	#[default(false)]
	pub mode_paused: bool,
	#[default(1)]
	pub mode_value: i32,
	pub player_id: ObjId,
	#[default(Vector3::ZERO)]
	pub start_pos: Vector3,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct BuildModeSet {
	pub start: bool,
	#[default(-1)]
	pub distance_type: i32,
	#[default(false)]
	pub mode_paused: bool,
	#[default(1)]
	pub mode_value: i32,
	pub player_id: ObjId,
	#[default(Vector3::ZERO)]
	pub start_pos: Vector3,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct BuildExitConfirmation {
	pub player_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct MoveItemBetweenInventoryTypes {
	pub inventory_type_a: InventoryType,
	pub inventory_type_b: InventoryType,
	pub object_id: ObjId,
	#[default(true)]
	pub show_flying_loot: bool,
	#[default(1)]
	pub stack_count: u32,
	#[default(LOT_NULL)]
	pub template_id: Lot,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct MissionDialogueCancelled {
	pub is_complete: bool,
	pub mission_state: MissionState,
	pub mission_id: i32,
	pub responder: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SyncSkill {
	#[default(false)]
	pub done: bool,
	pub bitstream: Vec<u8>,
	pub behavior_handle: u32,
	pub skill_handle: u32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RequestServerProjectileImpact {
	#[default(OBJID_EMPTY)]
	pub local_id: ObjId,
	#[default(OBJID_EMPTY)]
	pub target_id: ObjId,
	pub bitstream: Vec<u8>,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ToggleSendingPositionUpdates {
	#[default(false)]
	pub send_updates: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PlacePropertyModel {
	pub model_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ReportBug {
	pub body: GmWString,
	pub client_version: GmString,
	pub other_player_id: GmString,
	pub selection: GmString,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RacingPlayerInfoResetFinished {
	pub player_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct VehicleSetWheelLockState {
	#[default(true)]
	pub extra_friction: bool,
	#[default(false)]
	pub locked: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PropertyContentsFromClient {
	#[default(false)]
	pub query_db: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ZonePropertyModelRotated {
	#[default(OBJID_EMPTY)]
	pub player_id: ObjId,
	#[default(OBJID_EMPTY)]
	pub property_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ZonePropertyModelRemovedWhileEquipped {
	#[default(OBJID_EMPTY)]
	pub player_id: ObjId,
	#[default(OBJID_EMPTY)]
	pub property_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ZonePropertyModelEquipped {
	#[default(OBJID_EMPTY)]
	pub player_id: ObjId,
	#[default(OBJID_EMPTY)]
	pub property_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RacingClientReady {
	pub player_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ResetPropertyBehaviors {
	#[default(true)]
	pub force: bool,
	#[default(false)]
	pub pause: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SetConsumableItem {
	pub item_template_id: Lot,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct UsedInformationPlaque {
	pub plaque: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ActivateBrickMode {
	#[default(OBJID_EMPTY)]
	pub build_object_id: ObjId,
	#[default(BuildType::OnProperty)]
	pub build_type: BuildType,
	#[default(true)]
	pub enter_build_from_world: bool,
	#[default(true)]
	pub enter_flag: bool,
}

#[derive(Debug, Deserialize, Serialize, PartialEq, GmParam)]
#[repr(u32)]
pub enum BuildType {
	Nowhere,
	InWorld,
	OnProperty,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct CancelRailMovement {
	#[default(false)]
	pub immediate: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct PlayerRailArrivedNotification {
	pub path_name: GmWString,
	pub waypoint_number: i32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ModifyGhostingDistance {
	#[default(1.0)]
	pub distance: f32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct ModularAssemblyNifCompleted {
	pub object_id: ObjId,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct UpdatePropertyPerformanceCost {
	#[default(0.0)]
	pub performance_cost: f32,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct SetEmotesEnabled {
	#[default(true)]
	pub enable_emotes: bool,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct VehicleNotifyHitImaginationServer {
	#[default(OBJID_EMPTY)]
	pub pickup_obj_id: ObjId,
	#[default(OBJID_EMPTY)]
	pub pickup_spawner_id: ObjId,
	#[default(-1)]
	pub pickup_spawner_index: i32,
	#[default(Vector3::ZERO)]
	pub vehicle_position: Vector3,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct RequestMoveItemBetweenInventoryTypes {
	#[default(true)]
	pub allow_partial: bool,
	#[default(-1)]
	pub dest_slot: i32,
	#[default(1)]
	pub stack_count: u32,
	#[default(InventoryType::Default)]
	pub inv_type_dst: InventoryType,
	#[default(InventoryType::Default)]
	pub inv_type_src: InventoryType,
	#[default(OBJID_EMPTY)]
	pub object_id: ObjId,
	#[default(true)]
	pub show_flying_loot: bool,
	#[default(OBJID_EMPTY)]
	pub subkey: ObjId,
	#[default(LOT_NULL)]
	pub template_id: Lot,
}

#[derive(Debug, GameMessage, PartialEq)]
pub struct DismountComplete {
	pub mount_id: ObjId,
}