public static void MakeChannelChange(WRClient wc) { Core.OutPacket mPacket = new Core.OutPacket(28673); mPacket.AddBlock(1); mPacket.AddBlock((int)wc.Player.ChannelID); byte[] mBuffer = mPacket.GetOutput(); for (int I = 0; I < mBuffer.Length; I++) { mBuffer[I] ^= Core.BuildConfig.GameKey_Server; } wc.ClientSocket.Send(mBuffer); }
public static void MakeEquipmentPacket(WRClient wc, GameFramework.Classes _class, string _equipment) { Core.OutPacket mPacket = new Core.OutPacket(29970); mPacket.AddBlock(1); mPacket.AddBlock((int)_class); mPacket.AddBlock(_equipment); byte[] mBuffer = mPacket.GetOutput(); for (int I = 0; I < mBuffer.Length; I++) { mBuffer[I] ^= Core.BuildConfig.GameKey_Server; } wc.ClientSocket.Send(mBuffer); }
public static void MakeChatError(WRClient wc, ErrorCodes err) { Core.OutPacket mPacket = new Core.OutPacket(29696); mPacket.AddBlock((int)err); byte[] mBuffer = mPacket.GetOutput(); for (int I = 0; I < mBuffer.Length; I++) { mBuffer[I] ^= Core.BuildConfig.GameKey_Server; } wc.ClientSocket.Send(mBuffer); }
public static void MakeServerTime(WRClient wc) { Core.OutPacket mPacket = new Core.OutPacket(24832); mPacket.AddBlock(1); //Error_OK DateTime now = DateTime.Now.ToUniversalTime(); int month = now.Month - 1; int year = now.Year - 1900; CultureInfo ciCurr = CultureInfo.CurrentCulture; int weekNum = ciCurr.Calendar.GetWeekOfYear(now, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday); mPacket.AddBlock(now.ToString(@"ss\/mm\/HH\/dd") + "/" + month + "/" + year + "/" + weekNum + "/" + now.DayOfYear + "/0"); byte[] mBuffer = mPacket.GetOutput(); for (int I = 0; I < mBuffer.Length; I++) { mBuffer[I] ^= Core.BuildConfig.GameKey_Server; } wc.ClientSocket.Send(mBuffer); }
public static void MakeShopPurchase(WRClient wc) { Core.OutPacket mPacket = new Core.OutPacket(30208); mPacket.AddBlock(1); //Error_OK mPacket.AddBlock(1110); //Action_Code mPacket.AddBlock(-1); mPacket.AddBlock(3); mPacket.AddBlock(wc.Inventory.itemTable.Count); mPacket.AddBlock(wc.Inventory.BuildItemList()); mPacket.AddBlock(wc.Account.Dinar); mPacket.AddBlock(wc.GetOpenSlots()); byte[] mBuffer = mPacket.GetOutput(); for (int I = 0; I < mBuffer.Length; I++) { mBuffer[I] ^= Core.BuildConfig.GameKey_Server; } wc.ClientSocket.Send(mBuffer); }
public static void MakeChatPacket(WRClient wc, int userId, string name, ChatType type, int targetId, string targetName, string message) { Core.OutPacket mPacket = new Core.OutPacket(29696); mPacket.AddBlock(1); //Error_OK mPacket.AddBlock(userId); mPacket.AddBlock(name); mPacket.AddBlock((int)type); mPacket.AddBlock(targetId); mPacket.AddBlock(targetName); mPacket.AddBlock(message); byte[] mBuffer = mPacket.GetOutput(); for (int I = 0; I < mBuffer.Length; I++) { mBuffer[I] ^= Core.BuildConfig.GameKey_Server; } wc.ClientSocket.Send(mBuffer); }
private static void MakeClientVerPacket(WRClient wc) { Core.OutPacket mPacket = new Core.OutPacket(4112); mPacket.AddBlock(Globals.GetInstance().Config.GetValue("Format")); // Format mPacket.AddBlock(Globals.GetInstance().Config.GetValue("Launcher")); // Launcher Version mPacket.AddBlock(Globals.GetInstance().Config.GetValue("Updater")); // Updater Version mPacket.AddBlock(Globals.GetInstance().Config.GetValue("Client")); // Client Version mPacket.AddBlock(Globals.GetInstance().Config.GetValue("Sub")); // Sub Version mPacket.AddBlock(Globals.GetInstance().Config.GetValue("Option")); // Option mPacket.AddBlock(Globals.GetInstance().Config.GetValue("URL")); // Updater URL byte[] mBuffer = mPacket.GetOutput(); for (byte I = 0; I < mBuffer.Length; I++) { mBuffer[I] ^= Core.BuildConfig.AuthKey_Server; } wc.ClientSocket.Send(mBuffer); }
public static void MakeServerListPacket(WRClient wc) { Core.OutPacket mPacket = new Core.OutPacket(4352); mPacket.AddBlock(1); // ErrorCode (Error_OK) mPacket.AddBlock(wc.Account.Idx); // ID mPacket.AddBlock(0); mPacket.AddBlock(wc.Account.Username); // Username mPacket.AddBlock(wc.Account.Password); // Password mPacket.AddBlock(wc.Account.Nickname); // Nickname mPacket.AddBlock(wc.SessionIdx); mPacket.AddBlock(1); // Unknown mPacket.AddBlock(0); // Unknown mPacket.AddBlock(wc.Account.Accesslevel); // Accesslevel mPacket.AddBlock(Globals.GetInstance().ServerListHandler.serverListTable.Count); // Server Count foreach (ServerInfo mInfo in Globals.GetInstance().ServerListHandler.serverListTable.Values) { mPacket.AddBlock(mInfo.Idx); mPacket.AddBlock(mInfo.Name); mPacket.AddBlock(mInfo.IP); mPacket.AddBlock(5340); mPacket.AddBlock(0); // PlayerCount mPacket.AddBlock(mInfo.Flag); } mPacket.AddBlock(-1); // Clan ID mPacket.AddBlock(-1); // Clan Name mPacket.AddBlock(-1); // Clan Master mPacket.AddBlock(-1); // Unknown mPacket.AddBlock(0); // Unknown mPacket.AddBlock(0); // Unknown byte[] mBuffer = mPacket.GetOutput(); for (byte I = 0; I < mBuffer.Length; I++) { mBuffer[I] ^= Core.BuildConfig.AuthKey_Server; } wc.ClientSocket.Send(mBuffer); }
public static void MakeCharacterInfo(WRClient wc) { Core.OutPacket mPacket = new Core.OutPacket(25088); mPacket.AddBlock(1); mPacket.AddBlock("GameServer"); mPacket.AddBlock(wc.SessionIdx); mPacket.AddBlock(wc.Account.Idx); mPacket.AddBlock(wc.SessionIdx); mPacket.AddBlock(wc.Account.Nickname); mPacket.AddBlock(-1); // CLAN mPacket.AddBlock(-1); // CLAN mPacket.AddBlock(-1); // CLAN mPacket.AddBlock(-1); // CLAN mPacket.AddBlock(wc.Account.Premium); mPacket.AddBlock(0); // Unknown mPacket.AddBlock(0); // Unknown mPacket.AddBlock(Globals.GetInstance().LevelManager.GetLevelForExp(wc.Account.Exp)); // Level mPacket.AddBlock(wc.Account.Exp); mPacket.AddBlock(0); // Unknown mPacket.AddBlock(0); // Unknown mPacket.AddBlock(wc.Account.Dinar); mPacket.AddBlock(wc.Account.Kills); mPacket.AddBlock(wc.Account.Deaths); mPacket.AddBlock(0); // Unknown mPacket.AddBlock(0); // Unknown mPacket.AddBlock(0); // Unknown mPacket.AddBlock(0); // Unknown mPacket.AddBlock(0); // Unknown mPacket.AddBlock(wc.GetOpenSlots()); // Slots opened mPacket.AddBlock(string.Join(",", wc.Inventory.Engineer)); mPacket.AddBlock(string.Join(",", wc.Inventory.Medic)); mPacket.AddBlock(string.Join(",", wc.Inventory.Sniper)); mPacket.AddBlock(string.Join(",", wc.Inventory.Assault)); mPacket.AddBlock(string.Join(",", wc.Inventory.Heavy)); mPacket.AddBlock(wc.Inventory.BuildItemList()); mPacket.AddBlock(0); // Unknown mPacket.AddBlock(0); // Unknown byte[] mBuffer = mPacket.GetOutput(); for (int I = 0; I < mBuffer.Length; I++) { mBuffer[I] ^= Core.BuildConfig.GameKey_Server; } wc.ClientSocket.Send(mBuffer); }