Documentation
¶
Index ¶
- Constants
- func GetCommandByProto(protoMessage proto.Message) int32
- func GetFullMessageName(packageName, messageName string) string
- func GetMd5Password(password string) string
- func InitCommandMappingFromFile(file string)
- type MockClient
- func (c *MockClient) OnAccountRes(res *pb.AccountRes, errorCode int)
- func (c *MockClient) OnActivitySync(res *pb.ActivitySync)
- func (c *MockClient) OnBagsSync(res *pb.BagsSync)
- func (c *MockClient) OnBaseInfoSync(res *pb.BaseInfoSync)
- func (c *MockClient) OnCreatePlayerRes(res *pb.CreatePlayerRes, errorCode int)
- func (c *MockClient) OnElemContainerUpdate(res *pb.ElemContainerUpdate)
- func (c *MockClient) OnErrorRes(res *pb.ErrorRes)
- func (c *MockClient) OnExchangeRes(res *pb.ExchangeRes)
- func (c *MockClient) OnExchangeSync(res *pb.ExchangeSync)
- func (c *MockClient) OnExchangeUpdate(res *pb.ExchangeUpdate)
- func (c *MockClient) OnFinishQuestRes(res *pb.FinishQuestRes)
- func (c *MockClient) OnGateRouteClientPacketError(res *pb.GateRouteClientPacketError)
- func (c *MockClient) OnGuildCreateRes(res *pb.GuildCreateRes)
- func (c *MockClient) OnGuildDataViewRes(res *pb.GuildDataViewRes)
- func (c *MockClient) OnGuildJoinAgreeRes(res *pb.GuildJoinAgreeRes)
- func (c *MockClient) OnGuildJoinReqOpResult(res *pb.GuildJoinReqOpResult)
- func (c *MockClient) OnGuildJoinReqTip(res *pb.GuildJoinReqTip)
- func (c *MockClient) OnGuildJoinRes(res *pb.GuildJoinRes)
- func (c *MockClient) OnGuildListRes(res *pb.GuildListRes)
- func (c *MockClient) OnGuildSync(res *pb.GuildSync)
- func (c *MockClient) OnInputCmd(cmd string)
- func (c *MockClient) OnItemUseRes(res *pb.ItemUseRes)
- func (c *MockClient) OnLoginRes(res *pb.LoginRes, errorCode int)
- func (c *MockClient) OnPlayerEntryGameRes(res *pb.PlayerEntryGameRes, errorCode int)
- func (c *MockClient) OnQuestSync(res *pb.QuestSync)
- func (c *MockClient) OnQuestUpdate(res *pb.QuestUpdate)
- func (c *MockClient) Send(message proto.Message, opts ...SendOption) bool
- type MockClientHandler
- type TestClient
Constants ¶
View Source
const (
// 对应proto文件里的package导出名
ProtoPackageName = "gserver"
)
Variables ¶
This section is empty.
Functions ¶
func GetCommandByProto ¶
func GetFullMessageName ¶
func InitCommandMappingFromFile ¶
func InitCommandMappingFromFile(file string)
Types ¶
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
模拟客户端
func (*MockClient) OnAccountRes ¶
func (c *MockClient) OnAccountRes(res *pb.AccountRes, errorCode int)
func (*MockClient) OnActivitySync ¶
func (c *MockClient) OnActivitySync(res *pb.ActivitySync)
func (*MockClient) OnBagsSync ¶
func (c *MockClient) OnBagsSync(res *pb.BagsSync)
func (*MockClient) OnBaseInfoSync ¶
func (c *MockClient) OnBaseInfoSync(res *pb.BaseInfoSync)
func (*MockClient) OnCreatePlayerRes ¶
func (c *MockClient) OnCreatePlayerRes(res *pb.CreatePlayerRes, errorCode int)
func (*MockClient) OnElemContainerUpdate ¶
func (c *MockClient) OnElemContainerUpdate(res *pb.ElemContainerUpdate)
func (*MockClient) OnErrorRes ¶
func (c *MockClient) OnErrorRes(res *pb.ErrorRes)
func (*MockClient) OnExchangeRes ¶
func (c *MockClient) OnExchangeRes(res *pb.ExchangeRes)
func (*MockClient) OnExchangeSync ¶
func (c *MockClient) OnExchangeSync(res *pb.ExchangeSync)
func (*MockClient) OnExchangeUpdate ¶
func (c *MockClient) OnExchangeUpdate(res *pb.ExchangeUpdate)
func (*MockClient) OnFinishQuestRes ¶
func (c *MockClient) OnFinishQuestRes(res *pb.FinishQuestRes)
func (*MockClient) OnGateRouteClientPacketError ¶
func (c *MockClient) OnGateRouteClientPacketError(res *pb.GateRouteClientPacketError)
func (*MockClient) OnGuildCreateRes ¶
func (c *MockClient) OnGuildCreateRes(res *pb.GuildCreateRes)
func (*MockClient) OnGuildDataViewRes ¶
func (c *MockClient) OnGuildDataViewRes(res *pb.GuildDataViewRes)
func (*MockClient) OnGuildJoinAgreeRes ¶
func (c *MockClient) OnGuildJoinAgreeRes(res *pb.GuildJoinAgreeRes)
func (*MockClient) OnGuildJoinReqOpResult ¶
func (c *MockClient) OnGuildJoinReqOpResult(res *pb.GuildJoinReqOpResult)
func (*MockClient) OnGuildJoinReqTip ¶
func (c *MockClient) OnGuildJoinReqTip(res *pb.GuildJoinReqTip)
func (*MockClient) OnGuildJoinRes ¶
func (c *MockClient) OnGuildJoinRes(res *pb.GuildJoinRes)
func (*MockClient) OnGuildListRes ¶
func (c *MockClient) OnGuildListRes(res *pb.GuildListRes)
func (*MockClient) OnGuildSync ¶
func (c *MockClient) OnGuildSync(res *pb.GuildSync)
func (*MockClient) OnInputCmd ¶
func (c *MockClient) OnInputCmd(cmd string)
测试命令 支持的命令,详见https://github.com/fish-tennis/gserver/gameserver/test_cmd.go
func (*MockClient) OnItemUseRes ¶
func (c *MockClient) OnItemUseRes(res *pb.ItemUseRes)
func (*MockClient) OnLoginRes ¶
func (c *MockClient) OnLoginRes(res *pb.LoginRes, errorCode int)
func (*MockClient) OnPlayerEntryGameRes ¶
func (c *MockClient) OnPlayerEntryGameRes(res *pb.PlayerEntryGameRes, errorCode int)
func (*MockClient) OnQuestSync ¶
func (c *MockClient) OnQuestSync(res *pb.QuestSync)
func (*MockClient) OnQuestUpdate ¶
func (c *MockClient) OnQuestUpdate(res *pb.QuestUpdate)
type MockClientHandler ¶
type MockClientHandler struct {
DefaultConnectionHandler
// contains filtered or unexported fields
}
func NewMockClientHandler ¶
func NewMockClientHandler(protoCodec Codec) *MockClientHandler
func (*MockClientHandler) OnRecvPacket ¶
func (h *MockClientHandler) OnRecvPacket(connection Connection, packet Packet)
type TestClient ¶
type TestClient struct {
// contains filtered or unexported fields
}
客户端测试 可以管理多个模拟的客户端
func (*TestClient) Exit ¶
func (t *TestClient) Exit()
func (*TestClient) OnInputCmd ¶
func (t *TestClient) OnInputCmd(cmd string)
func (*TestClient) Run ¶
func (t *TestClient) Run(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.