TheStarport / FLHook

A Server Improvement for Freelancer.
GNU General Public License v3.0
30 stars 15 forks source link

TRADE related Packages #428

Closed erikroe closed 2 months ago

erikroe commented 4 months ago

I had some time to follow the sequence of trade calls. Those are:

Server.RequestTrade(CLIENT 1, CLIENT 2) (1 sends to 2)
Client.Send_FLPACKET_COMMON_PLAYER_TRADE (CLIENT 2, SHIPID 1) -> marks ShipId for Client as "wants to trade" (gives chat message + purple marking)

Server.RequestTrade(CLIENT 2, CLIENT 1) (2 replies to 1)
Server.InitiateTrade(CLIENT 2, CLIENT 1)
Server.StopTradeRequest(CLIENT 1)
Client.unknown_103(CLIENT 1, SHIPID 0) -> client 1 does not offer trade to ShipID anymore for
Client.unknown_109(CLIENT 2, SHIPID 1) -> client 2 has no more incoming trade offer from ShipId (revokes purple marking)
Client.unknown_102(CLIENT 2, SHIPID 1) -> client 2 opens trade with ShipId
Client.unknown_102(CLIENT 1, SHIPID 2)  -> client 1 opens trade with ShipId

Server.TerminateTrade(CLIENT 1, ACCEPT 0)
Client.unknown_103(CLIENT 2, SHIPID 0)
Client.unknown_103(CLIENT 1, SHIPID 0)

Server.SetTradeMoney(CLIENT 1, SHIPID 2) -> 1 sets his money to 10
Client.unknown_105(CLIENT 1, SHIPID 1, MONEY)
Client.unknown_105(CLIENT 2, SHIPID 1, MONEY)

Server.AcceptTrade(CLIENT 1, TRUE)
Client.unknown_104(CLIENT 2, SHIPID 1, 1 [TRUE])

Server.AddTradeEquip(CLIENT 1, equip)
Client.unknown_106(CLIENT 1, SHIPID 1, EQUIP ID)
Client.unknown_106(CLIENT 2, SHIPID 1, EQUIP ID)

Server.DelTradeEquip(CLIENT 1, equip)
Client.unknown_107(CLIENT 2, SHIPID 1, EQUIP ID)
Client.unknown_107(CLIENT 2, SHIPID 1, EQUIP ID)

My proposal for namings:

Lazrius commented 2 months ago

Changed in 57b84290bf11e2c73115875fbdea0aace1bc01ae