Example #1
0
        void AddUser(IPCReceiver receiver, IPCReader data, SyncHandler sync)
        {
            var magic = data.ReadUInt64();
            var id    = data.ReadInt32();

            if (!sync.UserExists(magic))
            {
                sync.AddUser(magic, id);
            }
        }
Example #2
0
        void GetUser(IPCReceiver receiver, IPCReader data, SyncHandler sync)
        {
            var magic  = data.ReadUInt64();
            var packet = new IPCWriter(IPC.GetUser);

            if (!sync.UserExists(magic))
            {
                packet.Write(-1);
                receiver.Send(packet);
                return;
            }

            var id = sync.GetUser(magic);

            packet.Write(id);
            receiver.Send(packet);
        }