报错修改

back_recharge
lvxinran 2021-04-22 10:00:24 +08:00
parent 66a0486528
commit 11bb0ec986
1 changed files with 17 additions and 20 deletions

View File

@ -1,7 +1,6 @@
package com.ljsd.network.client;
import com.google.protobuf.*;
import com.ljsd.jieling.netty.PackageConstant;
import com.ljsd.jieling.netty.cocdex.Tea;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
@ -14,12 +13,10 @@ import rpc.protocols.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import static com.ljsd.jieling.netty.PackageConstant.GAMEID_LEN;
public class NettyClient {
@ -306,23 +303,23 @@ public class NettyClient {
return PlayerInfoProto.WorkShopEquipCreateRequest.newBuilder().setEquipTid(equipTid).build();
}
public static byte[] wrappedBuffer(short gameId, byte[] content) {
int length = PackageConstant.GAMEID_LEN+PackageConstant.CONTENT_LEN+content.length;
byte[] bytes = new byte[length];
int pos = 0;
Tea.shortToByte(bytes, pos, gameId);
pos += PackageConstant.GAMEID_LEN;
Tea.intToByte(bytes, pos, content.length);
pos += PackageConstant.CONTENT_LEN;
if (content.length != 0) {
System.arraycopy(content, 0, bytes, pos, content.length);
}
// if (backMessage.length != 0) {
// LOGGER.info("wrappedBuffer uid=>{} sendbyte=>{}", uid, bytes1.length);
// public static byte[] wrappedBuffer(short gameId, byte[] content) {
// int length = PackageConstant.GAMEID_LEN+PackageConstant.CONTENT_LEN+content.length;
// byte[] bytes = new byte[length];
// int pos = 0;
// Tea.shortToByte(bytes, pos, gameId);
// pos += PackageConstant.GAMEID_LEN;
// Tea.intToByte(bytes, pos, content.length);
// pos += PackageConstant.CONTENT_LEN;
//
//
// if (content.length != 0) {
// System.arraycopy(content, 0, bytes, pos, content.length);
// }
return bytes;
}
//// if (backMessage.length != 0) {
//// LOGGER.info("wrappedBuffer uid=>{} sendbyte=>{}", uid, bytes1.length);
//// }
// return bytes;
// }
}