Aion Web PTS (Need Help)

Newbie Spellweaver
Joined
Jan 15, 2024
Messages
30
Reaction score
3
Good afternoon. Does anyone know how to fix this issue? There’s a roulette game on the site; I selected a character and spun, but it keeps saying "delivered."

рулетка44 - Aion Web PTS (Need Help) - RaGEZONE Forums



In the AionWorld_110 database, the `dbo.user_mail` table has these values at the end.
id to_id to_name from_id from_name title content item_id item_nameid item_amount money state arrive_time express_mail item_tid
3791 1002 Sorgravity 1072 Webshop Выигрыш: Большой су. Поздравляем! Вы выиграли Большой сундук (1 Шт) в рулетке. Награда отправлена на почту. 96007 188053101 5 0 0 1782393408 1 0
3792 1002 Sorgravity 1072 Webshop Выигрыш: Свиток тел. Поздравляем! Вы выиграли Свиток телепорта (10 Шт) в рулетке. Награда отправлена на почту. 96008 164002238 10 0 0 1782393431 1 0

And there is express mail in the game, but it doesn’t open. I go to the mailbox and there are letters there, but they are not clickable. I also forcefully read the letters, and then I can open them, but there is nothing there.

Screenshot_2026_06_25-4 - Aion Web PTS (Need Help) - RaGEZONE Forums
выаыв - Aion Web PTS (Need Help) - RaGEZONE Forums


And here is the backend API for email.
app.post('/api/mail/send', checkSession, async (req, res) => {
try {
const {
fromName,
fromId,
toName,
toId,
title,
content,
itemId,
itemAmount,
money = 0,
expressMail = 1
} = req.body;

console.log(`\n📧 Отправка почты:`);
console.log(` → От: ${fromName} (ID: ${fromId})`);
console.log(` → Кому: ${toName} (ID: ${toId})`);
console.log(` → Тема: ${title}`);
console.log(` → Предмет ID: ${itemId}, Кол-во: ${itemAmount}`);
console.log(` → Деньги: ${money}`);
console.log(` → Экспресс: ${expressMail ? 'Да' : 'Нет'}`);


if (!toName || !toId) {
return res.status(400).json({
success: false,
error: 'Не указан получатель'
});
}

if (!title) {
return res.status(400).json({
success: false,
error: 'Не указана тема письма'
});
}

const pool = await getPool();

// unix timestamp
const now = Math.floor(Date.now() / 1000);


let cleanTitle = title || 'Рулетка';
if (cleanTitle.length > 20) {
cleanTitle = cleanTitle.substring(0, 20);
}

console.log(` → Очищенный заголовок: ${cleanTitle} (${cleanTitle.length} симв.)`);

// Получаем максимальный item_id из таблицы
const maxIdResult = await pool.request()
.query(`
SELECT ISNULL(MAX(item_id), 96006) as max_id
FROM AionWorld_110.dbo.user_mail
`);

let maxId = maxIdResult.recordset[0]?.max_id || 96006;

// Если максимальный ID меньше 96007, начинаем с 96007
if (maxId < 96007) {
maxId = 96006;
}

// Следующий ID = максимальный + 1 (ЧИСЛОВОЕ СЛОЖЕНИЕ, а не конкатенация!)
let nextItemId = Number(maxId) + 1;

console.log(` → Максимальный item_id в БД: ${maxId}`);
console.log(` → Следующий item_id: ${nextItemId}`);
console.log(` → item_nameid (ID предмета из рулетки): ${itemId}`);

// Обрезаем содержимое до 1000 символов
let cleanContent = content || '';
if (cleanContent.length > 1000) {
cleanContent = cleanContent.substring(0, 997) + '...';
}

// ИСПОЛЬЗУЕМ ДАННЫЕ ИЗ ЗАПРОСА (fromId, fromName, title)
// item_id = уникальный ID (96007, 96008...)
// item_nameid = ID предмета из рулетки
// item_tid = 0
const result = await pool.request()
.input('toId', sql.Int, toId)
.input('toName', sql.NVarChar, toName)
.input('fromId', sql.Int, fromId || 0)
.input('fromName', sql.NVarChar, fromName || '$$ABYSS_REWARD_MAIL')
.input('title', sql.NVarChar, cleanTitle)
.input('content', sql.NVarChar, cleanContent)
.input('itemId', sql.BigInt, nextItemId) // Уникальный ID письма
.input('itemNameid', sql.Int, itemId || 0) // ID предмета из рулетки
.input('itemAmount', sql.BigInt, itemAmount || 0)
.input('money', sql.BigInt, money || 0)
.input('state', sql.TinyInt, 0)
.input('arriveTime', sql.Int, now)
.input('expressMail', sql.TinyInt, expressMail ? 1 : 0)
.input('itemTid', sql.BigInt, 0) // Всегда 0
.query(`
INSERT INTO AionWorld_110.dbo.user_mail (
to_id, to_name, from_id, from_name,
title, content, item_id, item_nameid, item_amount,
money, state, arrive_time, express_mail, item_tid
) VALUES (
@toId, @toName, @fromId, @fromName,
@title, @content, @itemId, @itemNameid, @itemAmount,
Money, @state, @arriveTime, @expressMail, @itemTid
);

SELECT SCOPE_IDENTITY() as id;
`);

const mailId = result.recordset[0]?.id || null;

console.log(`✅ Письмо отправлено! ID: ${mailId}`);
console.log(` → Получатель: ${toName} получит награду на почту`);
console.log(` → from_name: ${fromName}`);
console.log(` → title: ${cleanTitle}`);
console.log(` → item_id (уникальный): ${nextItemId}`);
console.log(` → item_nameid (предмет): ${itemId}`);
console.log(` → express_mail: ${expressMail}`);

return res.json({
success: true,
message: 'Письмо успешно отправлено',
mailId: mailId,
itemId: nextItemId
});

} catch (error) {
console.error('❌ Ошибка отправки почты:', error);
return res.status(500).json({
success: false,
error: error.message || 'Внутренняя ошибка сервера'
});
}
});


