Skip to content
This repository has been archived by the owner on Dec 27, 2020. It is now read-only.

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
* Restrict map_name to 32 characters limitation. 128 characters string
is illogical.
* Add missing 2 functions for D language in IObject API.
  • Loading branch information
RadWolfie committed Dec 13, 2017
1 parent 9cd7f63 commit 0a326ae
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
3 changes: 2 additions & 1 deletion C/struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ typedef struct s_server_header {
unsigned short state; //0x004
unsigned short Unknown2; //0x006
wchar_t server_name[66]; //0x008
char map_name[128]; //0x08C
char map_name[32]; //0x08C
unsigned char Unknown12[96]; //0x0AC
wchar_t gametype_name[24]; //0x10C
//IMPORTANT: DO NOT USE! Below this does not match with other Halo PC platforms, it is base on Halo CE version.
unsigned char Unknown11[40]; //0x13C // partial of Gametype need to break them down.
Expand Down
4 changes: 3 additions & 1 deletion CSharp/struct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ public struct s_gametype_globals_ptr {

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct map_name_ansi {
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string name;
}
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
Expand All @@ -491,6 +491,8 @@ public struct s_server_header {
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 66)]
public string server_name; //0x008
public map_name_ansi map_name; //0x08C
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 96)]
public byte[] Unknown12; //0x0AC
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 24)]
public string gametype_name; //0x10C
//IMPORTANT: DO NOT USE! Below this does not match with other Halo PC platforms, it is base on Halo CE version.
Expand Down
21 changes: 21 additions & 0 deletions D/object.d
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,27 @@ static if(__traits(compiles, EXT_IOBJECT)) {
* Returns: Return true or false if unable to find tag group.
*/
bool function(const e_tag_group tag_group, objTagGroupList* tag_list) m_get_lookup_group_tag_list;
/*
* Apply damage to specific object. (WARNING: May not be safe to use on certain custom maps.)
* Params:
* receiver = An object receive the damage.</param>
* causer = An object cause the damage.</param>
* multiply = Mulitply the damage.</param>
* flags = Type of damage flags</param>
* <returns>Return true or false if unable to apply generic damage.</returns>
*/
bool (*m_apply_damage_generic)(s_ident receiver, s_ident causer, float multiply, objDamageFlags flags);
/*
* Apply damage to specific object.
* Params:
* receiver = An object receive the damage.</param>
* causer = An object cause the damage.</param>
* tag = Apply type of tag damage to receiver.</param>
* multiply = Mulitply the damage.</param>
* flags = Type of damage flags</param>
* Returns: Return true or false if unable to apply custom damage.
*/
void (*m_apply_damage_custom)(s_ident receiver, s_ident causer, const hTagHeader* tag, float multiply, objDamageFlags flags);
};
export extern(C) IObject* getIObject(uint hash);
}
5 changes: 3 additions & 2 deletions D/structs.d
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ struct s_server_header {
ushort state; //0x004
ushort Unknown2; //0x006
wchar[66] server_name; //0x008
char[128] map_name; //0x08C
char[32] map_name; //0x08C
ubyte[96] Unknown12; //0x0AC
wchar[24] gametype_name; //0x10C
//IMPORTANT: DO NOT USE! Below this does not match with other Halo PC platforms, it is base on Halo CE version.
ubyte[40] Unknown11; //0x13C // partial of Gametype need to break them down.
Expand Down Expand Up @@ -770,7 +771,7 @@ align (1) struct s_map_header {
uint offset; //0x10
uint metaSize; //0x14
ubyte[8] PADDING1; //0x18 //Nulls
char[32] mapName; //0x20
char[32] name; //0x20
char[32] builddate; //0x40
uint type; //0x060 // 0 = Campaign, 1 = Multi-player, 2 = Menu
uint unknown07; //0x064
Expand Down
4 changes: 3 additions & 1 deletion VisualBasic/struct.vb
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)>
Public Structure map_name_ansi
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)>
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)>
Public name As String
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Expand All @@ -490,6 +490,8 @@ Public Structure s_server_header
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=66)>
Public server_name As String '0x008
Public map_name As map_name_ansi '0x08C
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=96)>
Public Unknown12 As Byte '0x0AC
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=24)>
Public gametype_name As String '0x10C
'IMPORTANT: DO NOT USE! Below this does Not match with other Halo PC platforms, it Is base on Halo CE version.
Expand Down

0 comments on commit 0a326ae

Please sign in to comment.