Shadow Network Framework
0.0.2-alpha
.NET Client Library for Shadow Network Framework
|
before setting up OPCodes you must know what is an OPCode, See Request's OPCode for more details
One thing to note is that you do not define whole OPCodes but you define each part of the OPCode one by one with a String definition of each Member, which means you define the Category, then the Sub-Category and so on
This is a General method for creating instances of a new member regardless of rank, however creating any member using this method requires you to add it manually to the OPCode structure, and/or it's parent if it should have one.
See Also
This function requires you 3 Arguments:
Example:
Creating a new category whose defining byte is 0x05 With a string definition of 'Simple Category'
You can use the method stated in Setting up a new Member and then add the Member instance you created and then add it to your opcode structure using AddCategory(Member), so unless you want to keep your Category's instance in a variable, then the use AddCategory(byte, string) would be better. See below for more details about both.
To make it possible, we use the function AddCategory(byte, string) which requires you 2 arguments:
Example:
Creating a new category whose defining byte is 0x05 With a string definition of 'Simple Category'
To make it possible, we create the member instance using the method stated in Setting up a new Member ,then use the function AddCategory(Member) which requires you 1 arguments:
Example:
Creating a new category whose defining byte is 0x05 With a string definition of 'Simple Category'
You can use the method stated in Setting up a new Member and then add the Member instance you created ( this time create the member instance with SubCategory Rank) and then add it to your opcode structure using AddSubCategory(Member, Member), so unless you want to keep your SubCategory's instance in a variable, then the use AddSubCategory(Member, byte, string) would be better. See below for more details about both.
To make it possible, we use the function AddSubCategory(Member, byte, string) which requires you 3 arguments:
Example:
Creating a new SubCategory whose defining byte is 0x00 With a string definition of 'Simple SubCategory' whose parent is the Category generated in the examples sated in Setting up a new Category
Category
To make it possible, we create the member instance using the method stated in Setting up a new Member with SubCategory Rank, then use the function AddSubCategory(Member, Member) which requires you 2 arguments:
Example:
Creating a new SubCategory whose defining byte is 0x00 With a string definition of 'Simple SubCategory' whose parent is the Category generated in the examples sated in Setting up a new Category
Category
Commands are different than the rest of OPCode Members because they (Even on the server side) define the functions to be called when they are triggered, If you create an Member instance you created with Command Rank, it will have no function to be called if the server sends a request with that command until you add it to your opcode structure.
To make it possible, we use the function AddCommand(Member, byte, string, RequestCB) which requires you 4 arguments:
Example:
Creating a new Command whose defining byte is 0x00 With a string definition of 'Simple Command' whose parent is the SubCategory generated in the examples sated in Setting up a new SubCategory
SubCategory
To make it possible, we create the member instance using the method stated in Setting up a new Member ,then use the function AddCommand(Member, Member, RequestCB) which requires you 2 arguments:
Example:
Creating a new SubCategory whose defining byte is 0x00 With a string definition of 'Simple Command' whose parent is the SubCategory generated in the examples sated in Setting up a new SubCategory
SubCategory
You can use the method stated in Setting up a new Member and then add the Member instance you created ( this time create the member instance with Detail Rank) and then add it to your opcode structure using AddDetail(Member, Member), so unless you want to keep your Detail's instance in a variable, then the use AddDetail(Member, byte, string) would be better. See below for more details about both.
To make it possible, we use the function AddDetail(Member, byte, string) which requires you 3 arguments:
Example:
Creating a new Detail whose defining byte is 0x01 With a string definition of 'Simple Detail' whose parent is the Command generated in the examples sated in Setting up a new Command
Command
To make it possible, we create the member instance using the method stated in Setting up a new Member with Detail Rank, then use the function AddDetail(Member, Member) which requires you 2 arguments:
Example:
Creating a new Detail whose defining byte is 0x01 With a string definition of 'Simple Detail' whose parent is the Command generated in the examples sated in Setting up a new Command
Command
In case you want to fetch a Base OPCode Member for some reason, use one of the Following
using
In case you want a specefic Category, you must use their defining byte
or if you want the base Category
In case you want a specefic subcategory, you must use their defining byte and the parent Category's defining byte or the category Member instance.
or if you want the base SubCategory
In case you want a specefic command, you must use their defining byte and the parent Category and Subcategory's defining Byte or the Subcategory's Member Instance,
or if you want a base command
In case you want a specefic command's detail, you must use their defining byte and the parent Category, Subcategory and Command's defining byte or the Command's Member Instance,
or if you want a base command's detail
OPCodes are a Set of bytes who's sole purpose is defining the action to perform on the server side which are mandaroty to generate new Request Instances
Category
and Base Subcategory
is 0x00
For Base OPCodes there is 2 Methods (Each having 2 Overloads)
1- Getting any base Command
2- Getting the Invalid
Command
There is 2 Methods To Generate an OPCode
1- Using The defining byte of it's Members
2- Using OPCode.Member Instances of it's Members
See Also:
0x00
and/or null
respectively, or not write that parameter to begin with