And here is the API from the file. Roulette.jsx

const sendMail = async (toName, toId, title, content, itemId, itemAmount, money = 0) => {
try {
const token = localStorage.getItem('authToken');

const response = await fetch('/api/mail/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify({
fromName: 'Webshop',
fromId: 1072,
toName: toName,
toId: toId,
title: title,
content: content,
itemId: itemId,
itemAmount: itemAmount,
money: money,
expressMail: 1
})
});

const data = await response.json();
return data;
} catch (error) {
console.error('❌ Ошибка отправки почты:', error);
return { success: false, error: error.message };
}
};
 
Good afternoon. Does anyone know how to fix this issue? There’s a roulette game on the site; I selected a character and spun, but it keeps saying "delivered."
I suspect the items being sent aren't on the server. Try retrieving them through the GM panel. If the item is accepted, then check the database and see what item ID it's listed in (user_mail table, item_nameid column). I suspect it'll list an invalid ID.
 
Upvote 0
const rouletteItems = [
{
id: 1,
name: 'Кинары',
image: '/images/items/kinah.png',
amount: '20 Млн',
itemId: 182400001,
itemAmount: 20000000,
isMoney: true,
money: 20000000
},
{
id: 2,
name: 'Свиток скорости 60м',
image: '/images/items/speed_potion.png',
amount: '100 Шт',
itemId: 164002112,
itemAmount: 100,
isMoney: false,
money: 0
},
{
id: 3,
name: 'Мыльный пузырь',
image: '/images/items/novice_wings.png',
amount: '1 Шт',
itemId: 187060260,
itemAmount: 1,
isMoney: false,
money: 0
},
{
id: 4,
name: 'Редкий сундук',
image: '/images/items/rare_chest.png',
amount: '1 Шт',
itemId: 188053156,
itemAmount: 1,
isMoney: false,
money: 0
},
{
id: 5,
name: 'Неиссякаемое зелье жизни',
image: '/images/items/elite_potion.png',
amount: '1 Шт',
itemId: 162002013,
itemAmount: 1,
isMoney: false,
money: 0
},
{
id: 6,
name: 'Зелье опыта',
image: '/images/items/exp.png',
amount: '5 Шт',
itemId: 188900001,
itemAmount: 5,
isMoney: false,
money: 0
},
{
id: 7,
name: 'Свиток телепорта',
image: '/images/items/teleport.png',
amount: '10 Шт',
itemId: 164002238,
itemAmount: 10,
isMoney: false,
money: 0
},
{
id: 8,
name: 'Большой сундук',
image: '/images/items/big_chest.png',
amount: '1 Шт',
itemId: 188053101,
itemAmount: 5,
isMoney: false,
money: 0
},
{
id: 9,
name: 'Уникальный титул',
image: '/images/items/unique_title.png',
amount: '1 Шт',
itemId: 169610341,
itemAmount: 1,
isMoney: false,
money: 0
},
{
id: 10,
name: 'Мешочек бож.камня',
image: '/images/items/rare_material.png',
amount: '1 Шт',
itemId: 188054473,
itemAmount: 1,
isMoney: false,
money: 0
},
{
id: 11,
name: 'Элитные крылья',
image: '/images/items/elite_wings.png',
amount: '1 Шт',
itemId: 187060153,
itemAmount: 1,
isMoney: false,
money: 0
},

кимнары - Aion Web PTS (Need Help) - RaGEZONE Forums
свиток 3 - Aion Web PTS (Need Help) - RaGEZONE Forums
пузырь - Aion Web PTS (Need Help) - RaGEZONE Forums


id to_id to_name from_id from_name title content item_id item_nameid item_amount money state arrive_time express_mail item_tid
3806 1003 Erikbrand 1072 Webshop Выигрыш: Редкий сун. Поздравляем! Вы выиграли Редкий сундук (1 Шт) в рулетке. Награда отправлена на почту. 96113 188053156 1 0 0 1782412235 1 0
3807 1003 Erikbrand 1072 Webshop Выигрыш: Элитные кр. Поздравляем! Вы выиграли Элитные крылья (1 Шт) в рулетке. Награда отправлена на почту. 96114 187060153 1 0 0 1782412251 1 0
3808 1003 Erikbrand 1072 Webshop Выигрыш: Элитные кр. Поздравляем! Вы выиграли Элитные крылья (1 Шт) в рулетке. Награда отправлена на почту. 96115 187060153 1 0 0 1782412264 1 0


Maybe the issue is that the Webshop character ID corresponds to a regular player character, and you need to set it to a neutral NPC instead—something like...

769 1004 0 $$ABYSS_REWARD_MAIL 2021,2,0 1737655396,0 22533 122001528 1 0 1 1737655396 0 0 2025-01-23 18:03:16.000
766 1004 0 $$ABYSS_REWARD_MAIL 1221,2,0 1737489522,0 22435 122001629 1 0 1 1737489522 0 0 2025-01-21 19:58:42.000


1747 0 0 $$HS_AUCTION_MAIL 3,0 1742720400,10019 0 0 0 1290000 0 1742720403 0 0 2025-03-23 09:00:03.000
1746 0 0 $$HS_AUCTION_MAIL 2,0 1742720400,10277 0 0 0 0 0 1742720403 0 0 2025-03-23 09:00:03.000


3098 1002 Sorgravity 0 $$VNDR_RETURN_MAIL 77120 0 1 0 0 1744828691 0 0 2025-04-16 18:38:11.000
3097 1002 Sorgravity 0 $$VNDR_RETURN_MAIL 58828 0 1000 0 0 1744828691 0 0 2025-04-16 18:38:11.000
 
Last edited:
Upvote 0
The server isn't logging any errors; in fact, it doesn't log anything at all regarding email dispatch. Here are the backend and database details: I kept spinning until I’d collected all the rewards, and while the emails triggered for specific rewards, the actual reward inside turned out to be completely different. GIF attached

🔐 Попытка входа: corvin
✅ Аккаунт найден: corvin
🔑 Хеш из БД: FB0270BEF3BBE884064238E251132D5F
📊 Данные аккаунта получены
- UID: 2
- Pay Stat: 1
- Login Flag: 0
- Block Flag: 0
- Last IP:
📊 Данные user_info получены
- Дата регистрации: Tue Dec 17 2024 22:50:10 GMT+0300 (Москва, стандартное время)
👥 Найдено персонажей: 2
1. Sorgravity (Уровень 65, Элийцы)
2. Erikbrand (Уровень 65, Элийцы)
🔐 PIN найден для corvin
✅ Сессия сохранена в БД для corvin, токен: 9b44202a4ec1aadc...
✅ Создана сессия для corvin, токен: 9b44202a4ec1aadc...
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...
👥 Запрос персонажей для: corvin
📋 account_id для corvin: 2
✅ Найдено персонажей: 2
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...
📊 Запрос информации об аккаунте: corvin
✅ Данные для corvin собраны
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...

📧 Отправка почты:
→ От: Webshop (ID: 1072)
→ Кому: Erikbrand (ID: 1003)
→ Тема: Выигрыш: Неиссякаем..
→ Предмет ID: 162002013, Кол-во: 1
→ Деньги: 0
→ Экспресс: Да
→ Очищенный заголовок: Выигрыш: Неиссякаем. (20 симв.)
→ Максимальный item_id в БД: 96146
→ Следующий item_id: 96147
→ item_nameid (ID предмета из рулетки): 162002013
✅ Письмо отправлено! ID: 3836
→ Получатель: Erikbrand получит награду на почту
→ from_name: Webshop
→ title: Выигрыш: Неиссякаем.
→ item_id (уникальный): 96147
→ item_nameid (предмет): 162002013
→ express_mail: 1
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...

📧 Отправка почты:
→ От: Webshop (ID: 1072)
→ Кому: Erikbrand (ID: 1003)
→ Тема: Выигрыш: Кинары
→ Предмет ID: 182400001, Кол-во: 20000000
→ Деньги: 20000000
→ Экспресс: Да
→ Очищенный заголовок: Выигрыш: Кинары (15 симв.)
→ Максимальный item_id в БД: 96147
→ Следующий item_id: 96148
→ item_nameid (ID предмета из рулетки): 182400001
✅ Письмо отправлено! ID: 3837
→ Получатель: Erikbrand получит награду на почту
→ from_name: Webshop
→ title: Выигрыш: Кинары
→ item_id (уникальный): 96148
→ item_nameid (предмет): 182400001
→ express_mail: 1
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...

📧 Отправка почты:
→ От: Webshop (ID: 1072)
→ Кому: Erikbrand (ID: 1003)
→ Тема: Выигрыш: Свиток тел..
→ Предмет ID: 164002238, Кол-во: 10
→ Деньги: 0
→ Экспресс: Да
→ Очищенный заголовок: Выигрыш: Свиток тел. (20 симв.)
→ Максимальный item_id в БД: 96148
→ Следующий item_id: 96149
→ item_nameid (ID предмета из рулетки): 164002238
✅ Письмо отправлено! ID: 3838
→ Получатель: Erikbrand получит награду на почту
→ from_name: Webshop
→ title: Выигрыш: Свиток тел.
→ item_id (уникальный): 96149
→ item_nameid (предмет): 164002238
→ express_mail: 1
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...
✅ Сессия обновлена в БД: 9b44202a4ec1aadc...
🗑️ Сессия удалена из БД: 9b44202a4ec1aadc…

id to_id to_name from_id from_name title content item_id item_nameid item_amount money state arrive_time express_mail item_tid
3831 1003 Erikbrand 1072 Webshop Выигрыш: Мыльный пу. Поздравляем! Вы выиграли Мыльный пузырь (1 Шт) в рулетке. Награда отправлена на почту. 96142 187060260 1 0 1 1782416167 1 0
3832 1003 Erikbrand 1072 Webshop Выигрыш: Мыльный пу. Поздравляем! Вы выиграли Мыльный пузырь (1 Шт) в рулетке. Награда отправлена на почту. 96143 187060260 1 0 1 1782416182 1 0
3833 1003 Erikbrand 1072 Webshop Выигрыш: Неиссякаем. Поздравляем! Вы выиграли Неиссякаемое зелье жизни (1 Шт) в рулетке. Награда отправлена на почту. 96144 162002013 1 0 1 1782416195 1 0
3835 1003 Erikbrand 1072 Webshop Выигрыш: Мешочек бо. Поздравляем! Вы выиграли Мешочек бож.камня (1 Шт) в рулетке. Награда отправлена на почту. 96146 188054473 1 0 1 1782416273 1 0
3836 1003 Erikbrand 1072 Webshop Выигрыш: Неиссякаем. Поздравляем! Вы выиграли Неиссякаемое зелье жизни (1 Шт) в рулетке. Награда отправлена на почту. 96147 162002013 1 0 0 1782461869 1 0
3837 1003 Erikbrand 1072 Webshop Выигрыш: Кинары Поздравляем! Вы выиграли Кинары (20 Млн) в рулетке. Награда отправлена на почту. 96148 182400001 20000000 20000000 0 1782461885 1 0
3838 1003 Erikbrand 1072 Webshop Выигрыш: Свиток тел. Поздравляем! Вы выиграли Свиток телепорта (10 Шт) в рулетке. Награда отправлена на почту. 96149 164002238 10 0 0 1782461902 1 0


18342331419297online-video-cutter.com-ezgif.com-video-to-gif-converter - Aion Web PTS (Need Help) - RaGEZONE Forums
 
Upvote 0
The server isn't logging any errors; in fact, it doesn't log anything at all regarding email dispatch. Here are the backend and database details: I kept spinning until I’d collected all the rewards, and while the emails triggered for specific rewards, the actual reward inside turned out to be completely different
If the server doesn't write anything, then the problem is in your website script.

Am I correct in understanding that your letter is compiled using the first option?

1782466688099 - Aion Web PTS (Need Help) - RaGEZONE Forums
 
Last edited:
Upvote 0
Perhaps someone could point me in the right direction to fix this situation. Thanks.

If the server isn't throwing errors, it means everything is being done correctly. And if the database is recording data sent from the user dashboard (the roulette feature), then the connection to the database is working and everything is fine. The issue is that there is a possibility the item IDs are being transmitted incorrectly, or perhaps they use their own encryption. For instance, if you take two in-game characters and one sends an item to the other via express mail, this is the output produced:

1online-video-cutter.com-ezgif.com-video-to-gif-converter - Aion Web PTS (Need Help) - RaGEZONE Forums

and an entry like this in the database
id to_id to_name from_id from_name title content item_id item_nameid item_amount money state arrive_time express_mail item_tid
3839 1003 Erikbrand 1002 Sorgravity рулетка рулетка 95943 0 1 0 1 1782468000 1 0
 
Upvote 0
If the server isn't throwing errors, it means everything is being done correctly. And if the database is recording data sent from the user dashboard (the roulette feature), then the connection to the database is working and everything is fine. The issue is that there is a possibility the item IDs are being transmitted incorrectly, or perhaps they use their own encryption. For instance, if you take two in-game characters and one sends an item to the other via express mail, this is the output produced:
I've only had this error when I send an item that doesn't exist on the server.
Otherwise, I'm out of ideas. I hope someone can help you...or at least write.
 
Upvote 0
What I just remembered... I see that you indicate item_id as conditionally random, but that's not true, it's not a random number.

You probably need to... set a condition... item_id is the ID column in the user_items table. I can assume there's a conflict between these numbers.
Try running this query and check the item it contains:
SELECT * FROM [dbo].[user_item] where id=96148

...in your case, it should be item 182400001
1782475580070 - Aion Web PTS (Need Help) - RaGEZONE Forums

1782475598847 - Aion Web PTS (Need Help) - RaGEZONE Forums
 
Upvote 0
Everything in the database is so logical that there’s absolutely nothing to find fault with.
ggg - Aion Web PTS (Need Help) - RaGEZONE Forums
jjj - Aion Web PTS (Need Help) - RaGEZONE Forums
 
Upvote 0
You only showed user_mail, look again at the tables I showed.
Screenshot_2026_06_26-4 - Aion Web PTS (Need Help) - RaGEZONE Forums

-- 1. Найти запись в user_item по id
SELECT
id,
name_id as item_nameid,
amount,
char_id,
slot,
warehouse,
create_date,
update_date
FROM AionWorld_110.dbo.user_item
WHERE id = 96148;

-- 2. Найти запись в user_item с полной информацией о персонаже
SELECT
ui.id,
ui.name_id as item_nameid,
ui.amount,
ui.char_id,
ud.user_id as character_name,
ud.lev as character_level,
ud.race,
ud.class,
ui.slot,
ui.warehouse,
ui.create_date,
CASE
WHEN ui.warehouse = 0 THEN 'Инвентарь'
WHEN ui.warehouse = 1 THEN 'Склад'
ELSE 'Другое'
END as location
FROM AionWorld_110.dbo.user_item ui
LEFT JOIN AionWorld_110.dbo.user_data ud ON ui.char_id = ud.char_id
WHERE ui.id = 96148;

-- 3. Проверить, есть ли такой предмет в инвентаре (по name_id)
SELECT
ui.id,
ui.name_id,
ui.amount,
ui.char_id,
ud.user_id,
ui.slot,
ui.warehouse,
ui.create_date
FROM AionWorld_110.dbo.user_item ui
JOIN AionWorld_110.dbo.user_data ud ON ui.char_id = ud.char_id
WHERE ui.name_id = (
SELECT name_id
FROM AionWorld_110.dbo.user_item
WHERE id = 96148
)
ORDER BY ui.char_id, ui.name_id;

-- 4. Полная информация: письмо + предмет в инвентаре
SELECT
'Письмо' as source,
um.id,
um.item_id,
um.item_nameid as mail_item_nameid,
um.item_amount as mail_item_amount,
um.to_name,
um.title,
um.express_mail,
DATEADD(SECOND, um.arrive_time, '1970-01-01') as date
FROM AionWorld_110.dbo.user_mail um
WHERE um.id = 96148 OR um.item_id = 96148

UNION ALL

SELECT
'Предмет' as source,
ui.id,
NULL as item_id,
ui.name_id as item_nameid,
ui.amount,
ud.user_id as to_name,
NULL as title,
NULL as express_mail,
ui.create_date as date
FROM AionWorld_110.dbo.user_item ui
LEFT JOIN AionWorld_110.dbo.user_data ud ON ui.char_id = ud.char_id
WHERE ui.id = 96148;​
 
Upvote 0
1782498046650 - Aion Web PTS (Need Help) - RaGEZONE Forums

Making two "select" statements - no
Creating a multi-line function and getting confused by it - yes


To the point:

If I understand correctly what you sent, the two "select" items I asked you about in the third screenshot are the same. The UID of the item in the email overlaps with the UID of the item in your bag, which is why this mess is happening.

PS. I doubt the servers aren't reporting this mess, but I certainly won't be checking.
 
Upvote 0
Back