JavaSteam icon indicating copy to clipboard operation
JavaSteam copied to clipboard

Version 1.6.0. SteamGameCoordinator sent no response.

Open jlj089742 opened this issue 1 year ago • 13 comments

Using SteamGameCoordinator to send EGCItemMg.k_EMsgGCUnlockCrate, the sending code is as follows, but no MessageCallback was received after sending.

public void sendUnlockCrate(long crateId, long keyId)  {
        ClientGCMsg<ClientToGCUnlockCrateRequest> unlockCrate = new ClientGCMsg<>(ClientToGCUnlockCrateRequest.class);
        Field bodyField = ReflectUtil.getField(ClientGCMsg.class, "body");
        bodyField.setAccessible(true);
        ClientToGCUnlockCrateRequest body = null;
        body = (ClientToGCUnlockCrateRequest) bodyField.get(unlockCrate);
        body.setCrateId(crateId).setKeyId(keyId);
        steamGameCoordinator.send(unlockCrate, 730);
    }
@Accessors(chain = true)
public class ClientToGCUnlockCrateRequest implements IGCSerializableMessage {

    @Setter
    private long crateId;
    @Setter
    private long keyId;

    public void serialize(OutputStream outputStream) throws IOException {
        BinaryWriter writer = new BinaryWriter(outputStream);
        writer.writeLong(keyId);
        writer.writeLong(crateId);
    }

    public void deserialize(InputStream inputStream) throws IOException {
    }

    public int getEMsg() {
        return EGCItemMg.k_EMsgGCUnlockCrate;
    }
}

jlj089742 avatar Aug 21 '25 02:08 jlj089742

Sometimes with game messages, you need to set yourself to be playing the game you're trying to unlock.

LossyDragon avatar Aug 21 '25 02:08 LossyDragon

Sometimes with game messages, you need to set yourself to be playing the game you're trying to unlock.

It has been done. Received callback 4004..The target game is 730. It was feasible before August 15th, but it is completely ineffective now. Has the content of the agreement changed?

jlj089742 avatar Aug 21 '25 05:08 jlj089742

Oh, you might be right. Check this blame out, its been appended with DEPRECATED

https://github.com/SteamDatabase/Protobufs/blame/414e81bfc99694f7af5bfe7697a8936c09fc26ba/csgo/econ_gcmessages.proto#L11

Actually a lot of gcmessages for cs seems to be like that. I'm not sure what the alternative is right now.

LossyDragon avatar Aug 21 '25 13:08 LossyDragon

哦,你可能是对的。看看这个指责,它被附加了DEPRECATED

https://github.com/SteamDatabase/Protobufs/blame/414e81bfc99694f7af5bfe7697a8936c09fc26ba/csgo/econ_gcmessages.proto#L11

实际上,很多 cs 的 gcmessage 看起来都是这样的。我不确定现在还有什么替代方案。

I noticed that there is a k_EMsgGCOpenCrate = 2534, and correspondingly, there should be a message as follows (also updated on August 15th): CMsgOpenCrate { optional uint64 tool_item_id = 1; optional uint64 subject_item_id = 2; optional bool for_rental = 3; optional uint32 points_remaining = 4; } Is this a substitution? But I don't know what value to assign to points_remaining. It would be helpful if you have any ideas.

jlj089742 avatar Aug 22 '25 03:08 jlj089742

I'm not sure about any substitutions. Though sometimes I check node-steam/node-globaloffensive forums from Dr. McKay or SteamKit's issues or discussions to keep up to date with potential problems.

We'd need to find a way to capture packets to find a proper response. Nethook and Nethook Analyzer from SteamKit may help, but I don't know if it will work with source2 games.

You can find both files assembled through their Github Actions. Build 1256 has those files and give it a try. (Read NetHooks readme)

LossyDragon avatar Aug 22 '25 05:08 LossyDragon

I'm not sure about any substitutions. Though sometimes I check node-steam/node-globaloffensive forums from Dr. McKay or SteamKit's issues or discussions to keep up to date with potential problems.

We'd need to find a way to capture packets to find a proper response. Nethook and Nethook Analyzer from SteamKit may help, but I don't know if it will work with source2 games.

You can find both files assembled through their Github Actions. Build 1256 has those files and give it a try. (Read NetHooks readme)

This is very helpful! I successfully captured the corresponding instructions using NetHook2 and parsed them! As shown in the figure. However, this still puzzles me. I have modified ClientGCMsg to a new EMsg (2534) and new parameters in the project, and executed it through SteamGameCoordinator.send. However, I did not receive the callback as expected. (As shown in the image, the expected callback is on the left). I use CallbackManager.subscribe(MessageCallback.class, this::onGCMessage) for message processing. It works fine when sending CMsgClientHello and CMsgClientWelcome, and I can receive MessageCallback. However, the log shows that I cannot receive any MessageCallback using EMsg (2534). This is very confusing to me. Please help me.

Image

jlj089742 avatar Aug 23 '25 01:08 jlj089742

Are you building the cs project manually?

If so, try building with the new protos from this PR https://github.com/Longi94/JavaSteam/pull/347

LossyDragon avatar Aug 23 '25 02:08 LossyDragon

Are you building the project manually?cs

If so, try building with the new protos from this PR #347 Okay, thank you very much! I noticed that the instruction I have been sending has always used ClientGCMsg, and its isProto() method returns false. If I want to send the correct one message CMsgOpenCrate { optional uint64 tool_item_id = 1; optional uint64 subject_item_id = 2; optional bool for_rental = 3; optional uint32 points_remaining = 4; } Should we use ClientGCMsgProtobuf instead?

jlj089742 avatar Aug 23 '25 04:08 jlj089742

Should we use ClientGCMsgProtobuf instead?

Wouldnt hurt to try. Most requests/responses use that

I dont play CS, so I dont have any crates to help troubleshoot 😄

LossyDragon avatar Aug 23 '25 05:08 LossyDragon

Should we use ClientGCMsgProtobuf instead?

Wouldnt hurt to try. Most requests/responses use that

I dont play CS, so I dont have any crates to help troubleshoot 😄

The problem has been solved! Thank you so much for your help! To fix it, we need to replace it with the Protobuf protocol and modify EMsg.

jlj089742 avatar Aug 23 '25 07:08 jlj089742

msgType= 1008 EGCItemMsg.k_EMsgGCUnlockCrateResponse ClientGCMsg?

userzd0907 avatar Aug 23 '25 10:08 userzd0907

Should we use ClientGCMsgProtobuf instead?

Wouldnt hurt to try. Most requests/responses use that I dont play CS, so I dont have any crates to help troubleshoot 😄

The problem has been solved! Thank you so much for your help! To fix it, we need to replace it with the Protobuf protocol and modify EMsg

Very helpful!

CharlesShao avatar Aug 24 '25 02:08 CharlesShao

Just FYI: CS (javasteam-cs) protos are available as a maven lib starting 1.7.1-SNAPSHOT (PR #351). The wiki has the url for snapshots if anyone would like to try.

LossyDragon avatar Sep 04 '25 04:09 LossyDragon