fix login issue*

This commit is contained in:
2026-02-25 12:26:26 -07:00
parent da581f5a20
commit 2c3d0ab580
37 changed files with 4708 additions and 721 deletions

View File

@@ -103,7 +103,7 @@ defmodule Odinsea.Shop.Client do
opcode == Opcodes.cp_player_loggedin() ->
handle_migrate_in(packet, state)
opcode == Opcodes.cp_cash_shop_update() ->
opcode == Opcodes.cp_cs_update() ->
# Cash shop operations
handle_cash_shop_operation(packet, state)

View File

@@ -126,7 +126,7 @@ defmodule Odinsea.Shop.Packets do
"""
def enable_cs_use(socket) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> encode_cs_update()
|> Out.to_data()
@@ -145,7 +145,7 @@ defmodule Odinsea.Shop.Packets do
cash_items = character.cash_inventory || []
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x4A) # Operation code for inventory
|> encode_cash_items(cash_items)
|> Out.to_data()
@@ -178,7 +178,7 @@ defmodule Odinsea.Shop.Packets do
"""
def show_nx_maple_tokens(socket, character) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x3D) # Operation code for balance
|> Out.encode_int(character.nx_cash || 0)
|> Out.encode_int(character.maple_points || 0)
@@ -196,7 +196,7 @@ defmodule Odinsea.Shop.Packets do
"""
def show_bought_cs_item(socket, item, sn, account_id) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x53) # Bought item operation
|> Out.encode_int(account_id)
|> encode_bought_item(item, sn)
@@ -220,7 +220,7 @@ defmodule Odinsea.Shop.Packets do
"""
def show_bought_cs_package(socket, items, account_id) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x5D) # Package operation
|> Out.encode_int(account_id)
|> Out.encode_short(length(items))
@@ -239,7 +239,7 @@ defmodule Odinsea.Shop.Packets do
"""
def show_bought_cs_quest_item(socket, item, position) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x73) # Quest item operation
|> Out.encode_int(item.price)
|> Out.encode_short(item.count)
@@ -255,7 +255,7 @@ defmodule Odinsea.Shop.Packets do
"""
def confirm_from_cs_inventory(socket, item, position) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x69) # From CS inventory
|> Out.encode_byte(Odinsea.Game.InventoryType.get_type(
Odinsea.Game.InventoryType.from_item_id(item.item_id)
@@ -271,7 +271,7 @@ defmodule Odinsea.Shop.Packets do
"""
def confirm_to_cs_inventory(socket, item, account_id) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x5F) # To CS inventory
|> Out.encode_int(account_id)
|> encode_cash_item_single(item)
@@ -298,7 +298,7 @@ defmodule Odinsea.Shop.Packets do
"""
def send_gift(socket, price, item_id, count, partner) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x5B) # Gift sent operation
|> Out.encode_int(price)
|> Out.encode_int(item_id)
@@ -314,7 +314,7 @@ defmodule Odinsea.Shop.Packets do
"""
def get_cs_gifts(socket, gifts) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x48) # Gifts operation
|> Out.encode_short(length(gifts))
|> then(fn pkt ->
@@ -340,7 +340,7 @@ defmodule Odinsea.Shop.Packets do
"""
def send_wishlist(socket, _character, wishlist) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x4D) # Wishlist operation
|> then(fn pkt ->
Enum.reduce(wishlist, pkt, fn sn, p ->
@@ -361,7 +361,7 @@ defmodule Odinsea.Shop.Packets do
"""
def show_coupon_redeemed(socket, items, maple_points, mesos, client_state) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x4B) # Coupon operation
|> Out.encode_byte(if safe_map_size(items) > 0, do: 1, else: 0)
|> Out.encode_int(safe_map_size(items))
@@ -390,7 +390,7 @@ defmodule Odinsea.Shop.Packets do
"""
def redeem_response(socket) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0xA1) # Redeem response
|> Out.encode_int(0)
|> Out.encode_int(0)
@@ -409,7 +409,7 @@ defmodule Odinsea.Shop.Packets do
"""
def send_cs_fail(socket, code) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x49) # Fail operation
|> Out.encode_byte(code)
|> Out.to_data()
@@ -422,7 +422,7 @@ defmodule Odinsea.Shop.Packets do
"""
def cash_item_expired(socket, unique_id) do
packet =
Out.new(Opcodes.lp_cash_shop_update())
Out.new(Opcodes.lp_cs_update())
|> Out.encode_byte(0x4E) # Expired operation
|> Out.encode_long(unique_id)
|> Out.to_data()