public static void Send(LobbyClient client) { PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_LOGIN_SUCCESS); Out.WriteParsedString("Welcome to rebornAPB", 48); Out.WriteUInt32Reverse(client.Account.IsAdmin); Out.WriteInt64Reverse(TCPManager.GetTimeStamp()); Out.WriteByte(0x13); Out.WriteByte(0x29); Out.WriteUInt16Reverse(0x12); Out.WriteByte(0x0E); Out.WriteByte(0x07); Out.WriteUInt16Reverse(9999); Out.WriteInt32Reverse(1450); Out.WriteUInt32Reverse((uint)client.Account.RTW_Points); for (int i = 1; i < 6; ++i) Out.WriteInt32Reverse(Program.FileMgr.GetFileVersion((int)client.Account.Index, i, true, "", "")); Out.WriteInt32Reverse(0); Out.WriteUInt16(0x957D); Out.WriteUInt16(0x0400); Out.WriteUInt16(0x5052); Out.WriteUInt16(0x4F45); Out.WriteUInt16(0x552E); Out.WriteUInt16(0x3232); Out.WriteUInt16(0x3738); Out.WriteUInt16(0x3031); Out.WriteUInt16(0); Out.WriteUInt16(0x0067); Out.WriteUInt64(0x526C624331313256); Out.WriteUInt64(0x486E314100000000); Out.WriteUInt16(0); Out.WriteStringBytes(""); Out.WriteByte(0); client.Send(Out); }
public static void Send(LobbyClient cclient) { PacketOut Out = new PacketOut((uint)Opcodes.WORLD_LIST); Out.WriteInt32Reverse((int)ResponseCodes.RC_SUCCESS); lock (Program.worldListener.Worlds) { Out.WriteUInt16Reverse((ushort)Program.worldListener.Worlds.Count); foreach (KeyValuePair <uint, World.World> info in Program.worldListener.Worlds) { Out.WriteUInt32Reverse(info.Key); Out.WriteParsedString(info.Value.Name, 32); Out.WriteByte((byte)info.Value.Id); Out.WriteByte(0); //m_nPopulation %d Out.WriteByte(0); //m_nEnfFaction %d Out.WriteByte(0); //m_nCrimFaction %d Out.WriteByte(0); //m_nPremiumOnly %d Out.WriteByte(info.Value.IP1); Out.WriteByte(info.Value.IP2); Out.WriteByte(info.Value.IP3); Out.WriteByte(info.Value.IP4); } } cclient.Send(Out); }
static public void Send(LobbyClient client) { PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_CHARACTER_CREATE); if (client.Pending == null) Out.WriteInt32Reverse((int)ResponseCodes.RC_FAILED); else { Out.WriteInt32Reverse((int)ResponseCodes.RC_SUCCESS); Out.WriteInt32Reverse(client.Pending.Slot); } client.Pending = null; client.Send(Out); }
public static void Send(LobbyClient client) { Log.Debug("LOGIN_SALT", "Sent to " + client.Account.Username); client.serverModulus = Auth.computeServerModulus(client.Verifier); PacketOut Out = new PacketOut((UInt32)Opcodes.LOGIN_SALT); Out.WriteUInt32Reverse((uint)client.Account.Index); Out.Write(client.serverModulus.B.ToByteArrayUnsigned(), 0, 64); Out.WriteByte(0x40); Out.WriteByte(0); Out.Write(client.Salt, 0, 10); client.Send(Out); }
static public void Send(LobbyClient client) { PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_CHARACTER_CREATE); if (client.Pending.Index < 1) Out.WriteInt32Reverse((int)ResponseCodes.RC_FAILED); else { Out.WriteInt32Reverse((int)ResponseCodes.RC_SUCCESS); Out.WriteInt32Reverse(client.Pending.Slot); } client.Pending = default(CharacterEntry); client.Send(Out); System.Threading.Thread.Sleep(200); client.Disconnect(); }
static public void Send(LobbyClient client) { PacketOut Out = new PacketOut((UInt32)Opcodes.WORLD_LIST); Out.WriteInt32Reverse((int)ResponseCodes.RC_SUCCESS); lock (Program.worldListener.Worlds) { Out.WriteUInt16Reverse((UInt16)Program.worldListener.Worlds.Count); foreach (KeyValuePair<UInt32, World.World> info in Program.worldListener.Worlds) { Out.WriteUInt32Reverse((UInt32)info.Key); Out.WriteParsedString(info.Value.Name, 32); Out.WriteByte(1); Out.WriteByte(info.Value.Population); Out.WriteByte(info.Value.EnforcerRecommended ? (Byte)1 : (Byte)0); Out.WriteByte(info.Value.CriminalRecommended ? (Byte)1 : (Byte)0); } } client.Send(Out); }
static public void Send(LobbyClient client) { client.Characters = Databases.CharacterTable.Select(c => c.AccountIndex == client.Account.Index); PacketOut Out = new PacketOut((UInt32)Opcodes.CHARACTER_LIST); Out.WriteByte((Byte)client.Characters.Count); lock (Program.worldListener.Worlds) { foreach (CharacterEntry chr in client.Characters) { Out.WriteByte(chr.Slot); Out.WriteByte(chr.Faction); Out.WriteByte(1); Out.WriteUInt32Reverse((uint)chr.World); World.World info = null; Program.worldListener.Worlds.TryGetValue((uint)chr.World, out info); if (info != null) Out.WriteParsedString(info.Name, 32); else Out.WriteParsedString("(undefined)", 32); Out.WriteParsedString(chr.Name, 32); } } client.Send(Out); if (client.Characters.Count <= 0) WORLD_LIST.Send(client); }
static public void Send(LobbyClient client) { client.Characters = new Characters(client.Account.Id); PacketOut Out = new PacketOut((UInt32)Opcodes.CHARACTER_LIST); Out.WriteByte(client.Characters.Length); lock (Program.worldListener.Worlds) { foreach (KeyValuePair<Byte, Character> pair in client.Characters.List) { Out.WriteByte(pair.Value.Slot); Out.WriteByte(pair.Value.Faction); Out.WriteByte(1); Out.WriteUInt32Reverse(pair.Value.WorldId); World.World info = null; Program.worldListener.Worlds.TryGetValue(pair.Value.WorldId, out info); if (info != null) Out.WriteParsedString(info.Name, 32); else Out.WriteParsedString("(undefined)", 32); Out.WriteParsedString(pair.Value.Name, 32); } } client.Send(Out); if (client.Characters.Length <= 0) WORLD_LIST.Send(client); }
static public void Send(LobbyClient client, int code) { PacketOut packet = new PacketOut((UInt32)Opcodes.ANS_LOGIN_FAILED); packet.WriteInt32Reverse(code); client.Send(packet); }