public bool unpack(Kaminari.IMarshal marshal, Kaminari.PacketReader packet) { if (packet.bytesRead() + sizeof(byte) > packet.bufferSize()) { return(false); } this.x = new Kaminari.Optional <uint>(); if (packet.getData().readByte() == 1) { if (packet.bytesRead() + marshal.size <uint>() > packet.bufferSize()) { return(false); } this.x.setValue(packet.getData().readUint()); } int size_y = packet.getData().readByte(); this.y = new List <SpawnData>(); for (int i = 0; i < size_y; ++i) { SpawnData data = new SpawnData(); if (data.unpack(marshal, packet)) { this.y.Add(data); } else { return(false); } } if (packet.bytesRead() + marshal.size <int>() > packet.bufferSize()) { return(false); } this.z = packet.getData().readInt(); if (packet.bytesRead() + sizeof(byte) > packet.bufferSize()) { return(false); } this.w = new Kaminari.Optional <List <bool> >(); if (packet.getData().readByte() == 1) { int size_w = packet.getData().readByte(); if (packet.bytesRead() + size_w * marshal.size <bool>() > packet.bufferSize()) { return(false); } this.w.setValue(new List <bool>()); for (int i = 0; i < size_w; ++i) { this.w.getValue().Add(packet.getData().readBool()); } } return(true); }
public static void broadcastSpawnSingle(Kaminari.Client <ProtocolQueues> client, Kaminari.IBroadcaster <ProtocolQueues> broadcaster, SpawnData data) { client.getProtocol().getPhaseSync().OneShot(() => Kumo.Unsafe.broadcastSpawnSingle(broadcaster, data)); }
public static void broadcastSpawn(Kaminari.Client <ProtocolQueues> client, Kaminari.IBroadcaster <ProtocolQueues> broadcaster, SpawnData data, Action callback) { client.getProtocol().getPhaseSync().OneShot(() => Kumo.Unsafe.broadcastSpawn(broadcaster, data, callback)); }
public static void sendSpawn(Kaminari.Client <ProtocolQueues> client, SpawnData data) { client.getProtocol().getPhaseSync().OneShot(() => Kumo.Unsafe.sendSpawn(client.getSuperPacket().getQueues(), data)); }
public static void broadcastSpawnSingle(Kaminari.IBroadcaster <ProtocolQueues> broadcaster, SpawnData data) { Kaminari.Packet packet = Kaminari.Packet.make((ushort)Opcodes.opcodeSpawn); data.pack(Marshal.instance, packet); broadcaster.broadcast((ProtocolQueues pq) => pq.sendReliable(packet)); }
public static void sendSpawn(ProtocolQueues pq, SpawnData data) { pq.sendReliable((ushort)Opcodes.opcodeSpawn, data); }
public static void sendSpawn(ProtocolQueues pq, SpawnData data, Action callback) { pq.sendReliable((ushort)Opcodes.opcodeSpawn, data, callback); }