Exemplo n.º 1
0
 protected override void SendParameter(NetWriter writer, ActionParam actionParam)
 {
     if (actionParam.HasValue)
     {
         MahJongGameAction requestPack = actionParam.GetValue <MahJongGameAction>();
         writer.writeString("GameAction", JsonUtil.SerializeObject(requestPack));
     }
 }
Exemplo n.º 2
0
 protected override void SendParameter(NetWriter writer, ActionParam actionParam)
 {
     if (actionParam.HasValue)
     {
         RoomMsgInfo requestPack = actionParam.GetValue <RoomMsgInfo>();
         writer.writeString("RoomMessage", JsonUtil.SerializeObject(requestPack));
     }
 }
Exemplo n.º 3
0
 protected override void SendParameter(NetWriter writer, ActionParam actionParam)
 {
     if (actionParam.HasValue)
     {
         //自定对象参数格式
         isCustom = true;
         var rankData = actionParam.GetValue<RankData>();
         byte[] data = ProtoBufUtils.Serialize(rankData);
         writer.SetBodyData(data);
     }
     else
     {
         isCustom = false;
         writer.writeString("UserName", "Jon");
         writer.writeInt32("Score", 100);
     }
 }
Exemplo n.º 4
0
 protected override void SendParameter(NetWriter writer, ActionParam actionParam)
 {
     if (actionParam.HasValue)
     {
         //自定对象参数格式
         isCustom = true;
         var    rankData = actionParam.GetValue <RankData>();
         byte[] data     = ProtoBufUtils.Serialize(rankData);
         writer.SetBodyData(data);
     }
     else
     {
         isCustom = false;
         writer.writeString("UserName", "Jon");
         writer.writeInt32("Score", 100);
     }
 }
Exemplo n.º 5
0
 protected override void SendParameter(NetWriter writer, ActionParam actionParam)
 {
     if (actionParam.HasValue)
     {
         //自定对象参数格式
         isCustom = true;
         Request1001Pack requestPack = actionParam.GetValue <Request1001Pack>();
         byte[]          data        = ProtoBufUtils.Serialize(requestPack);
         writer.SetBodyData(data);
     }
     else
     {
         isCustom = false;
         //默认url参数格式
         actionParam.Foreach((k, v) =>
         {
             writer.writeString(k, v.ToString());
             return(true);
         });
     }
 }
Exemplo n.º 6
0
 protected override void SendParameter(NetWriter writer, ActionParam actionParam)
 {
     if (actionParam.HasValue)
     {
         //自定对象参数格式
         isCustom = true;
         Request1001Pack requestPack = actionParam.GetValue<Request1001Pack>();
         byte[] data = ProtoBufUtils.Serialize(requestPack);
         writer.SetBodyData(data);
     }
     else
     {
         isCustom = false;
         //默认url参数格式
         actionParam.Foreach((k, v) =>
         {
             writer.writeString(k, v);
             return true;
         });
     }
 }
Exemplo n.º 7
0
 protected override void SendParameter(NetWriter writer, ActionParam userData)
 {
     byte[] data = ProtoBufUtils.Serialize(userData.GetValue<LoginMessage>());
     writer.SetBodyData(data);
 }