Skip to content

Commit

Permalink
update(builder): Use proto files from core
Browse files Browse the repository at this point in the history
  • Loading branch information
skuzzis committed Nov 7, 2024
1 parent 927dcac commit ff50492
Show file tree
Hide file tree
Showing 16 changed files with 4,777 additions and 2,133 deletions.
31 changes: 8 additions & 23 deletions AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -223,30 +223,15 @@ for sdk_target in MMSPlugin.sdk_targets:
os.path.join('alliedmodders', 'metamod', 'core', 'sourcehook')
]

protoc_builder = builder.tools.Protoc(protoc = sdk_target.protoc, sources = [
os.path.join(sdk['path'], 'game', 'shared', 'clientmessages.proto'),
os.path.join(sdk['path'], 'game', 'shared', 'usermessages.proto'),
os.path.join(sdk['path'], 'game', 'shared', 'te.proto'),
os.path.join(sdk['path'], 'game', 'shared', 'usercmd.proto'),

os.path.join(builder.sourcePath, 'protobufs', 'cs_gameevents.proto'),
os.path.join(builder.sourcePath, 'protobufs', 'cs_usercmd.proto'),

os.path.join(builder.sourcePath, 'protobufs', 'cstrike15_gcmessages.proto'),
os.path.join(builder.sourcePath, 'protobufs', 'cstrike15_usermessages.proto'),

os.path.join(sdk['path'], 'gcsdk', 'gcsdk_gcmessages.proto'),
os.path.join(sdk['path'], 'gcsdk', 'steammessages.proto'),
protobufSources = []
for root, dirs, files in os.walk(os.path.join(builder.sourcePath, "protobufs")):
for _file in files:
if fnmatch.fnmatch(_file, '*.proto'):
protobufSources.append(os.path.join(root, _file).replace("\\", "/"))

os.path.join(sdk['path'], 'common', 'network_connection.proto'),
os.path.join(sdk['path'], 'common', 'networkbasetypes.proto'),
os.path.join(sdk['path'], 'common', 'netmessages.proto'),
os.path.join(sdk['path'], 'common', 'engine_gcmessages.proto'),
])
protoc_builder.protoc.includes += [
os.path.join(sdk['path'], 'gcsdk'),
os.path.join(sdk['path'], 'common'),
os.path.join(sdk['path'], 'game', 'shared'),
protoc_builder = builder.tools.Protoc(protoc = sdk_target.protoc, sources = protobufSources)
protoc_builder.protoc.includes = [
os.path.join(sdk['path'], 'thirdparty', 'protobuf-3.21.8', 'src'),
os.path.join(builder.sourcePath, 'protobufs')
]

Expand Down
53 changes: 53 additions & 0 deletions protobufs/clientmessages.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
enum EBaseClientMessages {
CM_CustomGameEvent = 280;
CM_CustomGameEventBounce = 281;
CM_ClientUIEvent = 282;
CM_DevPaletteVisibilityChanged = 283;
CM_WorldUIControllerHasPanelChanged = 284;
CM_RotateAnchor = 285;
CM_ListenForResponseFound = 286;
CM_MAX_BASE = 300;
}

enum EClientUIEvent {
EClientUIEvent_Invalid = 0;
EClientUIEvent_DialogFinished = 1;
EClientUIEvent_FireOutput = 2;
}

message CClientMsg_CustomGameEvent {
optional string event_name = 1;
optional bytes data = 2;
}

message CClientMsg_CustomGameEventBounce {
optional string event_name = 1;
optional bytes data = 2;
optional int32 player_slot = 3 [default = -1];
}

message CClientMsg_ClientUIEvent {
optional .EClientUIEvent event = 1 [default = EClientUIEvent_Invalid];
optional uint32 ent_ehandle = 2;
optional uint32 client_ehandle = 3;
optional string data1 = 4;
optional string data2 = 5;
}

message CClientMsg_DevPaletteVisibilityChangedEvent {
optional bool visible = 1;
}

message CClientMsg_WorldUIControllerHasPanelChangedEvent {
optional bool has_panel = 1;
optional uint32 client_ehandle = 2;
optional uint32 literal_hand_type = 3;
}

message CClientMsg_RotateAnchor {
optional float angle = 1;
}

message CClientMsg_ListenForResponseFound {
optional int32 player_slot = 1 [default = -1];
}
70 changes: 35 additions & 35 deletions protobufs/cs_gameevents.proto
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import "networkbasetypes.proto";

enum ECsgoGameEvents {
GE_PlayerAnimEventId = 450;
GE_RadioIconEventId = 451;
GE_FireBulletsId = 452;
}

message CMsgTEPlayerAnimEvent {
optional fixed32 player = 1 [default = 16777215];
optional uint32 event = 2;
optional int32 data = 3;
}

message CMsgTERadioIcon {
optional fixed32 player = 1 [default = 16777215];
}

message CMsgTEFireBullets {
optional .CMsgVector origin = 1;
optional .CMsgQAngle angles = 2;
optional uint32 weapon_id = 3 [default = 16777215];
optional uint32 mode = 4;
optional uint32 seed = 5;
optional fixed32 player = 6 [default = 16777215];
optional float inaccuracy = 7;
optional float recoil_index = 8;
optional float spread = 9;
optional int32 sound_type = 10;
optional uint32 item_def_index = 11;
optional fixed32 sound_dsp_effect = 12;
optional .CMsgVector ent_origin = 13;
optional uint32 num_bullets_remaining = 14;
optional uint32 attack_type = 15;
}
import "networkbasetypes.proto";

enum ECsgoGameEvents {
GE_PlayerAnimEventId = 450;
GE_RadioIconEventId = 451;
GE_FireBulletsId = 452;
}

message CMsgTEPlayerAnimEvent {
optional fixed32 player = 1 [default = 16777215];
optional uint32 event = 2;
optional int32 data = 3;
}

message CMsgTERadioIcon {
optional fixed32 player = 1 [default = 16777215];
}

message CMsgTEFireBullets {
optional .CMsgVector origin = 1;
optional .CMsgQAngle angles = 2;
optional uint32 weapon_id = 3 [default = 16777215];
optional uint32 mode = 4;
optional uint32 seed = 5;
optional fixed32 player = 6 [default = 16777215];
optional float inaccuracy = 7;
optional float recoil_index = 8;
optional float spread = 9;
optional int32 sound_type = 10;
optional uint32 item_def_index = 11;
optional fixed32 sound_dsp_effect = 12;
optional .CMsgVector ent_origin = 13;
optional uint32 num_bullets_remaining = 14;
optional uint32 attack_type = 15;
}
77 changes: 42 additions & 35 deletions protobufs/cs_usercmd.proto
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
import "networkbasetypes.proto";
import "usercmd.proto";

message CSGOInterpolationInfoPB {
optional int32 src_tick = 1 [default = -1];
optional int32 dst_tick = 2 [default = -1];
optional float frac = 3 [default = 0];
}

message CSGOInputHistoryEntryPB {
optional .CMsgQAngle view_angles = 2;
optional int32 render_tick_count = 4;
optional float render_tick_fraction = 5;
optional int32 player_tick_count = 6;
optional float player_tick_fraction = 7;
optional .CSGOInterpolationInfoPB cl_interp = 12;
optional .CSGOInterpolationInfoPB sv_interp0 = 13;
optional .CSGOInterpolationInfoPB sv_interp1 = 14;
optional .CSGOInterpolationInfoPB player_interp = 15;
optional int32 frame_number = 20;
optional int32 target_ent_index = 8 [default = -1];
optional .CMsgVector shoot_position = 3;
optional .CMsgVector target_head_pos_check = 9;
optional .CMsgVector target_abs_pos_check = 10;
optional .CMsgQAngle target_abs_ang_check = 11;
}

message CSGOUserCmdPB {
optional .CBaseUserCmdPB base = 1;
repeated .CSGOInputHistoryEntryPB input_history = 2;
optional int32 attack1_start_history_index = 6 [default = -1];
optional int32 attack2_start_history_index = 7 [default = -1];
optional int32 attack3_start_history_index = 8 [default = -1];
optional bool left_hand_desired = 9 [default = false];
}
import "networkbasetypes.proto";
import "usercmd.proto";

message CSGOInterpolationInfoPB {
optional int32 src_tick = 1 [default = -1];
optional int32 dst_tick = 2 [default = -1];
optional float frac = 3 [default = 0];
}

message CSGOInterpolationInfoPB_CL {
optional float frac = 3 [default = 0];
}

message CSGOInputHistoryEntryPB {
optional .CMsgQAngle view_angles = 2;
optional int32 render_tick_count = 4;
optional float render_tick_fraction = 5;
optional int32 player_tick_count = 6;
optional float player_tick_fraction = 7;
optional .CSGOInterpolationInfoPB_CL cl_interp = 12;
optional .CSGOInterpolationInfoPB sv_interp0 = 13;
optional .CSGOInterpolationInfoPB sv_interp1 = 14;
optional .CSGOInterpolationInfoPB player_interp = 15;
optional int32 frame_number = 64;
optional int32 target_ent_index = 65 [default = -1];
optional .CMsgVector shoot_position = 66;
optional .CMsgVector target_head_pos_check = 67;
optional .CMsgVector target_abs_pos_check = 68;
optional .CMsgQAngle target_abs_ang_check = 69;
}

message CSGOUserCmdPB {
optional .CBaseUserCmdPB base = 1;
repeated .CSGOInputHistoryEntryPB input_history = 2;
optional int32 attack1_start_history_index = 6 [default = -1];
optional int32 attack2_start_history_index = 7 [default = -1];
optional int32 attack3_start_history_index = 8 [default = -1];
optional bool left_hand_desired = 9 [default = false];
optional bool is_predicting_body_shot_fx = 11 [default = false];
optional bool is_predicting_head_shot_fx = 12 [default = false];
optional bool is_predicting_kill_ragdolls = 13 [default = false];
}
Loading

0 comments on commit ff50492

Please sign in to comment.