/// <summary> /// Gets account information of a client, who is connected to master server, /// and who's peer id matches the one provided /// </summary> public void GetPeerAccountInfo(int peerId, PeerAccountInfoCallback callback, IClientSocket connection) { if (!connection.IsConnected) { callback.Invoke(null, "Not connected to server"); return; } connection.SendMessage((short)MsfOpCodes.GetPeerAccountInfo, peerId, (status, response) => { if (status != ResponseStatus.Success) { callback.Invoke(null, response.AsString("Unknown error")); return; } var data = response.Deserialize(new PeerAccountInfoPacket()); callback.Invoke(data, null); }); }
/// <summary> /// Gets account information of a client, who is connected to master server, /// and who's peer id matches the one provided /// </summary> public void GetPeerAccountInfo(int peerId, PeerAccountInfoCallback callback, ErrorCallback errorCallback) { if (!Client.IsConnected) { errorCallback.Invoke("Not connected to server"); return; } Client.SendMessage((ushort)OpCodes.GetPeerAccountInfo, peerId, (status, response) => { if (status != ResponseStatus.Success) { errorCallback.Invoke(response.AsString("Unknown error")); return; } var data = response.Deserialize <PeerAccountInfoPacket>(); callback.Invoke(data); }); }