Skip to content

Commit

Permalink
更新生成文件
Browse files Browse the repository at this point in the history
  • Loading branch information
davyxu committed Jan 26, 2022
1 parent 04aabac commit 289c68d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 456 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ api/csharp/ProtoPlus/obj
api/csharp/ProtoPlus/bin
bin
*.gz
tests/reg_gen.go
17 changes: 14 additions & 3 deletions example/csharp/Example/ProtoGenReg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@
// DO NOT EDIT!
using System;
using System.Collections.Generic;
using ProtoPlus;
#pragma warning disable 162

namespace Proto
{
public class MetaInfo
{
public ushort ID; // 消息ID
public Type Type; // 消息类型

// 消息方向
// 在proto中添加[MsgDir: "client -> game" ], 左边为源, 右边为目标
public string SourcePeer; // 消息发起的源
public string TargetPeer; // 消息的目标

public string Name;
}

public static class MessageVisitor
{
Expand Down Expand Up @@ -36,14 +47,14 @@ public static void Visit(Action<MetaInfo> callback)
callback(new MetaInfo
{
Type = typeof(LoginREQ),
ID = 45589,
ID = 225,
SourcePeer = "client",
TargetPeer = "game",
});
callback(new MetaInfo
{
Type = typeof(LoginACK),
ID = 7420,
ID = 27592,
SourcePeer = "",
TargetPeer = "",
});
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ require (
// 测试用
github.com/davyxu/golexer v0.1.1-0.20200202091144-a15ddde83f6a
github.com/davyxu/ulexer v0.0.0-20200713054812-c9bb8db3521f
github.com/stretchr/testify v1.7.0
)

replace (
github.com/davyxu/ulexer => ../ulexer
)
replace github.com/davyxu/ulexer => ../ulexer
Loading

0 comments on commit 289c68d

Please sign in to comment.