internal static void TryRedeemVoucher(GameClient Session, string Code) { if (!IsValidCode(Code)) { ServerMessage Error = new ServerMessage(Outgoing.VoucherRedeemError); Error.AppendRawInt32(0); // 0=invalid code,1=technical issue,3=redeem at webpage Session.SendMessage(Error); return; } int Value = GetVoucherValue(Code); TryDeleteVoucher(Code); Session.GetHabbo().Credits += Value; Session.GetHabbo().UpdateCreditsBalance(); ServerMessage message = new ServerMessage(Outgoing.VoucherRedeemOk); message.AppendString("Credits"); // productName message.AppendString("Awesome"); // productDescription Session.SendMessage(message); }
internal void RemoveBot(int VirtualId, bool Kicked) { RoomUser User = GetRoomUserByVirtualId(VirtualId); if (User == null || !User.IsBot) { return; } if (User.IsPet) { pets.Remove(User.PetData.PetId); petCount--; } User.BotAI.OnSelfLeaveRoom(Kicked); ServerMessage LeaveMessage = new ServerMessage(Outgoing.UserLeftRoom); LeaveMessage.AppendRawInt32(User.VirtualId); room.SendMessage(LeaveMessage); userlist.Remove(User.InternalRoomID); //freeIDs[User.InternalRoomID] = null; }
private void BotLeaveMessage() { foreach (RoomUser user in roomUserManager.UserList.Values) { if (user.IsBot || user.IsPet) { ServerMessage LeaveMessage = new ServerMessage(29); LeaveMessage.AppendRawInt32(user.VirtualId); SendMessage(LeaveMessage); } } }