Exemplo n.º 1
0
 public void BuildFrom(byte[] data)
 {
     byte[] array1 = ((IEnumerable <byte>)data).Take <byte>(4).ToArray <byte>();
     byte[] array2 = ((IEnumerable <byte>)data).Skip <byte>(4).ToArray <byte>();
     this._cmd      = (IPCMessageType)BitConverter.ToInt32(array1, 0);
     this._jsonData = Encoding.UTF8.GetString(array2);
 }
Exemplo n.º 2
0
 public void BuildFrom(byte[] data)
 {
     byte[] value = data.Take(4).ToArray();
     byte[] bytes = data.Skip(4).ToArray();
     _cmd      = (IPCMessageType)BitConverter.ToInt32(value, 0);
     _jsonData = Encoding.UTF8.GetString(bytes);
 }
Exemplo n.º 3
0
 public IPCMessage(Guid _id, Guid _responseId, Guid _source, Guid _destination, IPCMessageType _type, object _data)
 {
     Id          = _id;
     ResponseId  = _responseId;
     Source      = _source;
     Destination = _destination;
     Type        = _type;
     Data        = _data;
 }
        private void OnWegameMessage(IPCMessage message)
        {
            IPCMessageType cmd = message.GetCmd();

            if (cmd == IPCMessageType.IPCMessageTypeNotifyFriendList)
            {
                message.Parse <WeGameFriendListInfo>(out var value);
                UpdateFriendList(value);
            }
        }
Exemplo n.º 5
0
 public void Build <T>(IPCMessageType cmd, T t)
 {
     this._jsonData = WeGameHelper.Serialize <T>(t);
     this._cmd      = cmd;
 }