@@ -34,105 +34,106 @@ enum class command_type : uint8_t {
34
34
add_to_sphere = 24 ,
35
35
remove_from_sphere = 25 ,
36
36
upgrade_colony_to_state = 26 ,
37
- invest_in_colony = 27 ,
38
- abandon_colony = 28 ,
39
- finish_colonization = 29 ,
40
- intervene_in_war = 30 ,
41
- suppress_movement = 31 ,
42
- civilize_nation = 32 ,
43
- appoint_ruling_party = 33 ,
44
- change_issue_option = 34 ,
45
- change_reform_option = 35 ,
46
- become_interested_in_crisis = 36 ,
47
- take_sides_in_crisis = 37 ,
48
- begin_land_unit_construction = 38 ,
49
- cancel_land_unit_construction = 39 ,
50
- change_stockpile_settings = 40 ,
51
- take_decision = 41 ,
52
- make_n_event_choice = 42 ,
53
- make_f_n_event_choice = 43 ,
54
- make_p_event_choice = 44 ,
55
- make_f_p_event_choice = 45 ,
56
- fabricate_cb = 46 ,
57
- cancel_cb_fabrication = 47 ,
58
- ask_for_military_access = 48 ,
59
- ask_for_alliance = 49 ,
60
- call_to_arms = 50 ,
61
- respond_to_diplomatic_message = 51 ,
62
- cancel_military_access = 52 ,
63
- cancel_alliance = 53 ,
64
- cancel_given_military_access = 54 ,
65
- declare_war = 55 ,
66
- add_war_goal = 56 ,
67
- start_peace_offer = 58 ,
68
- add_peace_offer_term = 59 ,
69
- send_peace_offer = 60 ,
70
- move_army = 61 ,
71
- move_navy = 62 ,
72
- embark_army = 63 ,
73
- merge_armies = 64 ,
74
- merge_navies = 65 ,
75
- split_army = 66 ,
76
- split_navy = 67 ,
77
- delete_army = 68 ,
78
- delete_navy = 69 ,
79
- designate_split_regiments = 70 ,
80
- designate_split_ships = 71 ,
81
- naval_retreat = 72 ,
82
- land_retreat = 73 ,
83
- start_crisis_peace_offer = 74 ,
84
- invite_to_crisis = 75 ,
85
- add_wargoal_to_crisis_offer = 76 ,
86
- send_crisis_peace_offer = 77 ,
87
- change_admiral = 78 ,
88
- change_general = 79 ,
89
- toggle_mobilization = 80 ,
90
- give_military_access = 81 ,
91
- set_rally_point = 82 ,
92
- save_game = 83 ,
93
- cancel_factory_building_construction = 84 ,
94
- disband_undermanned = 85 ,
95
- even_split_army = 86 ,
96
- even_split_navy = 87 ,
97
- toggle_hunt_rebels = 88 ,
98
- toggle_select_province = 89 ,
99
- toggle_immigrator_province = 90 ,
100
- state_transfer = 91 ,
101
- release_subject = 92 ,
102
- enable_debt = 93 ,
103
- move_capital = 94 ,
104
- toggle_unit_ai_control = 95 ,
105
- toggle_mobilized_is_ai_controlled = 96 ,
106
- toggle_interested_in_alliance = 97 ,
107
- pbutton_script = 98 ,
108
- nbutton_script = 99 ,
109
- set_factory_type_priority = 100 ,
110
- crisis_add_wargoal = 101 ,
111
- change_unit_type = 102 ,
112
- take_province = 103 ,
113
- grant_province = 104 ,
114
- ask_for_free_trade_agreement = 105 ,
115
- switch_embargo_status = 106 ,
116
- revoke_trade_rights = 107 ,
117
- toggle_local_administration = 108 ,
118
-
119
- // network
120
- notify_player_ban = 110 ,
121
- notify_player_kick = 111 ,
122
- notify_player_picks_nation = 112 ,
123
- notify_player_joins = 113 ,
124
- notify_player_leaves = 114 ,
125
- notify_player_oos = 115 ,
126
- notify_save_loaded = 116 ,
127
- notify_start_game = 117 , // for synchronized "start game"
128
- notify_stop_game = 118 , // "go back to lobby"
129
- notify_pause_game = 119 , // visual aid mostly
130
- notify_reload = 120 ,
131
- advance_tick = 121 ,
132
- chat_message = 122 ,
133
- network_inactivity_ping = 123 ,
134
- notify_player_fully_loaded = 124 , // client sends this to the host to notify that they are fully loaded in, and host transmits it to all clients
135
- notify_player_is_loading = 125 , // host sends this to all clients to notify that a specific client has begun loading
37
+ invest_in_colony = 27 ,
38
+ abandon_colony = 28 ,
39
+ finish_colonization = 29 ,
40
+ intervene_in_war = 30 ,
41
+ suppress_movement = 31 ,
42
+ civilize_nation = 32 ,
43
+ appoint_ruling_party = 33 ,
44
+ change_issue_option = 34 ,
45
+ change_reform_option = 35 ,
46
+ become_interested_in_crisis = 36 ,
47
+ take_sides_in_crisis = 37 ,
48
+ begin_land_unit_construction = 38 ,
49
+ cancel_land_unit_construction = 39 ,
50
+ change_stockpile_settings = 40 ,
51
+ take_decision = 41 ,
52
+ make_n_event_choice = 42 ,
53
+ make_f_n_event_choice = 43 ,
54
+ make_p_event_choice = 44 ,
55
+ make_f_p_event_choice = 45 ,
56
+ fabricate_cb = 46 ,
57
+ cancel_cb_fabrication = 47 ,
58
+ ask_for_military_access = 48 ,
59
+ ask_for_alliance = 49 ,
60
+ call_to_arms = 50 ,
61
+ respond_to_diplomatic_message = 51 ,
62
+ cancel_military_access = 52 ,
63
+ cancel_alliance = 53 ,
64
+ cancel_given_military_access = 54 ,
65
+ declare_war = 55 ,
66
+ add_war_goal = 56 ,
67
+ start_peace_offer = 58 ,
68
+ add_peace_offer_term = 59 ,
69
+ send_peace_offer = 60 ,
70
+ move_army = 61 ,
71
+ move_navy = 62 ,
72
+ embark_army = 63 ,
73
+ merge_armies = 64 ,
74
+ merge_navies = 65 ,
75
+ split_army = 66 ,
76
+ split_navy = 67 ,
77
+ delete_army = 68 ,
78
+ delete_navy = 69 ,
79
+ designate_split_regiments = 70 ,
80
+ designate_split_ships = 71 ,
81
+ naval_retreat = 72 ,
82
+ land_retreat = 73 ,
83
+ start_crisis_peace_offer = 74 ,
84
+ invite_to_crisis = 75 ,
85
+ add_wargoal_to_crisis_offer = 76 ,
86
+ send_crisis_peace_offer = 77 ,
87
+ change_admiral = 78 ,
88
+ change_general = 79 ,
89
+ toggle_mobilization = 80 ,
90
+ give_military_access = 81 ,
91
+ set_rally_point = 82 ,
92
+ save_game = 83 ,
93
+ cancel_factory_building_construction = 84 ,
94
+ disband_undermanned = 85 ,
95
+ even_split_army = 86 ,
96
+ even_split_navy = 87 ,
97
+ toggle_hunt_rebels = 88 ,
98
+ toggle_select_province = 89 ,
99
+ toggle_immigrator_province = 90 ,
100
+ state_transfer = 91 ,
101
+ release_subject = 92 ,
102
+ enable_debt = 93 ,
103
+ move_capital = 94 ,
104
+ toggle_unit_ai_control = 95 ,
105
+ toggle_mobilized_is_ai_controlled = 96 ,
106
+ toggle_interested_in_alliance = 97 ,
107
+ pbutton_script = 98 ,
108
+ nbutton_script = 99 ,
109
+ set_factory_type_priority = 100 ,
110
+ crisis_add_wargoal = 101 ,
111
+ change_unit_type = 102 ,
112
+ take_province = 103 ,
113
+ grant_province = 104 ,
114
+ ask_for_free_trade_agreement = 105 ,
115
+ switch_embargo_status = 106 ,
116
+ revoke_trade_rights = 107 ,
117
+ toggle_local_administration = 108 ,
118
+
119
+ // network
120
+ notify_player_ban = 110 ,
121
+ notify_player_kick = 111 ,
122
+ notify_player_picks_nation = 112 ,
123
+ notify_player_joins = 113 ,
124
+ notify_player_leaves = 114 ,
125
+ notify_player_oos = 115 ,
126
+ notify_save_loaded = 116 ,
127
+ notify_start_game = 117 , // for synchronized "start game"
128
+ notify_stop_game = 118 , // "go back to lobby"
129
+ notify_pause_game = 119 , // visual aid mostly
130
+ notify_reload = 120 ,
131
+ advance_tick = 121 ,
132
+ chat_message = 122 ,
133
+ network_inactivity_ping = 123 ,
134
+ notify_player_fully_loaded = 124 , // client sends this to the host to notify that they are fully loaded in, and host transmits it to all clients
135
+ notify_player_is_loading = 125 , // host sends this to all clients to notify that a specific client has begun loading
136
+ change_ai_nation_state = 126 , // host sends this to new clients to inform them of no-ai nations, which arent players.
136
137
137
138
// console cheats
138
139
network_populate = 254 ,
@@ -209,6 +210,7 @@ struct factory_data {
209
210
210
211
struct tag_target_data {
211
212
dcon::national_identity_id ident;
213
+ sys::player_name player_name;
212
214
};
213
215
214
216
struct influence_action_data {
@@ -457,10 +459,12 @@ struct set_factory_priority_data {
457
459
struct chat_message_data {
458
460
char body[ui::max_chat_message_len];
459
461
dcon::nation_id target;
462
+ sys::player_name sender;
460
463
};
461
464
462
465
struct nation_pick_data {
463
466
dcon::nation_id target;
467
+ sys::player_name player_name;
464
468
};
465
469
466
470
struct advance_tick_data {
@@ -484,13 +488,28 @@ struct notify_reload_data {
484
488
};
485
489
struct notify_leaves_data {
486
490
bool make_ai;
491
+ sys::player_name player_name;
487
492
};
488
493
struct notify_player_fully_loaded_data {
489
494
sys::player_name name;
490
495
};
491
496
struct notify_player_is_loading_data {
492
497
sys::player_name name;
493
498
};
499
+ struct notify_player_ban_data {
500
+ bool make_ai;
501
+ sys::player_name player_name;
502
+ };
503
+ struct notify_player_kick_data {
504
+ bool make_ai;
505
+ sys::player_name player_name;
506
+ };
507
+ struct notify_player_oos_data {
508
+ sys::player_name player_name;
509
+ };
510
+ struct change_ai_nation_state_data {
511
+ bool no_ai;
512
+ };
494
513
495
514
struct payload {
496
515
union dtype {
@@ -559,6 +578,10 @@ struct payload {
559
578
pbutton_data pbutton;
560
579
cheat_invention_data_t cheat_invention_data;
561
580
set_factory_priority_data set_factory_priority;
581
+ notify_player_ban_data notify_player_ban;
582
+ notify_player_kick_data notify_player_kick;
583
+ notify_player_oos_data notify_player_oos;
584
+ change_ai_nation_state_data change_ai_nation_state;
562
585
563
586
dtype () { }
564
587
} data;
@@ -621,8 +644,8 @@ bool can_change_factory_settings(sys::state& state, dcon::nation_id source, dcon
621
644
void make_vassal (sys::state& state, dcon::nation_id source, dcon::national_identity_id t);
622
645
bool can_make_vassal (sys::state& state, dcon::nation_id source, dcon::national_identity_id t);
623
646
624
- void release_and_play_as (sys::state& state, dcon::nation_id source, dcon::national_identity_id t);
625
- bool can_release_and_play_as (sys::state& state, dcon::nation_id source, dcon::national_identity_id t);
647
+ void release_and_play_as (sys::state& state, dcon::nation_id source, dcon::national_identity_id t, sys::player_name& player_name );
648
+ bool can_release_and_play_as (sys::state& state, dcon::nation_id source, dcon::national_identity_id t, sys::player_name& player_name );
626
649
627
650
void give_war_subsidies (sys::state& state, dcon::nation_id source, dcon::nation_id target);
628
651
bool can_give_war_subsidies (sys::state& state, dcon::nation_id source, dcon::nation_id target);
@@ -922,8 +945,8 @@ void toggle_immigrator_province(sys::state& state, dcon::nation_id source, dcon:
922
945
bool can_toggle_immigrator_province (sys::state& state, dcon::nation_id source, dcon::province_id prov);
923
946
924
947
void post_chat_message (sys::state& state, ui::chat_message& m);
925
- void chat_message (sys::state& state, dcon::nation_id source, std::string_view body, dcon::nation_id target);
926
- bool can_chat_message (sys::state& state, dcon::nation_id source, std::string_view body, dcon::nation_id target);
948
+ void chat_message (sys::state& state, dcon::nation_id source, std::string_view body, dcon::nation_id target, sys::player_name& sender );
949
+ bool can_chat_message (sys::state& state, dcon::nation_id source, std::string_view body, dcon::nation_id target, sys::player_name& sender );
927
950
928
951
void release_subject (sys::state& state, dcon::nation_id source, dcon::nation_id target);
929
952
bool can_release_subject (sys::state& state, dcon::nation_id source, dcon::nation_id target);
@@ -932,23 +955,25 @@ void state_transfer(sys::state& state, dcon::nation_id asker, dcon::nation_id ta
932
955
bool can_state_transfer (sys::state& state, dcon::nation_id asker, dcon::nation_id target, dcon::state_definition_id sid);
933
956
934
957
void advance_tick (sys::state& state, dcon::nation_id source);
935
- void notify_player_ban (sys::state& state, dcon::nation_id source, dcon::nation_id target );
936
- bool can_notify_player_ban (sys::state& state, dcon::nation_id source, dcon::nation_id target );
937
- void notify_player_kick (sys::state& state, dcon::nation_id source, dcon::nation_id target );
938
- bool can_notify_player_kick (sys::state& state, dcon::nation_id source, dcon::nation_id target );
958
+ void notify_player_ban (sys::state& state, dcon::nation_id source, bool make_ai, sys::player_name& name );
959
+ bool can_notify_player_ban (sys::state& state, dcon::nation_id source, sys::player_name& name );
960
+ void notify_player_kick (sys::state& state, dcon::nation_id source, bool make_ai, sys::player_name& name );
961
+ bool can_notify_player_kick (sys::state& state, dcon::nation_id source, sys::player_name& name );
939
962
void notify_player_joins (sys::state& state, dcon::nation_id source, sys::player_name& name, sys::player_password_raw& password);
940
963
bool can_notify_player_joins (sys::state& state, dcon::nation_id source, sys::player_name& name);
941
- void notify_player_leaves (sys::state& state, dcon::nation_id source, bool make_ai);
942
- bool can_notify_player_leaves (sys::state& state, dcon::nation_id source, bool make_ai);
943
- void notify_player_picks_nation (sys::state& state, dcon::nation_id source, dcon::nation_id target);
944
- bool can_notify_player_picks_nation (sys::state& state, dcon::nation_id source, dcon::nation_id target);
945
- void notify_player_oos (sys::state& state, dcon::nation_id source);
964
+ void notify_player_leaves (sys::state& state, dcon::nation_id source, bool make_ai, sys::player_name& player_name );
965
+ bool can_notify_player_leaves (sys::state& state, dcon::nation_id source, bool make_ai, sys::player_name& player_name );
966
+ void notify_player_picks_nation (sys::state& state, dcon::nation_id source, dcon::nation_id target, sys::player_name& name );
967
+ bool can_notify_player_picks_nation (sys::state& state, dcon::nation_id source, dcon::nation_id target, sys::player_name& name );
968
+ void notify_player_oos (sys::state& state, dcon::nation_id source, sys::player_name& name );
946
969
void notify_save_loaded (sys::state& state, dcon::nation_id source);
947
970
void notify_reload (sys::state& state, dcon::nation_id source);
971
+ bool can_notify_start_game (sys::state& state, dcon::nation_id source);
948
972
void notify_start_game (sys::state& state, dcon::nation_id source);
949
973
void notify_player_is_loading (sys::state& state, dcon::nation_id source, sys::player_name& name);
950
974
void execute_notify_player_is_loading (sys::state& state, dcon::nation_id source, sys::player_name& name);
951
975
void notify_player_fully_loaded (sys::state& state, dcon::nation_id source, sys::player_name& name);
976
+ bool can_notify_stop_game (sys::state& state, dcon::nation_id source);
952
977
void notify_stop_game (sys::state& state, dcon::nation_id source);
953
978
void notify_pause_game (sys::state& state, dcon::nation_id source);
954
979
// returns true if the command was performed, false if not
0 commit comments