18-02-2017, 16:57
Rejoindre un lobby:
Récupérer une liste de lobby
Code :
SteamClient.send( { msg: Steam.EMsg.ClientMMSJoinLobby, proto: { routing_appid: 730 } }, new Steam.Internal.CMsgClientMMSJoinLobby( {
app_id: 730,
steam_id_lobby: "numero_de_lobby",
persona_name: "Pseudo_De_fou"
} ).toBuffer(), function( header, body ) {
var response = Steam.Internal.CMsgClientMMSJoinLobbyResponse.decode( body );
console.log( "app_id: " + response.app_id + "\n" );
console.log( "steam_id_lobby: " + response.steam_id_lobby + "\n" );
console.log( "chat_room_enter_response: " + response.chat_room_enter_response + "\n" ); // EChatRoomEnterResponse
console.log( "max_members: " + response.max_members + "\n" );
console.log( "lobby_type: " + response.lobby_type + "\n" );
console.log( "lobby_flags: " + response.lobby_flags + "\n" );
console.log( "steam_id_owner: " + response.steam_id_owner + "\n" );
console.log( "metadata: " + response.metadata + "\n" );
console.log( "members:\n" );
response.members.forEach( function( member ) {
console.log( "\tsteam_id: " + member.steam_id + "\n" );
console.log( "\tpersona_name: " + member.persona_name + "\n" );
console.log( "\tmetadata: " + member.metadata + "\n" );
} );
} );
Récupérer une liste de lobby
Code :
SteamClient.send( { msg: Steam.EMsg.ClientMMSGetLobbyList, proto: { routing_appid: 730 } }, new Steam.Internal.CMsgClientMMSGetLobbyList( {
app_id: 730,
num_lobbies_requested: 5 // cba to use filters
} ).toBuffer(), function( header, body ) {
var response = Steam.Internal.CMsgClientMMSGetLobbyListResponse.decode( body );
console.log( "app_id: " + response.app_id + "\n" );
console.log( "eresult: " + response.eresult + "\n" );
console.log( "lobbies:\n" );
response.lobbies.forEach( function( lobby ) {
// cba to dump them
} );
} );
message CMsgClientMMSGetLobbyList {
message Filter {
optional string key = 1;
optional string value = 2;
optional int32 comparision = 3;
optional int32 filter_type = 4;
}
optional uint32 app_id = 1;
optional int32 num_lobbies_requested = 3;
optional uint32 cell_id = 4;
optional uint32 public_ip = 5;
repeated .CMsgClientMMSGetLobbyList.Filter filters = 6;
}
message CMsgClientMMSGetLobbyListResponse {
message Lobby {
optional fixed64 steam_id = 1;
optional int32 max_members = 2;
optional int32 lobby_type = 3;
optional int32 lobby_flags = 4;
optional bytes metadata = 5;
optional int32 num_members = 6;
optional float distance = 7;
optional int64 weight = 8;
}
optional uint32 app_id = 1;
optional int32 eresult = 3 [default = 2];
repeated .CMsgClientMMSGetLobbyListResponse.Lobby lobbies = 4;
}