Closed Logxn closed 8 years ago
requestComment.commentation
is probably null
. You'll need to create a commendation object and assign it to the property.
Can you show me how to do that properly?
requestComment.commentation = new CMsgGCCStrike15_v2_Whatever_Type_Goes_Here();
requestCommend.Body.commendation = new CMsgGCCStrike15_v2_ClientCommendPlayer();
=>Cannot implicitly convert type 'SteamKit2.GC.CSGO.Internal.CMsgGCCStrike15_v2_ClientCommendPlayer' to 'SteamKit2.GC.CSGO.Internal.PlayerCommendationInfo'
Then you have the wrong type for CMsgGCCStrike15_v2_Whatever_Type_Goes_Here
.
The compiler is telling you what type it expect. Listen to it.
Also the values appear to be incorrect. See the types for the protobuf message. Ideally capture the message with nethook to see what message and values are sent.
requestCommend.Body.commendation = new SteamKit2.GC.CSGO.Internal.PlayerCommendationInfo();
requestCommend.Body.account_id = input;
requestCommend.Body.match_id = 8;
requestCommend.Body.commendation.cmd_friendly = 1;
requestCommend.Body.commendation.cmd_leader = 4;
requestCommend.Body.commendation.cmd_teaching = 2;
I am a complete noob, and using this to learn stuff. Its kinda hard to understand if it instantly gets closed.
When I do it like this: requestCommend.Body.commendation = new SteamKit2.GC.CSGO.Internal.PlayerCommendationInfo();
the program doesnt crash anymore, but cmd_friendly , cmd_teaching is set to 0;
@rossengeorgiev I never used nethook before. How can I use it for this purpose?
You should compile and use NetHook for reverse-engineering of functionality you're trying to implement.
I wrote short doc in my ASF, which you can use for quickstart, but I'd still suggest to compile tools youself.
(Especially because protobufs are changing constantly and they're out-of-date pretty quick)
@JustArchi I just used it, but it doesnt seem to write anything to the function, I want to implement.
You're not implementing function, you're implementing functionality, that's important.
Let's say you want to make a bot that writes message in Dota 2.
You should hook nethook, then launch Dota 2 and write message, unhook, then analyze the log.
Once you have recorded communication of let's say 10 packets, you can now implement the functionality in your SK2-based project by catching appropriate EMsg
s and doing exactly the same which Steam Client / Game Client would do.
For example:
PlayingGame ->
GC Hello ->
GC Response <-
GC JoinChat ->
GC Response <-
GC Chat ->
I don't know what you're trying to do, as I'm not playing CS:GO, but the general reverse-engineering is the same as adding missing Steam Client functionality, just with more complexity as you probably want to code whole functionality and not just one packet/response.
I have some examples in my ArchiHandler but they're all for adding missing SK2 functionality in Steam Client, not automating actual GC communication. However, it's pretty much the same, just more complex - with more functions and logic added. You should probably receive more help from people working with games in their SK2 projects rather than me, sorry.
PlayingGame -> GC Hello -> GC Response <- GC CommendPlayer -> GC Respone <-
This is what it should do with my code..
Then it's best to record the log from SK2 client as well and compare with your original one from Steam Client to notice differences.
@JustArchi Sorry, but thats a little to high for me. I mean I got the hello, welcome and startgame all by myself.
equestCommend.Body.commendation = new SteamKit2.GC.CSGO.Internal.PlayerCommendationInfo() { cmd_friendly = 1, cmd_leader = 4, cmd_teaching = 2 };
also this doesnt work
I need to say im very nooby with protobuffs. I looked trough the DOTA2 Example to try to understand whats happening and how its done. But they way I try to commend a guy on csgo is not quite working the way I thought it would :D
`static void OnClientWelcome(IPacketGCMsg packetMsg) { SteamID steamID = new SteamID(); uint input; var msg = new ClientGCMsgProtobuf(packetMsg);
I am sorry for the poorly coding :D Well it shows me that "cmd_teaching" => Object reference not set to an instance of an object. What am I doing wrong?