Skip to content

Commit 3eda06b

Browse files
committed
【Unity3D_常用模块】 Socket网络模块(超级详细完整,上线项目中稳定使用着)配套代码
1 parent 17cdc9d commit 3eda06b

235 files changed

Lines changed: 26058 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
500 KB
Loading
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@echo off
2+
rem ²éÕÒÎļþ
3+
for /f "delims=" %%i in ('dir /b ".\*.proto"') do echo %%i
4+
rem תcpp for /f "delims=" %%i in ('dir /b/a "*.proto"') do protoc -I=. --cpp_out=. %%i
5+
for /f "delims=" %%i in ('dir /b/a "*.proto"') do protogen -i:%%i -o:%%~ni.cs -ns:gprotocol
6+
pause
7+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The core Protocol Buffers technology is provided courtesy of Google.
2+
At the time of writing, this is released under the BSD license.
3+
Full details can be found here:
4+
5+
http://code.google.com/p/protobuf/
6+
7+
8+
This .NET implementation is Copyright 2008 Marc Gravell
9+
10+
Licensed under the Apache License, Version 2.0 (the "License");
11+
you may not use this file except in compliance with the License.
12+
You may obtain a copy of the License at
13+
14+
http://www.apache.org/licenses/LICENSE-2.0
15+
16+
Unless required by applicable law or agreed to in writing, software
17+
distributed under the License is distributed on an "AS IS" BASIS,
18+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
See the License for the specific language governing permissions and
20+
limitations under the License.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3+
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
4+
>
5+
<!--
6+
<xsl:template name="capitalizeFirst">
7+
<xsl:param name="value"/>
8+
<xsl:value-of select="translate(substring($value,1,1),$alpha,$ALPHA)"/>
9+
<xsl:value-of select="substring($value,2)"/>
10+
</xsl:template>
11+
-->
12+
<xsl:template match="*">
13+
<xsl:message terminate="yes">
14+
Node not handled: <xsl:for-each select="ancestor-or-self::*">/<xsl:value-of select="name()"/></xsl:for-each>
15+
<xsl:for-each select="*">
16+
; <xsl:value-of select="concat(name(),'=',.)"/>
17+
</xsl:for-each>
18+
</xsl:message>
19+
</xsl:template>
20+
<xsl:param name="fixCase"/>
21+
<xsl:variable name="optionFixCase" select="$fixCase='true'"/>
22+
23+
<xsl:template name="escapeKeyword">
24+
<xsl:param name="value"/>
25+
<xsl:value-of select="$value"/>
26+
</xsl:template>
27+
28+
<xsl:template name="toCamelCase">
29+
<xsl:param name="value"/>
30+
<xsl:param name="delimiter" select="'_'"/>
31+
<xsl:param name="keepDelimiter" select="false()"/>
32+
<xsl:variable name="segment" select="substring-before($value, $delimiter)"/>
33+
<xsl:choose>
34+
<xsl:when test="$segment != ''">
35+
<xsl:value-of select="$segment"/><xsl:if test="$keepDelimiter"><xsl:value-of select="$delimiter"/></xsl:if>
36+
<xsl:call-template name="toPascalCase">
37+
<xsl:with-param name="value" select="substring-after($value, $delimiter)"/>
38+
<xsl:with-param name="delimiter" select="$delimiter"/>
39+
<xsl:with-param name="keepDelimiter" select="$keepDelimiter"/>
40+
</xsl:call-template>
41+
</xsl:when>
42+
<xsl:otherwise>
43+
<xsl:value-of select="$value"/>
44+
</xsl:otherwise>
45+
</xsl:choose>
46+
</xsl:template>
47+
48+
<xsl:variable name="alpha" select="'abcdefghijklmnopqrstuvwxyz'"/>
49+
<xsl:variable name="ALPHA" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
50+
51+
<xsl:template name="toPascalCase">
52+
<xsl:param name="value"/>
53+
<xsl:param name="delimiter" select="'_'"/>
54+
<xsl:param name="keepDelimiter" select="false()"/>
55+
<xsl:if test="$value != ''">
56+
<xsl:variable name="segment" select="substring-before($value, $delimiter)"/>
57+
<xsl:choose>
58+
<xsl:when test="$segment != ''">
59+
<xsl:value-of select="translate(substring($segment,1,1),$alpha,$ALPHA)"/><xsl:value-of select="substring($segment,2)"/><xsl:if test="$keepDelimiter"><xsl:value-of select="$delimiter"/></xsl:if>
60+
<xsl:call-template name="toPascalCase">
61+
<xsl:with-param name="value" select="substring-after($value, $delimiter)"/>
62+
<xsl:with-param name="delimiter" select="$delimiter"/>
63+
<xsl:with-param name="keepDelimiter" select="$keepDelimiter"/>
64+
</xsl:call-template>
65+
</xsl:when>
66+
<xsl:otherwise>
67+
<xsl:value-of select="translate(substring($value,1,1),$alpha,$ALPHA)"/><xsl:value-of select="substring($value,2)"/>
68+
</xsl:otherwise>
69+
</xsl:choose>
70+
</xsl:if>
71+
</xsl:template>
72+
<xsl:template name="pascal">
73+
<xsl:param name="value" select="name"/>
74+
<xsl:param name="delimiter" select="'_'"/>
75+
<xsl:call-template name="escapeKeyword">
76+
<xsl:with-param name="value"><xsl:choose>
77+
<xsl:when test="$optionFixCase"><xsl:variable name="dotted"><xsl:call-template name="toPascalCase">
78+
<xsl:with-param name="value" select="$value"/>
79+
<xsl:with-param name="delimiter" select="'.'"/>
80+
<xsl:with-param name="keepDelimiter" select="true()"/>
81+
</xsl:call-template></xsl:variable><xsl:call-template name="toPascalCase">
82+
<xsl:with-param name="value" select="$dotted"/>
83+
<xsl:with-param name="delimiter" select="$delimiter"/>
84+
</xsl:call-template></xsl:when>
85+
<xsl:otherwise><xsl:value-of select="$value"/></xsl:otherwise>
86+
</xsl:choose></xsl:with-param></xsl:call-template>
87+
</xsl:template>
88+
89+
<xsl:template name="PickNamespace"><xsl:param name="defaultNamespace"/><xsl:choose>
90+
<xsl:when test="package"><xsl:call-template name="pascal">
91+
<xsl:with-param name="value" select="package"/>
92+
</xsl:call-template></xsl:when>
93+
<xsl:when test="$defaultNamespace"><xsl:value-of select="$defaultNamespace"/></xsl:when>
94+
<xsl:otherwise><xsl:variable name="trimmedName"><xsl:choose>
95+
<xsl:when test="substring(name,string-length(name)-5,6)='.proto'"><xsl:value-of select="substring(name,1,string-length(name)-6)"/></xsl:when>
96+
<xsl:otherwise><xsl:value-of select="name"/></xsl:otherwise>
97+
</xsl:choose></xsl:variable><xsl:call-template name="pascal">
98+
<xsl:with-param name="value" select="$trimmedName"/>
99+
</xsl:call-template></xsl:otherwise>
100+
</xsl:choose></xsl:template>
101+
102+
<xsl:template match="FieldDescriptorProto/options"/>
103+
<xsl:template match="FileDescriptorProto/options"/>
104+
<xsl:template match="DescriptorProto/options"/>
105+
<xsl:template match="EnumValueDescriptorProto/options"/>
106+
<xsl:template match="EnumDescriptorProto/options"/>
107+
<xsl:template match="ServiceDescriptorProto/options"/>
108+
<xsl:template match="MethodDescriptorProto/options"/>
109+
</xsl:stylesheet>

0 commit comments

Comments
 (0)