From 1d0ba967b5c5c74d4c2c8b33f01ff6436a3f108f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 5 Jun 2010 12:46:04 +0200 Subject: [PATCH] game: Initial mission start (for real) and abort support. --- p/packet1015_mission.bin | Bin 0 -> 8252 bytes src/egs_game.erl | 40 +++++++++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 p/packet1015_mission.bin diff --git a/p/packet1015_mission.bin b/p/packet1015_mission.bin new file mode 100644 index 0000000000000000000000000000000000000000..f1ddc30f0c0d87b3003417a7de26dada16cc2cf8 GIT binary patch literal 8252 zcmeI1cTiK?7RH02g(4yJCP-HhLCU2nQiOympcDlH(jig=9z`UfDkvZ&bSX-+0t!T0 zXd+cE5D}0n3P=@!zy-v6ocqq)(Rsf6=FPl$f86YuU)HRB*7}n3?L9eX&QTYFK;Rru z$iEy^Y>=qdPAc%2kroSt3dpc2a1;dSGd40bJODvK;0GWOnr}t0KPs;Rp}5U#>yPZu zPb*_H2>Q7R4v7CPVQw|$jQM&9K82y6pzkcvzxU_E5^Uy z0A&8{_)&jM5R*K!EmA6(Ji~i3`vuF7`iU@kn^P0G(EnEdxSl9EjwYME#K682p_{b( z{sX5<7+G8o{2u;{^7uq%r=I^*-%Qu=yYmC}xq55LR<9v>NK9pWsY-Hr;W*hYUUhSX)iBk3!ES6crwc{N#=bmp0fdKszQVFezK^Q zDB_bVqH4HmkqYX5a30k8!mh26Cz4AnWYSF7PVU3LjECG`xonJx47DDB3<##VjlpPl zx|Zmr9URY15~HQFi&E(PuOEsv>vfouT)r@&8*}Ju9LpSYf>R@g(X7_HQ_4O zr=y(1?tD%2YSYUSy-UN8+o+E-<#aqd2j(w*s5Fjj#)yHr7Tb#q^WGE>Yu#0&QdNlB{^lq3k=Q*AzO@v9tm3*#e+k)JcVcG0;H5QF-grx@BB-x9N_C~w#u3}Pr(MP9R z^^Ar+F#0iH{LGhb-*%NJH=1u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un0EwDqLk*Fo|^b zs($d!rKXQb+8qU_r`s*z&P80%UG+)-EHPDrM{|eE#cdBWElsSlG^o#Ie|qFxqq{1o zfBJ47P0{oa6x4^S>8F1tn6IP!#Ocy-Xa%ruf{+1wv=M#{?6Yz&&fl3`mQ3h#HMOkX z>f`DSZj)N#^jVb~eq!FuL=9E%&z-juA3E)VtJZb z|FiuO^ss{7oDb+yGGkIRL`|V*u{~nt*o(V*n7~ z)q^O&b$}dzdjKSWVSq7!_W;`f^uTj|ZUAY3d3vCaGAIsE9H2Nrae(3g#ex5e1HS{( CE)gaG literal 0 HcmV?d00001 diff --git a/src/egs_game.erl b/src/egs_game.erl index 85e2936..0690b50 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -611,12 +611,15 @@ handle(16#0402, _, _, _, _) -> %% Spaceports and my room are handled differently than normal lobbies. %% @todo Load 'Your room' correctly. %% @todo When changing lobby to the room, 0230 must also be sent. Same when going from room to lobby. +%% @todo The mission loading here is a temporary one-mission only choice. handle(16#0807, CSocket, GID, _, Orig) -> << _:352, Quest:32/little-unsigned-integer, MapType:16/little-unsigned-integer, MapNumber:16/little-unsigned-integer, MapEntry:16/little-unsigned-integer, _/bits >> = Orig, log(GID, "lobby change (~b,~b,~b,~b)", [Quest,MapType, MapNumber, MapEntry]), case {Quest, MapType, MapNumber, MapEntry} of + {1000013, _, _, _} -> + mission_load(CSocket, GID, 1000013, 0, 1121, 0); {1104000, 0, 900, 0} -> spaceport_load(CSocket, GID, Quest, MapType, MapNumber, MapEntry); {1120000, _, _, _} -> @@ -640,13 +643,18 @@ handle(16#0812, CSocket, GID, _, _) -> [QuestID, ZoneID] = proplists:get_value(User#users.quest, ?COUNTERS, [1100000, 0]), lobby_load(CSocket, GID, QuestID, ZoneID, User#users.maptype, User#users.mapnumber); -%% @doc Start mission handler. Packet contains the selected mission number. +%% @doc Start mission handler. %% @todo Load more than one mission. +%% @todo Forward the mission start to other players of the same party, whatever their location is. -handle(16#0c01, CSocket, GID, _, _) -> +handle(16#0c01, CSocket, GID, _, Orig) -> + << _:352, Quest:32/little-unsigned-integer >> = Orig, + log(GID, "start mission ~b", [Quest]), + send_packet_170c(CSocket, GID), + egs_proto:packet_send(CSocket, << 16#10200300:32, 0:160, 16#00011300:32, GID:32/little-unsigned-integer, 0:64 >>), + send_packet_1015(CSocket), Packet = << 16#0c020300:32, 0:160, 16#00011300:32, GID:32/little-unsigned-integer, 0:96 >>, - egs_proto:packet_send(CSocket, Packet), - mission_load(CSocket, GID, 1000013, 0, 1121, 0); % load test mission! + egs_proto:packet_send(CSocket, Packet); %% @doc Counter quests files request handler? Send huge number of quest files. %% @todo Handle correctly. @@ -662,6 +670,13 @@ handle(16#0c07, CSocket, GID, _, _) -> Packet = << 16#0c080300:32, 16#ffff0000:32, 0:128, 16#00011300:32, GID:32/little-unsigned-integer, 0:96 >>, egs_proto:packet_send(CSocket, Packet); +%% @doc Abort mission handler. +%% @todo Warp the player to the lobby if he's in a mission. No need if he's in a counter though. + +handle(16#0c0e, CSocket, GID, _, _) -> + Packet = << 16#10060300:32, 0:160, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, 16#0b000000:32 >>, + egs_proto:packet_send(CSocket, Packet); + %% @doc Counter available mission list request handler. %% @todo Temporarily allow rare mission and LL all difficulties to all players. @@ -733,12 +748,9 @@ handle(16#1709, CSocket, GID, _, _) -> egs_proto:packet_send(CSocket, Packet); %% @doc Counter-related handler. -%% @todo Find what the heck this packet is. handle(16#170b, CSocket, GID, _, _) -> - {ok, File} = file:read_file("p/packet170c.bin"), - Packet = << 16#170c0300:32, 0:160, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, File/binary >>, - egs_proto:packet_send(CSocket, Packet); + send_packet_170c(CSocket, GID); %% @doc Counter initialization handler? %% @todo Handle correctly. @@ -960,6 +972,11 @@ send_packet_1006(CSocket, GID, N) -> Packet = << 16#10060300:32, 0:160, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, N:32/little-unsigned-integer >>, egs_proto:packet_send(CSocket, Packet). +%% @todo Handle correctly. + +send_packet_1015(CSocket) -> + myroom_send_packet(CSocket, "p/packet1015_mission.bin"). + %% @todo Figure out what this packet does. Sane values for counter and missions for now. send_packet_1202(CSocket, GID) -> @@ -998,6 +1015,13 @@ send_packet_1512(CSocket, GID) -> Packet = << 16#15120300:32, 0:160, 16#00011300:32, GID:32/little-unsigned-integer, 0:46144 >>, egs_proto:packet_send(CSocket, Packet). +%% @todo Find what the heck this packet is. + +send_packet_170c(CSocket, GID) -> + {ok, File} = file:read_file("p/packet170c.bin"), + Packet = << 16#170c0300:32, 0:160, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, File/binary >>, + egs_proto:packet_send(CSocket, Packet). + %% @todo Figure out what the other things are and do it right. %% @todo Temporarily send 233 until the correct process is figured out. %% Should be something along the lines of 203 201 204.