entry : map.entrySet()) {
14 | if (ObjectsCompat.equals(value, entry.getValue())) {
15 | return entry.getKey();
16 | }
17 | }
18 | return null;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/IDebugNetworkListener.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util;
2 |
3 | import in.dragonbra.javasteam.enums.EMsg;
4 |
5 | /**
6 | * This is a debug utility, do not use it to implement your business logic.
7 | *
8 | * This interface is used for logging network messages sent to and received from the Steam server that the client is connected to.
9 | */
10 | public interface IDebugNetworkListener {
11 |
12 | /**
13 | * Called when a packet is received from the Steam server.
14 | *
15 | * @param msgType Network message type of this packet message.
16 | * @param data Raw packet data that was received.
17 | */
18 | void onIncomingNetworkMessage(EMsg msgType, byte[] data);
19 |
20 | /**
21 | * Called when a packet is about to be sent to the Steam server.
22 | *
23 | * @param msgType Network message type of this packet message.
24 | * @param data Raw packet data that was received.
25 | */
26 | void onOutgoingNetworkMessage(EMsg msgType, byte[] data);
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/Passable.kt:
--------------------------------------------------------------------------------
1 | package `in`.dragonbra.javasteam.util
2 |
3 | class Passable @JvmOverloads constructor(var value: T? = null)
4 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/SteamKitWebRequestException.kt:
--------------------------------------------------------------------------------
1 | package `in`.dragonbra.javasteam.util
2 |
3 | import okhttp3.Headers
4 | import okhttp3.Response
5 | import java.lang.Exception
6 |
7 | /**
8 | * Thrown when an HTTP request fails.
9 | */
10 | @Suppress("MemberVisibilityCanBePrivate")
11 | class SteamKitWebRequestException(message: String) : Exception(message) {
12 |
13 | /**
14 | * Represents the status code of the HTTP response.
15 | */
16 | var statusCode: Int = 0
17 |
18 | /**
19 | * Represents the collection of HTTP response headers.
20 | */
21 | var headers: Headers? = null
22 | private set
23 |
24 | /**
25 | * Initializes a new instance of the [SteamKitWebRequestException] class.
26 | * @param message The message that describes the error.
27 | * @param response HTTP response message including the status code and data.
28 | */
29 | constructor(message: String, response: Response) : this(message) {
30 | statusCode = response.code
31 | headers = response.headers
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/Strings.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util;
2 |
3 | import java.math.BigInteger;
4 |
5 | /**
6 | * @author lngtr
7 | * @since 2018-02-19
8 | */
9 | public class Strings {
10 |
11 | /**
12 | * the constant 2^64
13 | */
14 | private static final BigInteger TWO_64 = BigInteger.ONE.shiftLeft(64);
15 |
16 | public static boolean isNullOrEmpty(String str) {
17 | return str == null || str.isEmpty();
18 | }
19 |
20 | public String asUnsignedDecimalString(long l) {
21 | BigInteger b = BigInteger.valueOf(l);
22 | if (b.signum() < 0) {
23 | b = b.add(TWO_64);
24 | }
25 | return b.toString();
26 | }
27 |
28 | private final static char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray();
29 |
30 | public static String toHex(byte[] bytes) {
31 | char[] hexChars = new char[bytes.length * 2];
32 | for (int j = 0; j < bytes.length; j++) {
33 | int v = bytes[j] & 0xFF;
34 | hexChars[j * 2] = HEX_ARRAY[v >>> 4];
35 | hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F];
36 | }
37 | return new String(hexChars);
38 | }
39 |
40 | public static byte[] decodeHex(String s) {
41 | int len = s.length();
42 | byte[] data = new byte[len / 2];
43 | for (int i = 0; i < len; i += 2) {
44 | data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
45 | + Character.digit(s.charAt(i + 1), 16));
46 | }
47 | return data;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/WebHelpers.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util;
2 |
3 | import java.nio.charset.StandardCharsets;
4 |
5 | /**
6 | * @author lngtr
7 | * @since 2018-04-16
8 | */
9 | public class WebHelpers {
10 |
11 | private static boolean isUrlSafeChar(char ch) {
12 | return ch >= 'a' && ch <= 'z' ||
13 | ch >= 'A' && ch <= 'Z' ||
14 | ch >= '0' && ch <= '9' ||
15 | ch == '-' ||
16 | ch == '.' ||
17 | ch == '_';
18 | }
19 |
20 | public static String urlEncode(String input) {
21 | return urlEncode(input.getBytes(StandardCharsets.UTF_8));
22 | }
23 |
24 | public static String urlEncode(byte[] input) {
25 | StringBuilder encoded = new StringBuilder(input.length * 2);
26 |
27 | for (byte i : input) {
28 | char inch = (char) i;
29 |
30 | if (isUrlSafeChar(inch)) {
31 | encoded.append(inch);
32 | } else if (inch == ' ') {
33 | encoded.append('+');
34 | } else {
35 | encoded.append(String.format("%%%02X", i));
36 | }
37 | }
38 |
39 | return encoded.toString();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/ZipUtil.kt:
--------------------------------------------------------------------------------
1 | package `in`.dragonbra.javasteam.util
2 |
3 | import `in`.dragonbra.javasteam.util.compat.readNBytesCompat
4 | import `in`.dragonbra.javasteam.util.stream.MemoryStream
5 | import java.util.zip.ZipInputStream
6 |
7 | object ZipUtil {
8 |
9 | @JvmStatic
10 | fun decompress(ms: MemoryStream, destination: ByteArray, verifyChecksum: Boolean = true): Int {
11 | ZipInputStream(ms, Charsets.UTF_8).use { zip ->
12 | val entry = zip.nextEntry
13 | ?: throw IllegalArgumentException("Did not find any zip entries in the given stream")
14 |
15 | val sizeDecompressed = entry.size.toInt()
16 |
17 | if (destination.size < sizeDecompressed) {
18 | throw IllegalArgumentException("The destination buffer is smaller than the decompressed data size.")
19 | }
20 |
21 | val bytesRead = zip.readNBytesCompat(destination, 0, sizeDecompressed)
22 |
23 | if (zip.nextEntry != null) {
24 | throw IllegalArgumentException("Given stream should only contain one zip entry")
25 | }
26 |
27 | if (verifyChecksum && Utils.crc32(destination.sliceArray(0 until sizeDecompressed)) != entry.crc) {
28 | throw Exception("Checksum validation failed for decompressed file")
29 | }
30 |
31 | return bytesRead
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/compat/ByteArrayOutputStreamCompat.kt:
--------------------------------------------------------------------------------
1 | package `in`.dragonbra.javasteam.util.compat
2 |
3 | import java.io.ByteArrayOutputStream
4 |
5 | /**
6 | * Compatibility class to provide compatibility with Java ByteArrayOutputStream.
7 | *
8 | * @author Lossy
9 | * @since 30/12/2024
10 | */
11 | object ByteArrayOutputStreamCompat {
12 |
13 | @JvmStatic
14 | fun toString(byteArrayOutputStream: ByteArrayOutputStream): String =
15 | String(byteArrayOutputStream.toByteArray(), 0, byteArrayOutputStream.size())
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/compat/Consumer.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.compat;
2 |
3 | public interface Consumer {
4 | void accept(T t);
5 | }
6 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/compat/ObjectsCompat.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.compat;
2 |
3 | import java.util.Objects;
4 |
5 | /**
6 | * @author steev
7 | * @since 2018-03-21
8 | */
9 | public class ObjectsCompat {
10 | public static boolean equals(Object a, Object b) {
11 | return Objects.equals(a, b);
12 | }
13 | }
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/crypto/BerDecodeException.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.crypto;
2 |
3 | @SuppressWarnings("unused")
4 | public final class BerDecodeException extends Exception {
5 |
6 | private final int _position;
7 |
8 | public BerDecodeException() {
9 | _position = 0;
10 | }
11 |
12 | public BerDecodeException(String message) {
13 | super(message);
14 | _position = 0;
15 | }
16 |
17 | public BerDecodeException(String message, Exception ex) {
18 | super(message, ex);
19 | _position = 0;
20 | }
21 |
22 | public BerDecodeException(String message, int position) {
23 | super(message);
24 | _position = position;
25 | }
26 |
27 | public BerDecodeException(String message, int position, Exception ex) {
28 | super(message, ex);
29 | _position = position;
30 | }
31 |
32 | public int get_position() {
33 | return _position;
34 | }
35 |
36 | @Override
37 | public String getMessage() {
38 | return super.getMessage() + String.format(" (Position %d)%s", _position, System.lineSeparator());
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/crypto/CryptoException.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.crypto;
2 |
3 | /**
4 | * @author lngtr
5 | * @since 2018-03-02
6 | */
7 | public class CryptoException extends Exception {
8 | public CryptoException() {
9 | }
10 |
11 | public CryptoException(String message) {
12 | super(message);
13 | }
14 |
15 | public CryptoException(String message, Throwable cause) {
16 | super(message, cause);
17 | }
18 |
19 | public CryptoException(Throwable cause) {
20 | super(cause);
21 | }
22 |
23 | public CryptoException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
24 | super(message, cause, enableSuppression, writableStackTrace);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/event/Event.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.event;
2 |
3 | import java.util.HashSet;
4 |
5 | public class Event {
6 |
7 | protected final HashSet> handlers = new HashSet<>();
8 |
9 | public void addEventHandler(EventHandler handler) {
10 | synchronized (handlers) {
11 | handlers.add(handler);
12 | }
13 | }
14 |
15 | public void removeEventHandler(EventHandler handler) {
16 | synchronized (handlers) {
17 | handlers.remove(handler);
18 | }
19 | }
20 |
21 | public void handleEvent(Object sender, T e) {
22 | synchronized (handlers) {
23 | for (final EventHandler handler : handlers) {
24 | handler.handleEvent(sender, e);
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/event/EventArgs.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.event;
2 |
3 | public class EventArgs {
4 |
5 | public static final EventArgs EMPTY = new EventArgs();
6 |
7 | public EventArgs() {
8 | }
9 | }
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/event/EventHandler.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.event;
2 |
3 | public interface EventHandler {
4 | void handleEvent(Object sender, T e);
5 | }
6 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/event/ScheduledFunction.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.event;
2 |
3 | import java.util.Timer;
4 | import java.util.TimerTask;
5 |
6 | /**
7 | * @author lngtr
8 | * @since 2018-02-20
9 | */
10 | public class ScheduledFunction {
11 |
12 | private long delay;
13 |
14 | private final Runnable func;
15 |
16 | private Timer timer;
17 |
18 | private boolean bStarted = false;
19 |
20 | public ScheduledFunction(Runnable func, long delay) {
21 | this.delay = delay;
22 | this.func = func;
23 | }
24 |
25 | public void start() {
26 | if (!bStarted) {
27 | timer = new Timer();
28 | timer.scheduleAtFixedRate(new TimerTask() {
29 | @Override
30 | public void run() {
31 | if (func != null) {
32 | func.run();
33 | }
34 | }
35 | }, 0, delay);
36 | bStarted = true;
37 | }
38 | }
39 |
40 | public void stop() {
41 | if (bStarted) {
42 | timer.cancel();
43 | timer = null;
44 | bStarted = false;
45 | }
46 | }
47 |
48 | public long getDelay() {
49 | return delay;
50 | }
51 |
52 | public void setDelay(long delay) {
53 | this.delay = delay;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/log/LogListener.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.log;
2 |
3 | /**
4 | * @author lngtr
5 | * @since 2018-03-02
6 | */
7 | public interface LogListener {
8 | void onLog(Class> clazz, String message, Throwable throwable);
9 |
10 | void onError(Class> clazz, String message, Throwable throwable);
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/log/LogManager.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.log;
2 |
3 | import java.util.HashMap;
4 | import java.util.LinkedList;
5 | import java.util.List;
6 | import java.util.Map;
7 |
8 | /**
9 | * @author lngtr
10 | * @since 2018-03-02
11 | */
12 | public class LogManager {
13 |
14 | static final List LOG_LISTENERS = new LinkedList<>();
15 |
16 | private static final Map, Logger> LOGGERS = new HashMap<>();
17 |
18 | /**
19 | * Gets the {@link Logger} instance of the specified class.
20 | *
21 | * @param clazz the class, must not be null.
22 | * @return the logger instance.
23 | */
24 | public static Logger getLogger(Class> clazz) {
25 | return LOGGERS.computeIfAbsent(clazz, k -> new Logger(clazz));
26 | }
27 |
28 | /**
29 | * Adds a log listener that will be notified of logging events.
30 | * You can use the {@link DefaultLogListener} that prints logs to the standard output in a format similar to Log4j2
31 | *
32 | * @param listener the listener.
33 | */
34 | public static void addListener(LogListener listener) {
35 | if (listener != null) {
36 | LOG_LISTENERS.add(listener);
37 | }
38 | }
39 |
40 | /**
41 | * Remove a log listener.
42 | *
43 | * @param listener the listener.
44 | */
45 | public static void removeListener(LogListener listener) {
46 | LOG_LISTENERS.remove(listener);
47 | }
48 |
49 | private LogManager() {
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/log/Logger.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.log;
2 |
3 | /**
4 | * @author lngtr
5 | * @since 2018-03-02
6 | */
7 | public class Logger {
8 |
9 | private final Class> clazz;
10 |
11 | Logger(Class> clazz) {
12 | if (clazz == null) {
13 | throw new IllegalArgumentException("class is null");
14 | }
15 | this.clazz = clazz;
16 | }
17 |
18 | public void debug(Throwable throwable) {
19 | debug(null, throwable);
20 | }
21 |
22 | public void debug(String message) {
23 | debug(message, null);
24 | }
25 |
26 | public void debug(String message, Throwable throwable) {
27 | for (LogListener listener : LogManager.LOG_LISTENERS) {
28 | if (listener != null) {
29 | listener.onLog(clazz, message, throwable);
30 | }
31 | }
32 | }
33 |
34 | public void error(Throwable throwable) {
35 | error(null, throwable);
36 | }
37 |
38 | public void error(String message) {
39 | error(message, null);
40 | }
41 |
42 | public void error(String message, Throwable throwable) {
43 | for (LogListener listener : LogManager.LOG_LISTENERS) {
44 | if (listener != null) {
45 | listener.onError(clazz, message, throwable);
46 | }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/in/dragonbra/javasteam/util/stream/SeekOrigin.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.stream;
2 |
3 | /**
4 | * @author lngtr
5 | * @since 2018-02-21
6 | */
7 | public enum SeekOrigin {
8 | BEGIN,
9 | CURRENT,
10 | END
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/proto/in/dragonbra/javasteam/protobufs/steam/discovery/basic_server_list.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto2";
2 |
3 | option java_package = "in.dragonbra.javasteam.protobufs.steam.discovery";
4 | option java_outer_classname = "BasicServerListProtos";
5 |
6 | option optimize_for = SPEED;
7 |
8 | message BasicServerList {
9 | repeated BasicServer servers = 1;
10 | }
11 |
12 | message BasicServer {
13 | required string address = 1;
14 | required int32 port = 2;
15 | required int32 protocol = 3;
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/proto/in/dragonbra/javasteam/protobufs/steamclient/clientmetrics.proto:
--------------------------------------------------------------------------------
1 | option java_package = "in.dragonbra.javasteam.protobufs.steamclient";
2 |
3 | option optimize_for = SPEED;
4 |
5 | message CClientMetrics_ClientBootstrap_RequestInfo {
6 | optional string original_hostname = 1;
7 | optional string actual_hostname = 2;
8 | optional string path = 3;
9 | optional string base_name = 4;
10 | optional bool success = 5;
11 | optional uint32 status_code = 6;
12 | optional string address_of_request_url = 7;
13 | optional uint32 response_time_ms = 8;
14 | optional uint64 bytes_received = 9;
15 | optional uint32 num_retries = 10;
16 | }
17 |
18 | message CClientMetrics_ClientBootstrap_Summary {
19 | optional uint32 launcher_type = 1;
20 | optional uint32 steam_realm = 2;
21 | optional string beta_name = 3;
22 | optional bool download_completed = 4;
23 | optional uint32 total_time_ms = 6;
24 | repeated .CClientMetrics_ClientBootstrap_RequestInfo manifest_requests = 7;
25 | repeated .CClientMetrics_ClientBootstrap_RequestInfo package_requests = 8;
26 | }
27 |
28 | message CClientMetrics_ContentDownloadResponse_Counts {
29 | optional uint32 class_100 = 1;
30 | optional uint32 class_200 = 2;
31 | optional uint32 class_300 = 3;
32 | optional uint32 class_400 = 4;
33 | optional uint32 class_500 = 5;
34 | optional uint32 no_response = 6;
35 | optional uint32 class_unknown = 7;
36 | }
37 |
38 | message CClientMetrics_ContentDownloadResponse_HostCounts {
39 | optional string hostname = 1;
40 | optional uint32 source_type = 2;
41 | optional .CClientMetrics_ContentDownloadResponse_Counts counts = 3;
42 | }
43 |
44 | message CClientMetrics_ContentDownloadResponse_Hosts {
45 | repeated .CClientMetrics_ContentDownloadResponse_HostCounts hosts = 1;
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/proto/in/dragonbra/javasteam/protobufs/steamclient/encrypted_app_ticket.proto:
--------------------------------------------------------------------------------
1 | option java_package = "in.dragonbra.javasteam.protobufs.steamclient";
2 |
3 | option optimize_for = SPEED;
4 | option java_generic_services = false;
5 |
6 | message EncryptedAppTicket {
7 | optional uint32 ticket_version_no = 1;
8 | optional uint32 crc_encryptedticket = 2;
9 | optional uint32 cb_encrypteduserdata = 3;
10 | optional uint32 cb_encrypted_appownershipticket = 4;
11 | optional bytes encrypted_ticket = 5;
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/proto/in/dragonbra/javasteam/protobufs/steamclient/steammessages_clientserver_ufs.proto:
--------------------------------------------------------------------------------
1 | import "in/dragonbra/javasteam/protobufs/steamclient/steammessages_base.proto";
2 |
3 | option java_package = "in.dragonbra.javasteam.protobufs.steamclient";
4 |
5 | option optimize_for = SPEED;
6 | option java_generic_services = false;
7 |
8 | message CMsgClientUFSGetUGCDetails {
9 | optional fixed64 hcontent = 1 [default = 18446744073709551615];
10 | }
11 |
12 | message CMsgClientUFSGetUGCDetailsResponse {
13 | optional int32 eresult = 1 [default = 2];
14 | optional string url = 2;
15 | optional uint32 app_id = 3;
16 | optional string filename = 4;
17 | optional fixed64 steamid_creator = 5;
18 | optional uint32 file_size = 6;
19 | optional uint32 compressed_file_size = 7;
20 | optional string rangecheck_host = 8;
21 | optional string file_encoded_sha1 = 9;
22 | }
23 |
24 | message CMsgClientUFSGetSingleFileInfo {
25 | optional uint32 app_id = 1;
26 | optional string file_name = 2;
27 | }
28 |
29 | message CMsgClientUFSGetSingleFileInfoResponse {
30 | optional int32 eresult = 1 [default = 2];
31 | optional uint32 app_id = 2;
32 | optional string file_name = 3;
33 | optional bytes sha_file = 4;
34 | optional uint64 time_stamp = 5;
35 | optional uint32 raw_file_size = 6;
36 | optional bool is_explicit_delete = 7;
37 | }
38 |
39 | message CMsgClientUFSShareFile {
40 | optional uint32 app_id = 1;
41 | optional string file_name = 2;
42 | }
43 |
44 | message CMsgClientUFSShareFileResponse {
45 | optional int32 eresult = 1 [default = 2];
46 | optional fixed64 hcontent = 2 [default = 18446744073709551615];
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/proto/in/dragonbra/javasteam/protobufs/steamclient/steammessages_unified_base.steamclient.proto:
--------------------------------------------------------------------------------
1 | import "google/protobuf/descriptor.proto";
2 |
3 | option java_package = "in.dragonbra.javasteam.protobufs.steamclient";
4 |
5 | option optimize_for = SPEED;
6 | option java_generic_services = false;
7 |
8 | extend .google.protobuf.MessageOptions {
9 | optional string message_description = 51000;
10 | optional bool force_emit_message = 50026 [default = false];
11 | }
12 |
13 | extend .google.protobuf.FieldOptions {
14 | optional string description = 50000;
15 | }
16 |
17 | extend .google.protobuf.ServiceOptions {
18 | optional string service_description = 50000;
19 | optional .EProtoExecutionSite service_execution_site = 50008 [default = k_EProtoExecutionSiteUnknown];
20 | optional .EProtoServiceType service_type = 50025 [default = k_EProtoServiceTypeSteamMessages];
21 | optional bool force_emit_service = 50026 [default = false];
22 | }
23 |
24 | extend .google.protobuf.MethodOptions {
25 | optional string method_description = 50000;
26 | }
27 |
28 | extend .google.protobuf.EnumOptions {
29 | optional string enum_description = 50000;
30 | }
31 |
32 | extend .google.protobuf.EnumValueOptions {
33 | optional string enum_value_description = 50000;
34 | }
35 |
36 | enum EProtoExecutionSite {
37 | k_EProtoExecutionSiteUnknown = 0;
38 | k_EProtoExecutionSiteSteamClient = 2;
39 | }
40 |
41 | enum EProtoServiceType {
42 | k_EProtoServiceTypeSteamMessages = 0;
43 | k_EProtoServiceTypeVRGamepadUIMessages = 1;
44 | }
45 |
46 | message NoResponse {
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/steamd/in/dragonbra/javasteam/gamecoordinator.steamd:
--------------------------------------------------------------------------------
1 | class MsgGCHdrProtoBuf
2 | {
3 | protomaskgc uint msg = 0;
4 | int headerLength;
5 |
6 | proto SteamKit2.GC.Internal.CMsgProtoBufHeader proto;
7 | };
8 |
9 | class MsgGCHdr
10 | {
11 | ushort headerVersion = 1;
12 |
13 | ulong targetJobID = ulong.MaxValue;
14 | ulong sourceJobID = ulong.MaxValue;
15 | };
16 |
--------------------------------------------------------------------------------
/src/main/steamd/in/dragonbra/javasteam/header.steamd:
--------------------------------------------------------------------------------
1 | #import "emsg.steamd"
2 | #import "eresult.steamd"
3 | #import "enums.steamd"
4 | #import "netheader.steamd"
5 |
6 | class MsgHdr
7 | {
8 | EMsg msg = EMsg::Invalid;
9 |
10 | ulong targetJobID = ulong.MaxValue;
11 | ulong sourceJobID = ulong.MaxValue;
12 | };
13 |
14 | class ExtendedClientMsgHdr
15 | {
16 | EMsg msg = EMsg::Invalid;
17 |
18 | byte headerSize = 36;
19 |
20 | ushort headerVersion = 2;
21 |
22 | ulong targetJobID = ulong.MaxValue;
23 | ulong sourceJobID = ulong.MaxValue;
24 |
25 | byte headerCanary = 239;
26 |
27 | steamidmarshal ulong steamID;
28 | int sessionID;
29 | };
30 |
31 | class MsgHdrProtoBuf
32 | {
33 | protomask EMsg msg = EMsg::Invalid;
34 | int headerLength;
35 |
36 | proto SteamKit2.Internal.CMsgProtoBufHeader proto;
37 | };
38 |
--------------------------------------------------------------------------------
/src/main/steamd/in/dragonbra/javasteam/netheader.steamd:
--------------------------------------------------------------------------------
1 | enum EUdpPacketType
2 | {
3 | Invalid = 0;
4 |
5 | ChallengeReq = 1;
6 | Challenge = 2;
7 | Connect = 3;
8 | Accept = 4;
9 | Disconnect = 5;
10 | Data = 6;
11 | Datagram = 7;
12 | Max = 8;
13 | };
14 |
15 | class UdpHeader
16 | {
17 | const uint MAGIC = 0x31305356;
18 |
19 | uint magic = UdpHeader::MAGIC;
20 |
21 | ushort payloadSize;
22 | EUdpPacketType packetType = EUdpPacketType::Invalid;
23 | byte flags;
24 |
25 | uint sourceConnID = 512;
26 | uint destConnID;
27 |
28 | uint seqThis;
29 | uint seqAck;
30 |
31 | uint packetsInMsg;
32 | uint msgStartSeq;
33 |
34 | uint msgSize;
35 | };
36 |
37 | class ChallengeData
38 | {
39 | const uint CHALLENGE_MASK = 0xA426DF2B;
40 |
41 | uint challengeValue;
42 | uint serverLoad;
43 | };
44 |
45 | class ConnectData
46 | {
47 | const uint CHALLENGE_MASK = ChallengeData::CHALLENGE_MASK;
48 |
49 | uint challengeValue;
50 | };
51 |
52 | class Accept
53 | {
54 | };
55 |
56 | class Datagram
57 | {
58 | };
59 |
60 | class Disconnect
61 | {
62 | };
63 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/ConnectedSteamClient.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam;
2 |
3 | import in.dragonbra.javasteam.steam.steamclient.SteamClient;
4 |
5 | public class ConnectedSteamClient {
6 | public static SteamClient get() {
7 | var client = new SteamClient();
8 | client.setIsConnected(true);
9 |
10 | return client;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/TestBase.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam;
2 |
3 | import in.dragonbra.javasteam.util.log.DefaultLogListener;
4 | import in.dragonbra.javasteam.util.log.LogManager;
5 | import org.junit.jupiter.api.BeforeAll;
6 |
7 | /**
8 | * @author lngtr
9 | * @since 2018-02-25
10 | */
11 | public abstract class TestBase {
12 | @BeforeAll
13 | public static void beforeClass() {
14 | LogManager.addListener(new DefaultLogListener());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/steam/DummyClient.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.steam;
2 |
3 | import in.dragonbra.javasteam.base.IClientMsg;
4 | import in.dragonbra.javasteam.steam.steamclient.configuration.SteamConfiguration;
5 |
6 | /**
7 | * @author lngtr
8 | * @since 2018-02-25
9 | */
10 | public class DummyClient extends CMClient {
11 | public DummyClient() {
12 | super(SteamConfiguration.createDefault());
13 | }
14 |
15 | public void dummyDisconnect() {
16 | disconnect();
17 | onClientDisconnected(true);
18 | }
19 |
20 | public void handleClientMsg(IClientMsg clientMsg) {
21 | onClientMsgReceived(getPacketMsg(clientMsg.serialize()));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/types/GameIDTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.types;
2 |
3 | import org.junit.jupiter.api.Test;
4 |
5 | import static org.junit.jupiter.api.Assertions.assertEquals;
6 | import static org.junit.jupiter.api.Assertions.assertTrue;
7 |
8 | /**
9 | * @author lngtr
10 | * @since 2019-01-14
11 | */
12 | public class GameIDTest {
13 |
14 | @Test
15 | public void modCrcCorrect() {
16 | GameID gameId = new GameID(420, "Research and Development");
17 |
18 | assertTrue(gameId.isMod());
19 | assertEquals(420, gameId.getAppID());
20 | assertEquals(new GameID(0x8db24e81010001a4L), gameId);
21 |
22 | GameID gameId2 = new GameID(215, "hidden");
23 |
24 | assertTrue(gameId2.isMod());
25 | assertEquals(215, gameId2.getAppID());
26 | assertEquals(new GameID(0x885de9bd010000d7L), gameId2);
27 | }
28 |
29 | @Test
30 | public void shortcutCrcCorrect() {
31 | GameID gameId = new GameID("\"C:\\Program Files (x86)\\Git\\mingw64\\bin\\wintoast.exe\"", "Git for Windows");
32 |
33 | assertTrue(gameId.isShortcut());
34 | assertEquals(new GameID(0xb102133802000000L), gameId);
35 | }
36 | }
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/CollectionsTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util;
2 |
3 | import org.junit.jupiter.api.Assertions;
4 | import org.junit.jupiter.api.BeforeEach;
5 | import org.junit.jupiter.api.Test;
6 |
7 | import java.util.HashMap;
8 |
9 | public class CollectionsTest {
10 |
11 | private HashMap values;
12 |
13 | @BeforeEach
14 | public void setUp() {
15 | values = new HashMap<>();
16 | values.put(1, "Some Value");
17 | values.put(2, "A Value");
18 | values.put(3, "All the values");
19 | }
20 |
21 | @Test
22 | public void getKeyByValueExistingValue() {
23 | var result = CollectionUtils.getKeyByValue(values, "A Value");
24 | Assertions.assertEquals(2, result);
25 | }
26 |
27 | @Test
28 | public void getKeyByValueNullValue() {
29 | var nullResult = CollectionUtils.getKeyByValue(values, "Null Value");
30 | Assertions.assertNull(nullResult);
31 |
32 | var nullResult2 = CollectionUtils.getKeyByValue(values, null);
33 | Assertions.assertNull(nullResult2);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/HardwareUtilsTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util;
2 |
3 | import org.junit.jupiter.api.Assertions;
4 | import org.junit.jupiter.api.BeforeEach;
5 | import org.junit.jupiter.api.Test;
6 |
7 | import java.lang.reflect.Field;
8 |
9 | public class HardwareUtilsTest {
10 |
11 | @BeforeEach
12 | public void setUp() throws NoSuchFieldException, IllegalAccessException {
13 | // Ehh.... This resets the 'MACHINE_NAME' field for every test.
14 | Field field = HardwareUtils.class.getDeclaredField("MACHINE_NAME");
15 | field.setAccessible(true);
16 | field.set(null, null);
17 | }
18 |
19 | @Test
20 | public void machineNameWithTag() {
21 | var name = HardwareUtils.getMachineName(true);
22 | System.out.println(name);
23 | Assertions.assertTrue(name.contains(" (JavaSteam)"));
24 | }
25 |
26 | @Test
27 | public void machineNameWithNoTag() {
28 | var name = HardwareUtils.getMachineName();
29 | System.out.println(name);
30 | Assertions.assertFalse(name.contains(" (JavaSteam)"));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/MsgUtilTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util;
2 |
3 | import in.dragonbra.javasteam.enums.EMsg;
4 | import org.junit.jupiter.api.Assertions;
5 | import org.junit.jupiter.api.Test;
6 |
7 | public class MsgUtilTest {
8 |
9 | @Test
10 | public void isProtoBuf() {
11 | var result = MsgUtil.isProtoBuf(-2147482868); // ClientLicenseList
12 | Assertions.assertTrue(result);
13 | }
14 |
15 | @Test
16 | public void isNotProtoBuf() {
17 | var result = MsgUtil.isProtoBuf(798); // ClientUpdateGuestPassesList
18 | Assertions.assertFalse(result);
19 | }
20 |
21 | @Test
22 | public void getMsgAsServiceMethodResponse() {
23 | var result = MsgUtil.getMsg(-2147483501); // ServiceMethodResponse
24 | Assertions.assertEquals(EMsg.ServiceMethodResponse, result);
25 | }
26 |
27 | @Test
28 | public void getMsgAsClientUpdateGuestPassesList() {
29 | var result = MsgUtil.getMsg(798); // ClientUpdateGuestPassesList
30 | Assertions.assertEquals(EMsg.ClientUpdateGuestPassesList, result);
31 | }
32 |
33 | @Test
34 | public void getMsgAsWrongMsg() {
35 | var result = MsgUtil.getMsg(-2147483501); // ServiceMethodResponse
36 | Assertions.assertNotEquals(EMsg.ClientUpdateGuestPassesList, result);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/PassableTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util;
2 |
3 | import org.junit.jupiter.api.Assertions;
4 | import org.junit.jupiter.api.Test;
5 |
6 | public class PassableTest {
7 |
8 | @Test
9 | public void BooleanPassable() {
10 | var passableValue = new Passable<>(false);
11 |
12 | Assertions.assertFalse(passableValue.getValue());
13 |
14 | passableValue.setValue(true);
15 | Assertions.assertTrue(passableValue.getValue());
16 |
17 | passableValue.setValue(null);
18 | Assertions.assertNull(passableValue.getValue());
19 | }
20 |
21 | @Test
22 | public void IntegerPassable() {
23 | var passableValue = new Passable(null);
24 |
25 | Assertions.assertNull(passableValue.getValue());
26 |
27 | passableValue.setValue(1);
28 | Assertions.assertEquals(1, passableValue.getValue());
29 |
30 | passableValue.setValue(2);
31 | Assertions.assertEquals(2, passableValue.getValue());
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/StringsTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util;
2 |
3 | import org.junit.jupiter.api.Assertions;
4 | import org.junit.jupiter.api.Test;
5 |
6 | public class StringsTest {
7 |
8 | @Test
9 | public void toHex() {
10 | byte[] byteArray = {(byte) 0xDE, (byte) 0xAD, (byte) 0xBE, (byte) 0xEF};
11 | Assertions.assertEquals("DEADBEEF", Strings.toHex(byteArray));
12 | }
13 |
14 | @Test
15 | public void decodeHex() {
16 | byte[] byteArray = {(byte) 0xDE, (byte) 0xAD, (byte) 0xBE, (byte) 0xEF};
17 | Assertions.assertArrayEquals(byteArray, Strings.decodeHex("deadbeef"));
18 | }
19 |
20 | @Test
21 | public void invalid_decodeHex() {
22 | Assertions.assertThrows(StringIndexOutOfBoundsException.class, () -> Strings.decodeHex("odd"));
23 | }
24 |
25 | @Test
26 | public void isNullOrEmpty() {
27 | Assertions.assertTrue(Strings.isNullOrEmpty(null));
28 | Assertions.assertTrue(Strings.isNullOrEmpty(""));
29 | Assertions.assertFalse(Strings.isNullOrEmpty("Hello World!"));
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/UtilsTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util;
2 |
3 | import org.junit.jupiter.api.Assertions;
4 | import org.junit.jupiter.api.Test;
5 |
6 | /**
7 | * @author lngtr
8 | * @since 2019-01-15
9 | */
10 | public class UtilsTest {
11 |
12 | // Note: We can only set the "os.name" once, but "os.version" can be changed on the fly.
13 | // This breaks testing for EOSTypes.
14 | // If you create an EOSType test and run it individually after setting the properties above, it passes.
15 |
16 | @Test
17 | public void crc32() {
18 | long result = Utils.crc32("test_string");
19 | Assertions.assertEquals(0x0967B587, result);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/WebHelpersTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util;
2 |
3 | import in.dragonbra.javasteam.TestBase;
4 | import org.junit.jupiter.api.Assertions;
5 | import org.junit.jupiter.api.Test;
6 |
7 |
8 | /**
9 | * @author lngtr
10 | * @since 2018-04-16
11 | */
12 | public class WebHelpersTest extends TestBase {
13 |
14 | @Test
15 | public void urlEncodeWithString() {
16 | String result = WebHelpers.urlEncode("encrypt THIS sTrInG1234 \10 \11 \12");
17 | Assertions.assertEquals("encrypt+THIS+sTrInG1234+%08+%09+%0A", result);
18 | }
19 |
20 | @Test
21 | public void urlEncodeWithByteArray() {
22 | var input = "encrypt THIS sTrInG1234 \10 \11 \12".getBytes();
23 | String result = WebHelpers.urlEncode(input);
24 | Assertions.assertEquals("encrypt+THIS+sTrInG1234+%08+%09+%0A", result);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/compat/ConsumerTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.compat;
2 |
3 | import org.junit.jupiter.api.Assertions;
4 | import org.junit.jupiter.api.Test;
5 |
6 | public class ConsumerTest {
7 |
8 | @Test
9 | void testConsumerString() {
10 | Consumer consumer = s -> Assertions.assertEquals("Test String", s);
11 |
12 | consumer.accept("Test String");
13 | }
14 |
15 | @Test
16 | void testConsumerBoolean() {
17 | Consumer consumer = b -> Assertions.assertEquals(true, b);
18 |
19 | consumer.accept(true);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/compat/ObjectsCompatTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.compat;
2 |
3 | import in.dragonbra.javasteam.TestBase;
4 | import org.junit.jupiter.api.Test;
5 |
6 | import static org.junit.jupiter.api.Assertions.assertFalse;
7 | import static org.junit.jupiter.api.Assertions.assertTrue;
8 |
9 | public class ObjectsCompatTest extends TestBase {
10 |
11 | @SuppressWarnings("ConstantValue")
12 | @Test
13 | public void testEquals() {
14 | final String a = "aaa";
15 | final String b = "bbb";
16 | final String c = null;
17 |
18 | assertFalse(ObjectsCompat.equals(a, b));
19 | assertFalse(ObjectsCompat.equals(a, c));
20 | assertFalse(ObjectsCompat.equals(c, a));
21 |
22 | assertTrue(ObjectsCompat.equals(a, a));
23 | assertTrue(ObjectsCompat.equals(b, b));
24 | assertTrue(ObjectsCompat.equals(c, c));
25 | }
26 |
27 | }
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/crypto/RSACryptoTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.crypto;
2 |
3 | import in.dragonbra.javasteam.enums.EUniverse;
4 | import in.dragonbra.javasteam.util.KeyDictionary;
5 | import org.junit.jupiter.api.Assertions;
6 | import org.junit.jupiter.api.BeforeEach;
7 | import org.junit.jupiter.api.Test;
8 |
9 | import javax.crypto.Cipher;
10 | import javax.crypto.NoSuchPaddingException;
11 | import java.security.NoSuchAlgorithmException;
12 | import java.security.NoSuchProviderException;
13 |
14 | public class RSACryptoTest {
15 |
16 | private RSACrypto rsaCrypto;
17 |
18 | @BeforeEach
19 | public void setUp() {
20 | var pubKey = KeyDictionary.getPublicKey(EUniverse.Public);
21 | rsaCrypto = new RSACrypto(pubKey);
22 | }
23 |
24 | @Test
25 | public void encrypt() {
26 | var input = CryptoHelper.generateRandomBlock(32);
27 | var encrypted = rsaCrypto.encrypt(input);
28 |
29 | Assertions.assertNotNull(encrypted);
30 | }
31 |
32 | @Test
33 | public void cipherInstance() throws NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException {
34 | var cipher = Cipher.getInstance("RSA/None/OAEPWithSHA1AndMGF1Padding", CryptoHelper.SEC_PROV);
35 | Assertions.assertNotNull(cipher);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/test/java/in/dragonbra/javasteam/util/event/EventTest.java:
--------------------------------------------------------------------------------
1 | package in.dragonbra.javasteam.util.event;
2 |
3 | import org.junit.jupiter.api.Assertions;
4 | import org.junit.jupiter.api.Test;
5 |
6 | class EventTest {
7 |
8 | static class TestEventHandler implements EventHandler {
9 | boolean eventHandled = false;
10 | Object sender = null;
11 | EventArgs eventArgs = null;
12 |
13 | @Override
14 | public void handleEvent(Object sender, EventArgs e) {
15 | this.eventHandled = true;
16 | this.sender = sender;
17 | this.eventArgs = e;
18 | }
19 | }
20 |
21 | @Test
22 | void addEventHandlerAndHandleEvent() {
23 | var event = new Event<>();
24 | var handler = new TestEventHandler();
25 |
26 | event.addEventHandler(handler);
27 |
28 | event.handleEvent(this, EventArgs.EMPTY);
29 |
30 | Assertions.assertTrue(handler.eventHandled);
31 | Assertions.assertEquals(this, handler.sender);
32 | Assertions.assertEquals(EventArgs.EMPTY, handler.eventArgs);
33 | }
34 |
35 | @Test
36 | void removeEventHandler() {
37 | var event = new Event<>();
38 | var handler = new TestEventHandler();
39 |
40 | event.addEventHandler(handler);
41 | event.removeEventHandler(handler);
42 |
43 | event.handleEvent(this, EventArgs.EMPTY);
44 |
45 | Assertions.assertFalse(handler.eventHandled);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/test/resources/depot/depot_232250_chunk_7b8567d9b3c09295cdbf4978c32b348d8e76c750.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/depot/depot_232250_chunk_7b8567d9b3c09295cdbf4978c32b348d8e76c750.bin
--------------------------------------------------------------------------------
/src/test/resources/depot/depot_3441461_chunk_9e72678e305540630a665b93e1463bc3983eb55a.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/depot/depot_3441461_chunk_9e72678e305540630a665b93e1463bc3983eb55a.bin
--------------------------------------------------------------------------------
/src/test/resources/depot/depot_440_1118032470228587934.manifest:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/depot/depot_440_1118032470228587934.manifest
--------------------------------------------------------------------------------
/src/test/resources/depot/depot_440_1118032470228587934_decrypted.manifest:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/depot/depot_440_1118032470228587934_decrypted.manifest
--------------------------------------------------------------------------------
/src/test/resources/depot/depot_440_1118032470228587934_v4.manifest:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/depot/depot_440_1118032470228587934_v4.manifest
--------------------------------------------------------------------------------
/src/test/resources/depot/depot_440_chunk_bac8e2657470b2eb70d6ddcd6c07004be8738697.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/depot/depot_440_chunk_bac8e2657470b2eb70d6ddcd6c07004be8738697.bin
--------------------------------------------------------------------------------
/src/test/resources/packets/001_in_8904_k_EMsgClientPICSProductInfoResponse_app480_metadata.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/packets/001_in_8904_k_EMsgClientPICSProductInfoResponse_app480_metadata.bin
--------------------------------------------------------------------------------
/src/test/resources/packets/002_in_8904_k_EMsgClientPICSProductInfoResponse_app480.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/packets/002_in_8904_k_EMsgClientPICSProductInfoResponse_app480.bin
--------------------------------------------------------------------------------
/src/test/resources/packets/003_in_8904_k_EMsgClientPICSProductInfoResponse_sub0.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/packets/003_in_8904_k_EMsgClientPICSProductInfoResponse_sub0.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientAMGetPersonaNameHistoryResponse.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientAMGetPersonaNameHistoryResponse.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientClanState.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientClanState.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientFSGetFriendMessageHistoryResponse.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientFSGetFriendMessageHistoryResponse.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientFriendsList.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientFriendsList.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientLicenseList.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientLicenseList.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientMarketingMessageUpdate2.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientMarketingMessageUpdate2.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientPICSAccessTokenResponse.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientPICSAccessTokenResponse.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientPICSChangesSinceResponse.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientPICSChangesSinceResponse.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientPICSProductInfoResponse.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientPICSProductInfoResponse.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientPersonaState.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientPersonaState.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientUpdateGuestPassesList.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientUpdateGuestPassesList.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientUpdateMachineAuth.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientUpdateMachineAuth.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientVACBanStatus.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientVACBanStatus.bin
--------------------------------------------------------------------------------
/src/test/resources/testpackets/ClientWalletInfoUpdate.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Longi94/JavaSteam/12de8e0194bbe5210d73be82140e4edd7adf37f1/src/test/resources/testpackets/ClientWalletInfoUpdate.bin
--------------------------------------------------------------------------------
/src/test/resources/textkeyvalues/appinfo_utf8.txt:
--------------------------------------------------------------------------------
1 | "appinfo"
2 | {
3 | "appid" "1234567"
4 | "common"
5 | {
6 | "name" "Some Cool Game®: UTF8 Special® II | Java Steam™ 2.0"
7 | "name_localized"
8 | {
9 | "koreana" "적절하게 인코딩할 임의의 텍스트 | 2.0"
10 | "schinese" "《一些随机文本》 | 《®2.0》"
11 | "tchinese" "《一些隨機文本》 | 《™2.0》"
12 | }
13 | "random_text"
14 | {
15 | "set_1" "контрольная работа"
16 | "set_2" "δοκιμή"
17 | "set_3" "امتحان"
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/tools/javasteam-bot/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Node template
3 | # Logs
4 | logs
5 | *.log
6 | npm-debug.log*
7 | yarn-debug.log*
8 | yarn-error.log*
9 |
10 | # Runtime data
11 | pids
12 | *.pid
13 | *.seed
14 | *.pid.lock
15 |
16 | # Directory for instrumented libs generated by jscoverage/JSCover
17 | lib-cov
18 |
19 | # Coverage directory used by tools like istanbul
20 | coverage
21 |
22 | # nyc test coverage
23 | .nyc_output
24 |
25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26 | .grunt
27 |
28 | # Bower dependency directory (https://bower.io/)
29 | bower_components
30 |
31 | # node-waf configuration
32 | .lock-wscript
33 |
34 | # Compiled binary addons (https://nodejs.org/api/addons.html)
35 | build/Release
36 |
37 | # Dependency directories
38 | node_modules/
39 | jspm_packages/
40 |
41 | # Typescript v1 declaration files
42 | typings/
43 |
44 | # Optional npm cache directory
45 | .npm
46 |
47 | # Optional eslint cache
48 | .eslintcache
49 |
50 | # Optional REPL history
51 | .node_repl_history
52 |
53 | # Output of 'npm pack'
54 | *.tgz
55 |
56 | # Yarn Integrity file
57 | .yarn-integrity
58 |
59 | # dotenv environment variables file
60 | .env
61 |
62 | # next.js build output
63 | .next
64 |
65 | *.pem
--------------------------------------------------------------------------------
/tools/javasteam-bot/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "javasteam-bot",
3 | "version": "1.0.0",
4 | "main": "app.js",
5 | "description": "Polls the SteamKit2 GitHub repo for new merged pull requests.",
6 | "dependencies": {
7 | "@octokit/rest": "^20.0.2",
8 | "jsonwebtoken": "^9.0.2",
9 | "request": "^2.83.0",
10 | "yargs": "^17.7.2"
11 | },
12 | "repository": "https://github.com/Longi94/JavaSteam",
13 | "license": "MIT"
14 | }
15 |
--------------------------------------------------------------------------------