public static void SendBuffer(int msgid, byte[] data) { if (!isConnected) { return; } Frame.Packet packet = Frame.Packet.ToPacket(msgid, data); SendCommand(packet); }
public static void send(Frame.Packet cmd) { if (!isConnected) { return; } sSerializeBuffer.SetPosition(0); cmd.Serialize(sSerializeBuffer); Instance.mSocketBase.Send(sSerializeBuffer); }
public static void Send <T>(Cmd.CLIENTID msgid, T protodata) where T : ProtoBuf.IExtensible { if (!isConnected) { return; } MemoryStream stream = new MemoryStream(); ProtoBuf.Serializer.Serialize <T>(stream, protodata); Frame.Packet packet = Frame.Packet.ToPacket((int)msgid, stream.ToArray()); SendCommand(packet); }
public static void SendCommand(int msgid) { if (!isConnected) { return; } if (!isConnected) { return; } Frame.Packet packet = Frame.Packet.ToPacket(msgid, null); SendCommand(packet); }