public static PacketOutStream request_test() { PacketOutStream packet = new PacketOutStream(); packet.writeShort((short)99); return(packet); }
public static PacketOutStream request_cube() { PacketOutStream packet = new PacketOutStream(); packet.writeShort((short)PacketOpcode.CLIENT.REQUEST_CUBE); return(packet); }
public static PacketOutStream ping(long ticks) { PacketOutStream packet = new PacketOutStream(); packet.writeShort((short)PacketOpcode.SERVER.PONG); packet.writeLong(ticks); return(packet); }
public static PacketOutStream normal(string msgTest) { PacketOutStream packet = new PacketOutStream(); packet.writeShort((short)PacketOpcode.SERVER.RESPONSE_NORMAL); packet.writeString(msgTest); return(packet); }
//SYN SCENE public static PacketOutStream response_scene(string sceneName) { PacketOutStream packet = new PacketOutStream(); packet.writeShort((short)PacketOpcode.SERVER.RESPONSE_SCENE); packet.writeString(sceneName); return(packet); }
public void Send(PacketOutStream packet) { if (!isConnected) { return; } this.session.Write(packet.getPackets());; packet.Dispose(); }
public static PacketOutStream pong() { DateTime dt = DateTime.UtcNow; PacketOutStream packet = new PacketOutStream(); packet.writeShort((short)PacketOpcode.CLIENT.PING); packet.writeLong(dt.Ticks); return(packet); }
private void FixedUpdate() { countTime += Time.deltaTime; if (countTime >= pongTime) { countTime = 0.0f; PacketOutStream packet = ClientCreatePacket.pong(); ClientHelper.Instance.Send(packet); } }
public static PacketOutStream response_float(float[] arrs) { PacketOutStream packet = new PacketOutStream(); packet.writeShort((short)PacketOpcode.SERVER.RESPONSE_FLOAT); packet.writeInt(arrs.Length); foreach (float s in arrs) { packet.writeFloat(s); } return(packet); }
public static PacketOutStream response_string(string[] arrs) { PacketOutStream packet = new PacketOutStream(); packet.writeShort((short)PacketOpcode.SERVER.RESPONSE_STRING); packet.writeInt(arrs.Length); foreach (string s in arrs) { packet.writeString(s); } return(packet); }
public static PacketOutStream response_cube(Transform arrs) { PacketOutStream packet = new PacketOutStream(); packet.writeShort((short)PacketOpcode.SERVER.RESPONSE_CUBE); packet.writeFloat(arrs.localPosition.x); packet.writeFloat(arrs.localPosition.y); packet.writeFloat(arrs.localPosition.z); packet.writeFloat(arrs.localEulerAngles.x); packet.writeFloat(arrs.localEulerAngles.y); packet.writeFloat(arrs.localEulerAngles.z); packet.writeFloat(arrs.localScale.x); packet.writeFloat(arrs.localScale.y); packet.writeFloat(arrs.localScale.z); return(packet); }
public void Announce(PacketOutStream packet) { session.Write(packet.getPackets()); packet.Dispose(); }
public OutPackageObject(ClientObject client, PacketOutStream packet) { this.client = client; this.packet = packet; }
public void Broadcast(PacketOutStream packet) { acceptor.Broadcast(packet.getPackets());; packet.Dispose(); }