/// <summary> /// Writes room info onto a packet /// </summary> /// <param name="packet"></param> /// <param name="room"></param> public static void WriteRoomInfo(this ServerBasePacket packet, RoomInstance room) { packet.WriteString(Configuration.Global.GameHost); // Room server... If this does not match current server, it does a switch packet.WriteInt(room.Id); // Room Id packet.WriteInt(room.MasterId); // Unknown - maybe master? packet.WriteInt((int)room.GameType); // Game type packet.WriteString(room.Name); packet.WriteString(room.Password); // Unknown - Empty in packet packet.WriteString("Face Off"); // Map name? packet.WriteString(room.Master != null ? room.Master.Callsign : "UNKNOWN"); packet.WriteInt(room.Capacity); packet.WriteInt(room.Users.Count()); packet.WriteBool(!string.IsNullOrEmpty(room.Password)); // Game is private? packet.WriteByte(1); // Unknown packet.WriteInt((int)room.GameStatus); // Status? packet.WriteUInt(room.GameTemplate); // Not sure why this is sent twice? packet.WriteUInt(room.GameTemplate); // This was supposed to be adhoc id packet.WriteBool(room.SdMode); // SD Battle packet.WriteInt(0); // Unknown - zero on packet packet.WriteInt(0x000927c0); // Unknown - zero on packet packet.WriteInt(0x000668a0); // Unknown packet.WriteInt(0x000927c0); // Unknown packet.WriteInt(0); // Unknown packet.WriteBool(room.Balance); // Unknown packet.WriteInt(room.GameType == GameType.defensivebattle ? room.Difficulty : -1); // Unknown packet.WriteBool(room.FiveMinute); // Unknown packet.WriteInt(room.MaxLevel); // max level packet.WriteInt(room.MinLevel); // min Level packet.WriteInt(0); // Unknown packet.WriteInt(0); // Unknown packet.WriteInt(0); // Unknown }
public static void WriteRoomUserInfo(this ServerBasePacket packet, RoomInstance room, ExteelUser user) { packet.WriteString(user.Callsign); // Unknown - Looks like 2x callsign from packet cap packet.WriteString(user.Callsign); packet.WriteString(""); // Clan name packet.WriteInt(0); // Unknown packet.WriteInt(0); // Unknown - clan id? packet.WriteInt(user.Id); packet.WriteUInt(user.Team); packet.WriteUInt(user.Rank); // Unknown packet.WriteInt(0); // Unknown packet.WriteInt(0); // Unknown packet.WriteInt(0); // Unknown packet.WriteInt(0); // Unknown packet.WriteInt(0); // Unknown packet.WriteBool(user.IsReady); // Unknown - ready? packet.WriteBool(user.Id == room.MasterId); for (var i = 0; i < 13; i++) { packet.WriteInt(0); //Unknown } for (var i = 0; i < 12; i++) { packet.WriteInt(0); //Unknown } for (var i = 0; i < 13; i++) { packet.WriteInt(0); //Unknown } for (var i = 0; i < 14; i++) { packet.WriteInt(0); // Unknown } for (var i = 0; i < 11; i++) { packet.WriteInt(0); // Unknown } for (var i = 0; i < 11; i++) { packet.WriteInt(0); // Unknown } // Unknown struct packet.WriteInt(0); // packet.WriteInt(0); // packet.WriteInt(0); // packet.WriteInt(0); // packet.WriteInt(0); // packet.WriteInt(0); // packet.WriteInt(0); // packet.WriteInt(0); // // Another unknown struct. Seems to be an array? packet.WriteInt(0); // Size? packet.WritePilotInfo(user.PilotInfo); }