mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-16 06:14:45 +00:00
perf[protocol]: 支持指定协议生成的路径
This commit is contained in:
1 parent
8ae6926bd6
commit
04918a4ab8
11 files changed
+97
-38
No files matched your search
@@ -32,6 +32,7 @@ public class NetConfig {
|
||||
* 协议生成属性变量对应于{@link GenerateOperation}
|
||||
*/
|
||||
private boolean foldProtocol;
|
||||
private String protocolPath;
|
||||
private String protocolParam;
|
||||
private boolean generateJsProtocol;
|
||||
private boolean generateCsProtocol;
|
||||
@@ -73,6 +74,14 @@ public class NetConfig {
|
||||
this.foldProtocol = foldProtocol;
|
||||
}
|
||||
|
||||
public String getProtocolPath() {
|
||||
return protocolPath;
|
||||
}
|
||||
|
||||
public void setProtocolPath(String protocolPath) {
|
||||
this.protocolPath = protocolPath;
|
||||
}
|
||||
|
||||
public String getProtocolParam() {
|
||||
return protocolParam;
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ public class PacketService implements IPacketService {
|
||||
var protocolLocation = NetContext.getConfigManager().getLocalConfig().getProtocolLocation();
|
||||
|
||||
var foldProtocol = NetContext.getConfigManager().getLocalConfig().isFoldProtocol();
|
||||
var protocolPath = NetContext.getConfigManager().getLocalConfig().getProtocolPath();
|
||||
var protocolParam = NetContext.getConfigManager().getLocalConfig().getProtocolParam();
|
||||
var generateJsProtocol = NetContext.getConfigManager().getLocalConfig().isGenerateJsProtocol();
|
||||
var generateCsharpProtocol = NetContext.getConfigManager().getLocalConfig().isGenerateCsProtocol();
|
||||
@@ -90,6 +91,7 @@ public class PacketService implements IPacketService {
|
||||
var generateGdProtocol = NetContext.getConfigManager().getLocalConfig().isGenerateGdProtocol();
|
||||
var generateOperation = new GenerateOperation();
|
||||
generateOperation.setFoldProtocol(foldProtocol);
|
||||
generateOperation.setProtocolPath(protocolPath);
|
||||
generateOperation.setProtocolParam(protocolParam);
|
||||
if (generateJsProtocol) {
|
||||
generateOperation.getGenerateLanguages().add(CodeLanguage.JavaScript);
|
||||
|
||||
@@ -94,6 +94,7 @@ public class NetDefinitionParser implements BeanDefinitionParser {
|
||||
resolvePlaceholder("generate-lua-protocol", "generateLuaProtocol", builder, element, parserContext);
|
||||
resolvePlaceholder("generate-gd-protocol", "generateGdProtocol", builder, element, parserContext);
|
||||
resolvePlaceholder("fold-protocol", "foldProtocol", builder, element, parserContext);
|
||||
resolvePlaceholder("protocol-path", "protocolPath", builder, element, parserContext);
|
||||
resolvePlaceholder("protocol-param", "protocolParam", builder, element, parserContext);
|
||||
|
||||
var registryElement = DomUtils.getFirstChildElementByTagName(element, "registry");
|
||||
|
||||
@@ -71,7 +71,8 @@
|
||||
<xsd:attribute name="generate-lua-protocol" type="xsd:string" default="false"/>
|
||||
<xsd:attribute name="generate-gd-protocol" type="xsd:string" default="false"/>
|
||||
<xsd:attribute name="fold-protocol" type="xsd:string" default="false"/>
|
||||
<xsd:attribute name="protocol-param" type="xsd:string" default="false"/>
|
||||
<xsd:attribute name="protocol-path" type="xsd:string"/>
|
||||
<xsd:attribute name="protocol-param" type="xsd:string"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:element name="config" type="configType"/>
|
||||
|
||||
Reference in new issue
Block a user