23 Star 31 Fork 8

e2wugui / zeze

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
solution.zeze.xml 37.70 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
<?xml version="1.0" encoding="utf-8"?>
<solution name="Zeze" ModuleIdAllowRanges="11000-11999">
<externalkey beankey="Zeze.Util.Id128"/>
<module name="Builtin" id="11000">
<!-- Global With Raft 模块 -->
<module name="GlobalCacheManagerWithRaft" id="11001">
<!-- table -->
<bean name="CacheState" kind="rocks">
<variable id="1" name="AcquireStatePending" type="int" transient="true"/>
<variable id="2" name="Modify" type="int" default="-1"/> ServerId, default MUST BE -1.
<variable id="3" name="Share" type="set" value="int"/>
</bean>
<bean name="AcquiredState" kind="rocks">
<variable id="1" name="State" type="int"/>
</bean>
<table name="Global" key="binary" value="CacheState" kind="rocks" />
<table name="Session" key="binary" value="AcquiredState" kind="rocks" />
<!-- rpc -->
<bean name="AcquireParam">
<variable id="1" name="GlobalKey" type="binary"/>
<variable id="2" name="State" type="int"/>
</bean>
<bean name="ReduceParam">
<variable id="1" name="GlobalKey" type="binary"/>
<variable id="2" name="State" type="int"/>
<variable id="3" name="ReduceTid" type="Zeze.Util.Id128"/>
</bean>
<bean name="LoginParam">
<variable id="1" name="ServerId" type="int"/>
<variable id="2" name="GlobalCacheManagerHashIndex" type="int"/>
<variable id="3" name="DebugMode" type="bool"/> 调试模式下不检查Release Timeout,方便单步调试
</bean>
<bean name="AchillesHeel">
<variable id="1" name="ServerId" type="int"/>
<variable id="2" name="SecureKey" type="string"/>
<variable id="3" name="GlobalCacheManagerHashIndex" type="int"/>
</bean>
<bean name="AchillesHeelConfigFromGlobal">
<variable id="1" name="MaxNetPing" type="int"/>
<variable id="2" name="ServerProcessTime" type="int"/>
<variable id="3" name="ServerReleaseTimeout" type="int"/>
</bean>
<rpc name="Acquire" argument="AcquireParam" result="ReduceParam" base="Zeze.Raft.RaftRpc" handle="server" />
<rpc name="Reduce" argument="ReduceParam" result="ReduceParam" base="Zeze.Raft.RaftRpc" handle="client" />
<rpc name="Login" argument="LoginParam" result="AchillesHeelConfigFromGlobal" base="Zeze.Raft.RaftRpc" handle="server" />
<rpc name="ReLogin" argument="LoginParam" base="Zeze.Raft.RaftRpc" handle="server" />
<rpc name="NormalClose" handle="server" base="Zeze.Raft.RaftRpc" />
<rpc name="Cleanup" argument="AchillesHeel" base="Zeze.Raft.RaftRpc" handle="server" />
<rpc name="KeepAlive" base="Zeze.Raft.RaftRpc" handle="server" />
</module>
<!-- Rocks 测试模块 -->
<module name="TestRocks" id="11002">
<beankey name="BeanKey">
<variable id="1" name="Id" type="int"/>
<variable id="2" name="Name" type="string"/>
</beankey>
<bean name="Value" kind="rocks">
<variable id="1" name="Int" type="int"/>
<variable id="2" name="Bool" type="bool"/>
<variable id="3" name="Float" type="float"/>
<variable id="4" name="double" type="double"/>
<variable id="5" name="String" type="string"/>
<variable id="6" name="Binary" type="binary"/>
<variable id="7" name="SetInt" type="set" value="int"/>
<variable id="8" name="SetBeankey" type="set" value="BeanKey"/>
<variable id="9" name="MapInt" type="map" key="int" value="int"/>
<variable id="10" name="MapBean" type="map" key="int" value="Value"/>
<variable id="11" name="Beankey" type="BeanKey"/>
</bean>
<table name="tRocks" key="int" value="Value" kind="rocks"/>
</module>
<!-- 应用内部唯一ID生成器,仅支持long类型。-->
<module name="AutoKey" id="11003">
<beankey name="BSeedKey">
<variable id="1" name="ServerId" type="int"/>
<variable id="2" name="KeyName" type="string"/>
</beankey>
<bean name="BAutoKey">
<variable id="1" name="NextId" type="long"/>
</bean>
<table name="tAutoKeys" key="BSeedKey" value="BAutoKey" />
</module>
<module name="Collections" id="11004">
<!-- 一个简单的大容量Map,同时所有的分段节点按双向链表组织起来。新增节点放到链表尾部 -->
<module name="LinkedMap" id="11005">
<bean name="BLinkedMap">
<variable id="1" name="HeadNodeId" type="long" />
<variable id="2" name="TailNodeId" type="long" />
<variable id="3" name="Count" type="long" />
<variable id="4" name="LastNodeId" type="long" /> 最近分配过的NodeId, 用于下次分配
</bean>
<table name="tLinkedMaps" key="string" value="BLinkedMap" /> key: LinkedMap的Name
<beankey name="BLinkedMapKey">
<variable id="1" name="Name" type="string" /> LinkedMap的Name
<variable id="2" name="ValueId" type="string" /> LinkedMap的Key转成字符串类型
</beankey>
<bean name="BLinkedMapNodeId">
<variable id="1" name="NodeId" type="long" /> KeyValue对所属的节点ID. 每个节点有多个KeyValue对共享
</bean>
<table name="tValueIdToNodeId" key="BLinkedMapKey" value="BLinkedMapNodeId" />
<bean name="BLinkedMapNodeValue">
<variable id="1" name="Id" type="string" /> LinkedMap的Key转成字符串类型
<variable id="2" name="Value" type="dynamic">
<GetSpecialTypeIdFromBean value="Zeze.Collections.LinkedMap.GetSpecialTypeIdFromBean"/>
<CreateBeanFromSpecialTypeId value="Zeze.Collections.LinkedMap.CreateBeanFromSpecialTypeId"/>
</variable>
</bean>
<beankey name="BLinkedMapNodeKey">
<variable id="1" name="Name" type="string" /> LinkedMap的Name
<variable id="2" name="NodeId" type="long" />
</beankey>
<bean name="BLinkedMapNode"> 一个节点可以存多个KeyValue对,
<variable id="1" name="PrevNodeId" type="long" /> 前一个节点ID. 0表示已到达开头。
<variable id="2" name="NextNodeId" type="long" /> 后一个节点ID. 0表示已到达结尾。
<variable id="3" name="Values" type="list" value="BLinkedMapNodeValue" /> 多个KeyValue对,容量由LinkedMap构造时的nodeSize决定
</bean>
<table name="tLinkedMapNodes" key="BLinkedMapNodeKey" value="BLinkedMapNode"/>
</module>
<!-- 一个简单的大容量单向链表,可按Stack方式使用 -->
<module name="Queue" id="11006">
<!--
1. 单向链表。2. Value没有索引。3. 每个Value记录加入的时间。4. 只能从Head提取,从Tail添加。5. 用作Stack时也可以从Head添加。
链表结构: (NewStackNode ->) Head -> ... -> Tail (-> NewQueueNode)。
第一个用户是Table.GC,延迟删除记录。
-->
<bean name="BQueue">
<variable id="1" name="HeadNodeId" type="long" />
<variable id="2" name="TailNodeId" type="long" />
<variable id="3" name="Count" type="long" />
<variable id="4" name="LastNodeId" type="long" /> 最近分配过的NodeId, 用于下次分配
</bean>
<table name="tQueues" key="string" value="BQueue" /> key: Queue的Name
<bean name="BQueueNodeValue">
<variable id="1" name="Timestamp" type="long" />
<variable id="2" name="Value" type="dynamic">
<GetSpecialTypeIdFromBean value="Zeze.Collections.Queue.GetSpecialTypeIdFromBean"/>
<CreateBeanFromSpecialTypeId value="Zeze.Collections.Queue.CreateBeanFromSpecialTypeId"/>
</variable>
</bean>
<beankey name="BQueueNodeKey">
<variable id="1" name="Name" type="string" /> LinkedMap的Name
<variable id="2" name="NodeId" type="long" />
</beankey>
<bean name="BQueueNode"> 一个节点可以存多个KeyValue对,
<variable id="1" name="NextNodeId" type="long" /> 后一个节点ID. 0表示已到达结尾。
<variable id="2" name="Values" type="list" value="BQueueNodeValue" />
</bean>
<table name="tQueueNodes" key="BQueueNodeKey" value="BQueueNode"/>
</module>
<!-- 部门树-->
<module name="DepartmentTree" id="11101">
<bean name="BDepartmentRoot">
<variable id="1" name="Root" type="string" /> 群主
<variable id="2" name="Managers" type="map[string,dynamic]"> 管理员
<GetSpecialTypeIdFromBean value="Zeze.Collections.DepartmentTree.GetSpecialTypeIdFromBean"/>
<CreateBeanFromSpecialTypeId value="Zeze.Collections.DepartmentTree.CreateBeanFromSpecialTypeId"/>
</variable>
<variable id="3" name="NextDepartmentId" type="long" /> 部门Id种子
<variable id="4" name="Childs" type="map" key="string" value="long" /> name 2 id。采用整体保存,因为需要排序和重名判断。需要加数量上限。
</bean>
<table name="tDepartment" key="string" value="BDepartmentRoot" /> 群部门树根。普通用户也可以创建部门。暂不开放这个给个人。
<bean name="BDepartmentTreeNode">
<variable id="1" name="ParentDepartment" type="long" /> 0表示第一级部门
<variable id="2" name="Childs" type="map" key="string" value="long" /> name 2 id。采用整体保存,因为需要排序和重名判断。需要加数量上限。
<variable id="3" name="Name" type="string" />
<variable id="4" name="Managers" type="map[string,dynamic]">
<GetSpecialTypeIdFromBean value="Zeze.Collections.DepartmentTree.GetSpecialTypeIdFromBean"/>
<CreateBeanFromSpecialTypeId value="Zeze.Collections.DepartmentTree.CreateBeanFromSpecialTypeId"/>
</variable>
</bean>
<beankey name="BDepartmentKey">
<variable id="1" name="Owner" type="string" />
<variable id="2" name="DepartmentId" type="long" />
</beankey>
<table name="tDepartmentTree" key="BDepartmentKey" value="BDepartmentTreeNode" />
</module>
</module>
<!--
延迟从Table中删除记录。比如:记录被登记到这个模块7天以后才会被真正删除。
-->
<module name="DelayRemove" id="11007">
<bean name="BTableKey">
<variable id="1" name="TableName" type="string" />
<variable id="2" name="EncodedKey" type="binary" />
<variable id="3" name="EnqueueTime" type="long" />
</bean>
</module>
<!--
Linkd - Server 之间通讯的协议定义。
-->
<module name="Provider" id="11008">
<!-- gs to link -->
<bean name="BModule">
<!-- ChoiceType -->
<enum name="ChoiceTypeDefault" value="0"/> choice by load
<enum name="ChoiceTypeHashAccount" value="1"/>
<enum name="ChoiceTypeHashRoleId" value="2"/>
<enum name="ChoiceTypeFeedFullOneByOne" value="3"/>
<variable name="ChoiceType" id="1" type="int"/>
<!-- ConfigType 目前没有实际逻辑需要这个类型,根据模块绑定配置文件生成类型 -->
<enum name="ConfigTypeDefault" value="0"/>
<enum name="ConfigTypeSpecial" value="1"/>
<enum name="ConfigTypeDynamic" value="2"/>
<variable name="ConfigType" id="2" type="int"/>
</bean>
<bean name="BBind">
<variable name="modules" id="1" type="map" key="int" value="BModule"/> moduleId -> BModule
<!--
模式一,静态绑定,用于启用cache同步的多个gs(gameserver)。
此时 lindSids 为空。同一个moduleId可以绑定多个内部服务。客户端第一次访问时,随便选择一个内部服务,以后都用这个。
模式二,动态绑定,用于地图服务器,玩家只能在一个地图服务器上,进入退出地图时绑定。
lindSids 指定临时绑定该客户端连接到此服务。这个功能可能不需要,保留。
*** 同一个moduleId不能既是静态绑定又是动态绑定。
-->
<variable name="linkSids" id="2" type="set" value="long"/>
<enum name="ResultSuccess" value="0"/>
<enum name="ResultFailed" value="1"/>
</bean>
<rpc name="Bind" argument="BBind" handle="client"/>
<rpc name="UnBind" argument="BBind" handle="client"/>
<bean name="BSubscribe">
<variable name="modules" id="1" type="map" key="int" value="BModule"/> moduleId -> BModule
</bean>
<rpc name="Subscribe" argument="BSubscribe" handle="client"/> 通知linkd订阅模块的服务列表。
<bean name="BKick">
<enum name="ErrorProtocolUnknown" value="1"/>
<enum name="ErrorDecode" value="2"/>
<enum name="ErrorProtocolException" value="3"/>
<enum name="ErrorDuplicateLogin" value="4"/>
<enum name="ErrorSeeDescription" value="5"/>
<variable name="linksid" id="1" type="long"/>
<variable name="code" id="2" type="int"/>
<variable name="desc" id="3" type="string"/> // for debug
</bean>
<protocol name="Kick" argument="BKick" handle="client"/>
<bean name="BSend">
<variable name="linkSids" id="1" type="list" value="long"/>
<variable name="protocolType" id="2" type="long"/>
<variable name="protocolWholeData" id="3" type="binary"/> 完整的协议打包,包括了 type, size
</bean>
<bean name="BSendResult">
<variable name="ErrorLinkSids" id="1" type="list" value="long"/>
</bean>
<rpc name="Send" argument="BSend" result="BSendResult" handle="client"/>
<bean name="BBroadcast">
<variable name="protocolType" id="1" type="long"/>
<variable name="protocolWholeData" id="2" type="binary"/> 完整的协议打包,包括了 type, size
<variable name="time" id="3" type="int"/>
</bean>
<protocol name="Broadcast" argument="BBroadcast" handle="client"/>
<bean name="BSetUserState">
<variable name="linkSid" id="1" type="long"/>
<variable name="context" id="2" type="string"/>
<variable name="contextx" id="3" type="binary"/>
</bean>
<protocol name="SetUserState" argument="BSetUserState" handle="client"/>
<bean name="BLoad">
<enum name="eWorkFine" value="0"/>
<enum name="eThreshold" value="1"/>
<enum name="eOverload" value="2"/>
<variable name="Online" id="1" type="int"/> 用户数量
<variable name="ProposeMaxOnline" id="2" type="int"/> 建议最大用户数量
<variable name="OnlineNew" id="3" type="int"/> 最近上线用户数量,一般是一秒内的。用来防止短时间内给同一个gs分配太多用户。
<variable name="Overload" id="4" type="int"/> 过载保护类型。参见上面的枚举定义。
</bean>
<!-- link to gs -->
<bean name="BDispatch">
<variable name="linkSid" id="1" type="long"/>
<variable name="account" id="2" type="string"/>
<variable name="protocolType" id="3" type="long"/>
<variable name="protocolData" id="4" type="binary"/> 协议打包,不包括 type, size
<variable name="context" id="5" type="string"/> SetUserState
<variable name="contextx" id="6" type="binary"/> SetUserState
</bean>
<protocol name="Dispatch" argument="BDispatch" handle="server"/>
<bean name="BLinkBroken">
<enum name="REASON_PEERCLOSE" value="0"/>
<variable name="account" id="1" type="string"/>
<variable name="linkSid" id="2" type="long"/>
<variable name="reason" id="3" type="int"/>
<variable name="context" id="5" type="string"/> SetUserState
<variable name="contextx" id="6" type="binary"/> SetUserState
</bean>
<protocol name="LinkBroken" argument="BLinkBroken" handle="server"/>
<bean name="BAnnounceLinkInfo">
Linkd,Provider之间连接建立以后,通告自己的信息。保留。
</bean>
<protocol name="AnnounceLinkInfo" NoProcedure="true" argument="BAnnounceLinkInfo" handle="server"/>
<!-- gs to link -->
<bean name="BAnnounceProviderInfo">
<variable name="ServiceNamePrefix" id="1" type="string"/>
<variable name="ServiceIndentity" id="2" type="string"/>
<variable name="ProviderDirectIp" id="3" type="string"/>
<variable name="ProviderDirectPort" id="4" type="int"/>
</bean>
<protocol name="AnnounceProviderInfo" NoProcedure="true" argument="BAnnounceProviderInfo" handle="client"/>
</module>
<!-- gs 之间直连的服务: 即时客户端也是服务器 -->
<module name="ProviderDirect" id="11009">
<enum name="ErrorTransmitParameterFactoryNotFound" value="1" />
<bean name="BModuleRedirectArgument">
<variable name="ModuleId" id="1" type="int"/>
<variable name="HashCode" id="2" type="int"/> server 计算。see BBind.ChoiceType。
<variable name="RedirectType" id="3" type="int"/> 如果是ToServer,ServerId存在HashCode中。
<variable name="MethodFullName" id="4" type="string"/> format="ModuleFullName:MethodName"
<variable name="Params" id="5" type="binary"/>
<variable name="ServiceNamePrefix" id="6" type="string"/>
</bean>
<bean name="BModuleRedirectResult">
<variable name="ModuleId" id="1" type="int"/>
<variable name="ServerId" id="2" type="int"/> 目标server的id。
<!-- 上面两个参数用来调试,不是必要的。 -->
<!--
rpc.ResultCode == ResultCodeSuccess 时,才使用下面两个变量,此时表示rpc调用流程正确了。
处理结果是否正确,还需要进一步查看 ReturnCode。
-->
<variable name="Params" id="3" type="binary"/>
</bean>
<!-- 转发只定义一个rpc,以后可能需要实现server之间的直连,不再通过转发 -->
<rpc name="ModuleRedirect" argument="BModuleRedirectArgument" result="BModuleRedirectResult" handle="server">
<enum name="RedirectTypeWithHash" value="0"/>
<enum name="RedirectTypeToServer" value="1"/>
<enum name="ResultCodeSuccess" value="0"/>
<enum name="ResultCodeMethodFullNameNotFound" value="1"/>
<enum name="ResultCodeHandleException" value="2"/>
<enum name="ResultCodeHandleError" value="3"/>
<enum name="ResultCodeLinkdTimeout" value="10"/>
<enum name="ResultCodeLinkdNoProvider" value="11"/>
<enum name="ResultCodeRequestTimeout" value="12"/>
</rpc>
<bean name="BModuleRedirectAllRequest">
<variable name="ModuleId" id="1" type="int"/>
<variable name="HashCodeConcurrentLevel" id="2" type="int"/> 总的并发分组数量
<variable name="HashCodes" id="3" type="set" value="int"/> 发送给具体进程时需要处理的分组hash-index(目前由linkd填写)
<variable name="SourceProvider" id="4" type="long"/> linkd 转发的时候填写本地provider的sessionId。
<variable name="SessionId" id="5" type="long"/> 发起请求者初始化,返回结果时带回。
<variable name="MethodFullName" id="6" type="string"/> format="ModuleFullName:MethodName"
<variable name="Params" id="7" type="binary"/>
<variable name="ServiceNamePrefix" id="8" type="string"/>
</bean>
<bean name="BModuleRedirectAllHash">
<variable name="ReturnCode" id="1" type="long"/>
<variable name="Params" id="2" type="binary"/>
</bean>
<bean name="BModuleRedirectAllResult">
<variable name="ModuleId" id="1" type="int"/>
<variable name="ServerId" id="2" type="int"/> 目标server的id。
<!-- 上面两个参数用来调试,不是必要的。 -->
<variable name="SourceProvider" id="3" type="long"/> 从BModuleRedirectAllRequest里面得到。
<variable name="MethodFullName" id="4" type="string"/> format="ModuleFullName:MethodName"
<variable name="SessionId" id="5" type="long"/> 发起请求者初始化,返回结果时带回。
<!--
ResultCode == ResultCodeSuccess 时,才使用下面变量的Value,此时表示调用流程正确了。
处理结果是否正确,还需要进一步查看Value.ReturnCode。
-->
<variable name="Hashs" id="6" type="map" key="int" value="BModuleRedirectAllHash"/> 发送给具体进程时需要处理的分组hash-index(目前由linkd填写)
</bean>
<!-- 使用protocol而不是rpc,是为了可以按分组返回结果,当然现在定义支持一个结果里面包含多个分组结果 -->
<protocol name="ModuleRedirectAllRequest" argument="BModuleRedirectAllRequest" handle="server"/>
<protocol name="ModuleRedirectAllResult" argument="BModuleRedirectAllResult" handle="server"/>
<bean name="BTransmit">
<variable name="ActionName" id="1" type="string"/>
<variable name="Roles" id="2" type="set" value="long"/> 查询目标角色。
<variable name="Sender" id="3" type="long"/> 结果发送给Sender。
<variable name="Parameter" id="4" type="binary"/> encoded bean
</bean>
<protocol name="Transmit" argument="BTransmit" NoProcedure="true" handle="server"/> 默认不启用事务,由协议实现自己控制。
<bean name="BTransmitAccount">
<variable name="ActionName" id="1" type="string"/>
<variable name="Parameter" id="2" type="binary"/> encoded bean
<variable name="TargetAccounts" id="3" type="set" value="string"/> 查询目标角色。
<variable name="SenderAccount" id="4" type="string"/> 结果发送给Sender。
<variable name="SenderClientId" id="5" type="string"/> 结果发送给Sender。
</bean>
<protocol name="TransmitAccount" argument="BTransmitAccount" NoProcedure="true" handle="server"/> 默认不启用事务,由协议实现自己控制。
<bean name="BProviderInfo">
<variable name="Ip" id="1" type="string"/>
<variable name="Port" id="2" type="int"/>
<variable name="ServerId" id="3" type="int"/>
</bean>
<rpc name="AnnounceProviderInfo" argument="BProviderInfo" handle="server,client"/>
</module>
<module name="RedoQueue" id="11010">
<bean name="BQueueTask">
<variable name="QueueName" id="1" type="string"/> 队列名称。
<variable name="TaskType" id="2" type="int"/> 任务类型。
<variable name="TaskId" id="3" type="long"/> 任务编号,必须递增。
<variable name="TaskParam" id="4" type="binary"/> 任务参数。
<variable name="PrevTaskId" id="5" type="long"/> 上一个任务编号,用来发现错误。
</bean>
<rpc name="RunTask" argument="BQueueTask" result="BTaskId" handle="server"/>
<bean name="BTaskId">
<variable name="TaskId" id="1" type="long"/>
</bean>
<table name="tQueueLastTaskId" key="string" value="BTaskId" />
</module>
<module name="LinkdBase" id="11011">
<!-- linkd to client -->
<bean name="BReportError">
<enum name="FromLink" value="0"/>
<enum name="FromProvider" value="1"/>
<enum name="CodeNotAuthed" value="1"/>
<enum name="CodeNoProvider" value="2"/>
<enum name="CodeProviderBusy" value="3"/>
<variable id="1" name="from" type="int"/>
<variable id="2" name="code" type="int"/>
<variable id="3" name="desc" type="string"/>
</bean>
<protocol name="ReportError" argument="BReportError" handle="client"/>
</module>
<module name="Game" id="11012">
<module name="Online" id="11013">
<enum value="0" name="ResultCodeSuccess"/>
<enum value="1" name="ResultCodeCreateRoleDuplicateRoleName"/>
<enum value="2" name="ResultCodeAccountNotExist"/>
<enum value="3" name="ResultCodeRoleNotExist"/>
<enum value="4" name="ResultCodeNotLastLoginRoleId"/>
<enum value="5" name="ResultCodeOnlineDataNotFound"/>
<enum value="6" name="ResultCodeReliableNotifyConfirmIndexOutOfRange"/>
<enum value="7" name="ResultCodeNotLogin"/>
<!-- protocols -->
<bean name="BLogin">
<variable id="1" name="RoleId" type="long"/>
</bean>
<bean name="BReLogin">
<variable id="1" name="RoleId" type="long"/>
<variable id="2" name="ReliableNotifyConfirmIndex" type="long"/>
</bean>
<bean name="BReliableNotifyConfirm">
<variable id="1" name="ReliableNotifyConfirmIndex" type="long"/>
<variable id="2" name="Sync" type="bool"/>
</bean>
<bean name="BReliableNotify">
<variable id="1" name="Notifies" type="list" value="binary"/> full encoded protocol list
<variable id="2" name="ReliableNotifyIndex" type="long"/> Notify的计数开始。客户端收到的总计数为:start + Notifies.Count
</bean>
<rpc name="Login" argument="BLogin" handle="server"/> 登录角色
<rpc name="ReLogin" argument="BReLogin" handle="server"/> 网络断开重新登录(数据无法同步时会失败,此时客户端应该重新走完整的登录流程-装载数据。)
<rpc name="Logout" handle="server"/> 登出
<rpc name="ReliableNotifyConfirm" argument="BReliableNotifyConfirm" handle="server"/>
<protocol name="SReliableNotify" argument="BReliableNotify" handle="client"/>
<bean name="BDelayLogoutCustom">
<variable id="1" name="RoleId" type="long"/>
<variable id="2" name="LoginVersion" type="long"/>
</bean>
<!-- tables -->
<bean name="BOnline">
<variable id="1" name="LinkName" type="string"/>
<variable id="2" name="LinkSid" type="long"/>
</bean>
<bean name="BNotify">
<variable id="1" name="FullEncodedProtocol" type="binary"/>
</bean>
<!-- tables -->
<bean name="BVersion">
<variable id="1" name="LoginVersion" type="long"/>
<!-- 下面的定义用来实现可靠的协议通告。 -->
<variable id="2" name="ReliableNotifyMark" type="set" value="string"/>
<variable id="3" name="ReliableNotifyConfirmIndex" type="long"/>
<variable id="4" name="ReliableNotifyIndex" type="long"/>
<variable id="5" name="ServerId" type="int"/>
<variable id="6" name="LogoutVersion" type="long"/>
</bean>
<table name="tonline" key="long" value="BOnline"/>
<table name="tversion" key="long" value="BVersion"/>
<bean name="BAny">
<variable id="1" name="Any" type="dynamic">
<GetSpecialTypeIdFromBean value="Zeze.Game.Online.GetSpecialTypeIdFromBean"/>
<CreateBeanFromSpecialTypeId value="Zeze.Game.Online.CreateBeanFromSpecialTypeId"/>
</variable>
</bean>
<bean name="BLocal">
<variable id="1" name="LoginVersion" type="long"/>
<variable id="2" name="Datas" type="map" key="string" value="BAny"/>
</bean>
<table name="tlocal" key="long" memory="true" value="BLocal"/>
<!-- interface -->
<!--
* 事件
. Login Events
. ReLogin Events
. Logout Events
* 数据修改
. AddRole(account, roleId)
. RemoveRole(account, roleId)
. SetLastLoginRoleId?
* 协议发送
. SendXXX To Role
. SendXXX To Account?
. Transmit
. SendReliable
* 重载:一般不需要。
. override ProcessLoginRequest
. override ProcessReLoginRequest
. override ProcessLogoutRequest
-->
</module> Online 11013
<module name="Bag" id="11014">
<enum name="ResultCodeFromInvalid" value="1"/>
<enum name="ResultCodeToInvalid" value="2"/>
<enum name="ResultCodeFromNotExist" value="3"/>
<enum name="ResultCodeTrySplitButTargetExistDifferenceItem" value="4"/>
<bean name="BMove">
<variable id="1" name="BagName" type="string"/>
<variable id="2" name="PositionFrom" type="int"/>
<variable id="3" name="PositionTo" type="int"/>
<variable id="4" name="number" type="int"/> -1 表示全部
</bean>
<bean name="BDestroy">
<variable id="1" name="BagName" type="string"/>
<variable id="2" name="Position" type="int"/>
</bean>
<!--
<bean name="BChanged">
<enum name="TagIncrementChange" value="0"/> 增量修改。
<enum name="TagRecordRemoved" value="1"/> 整个记录删除了。
<enum name="TagRecordReplace" value="2"/> 整个记录发生了变更,需要先清除本地数据,再替换进去。
<variable id="1" name="BagName" type="string"/>
<variable id="2" name="Tag" type="int"/> 处理方式
<variable id="3" name="Replaced" type="map" key="int" value="BItem"/> key is position
<variable id="4" name="Removed" type="set" value="int"/> key is position
</bean>
<protocol name="NotifyChanged" argument="BChanged" handle="client"/> 所有的包裹改变都通过这个协议发送。
<protocol name="NotifyBag" argument="BBag" handle="client"/> 包裹全部改变时发送这个协议。在可靠消息框架内使用。不直接处理。
-->
<rpc name="Move" argument="BMove" handle="server"/>
<rpc name="Destroy" argument="BDestroy" handle="server"/>
<bean name="BItem">
<variable id="1" name="Id" type="int"/>
<variable id="2" name="Number" type="int"/>
<variable id="3" name="Item" type="dynamic">
<GetSpecialTypeIdFromBean value="Zeze.Game.Bag.GetSpecialTypeIdFromBean"/>
<CreateBeanFromSpecialTypeId value="Zeze.Game.Bag.CreateBeanFromSpecialTypeId"/>
</variable>
</bean>
<bean name="BBag">
<variable id="1" name="Capacity" type="int"/>
<variable id="2" name="Items" type="map" key="int" value="BItem"/> key is bag position
</bean>
<bean name="BItemClasses">
<variable id="1" name="ItemClasses" type="set" value="string"/>
</bean>
<table name="tbag" key="string" value="BBag"/> key is bag name
<table name="tItemClasses" key="int" value="BItemClasses"/> key is 1, only one record
</module> Bag 11014
<module name="Rank" id="11015">
<beankey name="BConcurrentKey">
<enum name="TimeTypeTotal" value="0"/> 所有时间
<enum name="TimeTypeDay" value="1"/> 每天:Year为当前时间的年份,Offset为天
<enum name="TimeTypeWeek" value="2"/> 每周:Year为当前时间的年份,Offset为周
<enum name="TimeTypeSeason" value="3"/> 每季:Year为当前时间的年份,Offset为季
<enum name="TimeTypeYear" value="4"/> 每年:Year为当前时间的年份,Offset为0
<enum name="TimeTypeCustomize" value="5"/> 自定义:此时Offset是自定义Id,Year为0
<variable id="1" name="RankType" type="int"/>
<variable id="2" name="ConcurrentId" type="int"/> = hash % ConcurrentLevel
<variable id="3" name="TimeType" type="int"/>
<variable id="4" name="Year" type="int"/>
<variable id="5" name="Offset" type="long"/> 根据TimeType,含义不同
</beankey>
<bean name="BRankValue">
<variable id="1" name="RoleId" type="long"/>
<variable id="2" name="Value" type="long"/> 含义由 BConcurrentKey.RankType 决定
<variable id="3" name="ValueEx" type="binary"/> 自定义数据。
</bean>
<bean name="BRankList">
<variable id="1" name="RankList" type="list" value="BRankValue"/>
</bean>
<table name="trank" key="BConcurrentKey" value="BRankList"/>
</module> Rank 11015
</module> Game
<module name="Online" id="11100">
<enum value="0" name="ResultCodeSuccess"/>
<enum value="1" name="ResultCodeCreateRoleDuplicateRoleName"/>
<enum value="2" name="ResultCodeAccountNotExist"/>
<enum value="3" name="ResultCodeRoleNotExist"/>
<enum value="4" name="ResultCodeNotLastLoginRoleId"/>
<enum value="5" name="ResultCodeOnlineDataNotFound"/>
<enum value="6" name="ResultCodeReliableNotifyConfirmIndexOutOfRange"/>
<enum value="7" name="ResultCodeNotLogin"/>
<!-- protocols -->
<bean name="BLogin">
<variable id="1" name="ClientId" type="string" />
</bean>
<bean name="BReLogin">
<variable id="1" name="ClientId" type="string" />
<variable id="2" name="ReliableNotifyConfirmIndex" type="long"/>
</bean>
<bean name="BReliableNotifyConfirm">
<variable id="1" name="ClientId" type="string" />
<variable id="2" name="ReliableNotifyConfirmIndex" type="long"/>
<variable id="3" name="Sync" type="bool"/>
</bean>
<bean name="BReliableNotify">
<variable id="1" name="Notifies" type="list" value="binary"/> full encoded protocol list
<variable id="2" name="ReliableNotifyIndex" type="long"/> Notify的计数开始。客户端收到的总计数为:start + Notifies.Count
</bean>
<rpc name="Login" argument="BLogin" handle="server"/> 登录角色
<rpc name="ReLogin" argument="BReLogin" handle="server"/> 网络断开重新登录(数据无法同步时会失败,此时客户端应该重新走完整的登录流程-装载数据。)
<rpc name="Logout" handle="server"/> 登出
<rpc name="ReliableNotifyConfirm" argument="BReliableNotifyConfirm" handle="server"/>
<protocol name="SReliableNotify" argument="BReliableNotify" handle="client"/>
<bean name="BDelayLogoutCustom">
<variable id="1" name="Account" type="string"/>
<variable id="2" name="ClientId" type="string"/>
<variable id="3" name="LoginVersion" type="long"/>
</bean>
<!-- tables -->
<bean name="BOnline">
<variable id="1" name="LinkName" type="string"/>
<variable id="2" name="LinkSid" type="long"/>
</bean>
<bean name="BNotify">
<variable id="1" name="FullEncodedProtocol" type="binary"/>
</bean>
<bean name="BVersion">
<variable id="1" name="LoginVersion" type="long"/>
<!-- 下面的定义用来实现可靠的协议通告。 -->
<variable id="2" name="ReliableNotifyMark" type="set" value="string"/>
<variable id="3" name="ReliableNotifyIndex" type="long"/>
<variable id="4" name="ReliableNotifyConfirmIndex" type="long"/>
<variable id="5" name="ServerId" type="int"/>
<variable id="6" name="LogoutVersion" type="long"/>
</bean>
<bean name="BOnlines">
<variable id="1" name="Logins" type="map" key="string" value="BOnline"/> key is ClientId
</bean>
<bean name="BVersions">
<variable id="1" name="Logins" type="map" key="string" value="BVersion"/> key is ClientId
<variable id="2" name="LastLoginVersion" type="long"/> 用来生成 account 登录版本号。每次递增。
</bean>
<table name="tonline" key="string" value="BOnlines"/>
<table name="tversion" key="string" value="BVersions"/>
<bean name="BAny">
<variable id="1" name="Any" type="dynamic">
<GetSpecialTypeIdFromBean value="Zeze.Arch.Online.GetSpecialTypeIdFromBean"/>
<CreateBeanFromSpecialTypeId value="Zeze.Arch.Online.CreateBeanFromSpecialTypeId"/>
</variable>
</bean>
<bean name="BLocal">
<variable id="1" name="LoginVersion" type="long"/>
<variable id="2" name="Datas" type="map" key="string" value="BAny"/>
</bean>
<bean name="BLocals">
<variable id="1" name="Logins" type="map" key="string" value="BLocal"/> key is ClientId
</bean>
<table name="tlocal" key="string" memory="true" value="BLocals"/>
</module> Online 11100
<module name="HotDistribute" id="11033" UseData="true" DefaultTransactionLevel="None">
<bean name="BVariable">
<variable id="1" name="Id" type="int"/>
<variable id="2" name="Name" type="string"/>
<variable id="3" name="Type" type="string"/>
<variable id="4" name="Key" type="string"/>
<variable id="5" name="Value" type="string"/>
</bean>
<bean name="BeanName">
<variable id="1" name="Name" type="string"/>
</bean>
<bean name="BLastVersionBeanInfo">
<variable id="1" name="Name" type="string"/>
<variable id="2" name="Variables" type="list[BVariable]"/>
</bean>
<rpc name="GetLastVersionBeanInfo" argument="BeanName" result="BLastVersionBeanInfo" handle="server"/>
</module>
<!--
可用id范围 [11034, 11100) [11103, 12000]
<module name="" id="11016">
</module>
<module name="" id="11103">
</module>
-->
</module> Builtin
<component name="HotDistribute" genrelativedir="Zeze/Gen/java" GenTables="client" platform="zeze+cs" NoRecursiveModule="true" AutoDelete="false">
<service name="" handle="client">
<module ref="Zeze.Builtin.HotDistribute"/>
</service>
</component>
<!-- Linkd 服务模块基类,仅用来生成代码 -->
<!-- account online -->
<component name="Online" genrelativedir="Zeze/Arch" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.Online"/>
</service>
</component>
<!-- role online -->
<component name="Online" genrelativedir="Zeze/Game" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.Game.Online"/>
</service>
</component>
<component name="Rank" genrelativedir="Zeze/Game" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.Game.Rank"/>
</service>
</component>
<component name="Bag" genrelativedir="Zeze/Game" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.Game.Bag"/>
</service>
</component>
<component name="LinkdBase" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.LinkdBase"/>
</service>
</component>
<component name="RedoQueueServer" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.RedoQueue"/>
</service>
</component>
<!-- Provider之间直连服务 -->
<component name="ProviderDirect" genrelativedir="Zeze/Arch" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.ProviderDirect"/>
</service>
</component>
<!-- Provider 在Linkd上的客户端支持组件 -->
<component name="LinkdProvider" genrelativedir="Zeze/Arch" platform="zeze+cs">
<service name="" handle="client">
<module ref="Zeze.Builtin.Provider"/>
</service>
</component>
<!-- Provider 为客户端协议服务。协议通过Linkd转发 -->
<component name="ProviderImplement" genrelativedir="Zeze/Arch" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.Provider"/>
</service>
</component>
<component name="DelayRemove" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.DelayRemove"/>
</service>
</component>
<component name="Queue" genrelativedir="Zeze/Collections" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.Collections.Queue"/>
</service>
</component>
<component name="LinkedMap" genrelativedir="Zeze/Collections" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.Collections.LinkedMap"/>
</service>
</component>
<component name="DepartmentTree" genrelativedir="Zeze/Collections" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.Collections.DepartmentTree"/>
</service>
</component>
<component name="AutoKey" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.AutoKey"/>
</service>
</component>
<component name="GlobalCacheManagerWithRaftAgent" genrelativedir="Zeze/Services" platform="zeze+cs" GenTables="client">
<service name="" handle="client">
<module ref="Zeze.Builtin.GlobalCacheManagerWithRaft"/>
</service>
</component>
<component name="TestRocks" genrelativedir="Zeze/Services" platform="zeze+cs">
<service name="" handle="server">
<module ref="Zeze.Builtin.TestRocks"/>
</service>
</component>
</solution>
C#
1
https://gitee.com/e2wugui/zeze.git
git@gitee.com:e2wugui/zeze.git
e2wugui
zeze
zeze
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891