ServerPackets.cs 199 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.IO;
  5. namespace ServerPackets
  6. {
  7. public sealed class KeepAlive : Packet
  8. {
  9. public override ushort Index
  10. {
  11. get { return (ushort)ServerPacketIds.KeepAlive; }
  12. }
  13. public long Time;
  14. protected override void ReadPacket(BinaryReader reader)
  15. {
  16. Time = reader.ReadInt64();
  17. }
  18. protected override void WritePacket(BinaryWriter writer)
  19. {
  20. writer.Write(Time);
  21. }
  22. }
  23. public sealed class Connected : Packet
  24. {
  25. public override ushort Index
  26. {
  27. get { return (ushort)ServerPacketIds.Connected; }
  28. }
  29. protected override void ReadPacket(BinaryReader reader)
  30. {
  31. }
  32. protected override void WritePacket(BinaryWriter writer)
  33. {
  34. }
  35. }
  36. public sealed class ClientHP : Packet
  37. {
  38. public override ushort Index
  39. {
  40. get { return (ushort)ServerPacketIds.ClientHP; }
  41. }
  42. protected override void ReadPacket(BinaryReader reader)
  43. {
  44. }
  45. protected override void WritePacket(BinaryWriter writer)
  46. {
  47. }
  48. }
  49. public sealed class ClientVersion : Packet
  50. {
  51. public override ushort Index
  52. {
  53. get { return (ushort)ServerPacketIds.ClientVersion; }
  54. }
  55. public byte Result;
  56. /*
  57. * 0: Wrong Version
  58. * 1: Correct Version
  59. */
  60. protected override void ReadPacket(BinaryReader reader)
  61. {
  62. Result = reader.ReadByte();
  63. }
  64. protected override void WritePacket(BinaryWriter writer)
  65. {
  66. writer.Write(Result);
  67. }
  68. }
  69. public sealed class Disconnect : Packet
  70. {
  71. public override ushort Index
  72. {
  73. get { return (ushort)ServerPacketIds.Disconnect; }
  74. }
  75. public byte Reason;
  76. /*
  77. * 0: Server Closing.
  78. * 1: Another User.
  79. * 2: Packet Error.
  80. * 3: Server Crashed.
  81. */
  82. protected override void ReadPacket(BinaryReader reader)
  83. {
  84. Reason = reader.ReadByte();
  85. }
  86. protected override void WritePacket(BinaryWriter writer)
  87. {
  88. writer.Write(Reason);
  89. }
  90. }
  91. public sealed class HookSuspicionMsg : Packet
  92. {
  93. public override ushort Index
  94. {
  95. get { return (ushort)ServerPacketIds.HookSuspicionMsg; }
  96. }
  97. public string Question;
  98. public List<string> Options = new List<string>();
  99. public long StartTime;
  100. public int AnswerIndex;
  101. public bool IsPrisonQuestion;
  102. protected override void ReadPacket(BinaryReader reader)
  103. {
  104. Question=reader.ReadString();
  105. var count=reader.ReadInt32();
  106. for (int i = 0; i < count; i++)
  107. {
  108. Options.Add(reader.ReadString());
  109. }
  110. StartTime = reader.ReadInt64();
  111. IsPrisonQuestion=reader.ReadBoolean();
  112. }
  113. protected override void WritePacket(BinaryWriter writer)
  114. {
  115. writer.Write(Question);
  116. writer.Write(Options.Count);
  117. for (int i = 0; i < Options.Count; i++)
  118. {
  119. writer.Write(Options[i]);
  120. }
  121. writer.Write(StartTime);
  122. writer.Write(IsPrisonQuestion);
  123. }
  124. }
  125. public sealed class HookSuspicionMsgFailure : Packet
  126. {
  127. public override ushort Index
  128. {
  129. get { return (ushort)ServerPacketIds.HookSuspicionMsgFailure; }
  130. }
  131. protected override void ReadPacket(BinaryReader reader)
  132. {
  133. }
  134. protected override void WritePacket(BinaryWriter writer)
  135. {
  136. }
  137. }
  138. public sealed class NewAccount : Packet
  139. {
  140. public override ushort Index
  141. {
  142. get { return (ushort)ServerPacketIds.NewAccount; }
  143. }
  144. public byte Result;
  145. /*
  146. * 0: Disabled
  147. * 1: Bad AccountID
  148. * 2: Bad Password
  149. * 3: Bad Email
  150. * 4: Bad Name
  151. * 5: Bad Question
  152. * 6: Bad Answer
  153. * 7: Account Exists.
  154. * 8: Success
  155. */
  156. protected override void ReadPacket(BinaryReader reader)
  157. {
  158. Result = reader.ReadByte();
  159. }
  160. protected override void WritePacket(BinaryWriter writer)
  161. {
  162. writer.Write(Result);
  163. }
  164. }
  165. public sealed class ChangePassword : Packet
  166. {
  167. public override ushort Index
  168. {
  169. get { return (ushort)ServerPacketIds.ChangePassword; }
  170. }
  171. public byte Result;
  172. /*
  173. * 0: Disabled
  174. * 1: Bad AccountID
  175. * 2: Bad Current Password
  176. * 3: Bad New Password
  177. * 4: Account Not Exist
  178. * 5: Wrong Password
  179. * 6: Success
  180. */
  181. protected override void ReadPacket(BinaryReader reader)
  182. {
  183. Result = reader.ReadByte();
  184. }
  185. protected override void WritePacket(BinaryWriter writer)
  186. {
  187. writer.Write(Result);
  188. }
  189. }
  190. public sealed class ChangePasswordBanned : Packet
  191. {
  192. public override ushort Index
  193. {
  194. get { return (ushort)ServerPacketIds.ChangePasswordBanned; }
  195. }
  196. public string Reason = string.Empty;
  197. public DateTime ExpiryDate;
  198. protected override void ReadPacket(BinaryReader reader)
  199. {
  200. Reason = reader.ReadString();
  201. ExpiryDate = DateTime.FromBinary(reader.ReadInt64());
  202. }
  203. protected override void WritePacket(BinaryWriter writer)
  204. {
  205. writer.Write(Reason);
  206. writer.Write(ExpiryDate.ToBinary());
  207. }
  208. }
  209. public sealed class Login : Packet
  210. {
  211. public override ushort Index
  212. {
  213. get { return (ushort)ServerPacketIds.Login; }
  214. }
  215. public byte Result;
  216. /*
  217. * 0: Disabled
  218. * 1: Bad AccountID
  219. * 2: Bad Password
  220. * 3: Account Not Exist
  221. * 4: Wrong Password
  222. */
  223. protected override void ReadPacket(BinaryReader reader)
  224. {
  225. Result = reader.ReadByte();
  226. }
  227. protected override void WritePacket(BinaryWriter writer)
  228. {
  229. writer.Write(Result);
  230. }
  231. }
  232. public sealed class LoginBanned : Packet
  233. {
  234. public override ushort Index
  235. {
  236. get { return (ushort)ServerPacketIds.LoginBanned; }
  237. }
  238. public string Reason = string.Empty;
  239. public DateTime ExpiryDate;
  240. protected override void ReadPacket(BinaryReader reader)
  241. {
  242. Reason = reader.ReadString();
  243. ExpiryDate = DateTime.FromBinary(reader.ReadInt64());
  244. }
  245. protected override void WritePacket(BinaryWriter writer)
  246. {
  247. writer.Write(string.IsNullOrEmpty(Reason)?"":Reason);
  248. writer.Write(ExpiryDate.ToBinary());
  249. }
  250. }
  251. public sealed class LoginSuccess : Packet
  252. {
  253. public override ushort Index
  254. {
  255. get { return (ushort)ServerPacketIds.LoginSuccess; }
  256. }
  257. public List<SelectInfo> Characters = new List<SelectInfo>();
  258. protected override void ReadPacket(BinaryReader reader)
  259. {
  260. int count = reader.ReadInt32();
  261. for (int i = 0; i < count; i++)
  262. Characters.Add(new SelectInfo(reader));
  263. }
  264. protected override void WritePacket(BinaryWriter writer)
  265. {
  266. writer.Write(Characters.Count);
  267. for (int i = 0; i < Characters.Count; i++)
  268. Characters[i].Save(writer);
  269. }
  270. }
  271. public sealed class NewCharacter : Packet
  272. {
  273. public override ushort Index
  274. {
  275. get { return (ushort)ServerPacketIds.NewCharacter; }
  276. }
  277. /*
  278. * 0: Disabled.
  279. * 1: Bad Character Name
  280. * 2: Bad Gender
  281. * 3: Bad Class
  282. * 4: Max Characters
  283. * 5: Character Exists.
  284. * */
  285. public byte Result;
  286. protected override void ReadPacket(BinaryReader reader)
  287. {
  288. Result = reader.ReadByte();
  289. }
  290. protected override void WritePacket(BinaryWriter writer)
  291. {
  292. writer.Write(Result);
  293. }
  294. }
  295. public sealed class NewCharacterSuccess : Packet
  296. {
  297. public override ushort Index
  298. {
  299. get { return (ushort)ServerPacketIds.NewCharacterSuccess; }
  300. }
  301. public SelectInfo CharInfo;
  302. protected override void ReadPacket(BinaryReader reader)
  303. {
  304. CharInfo = new SelectInfo(reader);
  305. }
  306. protected override void WritePacket(BinaryWriter writer)
  307. {
  308. CharInfo.Save(writer);
  309. }
  310. }
  311. public sealed class DeleteCharacter : Packet
  312. {
  313. public override ushort Index
  314. {
  315. get { return (ushort)ServerPacketIds.DeleteCharacter; }
  316. }
  317. public byte Result;
  318. /*
  319. * 0: Disabled.
  320. * 1: Character Not Found
  321. * */
  322. protected override void ReadPacket(BinaryReader reader)
  323. {
  324. Result = reader.ReadByte();
  325. }
  326. protected override void WritePacket(BinaryWriter writer)
  327. {
  328. writer.Write(Result);
  329. }
  330. }
  331. public sealed class DeleteCharacterSuccess : Packet
  332. {
  333. public override ushort Index
  334. {
  335. get { return (ushort)ServerPacketIds.DeleteCharacterSuccess; }
  336. }
  337. public int CharacterIndex;
  338. protected override void ReadPacket(BinaryReader reader)
  339. {
  340. CharacterIndex = reader.ReadInt32();
  341. }
  342. protected override void WritePacket(BinaryWriter writer)
  343. {
  344. writer.Write(CharacterIndex);
  345. }
  346. }
  347. public sealed class StartGame : Packet
  348. {
  349. public override ushort Index
  350. {
  351. get { return (ushort)ServerPacketIds.StartGame; }
  352. }
  353. public byte Result;
  354. public int Resolution;
  355. public int SessionID;
  356. /*
  357. * 0: Disabled.
  358. * 1: Not logged in
  359. * 2: Character not found.
  360. * 3: Start Game Error
  361. * */
  362. protected override void ReadPacket(BinaryReader reader)
  363. {
  364. Result = reader.ReadByte();
  365. Resolution = reader.ReadInt32();
  366. SessionID = reader.ReadInt32();
  367. }
  368. protected override void WritePacket(BinaryWriter writer)
  369. {
  370. writer.Write(Result);
  371. writer.Write(Resolution);
  372. writer.Write(SessionID);
  373. }
  374. }
  375. public sealed class StartGameBanned : Packet
  376. {
  377. public override ushort Index
  378. {
  379. get { return (ushort)ServerPacketIds.StartGameBanned; }
  380. }
  381. public string Reason = string.Empty;
  382. public DateTime ExpiryDate;
  383. protected override void ReadPacket(BinaryReader reader)
  384. {
  385. Reason = reader.ReadString();
  386. ExpiryDate = DateTime.FromBinary(reader.ReadInt64());
  387. }
  388. protected override void WritePacket(BinaryWriter writer)
  389. {
  390. writer.Write(Reason);
  391. writer.Write(ExpiryDate.ToBinary());
  392. }
  393. }
  394. public sealed class StartGameDelay : Packet
  395. {
  396. public override ushort Index
  397. {
  398. get { return (ushort)ServerPacketIds.StartGameDelay; }
  399. }
  400. public long Milliseconds;
  401. protected override void ReadPacket(BinaryReader reader)
  402. {
  403. Milliseconds = reader.ReadInt64();
  404. }
  405. protected override void WritePacket(BinaryWriter writer)
  406. {
  407. writer.Write(Milliseconds);
  408. }
  409. }
  410. public sealed class MapInformation : Packet
  411. {
  412. public override ushort Index
  413. {
  414. get { return (ushort)ServerPacketIds.MapInformation; }
  415. }
  416. public string FileName = string.Empty;
  417. public string Title = string.Empty;
  418. public ushort MiniMap, BigMap, Music;
  419. public LightSetting Lights;
  420. public bool Lightning, Fire;
  421. public byte MapDarkLight;
  422. public int MapIndex;
  423. protected override void ReadPacket(BinaryReader reader)
  424. {
  425. FileName = reader.ReadString();
  426. Title = reader.ReadString();
  427. MiniMap = reader.ReadUInt16();
  428. BigMap = reader.ReadUInt16();
  429. Lights = (LightSetting)reader.ReadByte();
  430. byte bools = reader.ReadByte();
  431. if ((bools & 0x01) == 0x01) Lightning = true;
  432. if ((bools & 0x02) == 0x02) Fire = true;
  433. MapDarkLight = reader.ReadByte();
  434. Music = reader.ReadUInt16();
  435. MapIndex = reader.ReadInt32();
  436. }
  437. protected override void WritePacket(BinaryWriter writer)
  438. {
  439. writer.Write(FileName);
  440. writer.Write(Title);
  441. writer.Write(MiniMap);
  442. writer.Write(BigMap);
  443. writer.Write((byte)Lights);
  444. byte bools = 0;
  445. bools |= (byte)(Lightning ? 0x01 : 0);
  446. bools |= (byte)(Fire ? 0x02 : 0);
  447. writer.Write(bools);
  448. writer.Write(MapDarkLight);
  449. writer.Write(Music);
  450. writer.Write(MapIndex);
  451. }
  452. }
  453. public sealed class UserInformation : Packet
  454. {
  455. public override ushort Index
  456. {
  457. get { return (ushort)ServerPacketIds.UserInformation; }
  458. }
  459. public uint ObjectID;
  460. public uint RealId;
  461. public string Name = string.Empty;
  462. public string GuildName = string.Empty;
  463. public string GuildRank = string.Empty;
  464. public Color NameColor;
  465. public MirClass Class;
  466. public MirGender Gender;
  467. public ushort Level;
  468. public Point Location;
  469. public MirDirection Direction;
  470. public byte Hair;
  471. public byte HR;
  472. public byte HG;
  473. public byte HB;
  474. public byte IR;
  475. public byte IG;
  476. public byte IB;
  477. public byte Emtype;
  478. public ushort HP, MP;
  479. public uint MaxHP;
  480. public long Experience, MaxExperience;
  481. public ushort LevelBonus;
  482. public ushort ExtraHP;
  483. public ushort ExtraMP;
  484. public ushort ExtraAC;
  485. public ushort ExtraMAC;
  486. public ushort ExtraDC;
  487. public ushort ExtraMC;
  488. public ushort ExtraSC;
  489. public ushort ExtraFire;
  490. public ushort ExtraIce;
  491. public ushort ExtraLight;
  492. public ushort ExtraWind;
  493. public ushort ExtraHoly;
  494. public ushort ExtraDark;
  495. public ushort ExtraPhantom;
  496. public bool AllowTrade; //是否开启交易状态
  497. public LevelEffects LevelEffects;
  498. public UserItem[] Inventory, Equipment;
  499. public uint Gold, Credit;
  500. public ushort Job;
  501. public ushort JobLevel;
  502. public long JobExp;
  503. public List<ClientMagic> Magics = new List<ClientMagic>();
  504. public List<ClientIntelligentCreature> IntelligentCreatures = new List<ClientIntelligentCreature>();//IntelligentCreature
  505. public IntelligentCreatureType SummonedCreatureType = IntelligentCreatureType.None;//IntelligentCreature
  506. public bool CreatureSummoned;//IntelligentCreature
  507. protected override void ReadPacket(BinaryReader reader)
  508. {
  509. ObjectID = reader.ReadUInt32();
  510. RealId = reader.ReadUInt32();
  511. Name = reader.ReadString();
  512. GuildName = reader.ReadString();
  513. GuildRank = reader.ReadString();
  514. NameColor = Color.FromArgb(reader.ReadInt32());
  515. Class = (MirClass)reader.ReadByte();
  516. Gender = (MirGender)reader.ReadByte();
  517. Level = reader.ReadUInt16();
  518. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  519. Direction = (MirDirection)reader.ReadByte();
  520. Hair = reader.ReadByte();
  521. HR = reader.ReadByte();
  522. HG = reader.ReadByte();
  523. HB = reader.ReadByte();
  524. IR = reader.ReadByte();
  525. IG = reader.ReadByte();
  526. IB = reader.ReadByte();
  527. Emtype = reader.ReadByte();
  528. HP = reader.ReadUInt16();
  529. MaxHP = reader.ReadUInt32();
  530. MP = reader.ReadUInt16();
  531. Experience = reader.ReadInt64();
  532. MaxExperience = reader.ReadInt64();
  533. LevelBonus = reader.ReadUInt16();
  534. ExtraHP = reader.ReadUInt16();
  535. ExtraMP = reader.ReadUInt16();
  536. ExtraAC = reader.ReadUInt16();
  537. ExtraMAC = reader.ReadUInt16();
  538. ExtraDC = reader.ReadUInt16();
  539. ExtraMC = reader.ReadUInt16();
  540. ExtraSC = reader.ReadUInt16();
  541. ExtraFire = reader.ReadUInt16();
  542. ExtraIce = reader.ReadUInt16();
  543. ExtraLight = reader.ReadUInt16();
  544. ExtraWind = reader.ReadUInt16();
  545. ExtraHoly = reader.ReadUInt16();
  546. ExtraDark = reader.ReadUInt16();
  547. ExtraPhantom = reader.ReadUInt16();
  548. AllowTrade = reader.ReadBoolean();
  549. Job = reader.ReadUInt16();
  550. JobLevel = reader.ReadUInt16();
  551. JobExp = reader.ReadInt64();
  552. LevelEffects = (LevelEffects)reader.ReadByte();
  553. if (reader.ReadBoolean())
  554. {
  555. Inventory = new UserItem[reader.ReadInt32()];
  556. for (int i = 0; i < Inventory.Length; i++)
  557. {
  558. if (!reader.ReadBoolean()) continue;
  559. Inventory[i] = new UserItem(reader);
  560. }
  561. }
  562. if (reader.ReadBoolean())
  563. {
  564. Equipment = new UserItem[reader.ReadInt32()];
  565. for (int i = 0; i < Equipment.Length; i++)
  566. {
  567. if (!reader.ReadBoolean()) continue;
  568. Equipment[i] = new UserItem(reader);
  569. }
  570. }
  571. //if (reader.ReadBoolean())
  572. //{
  573. // QuestInventory = new UserItem[reader.ReadInt32()];
  574. // for (int i = 0; i < QuestInventory.Length; i++)
  575. // {
  576. // if (!reader.ReadBoolean()) continue;
  577. // QuestInventory[i] = new UserItem(reader);
  578. // }
  579. //}
  580. Gold = reader.ReadUInt32();
  581. Credit = reader.ReadUInt32();
  582. int count = reader.ReadInt32();
  583. for (int i = 0; i < count; i++)
  584. Magics.Add(new ClientMagic(reader));
  585. //IntelligentCreature
  586. count = reader.ReadInt32();
  587. for (int i = 0; i < count; i++)
  588. IntelligentCreatures.Add(new ClientIntelligentCreature(reader));
  589. SummonedCreatureType = (IntelligentCreatureType)reader.ReadByte();
  590. CreatureSummoned = reader.ReadBoolean();
  591. }
  592. protected override void WritePacket(BinaryWriter writer)
  593. {
  594. writer.Write(ObjectID);
  595. writer.Write(RealId);
  596. writer.Write(Name);
  597. writer.Write(GuildName);
  598. writer.Write(GuildRank);
  599. writer.Write(NameColor.ToArgb());
  600. writer.Write((byte)Class);
  601. writer.Write((byte)Gender);
  602. writer.Write(Level);
  603. writer.Write(Location.X);
  604. writer.Write(Location.Y);
  605. writer.Write((byte)Direction);
  606. writer.Write(Hair);
  607. writer.Write(HR);
  608. writer.Write(HG);
  609. writer.Write(HB);
  610. writer.Write(IR);
  611. writer.Write(IG);
  612. writer.Write(IB);
  613. writer.Write(Emtype);
  614. writer.Write(HP);
  615. writer.Write(MaxHP);
  616. writer.Write(MP);
  617. writer.Write(Experience);
  618. writer.Write(MaxExperience);
  619. writer.Write(LevelBonus);
  620. writer.Write(ExtraHP);
  621. writer.Write(ExtraMP);
  622. writer.Write(ExtraAC);
  623. writer.Write(ExtraMAC);
  624. writer.Write(ExtraDC);
  625. writer.Write(ExtraMC);
  626. writer.Write(ExtraSC);
  627. writer.Write(ExtraFire);
  628. writer.Write(ExtraIce);
  629. writer.Write(ExtraLight);
  630. writer.Write(ExtraWind);
  631. writer.Write(ExtraHoly);
  632. writer.Write(ExtraDark);
  633. writer.Write(ExtraPhantom);
  634. writer.Write(AllowTrade);
  635. writer.Write(Job);
  636. writer.Write(JobLevel);
  637. writer.Write(JobExp);
  638. writer.Write((byte)LevelEffects);
  639. writer.Write(Inventory != null);
  640. if (Inventory != null)
  641. {
  642. writer.Write(Inventory.Length);
  643. for (int i = 0; i < Inventory.Length; i++)
  644. {
  645. writer.Write(Inventory[i] != null);
  646. if (Inventory[i] == null) continue;
  647. Inventory[i].Save(writer);
  648. }
  649. }
  650. writer.Write(Equipment != null);
  651. if (Equipment != null)
  652. {
  653. writer.Write(Equipment.Length);
  654. for (int i = 0; i < Equipment.Length; i++)
  655. {
  656. writer.Write(Equipment[i] != null);
  657. if (Equipment[i] == null) continue;
  658. Equipment[i].Save(writer);
  659. }
  660. }
  661. //writer.Write(QuestInventory != null);
  662. //if (QuestInventory != null)
  663. //{
  664. // writer.Write(QuestInventory.Length);
  665. // for (int i = 0; i < QuestInventory.Length; i++)
  666. // {
  667. // writer.Write(QuestInventory[i] != null);
  668. // if (QuestInventory[i] == null) continue;
  669. // QuestInventory[i].Save(writer);
  670. // }
  671. //}
  672. writer.Write(Gold);
  673. writer.Write(Credit);
  674. writer.Write(Magics.Count);
  675. for (int i = 0; i < Magics.Count; i++)
  676. Magics[i].Save(writer);
  677. //IntelligentCreature
  678. writer.Write(IntelligentCreatures.Count);
  679. for (int i = 0; i < IntelligentCreatures.Count; i++)
  680. IntelligentCreatures[i].Save(writer);
  681. writer.Write((byte)SummonedCreatureType);
  682. writer.Write(CreatureSummoned);
  683. }
  684. }
  685. public sealed class UserLocation : Packet
  686. {
  687. public override ushort Index
  688. {
  689. get { return (ushort)ServerPacketIds.UserLocation; }
  690. }
  691. public Point Location;
  692. public MirDirection Direction;
  693. protected override void ReadPacket(BinaryReader reader)
  694. {
  695. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  696. Direction = (MirDirection)reader.ReadByte();
  697. }
  698. protected override void WritePacket(BinaryWriter writer)
  699. {
  700. writer.Write(Location.X);
  701. writer.Write(Location.Y);
  702. writer.Write((byte)Direction);
  703. }
  704. }
  705. public sealed class ObjectPlayer : Packet
  706. {
  707. public override ushort Index
  708. {
  709. get { return (ushort)ServerPacketIds.ObjectPlayer; }
  710. }
  711. public uint ObjectID;
  712. public string Name = string.Empty;
  713. public string GuildName = string.Empty;
  714. public string GuildRankName = string.Empty;
  715. public Color NameColor;
  716. public MirClass Class;
  717. public MirGender Gender;
  718. public ushort Level;
  719. public Point Location;
  720. public MirDirection Direction;
  721. public byte Hair, HR, HG, HB;
  722. public byte Light;
  723. public short Weapon, Armour, Helmet;
  724. public byte IR, IG, IB;
  725. public byte Emtype;
  726. public byte AmultShape;
  727. public PoisonType Poison;
  728. public bool Dead, Hidden, SpHidden;
  729. public SpellEffect Effect;
  730. public byte WingEffect;
  731. public bool Extra;
  732. public short MountType;
  733. public bool RidingMount;
  734. public bool Fishing;
  735. public short TransformType;
  736. public uint ElementOrbEffect;
  737. public uint ElementOrbLvl;
  738. public uint ElementOrbMax;
  739. public LevelEffects LevelEffects;
  740. public List<BuffType> Buffs = new List<BuffType>();
  741. public uint Hp, MaxHp;
  742. protected override void ReadPacket(BinaryReader reader)
  743. {
  744. ObjectID = reader.ReadUInt32();
  745. Name = reader.ReadString();
  746. GuildName = reader.ReadString();
  747. GuildRankName = reader.ReadString();
  748. NameColor = Color.FromArgb(reader.ReadInt32());
  749. Class = (MirClass)reader.ReadByte();
  750. Gender = (MirGender)reader.ReadByte();
  751. Level = reader.ReadUInt16();
  752. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  753. Direction = (MirDirection)reader.ReadByte();
  754. Hair = reader.ReadByte();
  755. HR = reader.ReadByte();
  756. HG = reader.ReadByte();
  757. HB = reader.ReadByte();
  758. IR = reader.ReadByte();
  759. IG = reader.ReadByte();
  760. IB = reader.ReadByte();
  761. Emtype = reader.ReadByte();
  762. AmultShape = reader.ReadByte();
  763. Light = reader.ReadByte();
  764. Weapon = reader.ReadInt16();
  765. Armour = reader.ReadInt16();
  766. Helmet = reader.ReadInt16();
  767. Poison = (PoisonType)reader.ReadUInt16();
  768. Dead = reader.ReadBoolean();
  769. Hidden = reader.ReadBoolean();
  770. SpHidden = reader.ReadBoolean();
  771. Effect = (SpellEffect)reader.ReadByte();
  772. WingEffect = reader.ReadByte();
  773. Extra = reader.ReadBoolean();
  774. MountType = reader.ReadInt16();
  775. RidingMount = reader.ReadBoolean();
  776. Fishing = reader.ReadBoolean();
  777. TransformType = reader.ReadInt16();
  778. ElementOrbEffect = reader.ReadUInt32();
  779. ElementOrbLvl = reader.ReadUInt32();
  780. ElementOrbMax = reader.ReadUInt32();
  781. int count = reader.ReadInt32();
  782. for (int i = 0; i < count; i++)
  783. {
  784. Buffs.Add((BuffType)reader.ReadByte());
  785. }
  786. LevelEffects = (LevelEffects)reader.ReadByte();
  787. Hp = reader.ReadUInt32();
  788. MaxHp = reader.ReadUInt32();
  789. }
  790. protected override void WritePacket(BinaryWriter writer)
  791. {
  792. writer.Write(ObjectID);
  793. writer.Write(Name);
  794. writer.Write(GuildName);
  795. writer.Write(GuildRankName);
  796. writer.Write(NameColor.ToArgb());
  797. writer.Write((byte)Class);
  798. writer.Write((byte)Gender);
  799. writer.Write(Level);
  800. writer.Write(Location.X);
  801. writer.Write(Location.Y);
  802. writer.Write((byte)Direction);
  803. writer.Write(Hair);
  804. writer.Write(HR);
  805. writer.Write(HG);
  806. writer.Write(HB);
  807. writer.Write(IR);
  808. writer.Write(IG);
  809. writer.Write(IB);
  810. writer.Write(Emtype);
  811. writer.Write(AmultShape);
  812. writer.Write(Light);
  813. writer.Write(Weapon);
  814. writer.Write(Armour);
  815. writer.Write(Helmet);
  816. writer.Write((ushort)Poison);
  817. writer.Write(Dead);
  818. writer.Write(Hidden);
  819. writer.Write(SpHidden);
  820. writer.Write((byte)Effect);
  821. writer.Write(WingEffect);
  822. writer.Write(Extra);
  823. writer.Write(MountType);
  824. writer.Write(RidingMount);
  825. writer.Write(Fishing);
  826. writer.Write(TransformType);
  827. writer.Write(ElementOrbEffect);
  828. writer.Write(ElementOrbLvl);
  829. writer.Write(ElementOrbMax);
  830. writer.Write(Buffs.Count);
  831. for (int i = 0; i < Buffs.Count; i++)
  832. {
  833. writer.Write((byte)Buffs[i]);
  834. }
  835. writer.Write((byte)LevelEffects);
  836. writer.Write(Hp);
  837. writer.Write(MaxHp);
  838. }
  839. }
  840. public sealed class ObjectRemove : Packet
  841. {
  842. public override ushort Index
  843. {
  844. get { return (ushort)ServerPacketIds.ObjectRemove; }
  845. }
  846. public uint ObjectID;
  847. protected override void ReadPacket(BinaryReader reader)
  848. {
  849. ObjectID = reader.ReadUInt32();
  850. }
  851. protected override void WritePacket(BinaryWriter writer)
  852. {
  853. writer.Write(ObjectID);
  854. }
  855. }
  856. public sealed class ObjectTurn : Packet
  857. {
  858. public override ushort Index
  859. {
  860. get { return (ushort)ServerPacketIds.ObjectTurn; }
  861. }
  862. public uint ObjectID;
  863. public Point Location;
  864. public MirDirection Direction;
  865. protected override void ReadPacket(BinaryReader reader)
  866. {
  867. ObjectID = reader.ReadUInt32();
  868. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  869. Direction = (MirDirection)reader.ReadByte();
  870. }
  871. protected override void WritePacket(BinaryWriter writer)
  872. {
  873. writer.Write(ObjectID);
  874. writer.Write(Location.X);
  875. writer.Write(Location.Y);
  876. writer.Write((byte)Direction);
  877. }
  878. }
  879. public sealed class ObjectWalk : Packet
  880. {
  881. public override ushort Index
  882. {
  883. get { return (ushort)ServerPacketIds.ObjectWalk; }
  884. }
  885. public uint ObjectID;
  886. public Point Location;
  887. public MirDirection Direction;
  888. protected override void ReadPacket(BinaryReader reader)
  889. {
  890. ObjectID = reader.ReadUInt32();
  891. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  892. Direction = (MirDirection)reader.ReadByte();
  893. }
  894. protected override void WritePacket(BinaryWriter writer)
  895. {
  896. writer.Write(ObjectID);
  897. writer.Write(Location.X);
  898. writer.Write(Location.Y);
  899. writer.Write((byte)Direction);
  900. }
  901. }
  902. public sealed class ObjectRun : Packet
  903. {
  904. public override ushort Index
  905. {
  906. get { return (ushort)ServerPacketIds.ObjectRun; }
  907. }
  908. public uint ObjectID;
  909. public Point Location;
  910. public MirDirection Direction;
  911. protected override void ReadPacket(BinaryReader reader)
  912. {
  913. ObjectID = reader.ReadUInt32();
  914. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  915. Direction = (MirDirection)reader.ReadByte();
  916. }
  917. protected override void WritePacket(BinaryWriter writer)
  918. {
  919. writer.Write(ObjectID);
  920. writer.Write(Location.X);
  921. writer.Write(Location.Y);
  922. writer.Write((byte)Direction);
  923. }
  924. }
  925. public sealed class Chat : Packet
  926. {
  927. public override ushort Index
  928. {
  929. get { return (ushort)ServerPacketIds.Chat; }
  930. }
  931. public string Message = string.Empty;
  932. public ChatType Type;
  933. protected override void ReadPacket(BinaryReader reader)
  934. {
  935. Message = reader.ReadString();
  936. Type = (ChatType)reader.ReadByte();
  937. }
  938. protected override void WritePacket(BinaryWriter writer)
  939. {
  940. writer.Write(Message);
  941. writer.Write((byte)Type);
  942. }
  943. }
  944. public sealed class ObjectChat : Packet
  945. {
  946. public override ushort Index
  947. {
  948. get { return (ushort)ServerPacketIds.ObjectChat; }
  949. }
  950. public uint ObjectID;
  951. public string Text = string.Empty;
  952. public ChatType Type;
  953. public ulong UniqueID1;
  954. public ulong UniqueID2;
  955. public ulong UniqueID3;
  956. public string Name1 = string.Empty;
  957. public string Name2 = string.Empty;
  958. public string Name3 = string.Empty;
  959. public Color Color1 = Color.White;
  960. public Color Color2 = Color.White;
  961. public Color Color3 = Color.White;
  962. protected override void ReadPacket(BinaryReader reader)
  963. {
  964. ObjectID = reader.ReadUInt32();
  965. Text = reader.ReadString();
  966. Type = (ChatType)reader.ReadByte();
  967. UniqueID1 = reader.ReadUInt64();
  968. UniqueID2 = reader.ReadUInt64();
  969. UniqueID3 = reader.ReadUInt64();
  970. Name1 = reader.ReadString();
  971. Name2 = reader.ReadString();
  972. Name3 = reader.ReadString();
  973. Color1 = Color.FromArgb(reader.ReadInt32());
  974. Color2 = Color.FromArgb(reader.ReadInt32());
  975. Color3 = Color.FromArgb(reader.ReadInt32());
  976. }
  977. protected override void WritePacket(BinaryWriter writer)
  978. {
  979. writer.Write(ObjectID);
  980. writer.Write(Text);
  981. writer.Write((byte)Type);
  982. writer.Write(UniqueID1);
  983. writer.Write(UniqueID2);
  984. writer.Write(UniqueID3);
  985. writer.Write(Name1);
  986. writer.Write(Name2);
  987. writer.Write(Name3);
  988. writer.Write(Color1.ToArgb());
  989. writer.Write(Color2.ToArgb());
  990. writer.Write(Color3.ToArgb());
  991. }
  992. }
  993. public sealed class NewItemInfo : Packet
  994. {
  995. public override ushort Index
  996. {
  997. get { return (ushort)ServerPacketIds.NewItemInfo; }
  998. }
  999. public ItemInfo Info;
  1000. protected override void ReadPacket(BinaryReader reader)
  1001. {
  1002. Info = new ItemInfo(reader);
  1003. }
  1004. protected override void WritePacket(BinaryWriter writer)
  1005. {
  1006. Info.Save(writer);
  1007. }
  1008. }
  1009. public sealed class MoveItem : Packet
  1010. {
  1011. public override ushort Index
  1012. {
  1013. get { return (ushort)ServerPacketIds.MoveItem; }
  1014. }
  1015. public MirGridType Grid;
  1016. public int From, To;
  1017. public bool Success;
  1018. protected override void ReadPacket(BinaryReader reader)
  1019. {
  1020. Grid = (MirGridType)reader.ReadByte();
  1021. From = reader.ReadInt32();
  1022. To = reader.ReadInt32();
  1023. Success = reader.ReadBoolean();
  1024. }
  1025. protected override void WritePacket(BinaryWriter writer)
  1026. {
  1027. writer.Write((byte)Grid);
  1028. writer.Write(From);
  1029. writer.Write(To);
  1030. writer.Write(Success);
  1031. }
  1032. }
  1033. public sealed class EquipItem : Packet
  1034. {
  1035. public override ushort Index
  1036. {
  1037. get { return (ushort)ServerPacketIds.EquipItem; }
  1038. }
  1039. public MirGridType Grid;
  1040. public ulong UniqueID;
  1041. public int To;
  1042. public bool Success;
  1043. protected override void ReadPacket(BinaryReader reader)
  1044. {
  1045. Grid = (MirGridType)reader.ReadByte();
  1046. UniqueID = reader.ReadUInt64();
  1047. To = reader.ReadInt32();
  1048. Success = reader.ReadBoolean();
  1049. }
  1050. protected override void WritePacket(BinaryWriter writer)
  1051. {
  1052. writer.Write((byte)Grid);
  1053. writer.Write(UniqueID);
  1054. writer.Write(To);
  1055. writer.Write(Success);
  1056. }
  1057. }
  1058. public sealed class MergeItem : Packet
  1059. {
  1060. public override ushort Index
  1061. {
  1062. get { return (ushort)ServerPacketIds.MergeItem; }
  1063. }
  1064. public MirGridType GridFrom, GridTo;
  1065. public ulong IDFrom, IDTo;
  1066. public bool Success;
  1067. protected override void ReadPacket(BinaryReader reader)
  1068. {
  1069. GridFrom = (MirGridType)reader.ReadByte();
  1070. GridTo = (MirGridType)reader.ReadByte();
  1071. IDFrom = reader.ReadUInt64();
  1072. IDTo = reader.ReadUInt64();
  1073. Success = reader.ReadBoolean();
  1074. }
  1075. protected override void WritePacket(BinaryWriter writer)
  1076. {
  1077. writer.Write((byte)GridFrom);
  1078. writer.Write((byte)GridTo);
  1079. writer.Write(IDFrom);
  1080. writer.Write(IDTo);
  1081. writer.Write(Success);
  1082. }
  1083. }
  1084. public sealed class RemoveItem : Packet
  1085. {
  1086. public override ushort Index
  1087. {
  1088. get { return (ushort)ServerPacketIds.RemoveItem; }
  1089. }
  1090. public MirGridType Grid;
  1091. public ulong UniqueID;
  1092. public int To;
  1093. public bool Success;
  1094. protected override void ReadPacket(BinaryReader reader)
  1095. {
  1096. Grid = (MirGridType)reader.ReadByte();
  1097. UniqueID = reader.ReadUInt64();
  1098. To = reader.ReadInt32();
  1099. Success = reader.ReadBoolean();
  1100. }
  1101. protected override void WritePacket(BinaryWriter writer)
  1102. {
  1103. writer.Write((byte)Grid);
  1104. writer.Write(UniqueID);
  1105. writer.Write(To);
  1106. writer.Write(Success);
  1107. }
  1108. }
  1109. public sealed class RemoveSlotItem : Packet
  1110. {
  1111. public override ushort Index
  1112. {
  1113. get { return (ushort)ServerPacketIds.RemoveSlotItem; }
  1114. }
  1115. public MirGridType Grid;
  1116. public MirGridType GridTo;
  1117. public ulong UniqueID;
  1118. public int To;
  1119. public bool Success;
  1120. protected override void ReadPacket(BinaryReader reader)
  1121. {
  1122. Grid = (MirGridType)reader.ReadByte();
  1123. GridTo = (MirGridType)reader.ReadByte();
  1124. UniqueID = reader.ReadUInt64();
  1125. To = reader.ReadInt32();
  1126. Success = reader.ReadBoolean();
  1127. }
  1128. protected override void WritePacket(BinaryWriter writer)
  1129. {
  1130. writer.Write((byte)Grid);
  1131. writer.Write((byte)GridTo);
  1132. writer.Write(UniqueID);
  1133. writer.Write(To);
  1134. writer.Write(Success);
  1135. }
  1136. }
  1137. public sealed class TakeBackItem : Packet
  1138. {
  1139. public override ushort Index
  1140. {
  1141. get { return (ushort)ServerPacketIds.TakeBackItem; }
  1142. }
  1143. public int From, To;
  1144. public bool Success;
  1145. protected override void ReadPacket(BinaryReader reader)
  1146. {
  1147. From = reader.ReadInt32();
  1148. To = reader.ReadInt32();
  1149. Success = reader.ReadBoolean();
  1150. }
  1151. protected override void WritePacket(BinaryWriter writer)
  1152. {
  1153. writer.Write(From);
  1154. writer.Write(To);
  1155. writer.Write(Success);
  1156. }
  1157. }
  1158. public sealed class StorPasswordAsk : Packet
  1159. {
  1160. public override ushort Index
  1161. {
  1162. get { return (ushort)ServerPacketIds.StorPasswordAsk; }
  1163. }
  1164. protected override void ReadPacket(BinaryReader reader)
  1165. {
  1166. }
  1167. protected override void WritePacket(BinaryWriter writer)
  1168. {
  1169. }
  1170. }
  1171. public sealed class ReceiveMessageBox : Packet
  1172. {
  1173. public override ushort Index
  1174. {
  1175. get { return (ushort)ServerPacketIds.ReceiveMessageBox; }
  1176. }
  1177. public string Message;
  1178. protected override void ReadPacket(BinaryReader reader)
  1179. {
  1180. Message=reader.ReadString();
  1181. }
  1182. protected override void WritePacket(BinaryWriter writer)
  1183. {
  1184. writer.Write(Message);
  1185. }
  1186. }
  1187. public sealed class SetStoragePassword : Packet
  1188. {
  1189. public override ushort Index
  1190. {
  1191. get { return (ushort)ServerPacketIds.SetStoragePassword; }
  1192. }
  1193. public bool IsNewPassword;
  1194. protected override void ReadPacket(BinaryReader reader)
  1195. {
  1196. IsNewPassword = reader.ReadBoolean();
  1197. }
  1198. protected override void WritePacket(BinaryWriter writer)
  1199. {
  1200. writer.Write(IsNewPassword);
  1201. }
  1202. }
  1203. public sealed class StorPasswordAuthResult : Packet
  1204. {
  1205. public override ushort Index
  1206. {
  1207. get { return (ushort)ServerPacketIds.StorPasswordAuthResult; }
  1208. }
  1209. protected override void ReadPacket(BinaryReader reader)
  1210. {
  1211. }
  1212. protected override void WritePacket(BinaryWriter writer)
  1213. {
  1214. }
  1215. }
  1216. public sealed class SureBuyStorage : Packet
  1217. {
  1218. public override ushort Index
  1219. {
  1220. get { return (ushort)ServerPacketIds.SureBuyStorage; }
  1221. }
  1222. public int Status;
  1223. public int Position;
  1224. protected override void ReadPacket(BinaryReader reader)
  1225. {
  1226. Status= reader.ReadInt32();
  1227. Position= reader.ReadInt32();
  1228. }
  1229. protected override void WritePacket(BinaryWriter writer)
  1230. {
  1231. writer.Write(Status);
  1232. writer.Write(Position);
  1233. }
  1234. }
  1235. public sealed class StoreItem : Packet
  1236. {
  1237. public override ushort Index
  1238. {
  1239. get { return (ushort)ServerPacketIds.StoreItem; }
  1240. }
  1241. public int From, To;
  1242. public bool Success;
  1243. protected override void ReadPacket(BinaryReader reader)
  1244. {
  1245. From = reader.ReadInt32();
  1246. To = reader.ReadInt32();
  1247. Success = reader.ReadBoolean();
  1248. }
  1249. protected override void WritePacket(BinaryWriter writer)
  1250. {
  1251. writer.Write(From);
  1252. writer.Write(To);
  1253. writer.Write(Success);
  1254. }
  1255. }
  1256. public sealed class DepositRefineItem : Packet
  1257. {
  1258. public override ushort Index
  1259. {
  1260. get { return (ushort)ServerPacketIds.DepositRefineItem; }
  1261. }
  1262. public int From, To;
  1263. public bool Success;
  1264. protected override void ReadPacket(BinaryReader reader)
  1265. {
  1266. From = reader.ReadInt32();
  1267. To = reader.ReadInt32();
  1268. Success = reader.ReadBoolean();
  1269. }
  1270. protected override void WritePacket(BinaryWriter writer)
  1271. {
  1272. writer.Write(From);
  1273. writer.Write(To);
  1274. writer.Write(Success);
  1275. }
  1276. }
  1277. public sealed class RetrieveRefineItem : Packet
  1278. {
  1279. public override ushort Index
  1280. {
  1281. get { return (ushort)ServerPacketIds.RetrieveRefineItem; }
  1282. }
  1283. public int From, To;
  1284. public bool Success;
  1285. protected override void ReadPacket(BinaryReader reader)
  1286. {
  1287. From = reader.ReadInt32();
  1288. To = reader.ReadInt32();
  1289. Success = reader.ReadBoolean();
  1290. }
  1291. protected override void WritePacket(BinaryWriter writer)
  1292. {
  1293. writer.Write(From);
  1294. writer.Write(To);
  1295. writer.Write(Success);
  1296. }
  1297. }
  1298. public sealed class RefineCancel : Packet
  1299. {
  1300. public override ushort Index
  1301. {
  1302. get { return (ushort)ServerPacketIds.RefineCancel; }
  1303. }
  1304. public bool Unlock;
  1305. protected override void ReadPacket(BinaryReader reader)
  1306. {
  1307. Unlock = reader.ReadBoolean();
  1308. }
  1309. protected override void WritePacket(BinaryWriter writer)
  1310. {
  1311. writer.Write(Unlock);
  1312. }
  1313. }
  1314. public sealed class RefineItem : Packet
  1315. {
  1316. public override ushort Index
  1317. {
  1318. get { return (ushort)ServerPacketIds.RefineItem; }
  1319. }
  1320. public ulong UniqueID;
  1321. protected override void ReadPacket(BinaryReader reader)
  1322. {
  1323. UniqueID = reader.ReadUInt64();
  1324. }
  1325. protected override void WritePacket(BinaryWriter writer)
  1326. {
  1327. writer.Write(UniqueID);
  1328. }
  1329. }
  1330. public sealed class Mir3RefineItem : Packet
  1331. {
  1332. public override ushort Index
  1333. {
  1334. get { return (ushort)ServerPacketIds.Mir3RefineItem; }
  1335. }
  1336. public ulong UniqueID;
  1337. public byte Added;
  1338. // public RefinedValue Value;
  1339. protected override void ReadPacket(BinaryReader reader)
  1340. {
  1341. UniqueID = reader.ReadUInt64();
  1342. Added = reader.ReadByte();
  1343. // Value = (RefinedValue)reader.ReadByte();
  1344. }
  1345. protected override void WritePacket(BinaryWriter writer)
  1346. {
  1347. writer.Write(UniqueID);
  1348. writer.Write(Added);
  1349. // writer.Write((byte)Value);
  1350. }
  1351. }
  1352. public sealed class Mir3AtkRefine : Packet
  1353. {
  1354. public override ushort Index
  1355. {
  1356. get { return (ushort)ServerPacketIds.Mir3AtkRefine; }
  1357. }
  1358. // public ulong UniqueID;
  1359. public byte Added;
  1360. public RefinedValue Value;
  1361. protected override void ReadPacket(BinaryReader reader)
  1362. {
  1363. Added = reader.ReadByte();
  1364. Value = (RefinedValue)reader.ReadByte();
  1365. }
  1366. protected override void WritePacket(BinaryWriter writer)
  1367. {
  1368. writer.Write(Added);
  1369. writer.Write((byte)Value);
  1370. }
  1371. }
  1372. public sealed class FindBlackItem : Packet
  1373. {
  1374. public override ushort Index
  1375. {
  1376. get { return (ushort)ServerPacketIds.FindBlackItem; }
  1377. }
  1378. public UserItem Item;
  1379. protected override void ReadPacket(BinaryReader reader)
  1380. {
  1381. if (reader.ReadBoolean())
  1382. Item = new UserItem(reader);
  1383. }
  1384. protected override void WritePacket(BinaryWriter writer)
  1385. {
  1386. writer.Write(Item != null);
  1387. if (Item != null) Item.Save(writer);
  1388. }
  1389. }
  1390. public sealed class DepositTradeItem : Packet
  1391. {
  1392. public override ushort Index
  1393. {
  1394. get { return (ushort)ServerPacketIds.DepositTradeItem; }
  1395. }
  1396. public int From, To;
  1397. public bool Success;
  1398. protected override void ReadPacket(BinaryReader reader)
  1399. {
  1400. From = reader.ReadInt32();
  1401. To = reader.ReadInt32();
  1402. Success = reader.ReadBoolean();
  1403. }
  1404. protected override void WritePacket(BinaryWriter writer)
  1405. {
  1406. writer.Write(From);
  1407. writer.Write(To);
  1408. writer.Write(Success);
  1409. }
  1410. }
  1411. public sealed class RetrieveTradeItem : Packet
  1412. {
  1413. public override ushort Index
  1414. {
  1415. get { return (ushort)ServerPacketIds.RetrieveTradeItem; }
  1416. }
  1417. public int From, To;
  1418. public bool Success;
  1419. protected override void ReadPacket(BinaryReader reader)
  1420. {
  1421. From = reader.ReadInt32();
  1422. To = reader.ReadInt32();
  1423. Success = reader.ReadBoolean();
  1424. }
  1425. protected override void WritePacket(BinaryWriter writer)
  1426. {
  1427. writer.Write(From);
  1428. writer.Write(To);
  1429. writer.Write(Success);
  1430. }
  1431. }
  1432. public sealed class SplitItem : Packet
  1433. {
  1434. public override ushort Index
  1435. {
  1436. get { return (ushort)ServerPacketIds.SplitItem; }
  1437. }
  1438. public UserItem Item;
  1439. public MirGridType Grid;
  1440. protected override void ReadPacket(BinaryReader reader)
  1441. {
  1442. if (reader.ReadBoolean())
  1443. Item = new UserItem(reader);
  1444. Grid = (MirGridType)reader.ReadByte();
  1445. }
  1446. protected override void WritePacket(BinaryWriter writer)
  1447. {
  1448. writer.Write(Item != null);
  1449. if (Item != null) Item.Save(writer);
  1450. writer.Write((byte)Grid);
  1451. }
  1452. }
  1453. public sealed class SplitItem1 : Packet
  1454. {
  1455. public override ushort Index
  1456. {
  1457. get { return (ushort)ServerPacketIds.SplitItem1; }
  1458. }
  1459. public MirGridType Grid;
  1460. public ulong UniqueID;
  1461. public uint Count;
  1462. public bool Success;
  1463. protected override void ReadPacket(BinaryReader reader)
  1464. {
  1465. Grid = (MirGridType)reader.ReadByte();
  1466. UniqueID = reader.ReadUInt64();
  1467. Count = reader.ReadUInt32();
  1468. Success = reader.ReadBoolean();
  1469. }
  1470. protected override void WritePacket(BinaryWriter writer)
  1471. {
  1472. writer.Write((byte)Grid);
  1473. writer.Write(UniqueID);
  1474. writer.Write(Count);
  1475. writer.Write(Success);
  1476. }
  1477. }
  1478. public sealed class UseItem : Packet
  1479. {
  1480. public override ushort Index
  1481. {
  1482. get { return (ushort)ServerPacketIds.UseItem; }
  1483. }
  1484. public ulong UniqueID;
  1485. public bool Success;
  1486. public ItemType Type;
  1487. public short Shape;
  1488. protected override void ReadPacket(BinaryReader reader)
  1489. {
  1490. UniqueID = reader.ReadUInt64();
  1491. Success = reader.ReadBoolean();
  1492. Type = (ItemType)reader.ReadByte();
  1493. Shape = reader.ReadInt16();
  1494. }
  1495. protected override void WritePacket(BinaryWriter writer)
  1496. {
  1497. writer.Write(UniqueID);
  1498. writer.Write(Success);
  1499. writer.Write((byte)Type);
  1500. writer.Write(Shape);
  1501. }
  1502. }
  1503. public sealed class DropProtectSuccess : Packet
  1504. {
  1505. public override ushort Index
  1506. {
  1507. get { return (ushort)ServerPacketIds.DropProtectSuccess; }
  1508. }
  1509. public int result;
  1510. protected override void ReadPacket(BinaryReader reader)
  1511. {
  1512. result = reader.ReadInt32();
  1513. }
  1514. protected override void WritePacket(BinaryWriter writer)
  1515. {
  1516. writer.Write(result);
  1517. }
  1518. }
  1519. public sealed class DropItem : Packet
  1520. {
  1521. public override ushort Index
  1522. {
  1523. get { return (ushort)ServerPacketIds.DropItem; }
  1524. }
  1525. public ulong UniqueID;
  1526. public uint Count;
  1527. public bool Success;
  1528. protected override void ReadPacket(BinaryReader reader)
  1529. {
  1530. UniqueID = reader.ReadUInt64();
  1531. Count = reader.ReadUInt32();
  1532. Success = reader.ReadBoolean();
  1533. }
  1534. protected override void WritePacket(BinaryWriter writer)
  1535. {
  1536. writer.Write(UniqueID);
  1537. writer.Write(Count);
  1538. writer.Write(Success);
  1539. }
  1540. }
  1541. public sealed class PlayerUpdate : Packet
  1542. {
  1543. public override ushort Index
  1544. {
  1545. get { return (ushort)ServerPacketIds.PlayerUpdate; }
  1546. }
  1547. public uint ObjectID;
  1548. public byte Light;
  1549. public short Weapon, Armour, Helmet;
  1550. public byte IR, IG, IB;
  1551. public byte WingEffect;
  1552. public byte AmultShape;
  1553. public byte Emtype;
  1554. protected override void ReadPacket(BinaryReader reader)
  1555. {
  1556. ObjectID = reader.ReadUInt32();
  1557. Light = reader.ReadByte();
  1558. Weapon = reader.ReadInt16();
  1559. Armour = reader.ReadInt16();
  1560. Helmet = reader.ReadInt16();
  1561. WingEffect = reader.ReadByte();
  1562. IR = reader.ReadByte();
  1563. IG = reader.ReadByte();
  1564. IB = reader.ReadByte();
  1565. Emtype = reader.ReadByte();
  1566. AmultShape = reader.ReadByte();
  1567. }
  1568. protected override void WritePacket(BinaryWriter writer)
  1569. {
  1570. writer.Write(ObjectID);
  1571. writer.Write(Light);
  1572. writer.Write(Weapon);
  1573. writer.Write(Armour);
  1574. writer.Write(Helmet);
  1575. writer.Write(WingEffect);
  1576. writer.Write(IR);
  1577. writer.Write(IG);
  1578. writer.Write(IB);
  1579. writer.Write(Emtype);
  1580. writer.Write(AmultShape);
  1581. }
  1582. }
  1583. public sealed class PlayerInspect : Packet
  1584. {
  1585. public override ushort Index
  1586. {
  1587. get { return (ushort)ServerPacketIds.PlayerInspect; }
  1588. }
  1589. public string Name = string.Empty;
  1590. public string GuildName = string.Empty;
  1591. public string GuildRank = string.Empty;
  1592. public int Votes;
  1593. public UserItem[] Equipment;
  1594. public MirClass Class;
  1595. public MirGender Gender;
  1596. public byte Hair, HR, HG, HB;
  1597. public ushort Level;
  1598. public string LoverName;
  1599. protected override void ReadPacket(BinaryReader reader)
  1600. {
  1601. Name = reader.ReadString();
  1602. GuildName = reader.ReadString();
  1603. GuildRank = reader.ReadString();
  1604. Votes = reader.ReadInt32();
  1605. Equipment = new UserItem[reader.ReadInt32()];
  1606. for (int i = 0; i < Equipment.Length; i++)
  1607. {
  1608. if (reader.ReadBoolean())
  1609. Equipment[i] = new UserItem(reader);
  1610. }
  1611. Class = (MirClass)reader.ReadByte();
  1612. Gender = (MirGender)reader.ReadByte();
  1613. Hair = reader.ReadByte();
  1614. HR = reader.ReadByte();
  1615. HG = reader.ReadByte();
  1616. HB = reader.ReadByte();
  1617. Level = reader.ReadUInt16();
  1618. LoverName = reader.ReadString();
  1619. }
  1620. protected override void WritePacket(BinaryWriter writer)
  1621. {
  1622. writer.Write(Name);
  1623. writer.Write(GuildName);
  1624. writer.Write(GuildRank);
  1625. writer.Write(Votes);
  1626. writer.Write(Equipment.Length);
  1627. for (int i = 0; i < Equipment.Length; i++)
  1628. {
  1629. UserItem T = Equipment[i];
  1630. writer.Write(T != null);
  1631. if (T != null) T.Save(writer);
  1632. }
  1633. writer.Write((byte)Class);
  1634. writer.Write((byte)Gender);
  1635. writer.Write(Hair);
  1636. writer.Write(HR);
  1637. writer.Write(HG);
  1638. writer.Write(HB);
  1639. writer.Write(Level);
  1640. writer.Write(LoverName);
  1641. }
  1642. }
  1643. public sealed class MarriageRequest : Packet
  1644. {
  1645. public override ushort Index { get { return (ushort)ServerPacketIds.MarriageRequest; } }
  1646. public string Name;
  1647. protected override void ReadPacket(BinaryReader reader)
  1648. {
  1649. Name = reader.ReadString();
  1650. }
  1651. protected override void WritePacket(BinaryWriter writer)
  1652. {
  1653. writer.Write(Name);
  1654. }
  1655. }
  1656. public sealed class DivorceRequest : Packet
  1657. {
  1658. public override ushort Index { get { return (ushort)ServerPacketIds.DivorceRequest; } }
  1659. public string Name;
  1660. protected override void ReadPacket(BinaryReader reader)
  1661. {
  1662. Name = reader.ReadString();
  1663. }
  1664. protected override void WritePacket(BinaryWriter writer)
  1665. {
  1666. writer.Write(Name);
  1667. }
  1668. }
  1669. public sealed class MentorRequest : Packet
  1670. {
  1671. public override ushort Index { get { return (ushort)ServerPacketIds.MentorRequest; } }
  1672. public string Name;
  1673. public ushort Level;
  1674. protected override void ReadPacket(BinaryReader reader)
  1675. {
  1676. Name = reader.ReadString();
  1677. Level = reader.ReadUInt16();
  1678. }
  1679. protected override void WritePacket(BinaryWriter writer)
  1680. {
  1681. writer.Write(Name);
  1682. writer.Write(Level);
  1683. }
  1684. }
  1685. public sealed class TradeRequest : Packet
  1686. {
  1687. public override ushort Index { get { return (ushort)ServerPacketIds.TradeRequest; } }
  1688. public string Name;
  1689. protected override void ReadPacket(BinaryReader reader)
  1690. {
  1691. Name = reader.ReadString();
  1692. }
  1693. protected override void WritePacket(BinaryWriter writer)
  1694. {
  1695. writer.Write(Name);
  1696. }
  1697. }
  1698. public sealed class TradeAccept : Packet
  1699. {
  1700. public override ushort Index { get { return (ushort)ServerPacketIds.TradeAccept; } }
  1701. public string Name;
  1702. protected override void ReadPacket(BinaryReader reader)
  1703. {
  1704. Name = reader.ReadString();
  1705. }
  1706. protected override void WritePacket(BinaryWriter writer)
  1707. {
  1708. writer.Write(Name);
  1709. }
  1710. }
  1711. public sealed class TradeGold : Packet
  1712. {
  1713. public override ushort Index
  1714. {
  1715. get { return (ushort)ServerPacketIds.TradeGold; }
  1716. }
  1717. public uint Amount;
  1718. public uint TradeCost;
  1719. protected override void ReadPacket(BinaryReader reader)
  1720. {
  1721. Amount = reader.ReadUInt32();
  1722. TradeCost = reader.ReadUInt32();
  1723. }
  1724. protected override void WritePacket(BinaryWriter writer)
  1725. {
  1726. writer.Write(Amount);
  1727. writer.Write(TradeCost);
  1728. }
  1729. }
  1730. public sealed class TradeItem : Packet
  1731. {
  1732. public override ushort Index
  1733. {
  1734. get { return (ushort)ServerPacketIds.TradeItem; }
  1735. }
  1736. public UserItem[] TradeItems;
  1737. protected override void ReadPacket(BinaryReader reader)
  1738. {
  1739. TradeItems = new UserItem[reader.ReadInt32()];
  1740. for (int i = 0; i < TradeItems.Length; i++)
  1741. {
  1742. if (reader.ReadBoolean())
  1743. TradeItems[i] = new UserItem(reader);
  1744. }
  1745. }
  1746. protected override void WritePacket(BinaryWriter writer)
  1747. {
  1748. writer.Write(TradeItems.Length);
  1749. for (int i = 0; i < TradeItems.Length; i++)
  1750. {
  1751. UserItem T = TradeItems[i];
  1752. writer.Write(T != null);
  1753. if (T != null) T.Save(writer);
  1754. }
  1755. }
  1756. }
  1757. public sealed class TradeCost : Packet
  1758. {
  1759. public override ushort Index
  1760. {
  1761. get { return (ushort)ServerPacketIds.TradeCost; }
  1762. }
  1763. public uint MyTradeCost;
  1764. protected override void ReadPacket(BinaryReader reader)
  1765. {
  1766. MyTradeCost = reader.ReadUInt32();
  1767. }
  1768. protected override void WritePacket(BinaryWriter writer)
  1769. {
  1770. writer.Write(MyTradeCost);
  1771. }
  1772. }
  1773. public sealed class TradeConfirm : Packet
  1774. {
  1775. public override ushort Index
  1776. {
  1777. get { return (ushort)ServerPacketIds.TradeConfirm; }
  1778. }
  1779. protected override void ReadPacket(BinaryReader reader)
  1780. {
  1781. }
  1782. protected override void WritePacket(BinaryWriter writer)
  1783. {
  1784. }
  1785. }
  1786. public sealed class TradeCancel : Packet
  1787. {
  1788. public override ushort Index
  1789. {
  1790. get { return (ushort)ServerPacketIds.TradeCancel; }
  1791. }
  1792. public bool Unlock;
  1793. protected override void ReadPacket(BinaryReader reader)
  1794. {
  1795. Unlock = reader.ReadBoolean();
  1796. }
  1797. protected override void WritePacket(BinaryWriter writer)
  1798. {
  1799. writer.Write(Unlock);
  1800. }
  1801. }
  1802. public sealed class LogOutSuccess : Packet
  1803. {
  1804. public override ushort Index
  1805. {
  1806. get { return (ushort)ServerPacketIds.LogOutSuccess; }
  1807. }
  1808. public List<SelectInfo> Characters = new List<SelectInfo>();
  1809. protected override void ReadPacket(BinaryReader reader)
  1810. {
  1811. int count = reader.ReadInt32();
  1812. for (int i = 0; i < count; i++)
  1813. Characters.Add(new SelectInfo(reader));
  1814. }
  1815. protected override void WritePacket(BinaryWriter writer)
  1816. {
  1817. writer.Write(Characters.Count);
  1818. for (int i = 0; i < Characters.Count; i++)
  1819. Characters[i].Save(writer);
  1820. }
  1821. }
  1822. public sealed class LogOutFailed : Packet
  1823. {
  1824. public override ushort Index
  1825. {
  1826. get { return (ushort)ServerPacketIds.LogOutFailed; }
  1827. }
  1828. protected override void ReadPacket(BinaryReader reader)
  1829. {
  1830. }
  1831. protected override void WritePacket(BinaryWriter writer)
  1832. {
  1833. }
  1834. }
  1835. public sealed class TimeOfDay : Packet
  1836. {
  1837. public override ushort Index
  1838. {
  1839. get { return (ushort)ServerPacketIds.TimeOfDay; }
  1840. }
  1841. public LightSetting Lights;
  1842. protected override void ReadPacket(BinaryReader reader)
  1843. {
  1844. Lights = (LightSetting)reader.ReadByte();
  1845. }
  1846. protected override void WritePacket(BinaryWriter writer)
  1847. {
  1848. writer.Write((byte)Lights);
  1849. }
  1850. }
  1851. public sealed class ChangeAMode : Packet
  1852. {
  1853. public override ushort Index
  1854. {
  1855. get { return (ushort)ServerPacketIds.ChangeAMode; }
  1856. }
  1857. public AttackMode Mode;
  1858. protected override void ReadPacket(BinaryReader reader)
  1859. {
  1860. Mode = (AttackMode)reader.ReadByte();
  1861. }
  1862. protected override void WritePacket(BinaryWriter writer)
  1863. {
  1864. writer.Write((byte)Mode);
  1865. }
  1866. }
  1867. public sealed class ChangePMode : Packet
  1868. {
  1869. public override ushort Index
  1870. {
  1871. get { return (ushort)ServerPacketIds.ChangePMode; }
  1872. }
  1873. public PetMode Mode;
  1874. protected override void ReadPacket(BinaryReader reader)
  1875. {
  1876. Mode = (PetMode)reader.ReadByte();
  1877. }
  1878. protected override void WritePacket(BinaryWriter writer)
  1879. {
  1880. writer.Write((byte)Mode);
  1881. }
  1882. }
  1883. public sealed class ObjectItem : Packet
  1884. {
  1885. public override ushort Index
  1886. {
  1887. get { return (ushort)ServerPacketIds.ObjectItem; }
  1888. }
  1889. public uint ObjectID;
  1890. public string Name = string.Empty;
  1891. public Color NameColor;
  1892. public Point Location;
  1893. public ushort Image;
  1894. public bool IsAdd;
  1895. //public byte Gradenum;
  1896. protected override void ReadPacket(BinaryReader reader)
  1897. {
  1898. ObjectID = reader.ReadUInt32();
  1899. Name = reader.ReadString();
  1900. NameColor = Color.FromArgb(reader.ReadInt32());
  1901. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  1902. Image = reader.ReadUInt16();
  1903. IsAdd = reader.ReadBoolean();
  1904. }
  1905. protected override void WritePacket(BinaryWriter writer)
  1906. {
  1907. writer.Write(ObjectID);
  1908. writer.Write(Name);
  1909. writer.Write(NameColor.ToArgb());
  1910. writer.Write(Location.X);
  1911. writer.Write(Location.Y);
  1912. writer.Write(Image);
  1913. writer.Write(IsAdd);
  1914. }
  1915. }
  1916. public sealed class ObjectUseItem : Packet
  1917. {
  1918. public override ushort Index
  1919. {
  1920. get { return (ushort)ServerPacketIds.ObjectUseItem; }
  1921. }
  1922. public uint ObjectID;
  1923. public string Name = string.Empty;
  1924. public ItemType Type;
  1925. public short Shape;
  1926. protected override void ReadPacket(BinaryReader reader)
  1927. {
  1928. ObjectID = reader.ReadUInt32();
  1929. Name = reader.ReadString();
  1930. Type = (ItemType)reader.ReadByte();
  1931. Shape = reader.ReadInt16();
  1932. }
  1933. protected override void WritePacket(BinaryWriter writer)
  1934. {
  1935. writer.Write(ObjectID);
  1936. writer.Write(Name);
  1937. writer.Write((byte)Type);
  1938. writer.Write(Shape);
  1939. }
  1940. }
  1941. public sealed class ObjectGold : Packet
  1942. {
  1943. public override ushort Index
  1944. {
  1945. get { return (ushort)ServerPacketIds.ObjectGold; }
  1946. }
  1947. public uint ObjectID;
  1948. public uint Gold;
  1949. public Point Location;
  1950. protected override void ReadPacket(BinaryReader reader)
  1951. {
  1952. ObjectID = reader.ReadUInt32();
  1953. Gold = reader.ReadUInt32();
  1954. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  1955. }
  1956. protected override void WritePacket(BinaryWriter writer)
  1957. {
  1958. writer.Write(ObjectID);
  1959. writer.Write(Gold);
  1960. writer.Write(Location.X);
  1961. writer.Write(Location.Y);
  1962. }
  1963. }
  1964. public sealed class GainedItem : Packet
  1965. {
  1966. public override ushort Index
  1967. {
  1968. get { return (ushort)ServerPacketIds.GainedItem; }
  1969. }
  1970. public UserItem Item;
  1971. protected override void ReadPacket(BinaryReader reader)
  1972. {
  1973. Item = new UserItem(reader);
  1974. }
  1975. protected override void WritePacket(BinaryWriter writer)
  1976. {
  1977. Item.Save(writer);
  1978. }
  1979. }
  1980. public sealed class GainedGold : Packet
  1981. {
  1982. public override ushort Index
  1983. {
  1984. get { return (ushort)ServerPacketIds.GainedGold; }
  1985. }
  1986. public uint Gold;
  1987. protected override void ReadPacket(BinaryReader reader)
  1988. {
  1989. Gold = reader.ReadUInt32();
  1990. }
  1991. protected override void WritePacket(BinaryWriter writer)
  1992. {
  1993. writer.Write(Gold);
  1994. }
  1995. }
  1996. public sealed class LoseGold : Packet
  1997. {
  1998. public override ushort Index
  1999. {
  2000. get { return (ushort)ServerPacketIds.LoseGold; }
  2001. }
  2002. public uint Gold;
  2003. protected override void ReadPacket(BinaryReader reader)
  2004. {
  2005. Gold = reader.ReadUInt32();
  2006. }
  2007. protected override void WritePacket(BinaryWriter writer)
  2008. {
  2009. writer.Write(Gold);
  2010. }
  2011. }
  2012. public sealed class GainedCredit : Packet
  2013. {
  2014. public override ushort Index
  2015. {
  2016. get { return (ushort)ServerPacketIds.GainedCredit; }
  2017. }
  2018. public uint Credit;
  2019. protected override void ReadPacket(BinaryReader reader)
  2020. {
  2021. Credit = reader.ReadUInt32();
  2022. }
  2023. protected override void WritePacket(BinaryWriter writer)
  2024. {
  2025. writer.Write(Credit);
  2026. }
  2027. }
  2028. public sealed class LoseCredit : Packet
  2029. {
  2030. public override ushort Index
  2031. {
  2032. get { return (ushort)ServerPacketIds.LoseCredit; }
  2033. }
  2034. public uint Credit;
  2035. protected override void ReadPacket(BinaryReader reader)
  2036. {
  2037. Credit = reader.ReadUInt32();
  2038. }
  2039. protected override void WritePacket(BinaryWriter writer)
  2040. {
  2041. writer.Write(Credit);
  2042. }
  2043. }
  2044. public sealed class ObjectMonster : Packet
  2045. {
  2046. public override ushort Index
  2047. {
  2048. get { return (ushort)ServerPacketIds.ObjectMonster; }
  2049. }
  2050. public uint ObjectID;
  2051. public string Name = string.Empty;
  2052. public Color NameColor;
  2053. public Point Location;
  2054. public Monster Image;
  2055. public MirDirection Direction;
  2056. public byte Effect, AI, Light;
  2057. public bool Dead, Skeleton;
  2058. public PoisonType Poison;
  2059. public bool Hidden, Extra;
  2060. public byte ExtraByte;
  2061. public long ShockTime;
  2062. public bool BindingShotCenter;
  2063. public int ObjectIndex = 0;
  2064. public int Level;
  2065. public int Undead_;
  2066. public int FireMAC;
  2067. public int IceMAC;
  2068. public int LightMAC;
  2069. public int WindMAC;
  2070. public int HolyMAC;
  2071. public int DarkMAC;
  2072. public int PhantomMAC;
  2073. public int CanTame;
  2074. public int MCType;
  2075. public int MoveSpeed;
  2076. public int AttackSpeed;
  2077. public int MinDC;
  2078. public int MaxDC;
  2079. public int HP, MaxHP;
  2080. //
  2081. // public bool CanTame = false, Undead = false; // CanPush = false, AutoRev = false, ;
  2082. // public bool
  2083. protected override void ReadPacket(BinaryReader reader)
  2084. {
  2085. ObjectID = reader.ReadUInt32();
  2086. Name = reader.ReadString();
  2087. NameColor = Color.FromArgb(reader.ReadInt32());
  2088. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  2089. Image = (Monster)reader.ReadUInt16();
  2090. Direction = (MirDirection)reader.ReadByte();
  2091. Effect = reader.ReadByte();
  2092. AI = reader.ReadByte();
  2093. Light = reader.ReadByte();
  2094. Dead = reader.ReadBoolean();
  2095. Skeleton = reader.ReadBoolean();
  2096. Poison = (PoisonType)reader.ReadUInt16();
  2097. Hidden = reader.ReadBoolean();
  2098. ShockTime = reader.ReadInt64();
  2099. BindingShotCenter = reader.ReadBoolean();
  2100. Extra = reader.ReadBoolean();
  2101. ExtraByte = reader.ReadByte();
  2102. // CanTame = reader.ReadBoolean();
  2103. // Undead = reader.ReadBoolean();
  2104. ObjectIndex = reader.ReadInt32();
  2105. Level = reader.ReadInt32();
  2106. Undead_ = reader.ReadInt32();
  2107. FireMAC = reader.ReadInt32();
  2108. IceMAC = reader.ReadInt32();
  2109. LightMAC = reader.ReadInt32();
  2110. WindMAC = reader.ReadInt32();
  2111. HolyMAC = reader.ReadInt32();
  2112. DarkMAC = reader.ReadInt32();
  2113. PhantomMAC = reader.ReadInt32();
  2114. CanTame = reader.ReadInt32();
  2115. MCType = reader.ReadInt32();
  2116. MoveSpeed = reader.ReadInt32();
  2117. AttackSpeed = reader.ReadInt32();
  2118. MinDC = reader.ReadInt32();
  2119. MaxDC = reader.ReadInt32();
  2120. HP=reader.ReadInt32();
  2121. MaxHP=reader.ReadInt32();
  2122. }
  2123. protected override void WritePacket(BinaryWriter writer)
  2124. {
  2125. writer.Write(ObjectID);
  2126. writer.Write(Name);
  2127. writer.Write(NameColor.ToArgb());
  2128. writer.Write(Location.X);
  2129. writer.Write(Location.Y);
  2130. writer.Write((ushort)Image);
  2131. writer.Write((byte)Direction);
  2132. writer.Write(Effect);
  2133. writer.Write(AI);
  2134. writer.Write(Light);
  2135. writer.Write(Dead);
  2136. writer.Write(Skeleton);
  2137. writer.Write((ushort)Poison);
  2138. writer.Write(Hidden);
  2139. writer.Write(ShockTime);
  2140. writer.Write(BindingShotCenter);
  2141. writer.Write(Extra);
  2142. writer.Write((byte)ExtraByte);
  2143. writer.Write(ObjectIndex);
  2144. writer.Write(Level);
  2145. writer.Write(Undead_);
  2146. writer.Write(FireMAC);
  2147. writer.Write(IceMAC);
  2148. writer.Write(LightMAC);
  2149. writer.Write(WindMAC);
  2150. writer.Write(HolyMAC);
  2151. writer.Write(DarkMAC);
  2152. writer.Write(PhantomMAC);
  2153. writer.Write(CanTame);
  2154. writer.Write(MCType);
  2155. writer.Write(MoveSpeed);
  2156. writer.Write(AttackSpeed);
  2157. writer.Write(MinDC);
  2158. writer.Write(MaxDC);
  2159. writer.Write(HP);
  2160. writer.Write(MaxHP);
  2161. // writer.Write(CanTame);
  2162. //writer.Write(Undead);
  2163. }
  2164. }
  2165. public sealed class ObjectAttack : Packet
  2166. {
  2167. public override ushort Index
  2168. {
  2169. get { return (ushort)ServerPacketIds.ObjectAttack; }
  2170. }
  2171. public uint ObjectID;
  2172. public Point Location;
  2173. public MirDirection Direction;
  2174. public Spell Spell;
  2175. public byte Level;
  2176. public byte Type;
  2177. protected override void ReadPacket(BinaryReader reader)
  2178. {
  2179. ObjectID = reader.ReadUInt32();
  2180. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  2181. Direction = (MirDirection)reader.ReadByte();
  2182. Spell = (Spell)reader.ReadByte();
  2183. Level = reader.ReadByte();
  2184. Type = reader.ReadByte();
  2185. }
  2186. protected override void WritePacket(BinaryWriter writer)
  2187. {
  2188. writer.Write(ObjectID);
  2189. writer.Write(Location.X);
  2190. writer.Write(Location.Y);
  2191. writer.Write((byte)Direction);
  2192. writer.Write((byte)Spell);
  2193. writer.Write(Level);
  2194. writer.Write(Type);
  2195. }
  2196. }
  2197. public sealed class Struck : Packet
  2198. {
  2199. public override ushort Index
  2200. {
  2201. get { return (ushort)ServerPacketIds.Struck; }
  2202. }
  2203. public uint AttackerID;
  2204. public sbyte EIType;
  2205. public byte AttackerType; //判断玩家还是怪物
  2206. public uint time;
  2207. protected override void ReadPacket(BinaryReader reader)
  2208. {
  2209. AttackerID = reader.ReadUInt32();
  2210. EIType = reader.ReadSByte();
  2211. AttackerType = reader.ReadByte();
  2212. time = reader.ReadUInt32();
  2213. }
  2214. protected override void WritePacket(BinaryWriter writer)
  2215. {
  2216. writer.Write(AttackerID);
  2217. writer.Write(EIType);
  2218. writer.Write(AttackerType);
  2219. writer.Write(time);
  2220. }
  2221. }
  2222. public sealed class ObjectStruck : Packet
  2223. {
  2224. public override ushort Index
  2225. {
  2226. get { return (ushort)ServerPacketIds.ObjectStruck; }
  2227. }
  2228. public uint ObjectID;
  2229. public uint AttackerID;
  2230. public sbyte EIType;
  2231. public Point Location;
  2232. public MirDirection Direction;
  2233. protected override void ReadPacket(BinaryReader reader)
  2234. {
  2235. ObjectID = reader.ReadUInt32();
  2236. AttackerID = reader.ReadUInt32();
  2237. EIType = reader.ReadSByte();
  2238. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  2239. Direction = (MirDirection)reader.ReadByte();
  2240. }
  2241. protected override void WritePacket(BinaryWriter writer)
  2242. {
  2243. writer.Write(ObjectID);
  2244. writer.Write(AttackerID);
  2245. writer.Write(EIType);
  2246. writer.Write(Location.X);
  2247. writer.Write(Location.Y);
  2248. writer.Write((byte)Direction);
  2249. }
  2250. }
  2251. // 飘血量指示器数据包
  2252. public sealed class DamageIndicator : Packet
  2253. {
  2254. public int Damage;
  2255. public DamageType Type;
  2256. public uint ObjectID;
  2257. //public byte PercentHealth;
  2258. //public uint HP;
  2259. //public uint MaxHP;
  2260. public override ushort Index
  2261. {
  2262. get { return (ushort)ServerPacketIds.DamageIndicator; }
  2263. }
  2264. protected override void ReadPacket(BinaryReader reader)
  2265. {
  2266. Damage = reader.ReadInt32();
  2267. Type = (DamageType)reader.ReadByte();
  2268. ObjectID = reader.ReadUInt32();
  2269. //PercentHealth = reader.ReadByte();
  2270. //HP = reader.ReadUInt32();
  2271. //MaxHP = reader.ReadUInt32();
  2272. }
  2273. protected override void WritePacket(BinaryWriter writer)
  2274. {
  2275. writer.Write(Damage);
  2276. writer.Write((byte)Type);
  2277. writer.Write(ObjectID);
  2278. // writer.Write(PercentHealth);
  2279. //writer.Write(HP);
  2280. //writer.Write(MaxHP);
  2281. }
  2282. }
  2283. public sealed class DuraChanged : Packet
  2284. {
  2285. public override ushort Index
  2286. {
  2287. get { return (ushort)ServerPacketIds.DuraChanged; }
  2288. }
  2289. public ulong UniqueID;
  2290. public int CurrentDura;
  2291. protected override void ReadPacket(BinaryReader reader)
  2292. {
  2293. UniqueID = reader.ReadUInt64();
  2294. CurrentDura = reader.ReadInt32();
  2295. }
  2296. protected override void WritePacket(BinaryWriter writer)
  2297. {
  2298. writer.Write(UniqueID);
  2299. writer.Write(CurrentDura);
  2300. }
  2301. }
  2302. public sealed class PoisonChangaChanged : Packet
  2303. {
  2304. public override ushort Index
  2305. {
  2306. get { return (ushort)ServerPacketIds.PoisonChangaChanged; }
  2307. }
  2308. public byte Shape;
  2309. protected override void ReadPacket(BinaryReader reader)
  2310. {
  2311. Shape = reader.ReadByte();
  2312. }
  2313. protected override void WritePacket(BinaryWriter writer)
  2314. {
  2315. writer.Write(Shape);
  2316. }
  2317. }
  2318. public sealed class HealthChanged : Packet
  2319. {
  2320. public override ushort Index
  2321. {
  2322. get { return (ushort)ServerPacketIds.HealthChanged; }
  2323. }
  2324. public ushort HP, MP;
  2325. protected override void ReadPacket(BinaryReader reader)
  2326. {
  2327. HP = reader.ReadUInt16();
  2328. MP = reader.ReadUInt16();
  2329. }
  2330. protected override void WritePacket(BinaryWriter writer)
  2331. {
  2332. writer.Write(HP);
  2333. writer.Write(MP);
  2334. }
  2335. }
  2336. public sealed class DeleteItem : Packet
  2337. {
  2338. public override ushort Index
  2339. {
  2340. get { return (ushort)ServerPacketIds.DeleteItem; }
  2341. }
  2342. public ulong UniqueID;
  2343. public uint Count;
  2344. protected override void ReadPacket(BinaryReader reader)
  2345. {
  2346. UniqueID = reader.ReadUInt64();
  2347. Count = reader.ReadUInt32();
  2348. }
  2349. protected override void WritePacket(BinaryWriter writer)
  2350. {
  2351. writer.Write(UniqueID);
  2352. writer.Write(Count);
  2353. }
  2354. }
  2355. public sealed class Death : Packet
  2356. {
  2357. public override ushort Index
  2358. {
  2359. get { return (ushort)ServerPacketIds.Death; }
  2360. }
  2361. public Point Location;
  2362. public MirDirection Direction;
  2363. protected override void ReadPacket(BinaryReader reader)
  2364. {
  2365. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  2366. Direction = (MirDirection)reader.ReadByte();
  2367. }
  2368. protected override void WritePacket(BinaryWriter writer)
  2369. {
  2370. writer.Write(Location.X);
  2371. writer.Write(Location.Y);
  2372. writer.Write((byte)Direction);
  2373. }
  2374. }
  2375. public sealed class ObjectDied : Packet
  2376. {
  2377. public override ushort Index
  2378. {
  2379. get { return (ushort)ServerPacketIds.ObjectDied; }
  2380. }
  2381. public uint ObjectID;
  2382. public Point Location;
  2383. public MirDirection Direction;
  2384. public byte Type;
  2385. protected override void ReadPacket(BinaryReader reader)
  2386. {
  2387. ObjectID = reader.ReadUInt32();
  2388. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  2389. Direction = (MirDirection)reader.ReadByte();
  2390. Type = reader.ReadByte();
  2391. }
  2392. protected override void WritePacket(BinaryWriter writer)
  2393. {
  2394. writer.Write(ObjectID);
  2395. writer.Write(Location.X);
  2396. writer.Write(Location.Y);
  2397. writer.Write((byte)Direction);
  2398. writer.Write(Type);
  2399. }
  2400. }
  2401. public sealed class ColorChanged : Packet
  2402. {
  2403. public override ushort Index
  2404. {
  2405. get { return (ushort)ServerPacketIds.ColorChanged; }
  2406. }
  2407. public Color NameColor;
  2408. protected override void ReadPacket(BinaryReader reader)
  2409. {
  2410. NameColor = Color.FromArgb(reader.ReadInt32());
  2411. }
  2412. protected override void WritePacket(BinaryWriter writer)
  2413. {
  2414. writer.Write(NameColor.ToArgb());
  2415. }
  2416. }
  2417. public sealed class ObjectColorChanged : Packet
  2418. {
  2419. public override ushort Index
  2420. {
  2421. get { return (ushort)ServerPacketIds.ObjectColorChanged; }
  2422. }
  2423. public uint ObjectID;
  2424. public Color NameColor;
  2425. protected override void ReadPacket(BinaryReader reader)
  2426. {
  2427. ObjectID = reader.ReadUInt32();
  2428. NameColor = Color.FromArgb(reader.ReadInt32());
  2429. }
  2430. protected override void WritePacket(BinaryWriter writer)
  2431. {
  2432. writer.Write(ObjectID);
  2433. writer.Write(NameColor.ToArgb());
  2434. }
  2435. }
  2436. public sealed class ObjectGuildNameChanged : Packet
  2437. {
  2438. public override ushort Index
  2439. {
  2440. get { return (ushort)ServerPacketIds.ObjectGuildNameChanged; }
  2441. }
  2442. public uint ObjectID;
  2443. public string GuildName;
  2444. protected override void ReadPacket(BinaryReader reader)
  2445. {
  2446. ObjectID = reader.ReadUInt32();
  2447. GuildName = reader.ReadString();
  2448. }
  2449. protected override void WritePacket(BinaryWriter writer)
  2450. {
  2451. writer.Write(ObjectID);
  2452. writer.Write(GuildName);
  2453. }
  2454. }
  2455. public sealed class GainExperience : Packet
  2456. {
  2457. public override ushort Index
  2458. {
  2459. get { return (ushort)ServerPacketIds.GainExperience; }
  2460. }
  2461. public uint Amount;
  2462. public bool Levellock;
  2463. public bool WepExp;
  2464. protected override void ReadPacket(BinaryReader reader)
  2465. {
  2466. Amount = reader.ReadUInt32();
  2467. Levellock = reader.ReadBoolean();
  2468. WepExp = reader.ReadBoolean();
  2469. }
  2470. protected override void WritePacket(BinaryWriter writer)
  2471. {
  2472. writer.Write(Amount);
  2473. writer.Write(Levellock);
  2474. writer.Write(WepExp);
  2475. }
  2476. }
  2477. public sealed class SubExperience : Packet
  2478. {
  2479. public override ushort Index
  2480. {
  2481. get { return (ushort)ServerPacketIds.SubExperience; }
  2482. }
  2483. public uint Amount;
  2484. protected override void ReadPacket(BinaryReader reader)
  2485. {
  2486. Amount = reader.ReadUInt32();
  2487. }
  2488. protected override void WritePacket(BinaryWriter writer)
  2489. {
  2490. writer.Write(Amount);
  2491. }
  2492. }
  2493. public sealed class LevelChanged : Packet
  2494. {
  2495. public override ushort Index
  2496. {
  2497. get { return (ushort)ServerPacketIds.LevelChanged; }
  2498. }
  2499. public ushort Level;
  2500. public long Experience, MaxExperience;
  2501. protected override void ReadPacket(BinaryReader reader)
  2502. {
  2503. Level = reader.ReadUInt16();
  2504. Experience = reader.ReadInt64();
  2505. MaxExperience = reader.ReadInt64();
  2506. }
  2507. protected override void WritePacket(BinaryWriter writer)
  2508. {
  2509. writer.Write(Level);
  2510. writer.Write(Experience);
  2511. writer.Write(MaxExperience);
  2512. }
  2513. }
  2514. //自写扩展属性更新封包
  2515. public sealed class ExtraChanged : Packet
  2516. {
  2517. public override ushort Index
  2518. {
  2519. get { return (ushort)ServerPacketIds.ExtraChanged; }
  2520. }
  2521. public ushort LevelBonus;
  2522. public ushort ExtraHP;
  2523. public ushort ExtraMP;
  2524. public ushort ExtraAC;
  2525. public ushort ExtraMAC;
  2526. public ushort ExtraDC;
  2527. public ushort ExtraMC;
  2528. public ushort ExtraSC;
  2529. public ushort ExtraFire;
  2530. public ushort ExtraIce;
  2531. public ushort ExtraLight;
  2532. public ushort ExtraWind;
  2533. public ushort ExtraHoly;
  2534. public ushort ExtraDark;
  2535. public ushort ExtraPhantom;
  2536. protected override void ReadPacket(BinaryReader reader)
  2537. {
  2538. LevelBonus = reader.ReadUInt16();
  2539. ExtraHP = reader.ReadUInt16();
  2540. ExtraMP = reader.ReadUInt16();
  2541. ExtraAC = reader.ReadUInt16();
  2542. ExtraMAC = reader.ReadUInt16();
  2543. ExtraDC = reader.ReadUInt16();
  2544. ExtraMC = reader.ReadUInt16();
  2545. ExtraSC = reader.ReadUInt16();
  2546. ExtraFire = reader.ReadUInt16();
  2547. ExtraIce = reader.ReadUInt16();
  2548. ExtraLight = reader.ReadUInt16();
  2549. ExtraWind = reader.ReadUInt16();
  2550. ExtraHoly = reader.ReadUInt16();
  2551. ExtraDark = reader.ReadUInt16();
  2552. ExtraPhantom = reader.ReadUInt16();
  2553. }
  2554. protected override void WritePacket(BinaryWriter writer)
  2555. {
  2556. writer.Write(LevelBonus);
  2557. writer.Write(ExtraHP);
  2558. writer.Write(ExtraMP);
  2559. writer.Write(ExtraAC);
  2560. writer.Write(ExtraMAC);
  2561. writer.Write(ExtraDC);
  2562. writer.Write(ExtraMC);
  2563. writer.Write(ExtraSC);
  2564. writer.Write(ExtraFire);
  2565. writer.Write(ExtraIce);
  2566. writer.Write(ExtraLight);
  2567. writer.Write(ExtraWind);
  2568. writer.Write(ExtraHoly);
  2569. writer.Write(ExtraDark);
  2570. writer.Write(ExtraPhantom);
  2571. }
  2572. }
  2573. public sealed class ObjectLeveled : Packet
  2574. {
  2575. public override ushort Index
  2576. {
  2577. get { return (ushort)ServerPacketIds.ObjectLeveled; }
  2578. }
  2579. public uint ObjectID;
  2580. protected override void ReadPacket(BinaryReader reader)
  2581. {
  2582. ObjectID = reader.ReadUInt32();
  2583. }
  2584. protected override void WritePacket(BinaryWriter writer)
  2585. {
  2586. writer.Write(ObjectID);
  2587. }
  2588. }
  2589. //武器升级广播包
  2590. public sealed class ObjectWpLeveled : Packet
  2591. {
  2592. public override ushort Index
  2593. {
  2594. get { return (ushort)ServerPacketIds.ObjectWpLeveled; }
  2595. }
  2596. public uint ObjectID;
  2597. public Point Location;
  2598. public MirDirection Direction;
  2599. public bool WepExp;
  2600. protected override void ReadPacket(BinaryReader reader)
  2601. {
  2602. ObjectID = reader.ReadUInt32();
  2603. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  2604. Direction = (MirDirection)reader.ReadByte();
  2605. WepExp = reader.ReadBoolean();
  2606. }
  2607. protected override void WritePacket(BinaryWriter writer)
  2608. {
  2609. writer.Write(ObjectID);
  2610. writer.Write(Location.X);
  2611. writer.Write(Location.Y);
  2612. writer.Write((byte)Direction);
  2613. writer.Write(WepExp);
  2614. }
  2615. }
  2616. // //自写头盔显示更新封包
  2617. public sealed class ObjectShowHelmet : Packet
  2618. {
  2619. public override ushort Index
  2620. {
  2621. get { return (ushort)ServerPacketIds.ObjectShowHelmet; }
  2622. }
  2623. public uint ObjectID;
  2624. public bool Helmetoff;
  2625. protected override void ReadPacket(BinaryReader reader)
  2626. {
  2627. ObjectID = reader.ReadUInt32();
  2628. Helmetoff = reader.ReadBoolean();
  2629. }
  2630. protected override void WritePacket(BinaryWriter writer)
  2631. {
  2632. writer.Write(ObjectID);
  2633. writer.Write(Helmetoff);
  2634. }
  2635. }
  2636. public sealed class ObjectHarvest : Packet
  2637. {
  2638. public override ushort Index
  2639. {
  2640. get { return (ushort)ServerPacketIds.ObjectHarvest; }
  2641. }
  2642. public uint ObjectID;
  2643. public Point Location;
  2644. public MirDirection Direction;
  2645. protected override void ReadPacket(BinaryReader reader)
  2646. {
  2647. ObjectID = reader.ReadUInt32();
  2648. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  2649. Direction = (MirDirection)reader.ReadByte();
  2650. }
  2651. protected override void WritePacket(BinaryWriter writer)
  2652. {
  2653. writer.Write(ObjectID);
  2654. writer.Write(Location.X);
  2655. writer.Write(Location.Y);
  2656. writer.Write((byte)Direction);
  2657. }
  2658. }
  2659. public sealed class ObjectHarvested : Packet
  2660. {
  2661. public override ushort Index
  2662. {
  2663. get { return (ushort)ServerPacketIds.ObjectHarvested; }
  2664. }
  2665. public uint ObjectID;
  2666. public Point Location;
  2667. public MirDirection Direction;
  2668. protected override void ReadPacket(BinaryReader reader)
  2669. {
  2670. ObjectID = reader.ReadUInt32();
  2671. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  2672. Direction = (MirDirection)reader.ReadByte();
  2673. }
  2674. protected override void WritePacket(BinaryWriter writer)
  2675. {
  2676. writer.Write(ObjectID);
  2677. writer.Write(Location.X);
  2678. writer.Write(Location.Y);
  2679. writer.Write((byte)Direction);
  2680. }
  2681. }
  2682. public sealed class ObjectNPC : Packet
  2683. {
  2684. public override ushort Index
  2685. {
  2686. get { return (ushort)ServerPacketIds.ObjectNpc; }
  2687. }
  2688. public uint ObjectID;
  2689. public string Name = string.Empty;
  2690. public Color NameColor;
  2691. public byte Image;
  2692. public Point Location;
  2693. public MirDirection Direction;
  2694. public List<int> QuestIDs = new List<int>();
  2695. public int NPCIndex;
  2696. protected override void ReadPacket(BinaryReader reader)
  2697. {
  2698. ObjectID = reader.ReadUInt32();
  2699. Name = reader.ReadString();
  2700. NameColor = Color.FromArgb(reader.ReadInt32());
  2701. Image = reader.ReadByte();
  2702. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  2703. Direction = (MirDirection)reader.ReadByte();
  2704. int count = reader.ReadInt32();
  2705. for (var i = 0; i < count; i++)
  2706. QuestIDs.Add(reader.ReadInt32());
  2707. NPCIndex= reader.ReadInt32();
  2708. }
  2709. protected override void WritePacket(BinaryWriter writer)
  2710. {
  2711. writer.Write(ObjectID);
  2712. writer.Write(Name);
  2713. writer.Write(NameColor.ToArgb());
  2714. writer.Write(Image);
  2715. writer.Write(Location.X);
  2716. writer.Write(Location.Y);
  2717. writer.Write((byte)Direction);
  2718. writer.Write(QuestIDs.Count);
  2719. for (int i = 0; i < QuestIDs.Count; i++)
  2720. writer.Write(QuestIDs[i]);
  2721. writer.Write(NPCIndex);
  2722. }
  2723. }
  2724. public sealed class QueryMapNPCs : Packet
  2725. {
  2726. public override ushort Index
  2727. {
  2728. get { return (ushort)ServerPacketIds.QueryMapNPCs; }
  2729. }
  2730. public int MapIndex;
  2731. public int BigMap, MiniMap;
  2732. public string FileName;
  2733. public List<string> Names=new List<string>();
  2734. public List<Point> Locations=new List<Point>();
  2735. public List<int> MovementMaps=new List<int>();
  2736. public List<Point> MovementLocations=new List<Point>();
  2737. protected override void ReadPacket(BinaryReader reader)
  2738. {
  2739. MapIndex = reader.ReadInt32();
  2740. BigMap = reader.ReadInt32();
  2741. MiniMap = reader.ReadInt32();
  2742. FileName = reader.ReadString();
  2743. int count = reader.ReadInt32();
  2744. for (var i = 0; i < count; i++)
  2745. {
  2746. Names.Add(reader.ReadString());
  2747. Locations.Add(new Point(reader.ReadInt32(), reader.ReadInt32()));
  2748. }
  2749. count = reader.ReadInt32();
  2750. for (var i = 0; i < count; i++)
  2751. {
  2752. MovementMaps.Add(reader.ReadInt32());
  2753. MovementLocations.Add(new Point(reader.ReadInt32(), reader.ReadInt32()));
  2754. }
  2755. }
  2756. protected override void WritePacket(BinaryWriter writer)
  2757. {
  2758. writer.Write(MapIndex);
  2759. writer.Write(BigMap);
  2760. writer.Write(MiniMap);
  2761. writer.Write(FileName);
  2762. writer.Write(Names.Count);
  2763. for (int i = 0; i < Names.Count; i++)
  2764. {
  2765. writer.Write(Names[i]);
  2766. writer.Write(Locations[i].X);
  2767. writer.Write(Locations[i].Y);
  2768. }
  2769. writer.Write(MovementMaps.Count);
  2770. for (int i = 0; i < MovementMaps.Count; i++)
  2771. {
  2772. writer.Write(MovementMaps[i]);
  2773. writer.Write(MovementLocations[i].X);
  2774. writer.Write(MovementLocations[i].Y);
  2775. }
  2776. }
  2777. }
  2778. public sealed class QueryAllMaps : Packet
  2779. {
  2780. public override ushort Index
  2781. {
  2782. get { return (ushort)ServerPacketIds.QueryAllMaps; }
  2783. }
  2784. public List<int> MapIndexs = new List<int>();
  2785. public List<string> MapNames = new List<string>();
  2786. protected override void ReadPacket(BinaryReader reader)
  2787. {
  2788. int count = reader.ReadInt32();
  2789. for (var i = 0; i < count; i++)
  2790. {
  2791. MapIndexs.Add(reader.ReadInt32());
  2792. MapNames.Add(reader.ReadString());
  2793. }
  2794. }
  2795. protected override void WritePacket(BinaryWriter writer)
  2796. {
  2797. writer.Write(MapIndexs.Count);
  2798. for (int i = 0; i < MapIndexs.Count; i++)
  2799. {
  2800. writer.Write(MapIndexs[i]);
  2801. writer.Write(MapNames[i]);
  2802. }
  2803. }
  2804. }
  2805. public sealed class NPCResponse : Packet
  2806. {
  2807. public override ushort Index { get { return (ushort)ServerPacketIds.NPCResponse; } }
  2808. public List<string> Page;
  2809. protected override void ReadPacket(BinaryReader reader)
  2810. {
  2811. Page = new List<string>();
  2812. int count = reader.ReadInt32();
  2813. for (int i = 0; i < count; i++)
  2814. Page.Add(reader.ReadString());
  2815. }
  2816. protected override void WritePacket(BinaryWriter writer)
  2817. {
  2818. writer.Write(Page.Count);
  2819. for (int i = 0; i < Page.Count; i++)
  2820. writer.Write(Page[i]);
  2821. }
  2822. }
  2823. public sealed class NPCDocument : Packet
  2824. {
  2825. public override ushort Index { get { return (ushort)ServerPacketIds.NPCDocument; } }
  2826. public string Html;
  2827. protected override void ReadPacket(BinaryReader reader)
  2828. {
  2829. Html = reader.ReadString();
  2830. }
  2831. protected override void WritePacket(BinaryWriter writer)
  2832. {
  2833. writer.Write(Html);
  2834. }
  2835. }
  2836. public sealed class ObjectHide : Packet
  2837. {
  2838. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectHide; } }
  2839. public uint ObjectID;
  2840. protected override void ReadPacket(BinaryReader reader)
  2841. {
  2842. ObjectID = reader.ReadUInt32();
  2843. }
  2844. protected override void WritePacket(BinaryWriter writer)
  2845. {
  2846. writer.Write(ObjectID);
  2847. }
  2848. }
  2849. public sealed class ObjectShow : Packet
  2850. {
  2851. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectShow; } }
  2852. public uint ObjectID;
  2853. protected override void ReadPacket(BinaryReader reader)
  2854. {
  2855. ObjectID = reader.ReadUInt32();
  2856. }
  2857. protected override void WritePacket(BinaryWriter writer)
  2858. {
  2859. writer.Write(ObjectID);
  2860. }
  2861. }
  2862. public sealed class Poisoned : Packet
  2863. {
  2864. public override ushort Index { get { return (ushort)ServerPacketIds.Poisoned; } }
  2865. public PoisonType Poison;
  2866. protected override void ReadPacket(BinaryReader reader)
  2867. {
  2868. Poison = (PoisonType)reader.ReadUInt16();
  2869. }
  2870. protected override void WritePacket(BinaryWriter writer)
  2871. {
  2872. writer.Write((ushort)Poison);
  2873. }
  2874. }
  2875. public sealed class ObjectPoisoned : Packet
  2876. {
  2877. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectPoisoned; } }
  2878. public uint ObjectID;
  2879. public PoisonType Poison;
  2880. protected override void ReadPacket(BinaryReader reader)
  2881. {
  2882. ObjectID = reader.ReadUInt32();
  2883. Poison = (PoisonType)reader.ReadUInt16();
  2884. }
  2885. protected override void WritePacket(BinaryWriter writer)
  2886. {
  2887. writer.Write(ObjectID);
  2888. writer.Write((ushort)Poison);
  2889. }
  2890. }
  2891. public sealed class MapChanged : Packet
  2892. {
  2893. public override ushort Index
  2894. {
  2895. get { return (ushort)ServerPacketIds.MapChanged; }
  2896. }
  2897. public string FileName = string.Empty;
  2898. public string Title = string.Empty;
  2899. public ushort MiniMap, BigMap, Music;
  2900. public LightSetting Lights;
  2901. public Point Location;
  2902. public MirDirection Direction;
  2903. public byte MapDarkLight;
  2904. public int MapIndex;
  2905. protected override void ReadPacket(BinaryReader reader)
  2906. {
  2907. FileName = reader.ReadString();
  2908. Title = reader.ReadString();
  2909. MiniMap = reader.ReadUInt16();
  2910. BigMap = reader.ReadUInt16();
  2911. Lights = (LightSetting)reader.ReadByte();
  2912. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  2913. Direction = (MirDirection)reader.ReadByte();
  2914. MapDarkLight = reader.ReadByte();
  2915. Music = reader.ReadUInt16();
  2916. MapIndex = reader.ReadInt32();
  2917. }
  2918. protected override void WritePacket(BinaryWriter writer)
  2919. {
  2920. writer.Write(FileName);
  2921. writer.Write(Title);
  2922. writer.Write(MiniMap);
  2923. writer.Write(BigMap);
  2924. writer.Write((byte)Lights);
  2925. writer.Write(Location.X);
  2926. writer.Write(Location.Y);
  2927. writer.Write((byte)Direction);
  2928. writer.Write(MapDarkLight);
  2929. writer.Write(Music);
  2930. writer.Write(MapIndex);
  2931. }
  2932. }
  2933. public sealed class ObjectTeleportOut : Packet
  2934. {
  2935. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectTeleportOut; } }
  2936. public uint ObjectID;
  2937. public byte Type;
  2938. protected override void ReadPacket(BinaryReader reader)
  2939. {
  2940. ObjectID = reader.ReadUInt32();
  2941. Type = reader.ReadByte();
  2942. }
  2943. protected override void WritePacket(BinaryWriter writer)
  2944. {
  2945. writer.Write(ObjectID);
  2946. writer.Write(Type);
  2947. }
  2948. }
  2949. public sealed class ObjectTeleportIn : Packet
  2950. {
  2951. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectTeleportIn; } }
  2952. public uint ObjectID;
  2953. public byte Type;
  2954. protected override void ReadPacket(BinaryReader reader)
  2955. {
  2956. ObjectID = reader.ReadUInt32();
  2957. Type = reader.ReadByte();
  2958. }
  2959. protected override void WritePacket(BinaryWriter writer)
  2960. {
  2961. writer.Write(ObjectID);
  2962. writer.Write(Type);
  2963. }
  2964. }
  2965. public sealed class TeleportIn : Packet
  2966. {
  2967. public override ushort Index { get { return (ushort)ServerPacketIds.TeleportIn; } }
  2968. protected override void ReadPacket(BinaryReader reader)
  2969. {
  2970. }
  2971. protected override void WritePacket(BinaryWriter writer)
  2972. {
  2973. }
  2974. }
  2975. public sealed class NPCSelectGoods : Packet
  2976. {
  2977. public override ushort Index { get { return (ushort)ServerPacketIds.NPCSelectGoods; } }
  2978. public List<UserItem> Items = new List<UserItem>();
  2979. public float Rate;
  2980. protected override void ReadPacket(BinaryReader reader)
  2981. {
  2982. int count = reader.ReadInt32();
  2983. for (int i = 0; i < count; i++)
  2984. Items.Add(new UserItem(reader));
  2985. Rate = reader.ReadSingle();
  2986. }
  2987. protected override void WritePacket(BinaryWriter writer)
  2988. {
  2989. writer.Write(Items.Count);
  2990. for (int i = 0; i < Items.Count; i++)
  2991. Items[i].Save(writer);
  2992. writer.Write(Rate);
  2993. }
  2994. }
  2995. public sealed class NPCGoods : Packet
  2996. {
  2997. public override ushort Index { get { return (ushort)ServerPacketIds.NPCGoods; } }
  2998. public List<UserItem> List = new List<UserItem>();
  2999. public float Rate;
  3000. public bool IsBuyBack = false;
  3001. protected override void ReadPacket(BinaryReader reader)
  3002. {
  3003. int count = reader.ReadInt32();
  3004. for (int i = 0; i < count; i++)
  3005. List.Add(new UserItem(reader));
  3006. Rate = reader.ReadSingle();
  3007. IsBuyBack = reader.ReadBoolean();
  3008. //IsCanBuyUsed = reader.ReadBoolean();
  3009. //count= reader.ReadInt32();
  3010. //for (int i = 0; i < count; i++)
  3011. // UsedList.Add(new UserItem(reader));
  3012. }
  3013. protected override void WritePacket(BinaryWriter writer)
  3014. {
  3015. writer.Write(List.Count);
  3016. for (int i = 0; i < List.Count; i++)
  3017. List[i].Save(writer);
  3018. writer.Write(Rate);
  3019. writer.Write(IsBuyBack);
  3020. //writer.Write(IsCanBuyUsed);
  3021. //writer.Write(UsedList.Count);
  3022. //for (int i = 0; i < UsedList.Count; i++)
  3023. // UsedList[i].Save(writer);
  3024. }
  3025. }
  3026. public sealed class StartMACUpgrade : Packet
  3027. {
  3028. public override ushort Index { get { return (ushort)ServerPacketIds.StartMACUpgrade; } }
  3029. public string MACValue;
  3030. public List<int> ItemList1=new List<int>();
  3031. public List<int> ItemList2=new List<int>();
  3032. protected override void ReadPacket(BinaryReader reader)
  3033. {
  3034. MACValue = reader.ReadString();
  3035. int count= reader.ReadInt32();
  3036. for (int i = 0; i < count; i++)
  3037. {
  3038. ItemList1.Add(reader.ReadInt32());
  3039. }
  3040. count = reader.ReadInt32();
  3041. for (int i = 0; i < count; i++)
  3042. {
  3043. ItemList2.Add(reader.ReadInt32());
  3044. }
  3045. }
  3046. protected override void WritePacket(BinaryWriter writer)
  3047. {
  3048. writer.Write(MACValue);
  3049. writer.Write(ItemList1.Count);
  3050. for (int i = 0; i < ItemList1.Count; i++)
  3051. {
  3052. writer.Write(ItemList1[i]);
  3053. }
  3054. writer.Write(ItemList2.Count);
  3055. for (int i = 0; i < ItemList2.Count; i++)
  3056. {
  3057. writer.Write(ItemList2[i]);
  3058. }
  3059. }
  3060. }
  3061. public sealed class ClearMACUpgrade : Packet
  3062. {
  3063. public override ushort Index { get { return (ushort)ServerPacketIds.ClearMACUpgrade; } }
  3064. public string MACValue;
  3065. protected override void ReadPacket(BinaryReader reader)
  3066. {
  3067. MACValue = reader.ReadString();
  3068. }
  3069. protected override void WritePacket(BinaryWriter writer)
  3070. {
  3071. writer.Write(MACValue);
  3072. }
  3073. }
  3074. public sealed class MACUpgradeResult : Packet
  3075. {
  3076. public override ushort Index { get { return (ushort)ServerPacketIds.MACUpgradeResult; } }
  3077. public int result;
  3078. protected override void ReadPacket(BinaryReader reader)
  3079. {
  3080. result=reader.ReadInt32();
  3081. }
  3082. protected override void WritePacket(BinaryWriter writer)
  3083. {
  3084. writer.Write(result);
  3085. }
  3086. }
  3087. public sealed class NPCSell : Packet
  3088. {
  3089. public override ushort Index { get { return (ushort)ServerPacketIds.NPCSell; } }
  3090. protected override void ReadPacket(BinaryReader reader)
  3091. {
  3092. }
  3093. protected override void WritePacket(BinaryWriter writer)
  3094. {
  3095. }
  3096. }
  3097. public sealed class NPCRepair : Packet
  3098. {
  3099. public override ushort Index { get { return (ushort)ServerPacketIds.NPCRepair; } }
  3100. public float Rate;
  3101. protected override void ReadPacket(BinaryReader reader)
  3102. {
  3103. Rate = reader.ReadSingle();
  3104. }
  3105. protected override void WritePacket(BinaryWriter writer)
  3106. {
  3107. writer.Write(Rate);
  3108. }
  3109. }
  3110. public sealed class NPCSRepair : Packet
  3111. {
  3112. public override ushort Index { get { return (ushort)ServerPacketIds.NPCSRepair; } }
  3113. public float Rate;
  3114. protected override void ReadPacket(BinaryReader reader)
  3115. {
  3116. Rate = reader.ReadSingle();
  3117. }
  3118. protected override void WritePacket(BinaryWriter writer)
  3119. {
  3120. writer.Write(Rate);
  3121. }
  3122. }
  3123. public sealed class NPCRefine : Packet
  3124. {
  3125. public override ushort Index { get { return (ushort)ServerPacketIds.NPCRefine; } }
  3126. public float Rate;
  3127. public bool Refining;
  3128. protected override void ReadPacket(BinaryReader reader)
  3129. {
  3130. Rate = reader.ReadSingle();
  3131. Refining = reader.ReadBoolean();
  3132. }
  3133. protected override void WritePacket(BinaryWriter writer)
  3134. {
  3135. writer.Write(Rate);
  3136. writer.Write(Refining);
  3137. }
  3138. }
  3139. public sealed class NPCCheckRefine : Packet
  3140. {
  3141. public override ushort Index { get { return (ushort)ServerPacketIds.NPCCheckRefine; } }
  3142. protected override void ReadPacket(BinaryReader reader)
  3143. {
  3144. }
  3145. protected override void WritePacket(BinaryWriter writer)
  3146. {
  3147. }
  3148. }
  3149. public sealed class NPCCollectRefine : Packet
  3150. {
  3151. public override ushort Index { get { return (ushort)ServerPacketIds.NPCCollectRefine; } }
  3152. public bool Success;
  3153. protected override void ReadPacket(BinaryReader reader)
  3154. {
  3155. Success = reader.ReadBoolean();
  3156. }
  3157. protected override void WritePacket(BinaryWriter writer)
  3158. {
  3159. writer.Write(Success);
  3160. }
  3161. }
  3162. public sealed class NPCReplaceWedRing : Packet
  3163. {
  3164. public override ushort Index { get { return (ushort)ServerPacketIds.NPCReplaceWedRing; } }
  3165. public float Rate;
  3166. protected override void ReadPacket(BinaryReader reader)
  3167. {
  3168. Rate = reader.ReadSingle();
  3169. }
  3170. protected override void WritePacket(BinaryWriter writer)
  3171. {
  3172. writer.Write(Rate);
  3173. }
  3174. }
  3175. public sealed class NPCStorage : Packet
  3176. {
  3177. public override ushort Index { get { return (ushort)ServerPacketIds.NPCStorage; } }
  3178. protected override void ReadPacket(BinaryReader reader)
  3179. {
  3180. }
  3181. protected override void WritePacket(BinaryWriter writer)
  3182. {
  3183. }
  3184. }
  3185. public sealed class SellItem : Packet
  3186. {
  3187. public override ushort Index { get { return (ushort)ServerPacketIds.SellItem; } }
  3188. public ulong UniqueID;
  3189. public uint Count;
  3190. public bool Success;
  3191. protected override void ReadPacket(BinaryReader reader)
  3192. {
  3193. UniqueID = reader.ReadUInt64();
  3194. Count = reader.ReadUInt32();
  3195. Success = reader.ReadBoolean();
  3196. }
  3197. protected override void WritePacket(BinaryWriter writer)
  3198. {
  3199. writer.Write(UniqueID);
  3200. writer.Write(Count);
  3201. writer.Write(Success);
  3202. }
  3203. }
  3204. public sealed class RepairItem : Packet
  3205. {
  3206. public override ushort Index { get { return (ushort)ServerPacketIds.RepairItem; } }
  3207. public ulong UniqueID;
  3208. protected override void ReadPacket(BinaryReader reader)
  3209. {
  3210. UniqueID = reader.ReadUInt64();
  3211. }
  3212. protected override void WritePacket(BinaryWriter writer)
  3213. {
  3214. writer.Write(UniqueID);
  3215. }
  3216. }
  3217. public sealed class ItemRepaired : Packet
  3218. {
  3219. public override ushort Index { get { return (ushort)ServerPacketIds.ItemRepaired; } }
  3220. public ulong UniqueID;
  3221. public int MaxDura, CurrentDura;
  3222. protected override void ReadPacket(BinaryReader reader)
  3223. {
  3224. UniqueID = reader.ReadUInt64();
  3225. MaxDura = reader.ReadInt32();
  3226. CurrentDura = reader.ReadInt32();
  3227. }
  3228. protected override void WritePacket(BinaryWriter writer)
  3229. {
  3230. writer.Write(UniqueID);
  3231. writer.Write(MaxDura);
  3232. writer.Write(CurrentDura);
  3233. }
  3234. }
  3235. public sealed class NewMagic : Packet
  3236. {
  3237. public override ushort Index
  3238. {
  3239. get { return (ushort)ServerPacketIds.NewMagic; }
  3240. }
  3241. public ClientMagic Magic;
  3242. protected override void ReadPacket(BinaryReader reader)
  3243. {
  3244. Magic = new ClientMagic(reader);
  3245. }
  3246. protected override void WritePacket(BinaryWriter writer)
  3247. {
  3248. Magic.Save(writer);
  3249. }
  3250. }
  3251. public sealed class RemoveMagic : Packet
  3252. {
  3253. public override ushort Index
  3254. {
  3255. get { return (ushort)ServerPacketIds.RemoveMagic; }
  3256. }
  3257. public int PlaceId;
  3258. protected override void ReadPacket(BinaryReader reader)
  3259. {
  3260. PlaceId = reader.ReadInt32();
  3261. }
  3262. protected override void WritePacket(BinaryWriter writer)
  3263. {
  3264. writer.Write(PlaceId);
  3265. }
  3266. }
  3267. public sealed class MagicLeveled : Packet
  3268. {
  3269. public override ushort Index
  3270. {
  3271. get { return (ushort)ServerPacketIds.MagicLeveled; }
  3272. }
  3273. public Spell Spell;
  3274. public byte Level;
  3275. public ushort Experience;
  3276. protected override void ReadPacket(BinaryReader reader)
  3277. {
  3278. Spell = (Spell)reader.ReadByte();
  3279. Level = reader.ReadByte();
  3280. Experience = reader.ReadUInt16();
  3281. }
  3282. protected override void WritePacket(BinaryWriter writer)
  3283. {
  3284. writer.Write((byte)Spell);
  3285. writer.Write(Level);
  3286. writer.Write(Experience);
  3287. }
  3288. }
  3289. public sealed class Magic : Packet
  3290. {
  3291. public override ushort Index { get { return (ushort)ServerPacketIds.Magic; } }
  3292. public Spell Spell;
  3293. public uint TargetID;
  3294. public Point Target;
  3295. public bool Cast;
  3296. public byte Level;
  3297. protected override void ReadPacket(BinaryReader reader)
  3298. {
  3299. Spell = (Spell)reader.ReadByte();
  3300. TargetID = reader.ReadUInt32();
  3301. Target = new Point(reader.ReadInt32(), reader.ReadInt32());
  3302. Cast = reader.ReadBoolean();
  3303. Level = reader.ReadByte();
  3304. }
  3305. protected override void WritePacket(BinaryWriter writer)
  3306. {
  3307. writer.Write((byte)Spell);
  3308. writer.Write(TargetID);
  3309. writer.Write(Target.X);
  3310. writer.Write(Target.Y);
  3311. writer.Write(Cast);
  3312. writer.Write(Level);
  3313. }
  3314. }
  3315. public sealed class MagicDelay : Packet
  3316. {
  3317. public override ushort Index { get { return (ushort)ServerPacketIds.MagicDelay; } }
  3318. public Spell Spell;
  3319. public long Delay;
  3320. protected override void ReadPacket(BinaryReader reader)
  3321. {
  3322. Spell = (Spell)reader.ReadByte();
  3323. Delay = reader.ReadInt64();
  3324. }
  3325. protected override void WritePacket(BinaryWriter writer)
  3326. {
  3327. writer.Write((byte)Spell);
  3328. writer.Write(Delay);
  3329. }
  3330. }
  3331. public sealed class MagicCast : Packet
  3332. {
  3333. public override ushort Index { get { return (ushort)ServerPacketIds.MagicCast; } }
  3334. public Spell Spell;
  3335. protected override void ReadPacket(BinaryReader reader)
  3336. {
  3337. Spell = (Spell)reader.ReadByte();
  3338. }
  3339. protected override void WritePacket(BinaryWriter writer)
  3340. {
  3341. writer.Write((byte)Spell);
  3342. }
  3343. }
  3344. public sealed class ObjectMagic : Packet
  3345. {
  3346. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectMagic; } }
  3347. public uint ObjectID;
  3348. public Point Location;
  3349. public MirDirection Direction;
  3350. public Spell Spell;
  3351. public uint TargetID;
  3352. public Point Target;
  3353. public bool Cast;
  3354. public byte Level;
  3355. public bool SelfBroadcast = false;
  3356. protected override void ReadPacket(BinaryReader reader)
  3357. {
  3358. ObjectID = reader.ReadUInt32();
  3359. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3360. Direction = (MirDirection)reader.ReadByte();
  3361. Spell = (Spell)reader.ReadByte();
  3362. TargetID = reader.ReadUInt32();
  3363. Target = new Point(reader.ReadInt32(), reader.ReadInt32());
  3364. Cast = reader.ReadBoolean();
  3365. Level = reader.ReadByte();
  3366. SelfBroadcast = reader.ReadBoolean();
  3367. }
  3368. protected override void WritePacket(BinaryWriter writer)
  3369. {
  3370. writer.Write(ObjectID);
  3371. writer.Write(Location.X);
  3372. writer.Write(Location.Y);
  3373. writer.Write((byte)Direction);
  3374. writer.Write((byte)Spell);
  3375. writer.Write(TargetID);
  3376. writer.Write(Target.X);
  3377. writer.Write(Target.Y);
  3378. writer.Write(Cast);
  3379. writer.Write(Level);
  3380. writer.Write(SelfBroadcast);
  3381. }
  3382. }
  3383. public sealed class ObjectEffect : Packet
  3384. {
  3385. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectEffect; } }
  3386. public uint ObjectID;
  3387. public SpellEffect Effect;
  3388. public uint EffectType;
  3389. public uint DelayTime = 0;
  3390. public uint Time = 0;
  3391. protected override void ReadPacket(BinaryReader reader)
  3392. {
  3393. ObjectID = reader.ReadUInt32();
  3394. Effect = (SpellEffect)reader.ReadByte();
  3395. EffectType = reader.ReadUInt32();
  3396. DelayTime = reader.ReadUInt32();
  3397. Time = reader.ReadUInt32();
  3398. }
  3399. protected override void WritePacket(BinaryWriter writer)
  3400. {
  3401. writer.Write(ObjectID);
  3402. writer.Write((byte)Effect);
  3403. writer.Write(EffectType);
  3404. writer.Write(DelayTime);
  3405. writer.Write(Time);
  3406. }
  3407. }
  3408. public sealed class RangeAttack : Packet //ArcherTest
  3409. {
  3410. public override ushort Index { get { return (ushort)ServerPacketIds.RangeAttack; } }
  3411. public uint TargetID;
  3412. public Point Target;
  3413. public Spell Spell;
  3414. protected override void ReadPacket(BinaryReader reader)
  3415. {
  3416. TargetID = reader.ReadUInt32();
  3417. Target = new Point(reader.ReadInt32(), reader.ReadInt32());
  3418. Spell = (Spell)reader.ReadByte();
  3419. }
  3420. protected override void WritePacket(BinaryWriter writer)
  3421. {
  3422. writer.Write(TargetID);
  3423. writer.Write(Target.X);
  3424. writer.Write(Target.Y);
  3425. writer.Write((byte)Spell);
  3426. }
  3427. }
  3428. public sealed class Pushed : Packet
  3429. {
  3430. public override ushort Index
  3431. {
  3432. get { return (ushort)ServerPacketIds.Pushed; }
  3433. }
  3434. public Point Location;
  3435. public MirDirection Direction;
  3436. protected override void ReadPacket(BinaryReader reader)
  3437. {
  3438. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3439. Direction = (MirDirection)reader.ReadByte();
  3440. }
  3441. protected override void WritePacket(BinaryWriter writer)
  3442. {
  3443. writer.Write(Location.X);
  3444. writer.Write(Location.Y);
  3445. writer.Write((byte)Direction);
  3446. }
  3447. }
  3448. public sealed class ObjectPushed : Packet
  3449. {
  3450. public override ushort Index
  3451. {
  3452. get { return (ushort)ServerPacketIds.ObjectPushed; }
  3453. }
  3454. public uint ObjectID;
  3455. public Point Location;
  3456. public MirDirection Direction;
  3457. protected override void ReadPacket(BinaryReader reader)
  3458. {
  3459. ObjectID = reader.ReadUInt32();
  3460. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3461. Direction = (MirDirection)reader.ReadByte();
  3462. }
  3463. protected override void WritePacket(BinaryWriter writer)
  3464. {
  3465. writer.Write(ObjectID);
  3466. writer.Write(Location.X);
  3467. writer.Write(Location.Y);
  3468. writer.Write((byte)Direction);
  3469. }
  3470. }
  3471. public sealed class ObjectName : Packet
  3472. {
  3473. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectName; } }
  3474. public uint ObjectID;
  3475. public string Name = string.Empty;
  3476. protected override void ReadPacket(BinaryReader reader)
  3477. {
  3478. ObjectID = reader.ReadUInt32();
  3479. Name = reader.ReadString();
  3480. }
  3481. protected override void WritePacket(BinaryWriter writer)
  3482. {
  3483. writer.Write(ObjectID);
  3484. writer.Write(Name);
  3485. }
  3486. }
  3487. public sealed class UserStorage : Packet
  3488. {
  3489. public override ushort Index { get { return (ushort)ServerPacketIds.UserStorage; } }
  3490. public UserItem[] Storage;
  3491. public List<bool> StorageBox;
  3492. protected override void ReadPacket(BinaryReader reader)
  3493. {
  3494. if (!reader.ReadBoolean()) return;
  3495. Storage = new UserItem[reader.ReadInt32()];
  3496. for (int i = 0; i < Storage.Length; i++)
  3497. {
  3498. if (!reader.ReadBoolean()) continue;
  3499. Storage[i] = new UserItem(reader);
  3500. }
  3501. int count=reader.ReadInt32();
  3502. StorageBox= new List<bool>();
  3503. for (int i = 0; i < count; i++)
  3504. {
  3505. StorageBox.Add(reader.ReadBoolean());
  3506. }
  3507. }
  3508. protected override void WritePacket(BinaryWriter writer)
  3509. {
  3510. writer.Write(Storage != null);
  3511. if (Storage == null) return;
  3512. writer.Write(Storage.Length);
  3513. for (int i = 0; i < Storage.Length; i++)
  3514. {
  3515. writer.Write(Storage[i] != null);
  3516. if (Storage[i] == null) continue;
  3517. Storage[i].Save(writer);
  3518. }
  3519. writer.Write(StorageBox.Count);
  3520. for (int i = 0; i < StorageBox.Count; i++)
  3521. {
  3522. writer.Write(StorageBox[i]);
  3523. }
  3524. }
  3525. }
  3526. public sealed class SwitchGroup : Packet
  3527. {
  3528. public override ushort Index { get { return (ushort)ServerPacketIds.SwitchGroup; } }
  3529. public bool AllowGroup;
  3530. protected override void ReadPacket(BinaryReader reader)
  3531. {
  3532. AllowGroup = reader.ReadBoolean();
  3533. }
  3534. protected override void WritePacket(BinaryWriter writer)
  3535. {
  3536. writer.Write(AllowGroup);
  3537. }
  3538. }
  3539. public sealed class DeleteGroup : Packet
  3540. {
  3541. public override ushort Index { get { return (ushort)ServerPacketIds.DeleteGroup; } }
  3542. protected override void ReadPacket(BinaryReader reader)
  3543. {
  3544. }
  3545. protected override void WritePacket(BinaryWriter writer)
  3546. {
  3547. }
  3548. }
  3549. public sealed class DeleteMember : Packet
  3550. {
  3551. public override ushort Index { get { return (ushort)ServerPacketIds.DeleteMember; } }
  3552. public string Name = string.Empty;
  3553. protected override void ReadPacket(BinaryReader reader)
  3554. {
  3555. Name = reader.ReadString();
  3556. }
  3557. protected override void WritePacket(BinaryWriter writer)
  3558. {
  3559. writer.Write(Name);
  3560. }
  3561. }
  3562. public sealed class MemberLocation : Packet //广播组队位置包类
  3563. {
  3564. public override ushort Index { get { return (ushort)ServerPacketIds.MemberLocation; } }
  3565. public Point Location;
  3566. public int CurrentMapIndex;
  3567. public uint ObjectID;
  3568. public string Name;
  3569. protected override void ReadPacket(BinaryReader reader)
  3570. {
  3571. ObjectID = reader.ReadUInt32();
  3572. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3573. CurrentMapIndex = reader.ReadInt32();
  3574. Name = reader.ReadString();
  3575. }
  3576. protected override void WritePacket(BinaryWriter writer)
  3577. {
  3578. writer.Write(ObjectID);
  3579. writer.Write(Location.X);
  3580. writer.Write(Location.Y);
  3581. writer.Write(CurrentMapIndex);
  3582. writer.Write(Name);
  3583. }
  3584. }
  3585. public sealed class GroupInvite : Packet
  3586. {
  3587. public override ushort Index { get { return (ushort)ServerPacketIds.GroupInvite; } }
  3588. public string Name = string.Empty;
  3589. protected override void ReadPacket(BinaryReader reader)
  3590. {
  3591. Name = reader.ReadString();
  3592. }
  3593. protected override void WritePacket(BinaryWriter writer)
  3594. {
  3595. writer.Write(Name);
  3596. }
  3597. }
  3598. public sealed class AddMember : Packet
  3599. {
  3600. public override ushort Index { get { return (ushort)ServerPacketIds.AddMember; } }
  3601. public string Name = string.Empty;
  3602. protected override void ReadPacket(BinaryReader reader)
  3603. {
  3604. Name = reader.ReadString();
  3605. }
  3606. protected override void WritePacket(BinaryWriter writer)
  3607. {
  3608. writer.Write(string.IsNullOrEmpty(Name)?"":Name);
  3609. }
  3610. }
  3611. public sealed class EnterAlive : Packet
  3612. {
  3613. public override ushort Index
  3614. {
  3615. get { return (ushort)ServerPacketIds.EnterAlive; }
  3616. }
  3617. public byte[] tag;
  3618. protected override void ReadPacket(BinaryReader reader)
  3619. {
  3620. tag = reader.ReadBytes(8);
  3621. }
  3622. protected override void WritePacket(BinaryWriter writer)
  3623. {
  3624. writer.Write(tag);
  3625. }
  3626. }
  3627. public sealed class Revived : Packet
  3628. {
  3629. public override ushort Index { get { return (ushort)ServerPacketIds.Revived; } }
  3630. protected override void ReadPacket(BinaryReader reader)
  3631. {
  3632. }
  3633. protected override void WritePacket(BinaryWriter writer)
  3634. {
  3635. }
  3636. }
  3637. public sealed class ObjectRevived : Packet
  3638. {
  3639. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectRevived; } }
  3640. public uint ObjectID;
  3641. public bool Effect;
  3642. protected override void ReadPacket(BinaryReader reader)
  3643. {
  3644. ObjectID = reader.ReadUInt32();
  3645. Effect = reader.ReadBoolean();
  3646. }
  3647. protected override void WritePacket(BinaryWriter writer)
  3648. {
  3649. writer.Write(ObjectID);
  3650. writer.Write(Effect);
  3651. }
  3652. }
  3653. public sealed class SpellToggle : Packet
  3654. {
  3655. public override ushort Index { get { return (ushort)ServerPacketIds.SpellToggle; } }
  3656. public Spell Spell;
  3657. public bool CanUse;
  3658. protected override void ReadPacket(BinaryReader reader)
  3659. {
  3660. Spell = (Spell)reader.ReadByte();
  3661. CanUse = reader.ReadBoolean();
  3662. }
  3663. protected override void WritePacket(BinaryWriter writer)
  3664. {
  3665. writer.Write((byte)Spell);
  3666. writer.Write(CanUse);
  3667. }
  3668. }
  3669. public sealed class ObjectHealth : Packet
  3670. {
  3671. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectHealth; } }
  3672. public uint ObjectID;
  3673. public byte Percent, Expire;
  3674. public uint HP, MaxHP;
  3675. protected override void ReadPacket(BinaryReader reader)
  3676. {
  3677. ObjectID = reader.ReadUInt32();
  3678. Percent = reader.ReadByte();
  3679. Expire = reader.ReadByte();
  3680. HP = reader.ReadUInt32();
  3681. MaxHP = reader.ReadUInt32();
  3682. }
  3683. protected override void WritePacket(BinaryWriter writer)
  3684. {
  3685. writer.Write(ObjectID);
  3686. writer.Write(Percent);
  3687. writer.Write(Expire);
  3688. writer.Write(HP);
  3689. writer.Write(MaxHP);
  3690. }
  3691. }
  3692. public sealed class MapEffect : Packet
  3693. {
  3694. public override ushort Index { get { return (ushort)ServerPacketIds.MapEffect; } }
  3695. public Point Location;
  3696. public SpellEffect Effect;
  3697. public byte Value;
  3698. protected override void ReadPacket(BinaryReader reader)
  3699. {
  3700. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3701. Effect = (SpellEffect)reader.ReadByte();
  3702. Value = reader.ReadByte();
  3703. }
  3704. protected override void WritePacket(BinaryWriter writer)
  3705. {
  3706. writer.Write(Location.X);
  3707. writer.Write(Location.Y);
  3708. writer.Write((byte)Effect);
  3709. writer.Write(Value);
  3710. }
  3711. }
  3712. public sealed class ObjectRangeAttack : Packet
  3713. {
  3714. public override ushort Index
  3715. {
  3716. get { return (ushort)ServerPacketIds.ObjectRangeAttack; }
  3717. }
  3718. public uint ObjectID;
  3719. public Point Location;
  3720. public MirDirection Direction;
  3721. public uint TargetID;
  3722. public Point Target;
  3723. public byte Type;
  3724. public Spell Spell;
  3725. protected override void ReadPacket(BinaryReader reader)
  3726. {
  3727. ObjectID = reader.ReadUInt32();
  3728. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3729. Direction = (MirDirection)reader.ReadByte();
  3730. TargetID = reader.ReadUInt32();
  3731. Target = new Point(reader.ReadInt32(), reader.ReadInt32());
  3732. Type = reader.ReadByte();
  3733. Spell = (Spell)reader.ReadByte();
  3734. }
  3735. protected override void WritePacket(BinaryWriter writer)
  3736. {
  3737. writer.Write(ObjectID);
  3738. writer.Write(Location.X);
  3739. writer.Write(Location.Y);
  3740. writer.Write((byte)Direction);
  3741. writer.Write(TargetID);
  3742. writer.Write(Target.X);
  3743. writer.Write(Target.Y);
  3744. writer.Write(Type);
  3745. writer.Write((byte)Spell);
  3746. }
  3747. }
  3748. public sealed class AddBuff : Packet
  3749. {
  3750. public override ushort Index { get { return (ushort)ServerPacketIds.AddBuff; } }
  3751. public BuffType Type;
  3752. public string Caster = string.Empty;
  3753. public uint ObjectID;
  3754. public bool Visible;
  3755. public long Expire;
  3756. public int[] Values;
  3757. public bool Infinite;
  3758. protected override void ReadPacket(BinaryReader reader)
  3759. {
  3760. Type = (BuffType)reader.ReadByte();
  3761. Caster = reader.ReadString();
  3762. Visible = reader.ReadBoolean();
  3763. ObjectID = reader.ReadUInt32();
  3764. Expire = reader.ReadInt64();
  3765. Values = new int[reader.ReadInt32()];
  3766. for (int i = 0; i < Values.Length; i++)
  3767. {
  3768. Values[i] = reader.ReadInt32();
  3769. }
  3770. Infinite = reader.ReadBoolean();
  3771. }
  3772. protected override void WritePacket(BinaryWriter writer)
  3773. {
  3774. writer.Write((byte)Type);
  3775. writer.Write(Caster);
  3776. writer.Write(Visible);
  3777. writer.Write(ObjectID);
  3778. writer.Write(Expire);
  3779. writer.Write(Values.Length);
  3780. for (int i = 0; i < Values.Length; i++)
  3781. {
  3782. writer.Write(Values[i]);
  3783. }
  3784. writer.Write(Infinite);
  3785. }
  3786. }
  3787. public sealed class RemoveBuff : Packet
  3788. {
  3789. public override ushort Index { get { return (ushort)ServerPacketIds.RemoveBuff; } }
  3790. public BuffType Type;
  3791. public uint ObjectID;
  3792. protected override void ReadPacket(BinaryReader reader)
  3793. {
  3794. Type = (BuffType)reader.ReadByte();
  3795. ObjectID = reader.ReadUInt32();
  3796. }
  3797. protected override void WritePacket(BinaryWriter writer)
  3798. {
  3799. writer.Write((byte)Type);
  3800. writer.Write(ObjectID);
  3801. }
  3802. }
  3803. public sealed class ObjectHidden : Packet
  3804. {
  3805. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectHidden; } }
  3806. public uint ObjectID;
  3807. public bool Hidden;
  3808. protected override void ReadPacket(BinaryReader reader)
  3809. {
  3810. ObjectID = reader.ReadUInt32();
  3811. Hidden = reader.ReadBoolean();
  3812. }
  3813. protected override void WritePacket(BinaryWriter writer)
  3814. {
  3815. writer.Write(ObjectID);
  3816. writer.Write(Hidden);
  3817. }
  3818. }
  3819. public sealed class ObjectSpHidden : Packet
  3820. {
  3821. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectSpHidden; } }
  3822. public uint ObjectID;
  3823. public bool SpHidden;
  3824. protected override void ReadPacket(BinaryReader reader)
  3825. {
  3826. ObjectID = reader.ReadUInt32();
  3827. SpHidden = reader.ReadBoolean();
  3828. }
  3829. protected override void WritePacket(BinaryWriter writer)
  3830. {
  3831. writer.Write(ObjectID);
  3832. writer.Write(SpHidden);
  3833. }
  3834. }
  3835. public sealed class RefreshItem : Packet
  3836. {
  3837. public override ushort Index { get { return (ushort)ServerPacketIds.RefreshItem; } }
  3838. public UserItem Item;
  3839. protected override void ReadPacket(BinaryReader reader)
  3840. {
  3841. Item = new UserItem(reader);
  3842. }
  3843. protected override void WritePacket(BinaryWriter writer)
  3844. {
  3845. Item.Save(writer);
  3846. }
  3847. }
  3848. public sealed class RefreshHair : Packet
  3849. {
  3850. public override ushort Index { get { return (ushort)ServerPacketIds.RefreshHair; } }
  3851. public byte hair;
  3852. public Color hairColor;
  3853. protected override void ReadPacket(BinaryReader reader)
  3854. {
  3855. hair = reader.ReadByte();
  3856. hairColor = Color.FromArgb(reader.ReadInt32());
  3857. }
  3858. protected override void WritePacket(BinaryWriter writer)
  3859. {
  3860. writer.Write(hair);
  3861. writer.Write(hairColor.ToArgb());
  3862. }
  3863. }
  3864. public sealed class ObjectRefreshHair : Packet
  3865. {
  3866. public override ushort Index
  3867. {
  3868. get { return (ushort)ServerPacketIds.ObjectRefreshHair; }
  3869. }
  3870. public uint ObjectID;
  3871. public byte hair;
  3872. public Color hairColor;
  3873. protected override void ReadPacket(BinaryReader reader)
  3874. {
  3875. ObjectID = reader.ReadUInt32();
  3876. hair = reader.ReadByte();
  3877. hairColor = Color.FromArgb(reader.ReadInt32());
  3878. }
  3879. protected override void WritePacket(BinaryWriter writer)
  3880. {
  3881. writer.Write(ObjectID);
  3882. writer.Write(hair);
  3883. writer.Write(hairColor.ToArgb());
  3884. }
  3885. }
  3886. public sealed class ObjectSpell : Packet
  3887. {
  3888. public override ushort Index
  3889. {
  3890. get { return (ushort)ServerPacketIds.ObjectSpell; }
  3891. }
  3892. public uint ObjectID;
  3893. public Point Location;
  3894. public Spell Spell;
  3895. public MirDirection Direction;
  3896. public bool Param;
  3897. public long ExpireTime; //添加返回地面魔法持续时间数据包
  3898. protected override void ReadPacket(BinaryReader reader)
  3899. {
  3900. ObjectID = reader.ReadUInt32();
  3901. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3902. Spell = (Spell)reader.ReadByte();
  3903. Direction = (MirDirection)reader.ReadByte();
  3904. Param = reader.ReadBoolean();
  3905. ExpireTime = reader.ReadInt64();
  3906. }
  3907. protected override void WritePacket(BinaryWriter writer)
  3908. {
  3909. writer.Write(ObjectID);
  3910. writer.Write(Location.X);
  3911. writer.Write(Location.Y);
  3912. writer.Write((byte)Spell);
  3913. writer.Write((byte)Direction);
  3914. writer.Write(Param);
  3915. writer.Write(ExpireTime);
  3916. }
  3917. }
  3918. public sealed class UserDash : Packet
  3919. {
  3920. public override ushort Index
  3921. {
  3922. get { return (ushort)ServerPacketIds.UserDash; }
  3923. }
  3924. public Point Location;
  3925. public MirDirection Direction;
  3926. protected override void ReadPacket(BinaryReader reader)
  3927. {
  3928. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3929. Direction = (MirDirection)reader.ReadByte();
  3930. }
  3931. protected override void WritePacket(BinaryWriter writer)
  3932. {
  3933. writer.Write(Location.X);
  3934. writer.Write(Location.Y);
  3935. writer.Write((byte)Direction);
  3936. }
  3937. }
  3938. public sealed class ObjectDash : Packet
  3939. {
  3940. public override ushort Index
  3941. {
  3942. get { return (ushort)ServerPacketIds.ObjectDash; }
  3943. }
  3944. public uint ObjectID;
  3945. public Point Location;
  3946. public MirDirection Direction;
  3947. protected override void ReadPacket(BinaryReader reader)
  3948. {
  3949. ObjectID = reader.ReadUInt32();
  3950. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3951. Direction = (MirDirection)reader.ReadByte();
  3952. }
  3953. protected override void WritePacket(BinaryWriter writer)
  3954. {
  3955. writer.Write(ObjectID);
  3956. writer.Write(Location.X);
  3957. writer.Write(Location.Y);
  3958. writer.Write((byte)Direction);
  3959. }
  3960. }
  3961. public sealed class UserDashFail : Packet
  3962. {
  3963. public override ushort Index
  3964. {
  3965. get { return (ushort)ServerPacketIds.UserDashFail; }
  3966. }
  3967. public Point Location;
  3968. public MirDirection Direction;
  3969. protected override void ReadPacket(BinaryReader reader)
  3970. {
  3971. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3972. Direction = (MirDirection)reader.ReadByte();
  3973. }
  3974. protected override void WritePacket(BinaryWriter writer)
  3975. {
  3976. writer.Write(Location.X);
  3977. writer.Write(Location.Y);
  3978. writer.Write((byte)Direction);
  3979. }
  3980. }
  3981. public sealed class ObjectDashFail : Packet
  3982. {
  3983. public override ushort Index
  3984. {
  3985. get { return (ushort)ServerPacketIds.ObjectDashFail; }
  3986. }
  3987. public uint ObjectID;
  3988. public Point Location;
  3989. public MirDirection Direction;
  3990. protected override void ReadPacket(BinaryReader reader)
  3991. {
  3992. ObjectID = reader.ReadUInt32();
  3993. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  3994. Direction = (MirDirection)reader.ReadByte();
  3995. }
  3996. protected override void WritePacket(BinaryWriter writer)
  3997. {
  3998. writer.Write(ObjectID);
  3999. writer.Write(Location.X);
  4000. writer.Write(Location.Y);
  4001. writer.Write((byte)Direction);
  4002. }
  4003. }
  4004. public sealed class RemoveDelayedExplosion : Packet
  4005. {
  4006. public override ushort Index { get { return (ushort)ServerPacketIds.RemoveDelayedExplosion; } }
  4007. public uint ObjectID;
  4008. protected override void ReadPacket(BinaryReader reader)
  4009. {
  4010. ObjectID = reader.ReadUInt32();
  4011. }
  4012. protected override void WritePacket(BinaryWriter writer)
  4013. {
  4014. writer.Write(ObjectID);
  4015. }
  4016. }
  4017. public sealed class ZanZhuChangeName : Packet
  4018. {
  4019. public override ushort Index { get { return (ushort)ServerPacketIds.ZanZhuChangeName; } }
  4020. protected override void ReadPacket(BinaryReader reader)
  4021. {
  4022. }
  4023. protected override void WritePacket(BinaryWriter writer)
  4024. {
  4025. }
  4026. }
  4027. public sealed class NPCConsign : Packet
  4028. {
  4029. public override ushort Index { get { return (ushort)ServerPacketIds.NPCConsign; } }
  4030. protected override void ReadPacket(BinaryReader reader)
  4031. {
  4032. }
  4033. protected override void WritePacket(BinaryWriter writer)
  4034. {
  4035. }
  4036. }
  4037. public sealed class NPCMarket : Packet
  4038. {
  4039. public override ushort Index { get { return (ushort)ServerPacketIds.NPCMarket; } }
  4040. public List<ClientAuction> Listings = new List<ClientAuction>();
  4041. public int Pages;
  4042. public bool UserMode;
  4043. protected override void ReadPacket(BinaryReader reader)
  4044. {
  4045. int count = reader.ReadInt32();
  4046. for (int i = 0; i < count; i++)
  4047. Listings.Add(new ClientAuction(reader));
  4048. Pages = reader.ReadInt32();
  4049. UserMode = reader.ReadBoolean();
  4050. }
  4051. protected override void WritePacket(BinaryWriter writer)
  4052. {
  4053. writer.Write(Listings.Count);
  4054. for (int i = 0; i < Listings.Count; i++)
  4055. Listings[i].Save(writer);
  4056. writer.Write(Pages);
  4057. writer.Write(UserMode);
  4058. }
  4059. }
  4060. public sealed class ExchangeConfigSearch : Packet
  4061. {
  4062. public override ushort Index { get { return (ushort)ServerPacketIds.ExchangeConfigSearch; } }
  4063. public string ExchangeConfigsJson;
  4064. protected override void ReadPacket(BinaryReader reader)
  4065. {
  4066. ExchangeConfigsJson = reader.ReadString();
  4067. //int count = reader.ReadInt32();
  4068. //for (int i = 0; i < count; i++)
  4069. //{
  4070. // ItemInfos.Add(new UserItem(reader));
  4071. //}
  4072. //int count = reader.ReadInt32();
  4073. //ExchangeConfigsJson = "";
  4074. //for (int i = 0; i < count; i++)
  4075. //{
  4076. // ExchangeConfigsJson += reader.ReadString();
  4077. //}
  4078. }
  4079. protected override void WritePacket(BinaryWriter writer)
  4080. {
  4081. //writer.Write(ExchangeConfigsJson.Length / 1000+1);
  4082. //for (int i = 0; i < ExchangeConfigsJson.Length; i+=1000)
  4083. //{
  4084. // if (i+1000>= ExchangeConfigsJson.Length)
  4085. // {
  4086. // writer.Write(ExchangeConfigsJson.Substring(i, i + 1000));
  4087. // }
  4088. // else
  4089. // {
  4090. // writer.Write(ExchangeConfigsJson.Substring(i, ExchangeConfigsJson.Length));
  4091. // }
  4092. //}
  4093. writer.Write(ExchangeConfigsJson);
  4094. //writer.Write(ItemInfos.Count);
  4095. //for (int i = 0; i < ItemInfos.Count; i++)
  4096. //{
  4097. // ItemInfos[i].Save(writer);
  4098. //}
  4099. }
  4100. }
  4101. public sealed class ItemProtectStart : Packet
  4102. {
  4103. public override ushort Index { get { return (ushort)ServerPacketIds.ItemProtectStart; } }
  4104. protected override void ReadPacket(BinaryReader reader)
  4105. {
  4106. }
  4107. protected override void WritePacket(BinaryWriter writer)
  4108. {
  4109. }
  4110. }
  4111. public sealed class GameShopSearch : Packet
  4112. {
  4113. public override ushort Index { get { return (ushort)ServerPacketIds.GameShopSearch; } }
  4114. public string GameItemsJson;
  4115. public List<UserItem> GoodsInfos = new List<UserItem>();
  4116. protected override void ReadPacket(BinaryReader reader)
  4117. {
  4118. GameItemsJson= reader.ReadString();
  4119. int count= reader.ReadInt32();
  4120. for (int i = 0; i < count; i++)
  4121. {
  4122. GoodsInfos.Add(new UserItem(reader));
  4123. }
  4124. }
  4125. protected override void WritePacket(BinaryWriter writer)
  4126. {
  4127. writer.Write(GameItemsJson);
  4128. writer.Write(GoodsInfos.Count);
  4129. for (int i = 0; i < GoodsInfos.Count; i++)
  4130. {
  4131. GoodsInfos[i].Save(writer);
  4132. }
  4133. }
  4134. }
  4135. public sealed class AuctionGroups : Packet
  4136. {
  4137. public override ushort Index { get { return (ushort)ServerPacketIds.AuctionGroups; } }
  4138. public List<ItemInfo> ItemInfos = new List<ItemInfo>();
  4139. public List<int> Counts= new List<int>();
  4140. protected override void ReadPacket(BinaryReader reader)
  4141. {
  4142. int count = reader.ReadInt32();
  4143. for (int i = 0; i < count; i++)
  4144. ItemInfos.Add(new ItemInfo(reader));
  4145. for (int i = 0; i < count; i++)
  4146. Counts.Add(reader.ReadInt32());
  4147. }
  4148. protected override void WritePacket(BinaryWriter writer)
  4149. {
  4150. writer.Write(ItemInfos.Count);
  4151. for (int i = 0; i < ItemInfos.Count; i++)
  4152. ItemInfos[i].Save(writer);
  4153. for (int i = 0; i < ItemInfos.Count; i++)
  4154. writer.Write(Counts[i]);
  4155. }
  4156. }
  4157. public sealed class ItemAuctionSearch : Packet
  4158. {
  4159. public override ushort Index { get { return (ushort)ServerPacketIds.ItemAuctionSearch; } }
  4160. public List<ClientAuction> Auctions = new List<ClientAuction>();
  4161. protected override void ReadPacket(BinaryReader reader)
  4162. {
  4163. int count = reader.ReadInt32();
  4164. for (int i = 0; i < count; i++)
  4165. Auctions.Add(new ClientAuction(reader));
  4166. }
  4167. protected override void WritePacket(BinaryWriter writer)
  4168. {
  4169. writer.Write(Auctions.Count);
  4170. for (int i = 0; i < Auctions.Count; i++)
  4171. Auctions[i].Save(writer);
  4172. }
  4173. }
  4174. public sealed class MyAuctionSearch : Packet
  4175. {
  4176. public override ushort Index { get { return (ushort)ServerPacketIds.MyAuctionSearch; } }
  4177. public List<ClientAuction> Auctions = new List<ClientAuction>();
  4178. protected override void ReadPacket(BinaryReader reader)
  4179. {
  4180. int count = reader.ReadInt32();
  4181. for (int i = 0; i < count; i++)
  4182. Auctions.Add(new ClientAuction(reader));
  4183. }
  4184. protected override void WritePacket(BinaryWriter writer)
  4185. {
  4186. writer.Write(Auctions.Count);
  4187. for (int i = 0; i < Auctions.Count; i++)
  4188. Auctions[i].Save(writer);
  4189. }
  4190. }
  4191. //public sealed class GNPCMarket : Packet
  4192. //{
  4193. // public override ushort Index { get { return (ushort)ServerPacketIds.GNPCMarket; } }
  4194. // public List<GClientAuction> Listings = new List<GClientAuction>();
  4195. // public int Pages;
  4196. // protected override void ReadPacket(BinaryReader reader)
  4197. // {
  4198. // int count = reader.ReadInt32();
  4199. // for (int i = 0; i < count; i++)
  4200. // Listings.Add(new GClientAuction(reader));
  4201. // Pages = reader.ReadInt32();
  4202. // }
  4203. // protected override void WritePacket(BinaryWriter writer)
  4204. // {
  4205. // writer.Write(Listings.Count);
  4206. // for (int i = 0; i < Listings.Count; i++)
  4207. // Listings[i].Save(writer);
  4208. // writer.Write(Pages);
  4209. // }
  4210. //}
  4211. public sealed class NPCMarketPage : Packet
  4212. {
  4213. public override ushort Index { get { return (ushort)ServerPacketIds.NPCMarketPage; } }
  4214. public List<ClientAuction> Listings = new List<ClientAuction>();
  4215. protected override void ReadPacket(BinaryReader reader)
  4216. {
  4217. int count = reader.ReadInt32();
  4218. for (int i = 0; i < count; i++)
  4219. Listings.Add(new ClientAuction(reader));
  4220. }
  4221. protected override void WritePacket(BinaryWriter writer)
  4222. {
  4223. writer.Write(Listings.Count);
  4224. for (int i = 0; i < Listings.Count; i++)
  4225. Listings[i].Save(writer);
  4226. }
  4227. }
  4228. public sealed class ConsignItem : Packet
  4229. {
  4230. public override ushort Index { get { return (ushort)ServerPacketIds.ConsignItem; } }
  4231. public ulong UniqueID;
  4232. public bool Success;
  4233. public int Error;
  4234. protected override void ReadPacket(BinaryReader reader)
  4235. {
  4236. UniqueID = reader.ReadUInt64();
  4237. Success = reader.ReadBoolean();
  4238. Error = reader.ReadInt32();
  4239. }
  4240. protected override void WritePacket(BinaryWriter writer)
  4241. {
  4242. writer.Write(UniqueID);
  4243. writer.Write(Success);
  4244. writer.Write(Error);
  4245. }
  4246. }
  4247. public sealed class MarketFail : Packet
  4248. {
  4249. public override ushort Index { get { return (ushort)ServerPacketIds.MarketFail; } }
  4250. public byte Reason;
  4251. /*
  4252. * 0: Dead.
  4253. * 1: Not talking to TrustMerchant.
  4254. * 2: Already Sold.
  4255. * 3: Expired.
  4256. * 4: Not enough Gold.
  4257. * 5: Too heavy or not enough bag space.
  4258. * 6: You cannot buy your own items.
  4259. * 7: Trust Merchant is too far.
  4260. * 8: Too much Gold.
  4261. */
  4262. protected override void ReadPacket(BinaryReader reader)
  4263. {
  4264. Reason = reader.ReadByte();
  4265. }
  4266. protected override void WritePacket(BinaryWriter writer)
  4267. {
  4268. writer.Write(Reason);
  4269. }
  4270. }
  4271. public sealed class MarketSuccess : Packet
  4272. {
  4273. public override ushort Index { get { return (ushort)ServerPacketIds.MarketSuccess; } }
  4274. public string Message = string.Empty;
  4275. protected override void ReadPacket(BinaryReader reader)
  4276. {
  4277. Message = reader.ReadString();
  4278. }
  4279. protected override void WritePacket(BinaryWriter writer)
  4280. {
  4281. writer.Write(Message);
  4282. }
  4283. }
  4284. public sealed class RefreshSeasonExitTime : Packet
  4285. {
  4286. public override ushort Index { get { return (ushort)ServerPacketIds.RefreshSeasonExitTime; } }
  4287. public long Time;
  4288. protected override void ReadPacket(BinaryReader reader)
  4289. {
  4290. Time=reader.ReadInt64();
  4291. }
  4292. protected override void WritePacket(BinaryWriter writer)
  4293. {
  4294. writer.Write(Time);
  4295. }
  4296. }
  4297. public sealed class ObjectSitDown : Packet
  4298. {
  4299. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectSitDown; } }
  4300. public uint ObjectID;
  4301. public Point Location;
  4302. public MirDirection Direction;
  4303. public bool Sitting;
  4304. protected override void ReadPacket(BinaryReader reader)
  4305. {
  4306. ObjectID = reader.ReadUInt32();
  4307. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  4308. Direction = (MirDirection)reader.ReadByte();
  4309. Sitting = reader.ReadBoolean();
  4310. }
  4311. protected override void WritePacket(BinaryWriter writer)
  4312. {
  4313. writer.Write(ObjectID);
  4314. writer.Write(Location.X);
  4315. writer.Write(Location.Y);
  4316. writer.Write((byte)Direction);
  4317. writer.Write(Sitting);
  4318. }
  4319. }
  4320. public sealed class InTrapRock : Packet
  4321. {
  4322. public override ushort Index { get { return (ushort)ServerPacketIds.InTrapRock; } }
  4323. public bool Trapped;
  4324. protected override void ReadPacket(BinaryReader reader)
  4325. {
  4326. Trapped = reader.ReadBoolean();
  4327. }
  4328. protected override void WritePacket(BinaryWriter writer)
  4329. {
  4330. writer.Write(Trapped);
  4331. }
  4332. }
  4333. public sealed class BaseStatsInfo : Packet
  4334. {
  4335. public override ushort Index
  4336. {
  4337. get { return (ushort)ServerPacketIds.BaseStatsInfo; }
  4338. }
  4339. public BaseStats Stats;
  4340. protected override void ReadPacket(BinaryReader reader)
  4341. {
  4342. Stats = new BaseStats(reader);
  4343. }
  4344. protected override void WritePacket(BinaryWriter writer)
  4345. {
  4346. Stats.Save(writer);
  4347. }
  4348. }
  4349. public sealed class UserName : Packet
  4350. {
  4351. public override ushort Index { get { return (ushort)ServerPacketIds.UserName; } }
  4352. public uint Id;
  4353. public string Name;
  4354. protected override void ReadPacket(BinaryReader reader)
  4355. {
  4356. Id = reader.ReadUInt32();
  4357. Name = reader.ReadString();
  4358. }
  4359. protected override void WritePacket(BinaryWriter writer)
  4360. {
  4361. writer.Write(Id);
  4362. writer.Write(Name);
  4363. }
  4364. }
  4365. public sealed class ChatItemStats : Packet
  4366. {
  4367. public override ushort Index { get { return (ushort)ServerPacketIds.ChatItemStats; } }
  4368. public ulong ChatItemId;
  4369. public UserItem Stats;
  4370. protected override void ReadPacket(BinaryReader reader)
  4371. {
  4372. ChatItemId = reader.ReadUInt64();
  4373. Stats = new UserItem(reader);
  4374. }
  4375. protected override void WritePacket(BinaryWriter writer)
  4376. {
  4377. writer.Write(ChatItemId);
  4378. if (Stats != null) Stats.Save(writer);
  4379. }
  4380. }
  4381. public sealed class GuildNoticeChange : Packet
  4382. {
  4383. public override ushort Index
  4384. {
  4385. get { return (ushort)ServerPacketIds.GuildNoticeChange; }
  4386. }
  4387. public int update = 0;
  4388. public List<string> notice = new List<string>();
  4389. protected override void ReadPacket(BinaryReader reader)
  4390. {
  4391. update = reader.ReadInt32();
  4392. for (int i = 0; i < update; i++)
  4393. notice.Add(reader.ReadString());
  4394. }
  4395. protected override void WritePacket(BinaryWriter writer)
  4396. {
  4397. if (update < 0)
  4398. {
  4399. writer.Write(update);
  4400. return;
  4401. }
  4402. writer.Write(notice.Count);
  4403. for (int i = 0; i < notice.Count; i++)
  4404. writer.Write(notice[i]);
  4405. }
  4406. }
  4407. public sealed class GuildMemberChange : Packet
  4408. {
  4409. public override ushort Index
  4410. {
  4411. get { return (ushort)ServerPacketIds.GuildMemberChange; }
  4412. }
  4413. public string Name = string.Empty;
  4414. public byte Status = 0;
  4415. public byte RankIndex = 0;
  4416. public List<Rank> Ranks = new List<Rank>();
  4417. protected override void ReadPacket(BinaryReader reader)
  4418. {
  4419. Name = reader.ReadString();
  4420. RankIndex = reader.ReadByte();
  4421. Status = reader.ReadByte();
  4422. if (Status > 5)
  4423. {
  4424. int rankcount = reader.ReadInt32();
  4425. for (int i = 0; i < rankcount; i++)
  4426. Ranks.Add(new Rank(reader));
  4427. }
  4428. }
  4429. protected override void WritePacket(BinaryWriter writer)
  4430. {
  4431. writer.Write(Name);
  4432. writer.Write(RankIndex);
  4433. writer.Write(Status);
  4434. if (Status > 5)
  4435. {
  4436. writer.Write(Ranks.Count);
  4437. for (int i = 0; i < Ranks.Count; i++)
  4438. Ranks[i].Save(writer);
  4439. }
  4440. }
  4441. }
  4442. public sealed class GetAllGuild : Packet
  4443. {
  4444. public override ushort Index
  4445. {
  4446. get { return (ushort)ServerPacketIds.GetAllGuild; }
  4447. }
  4448. public List<GuildStatus> guildStatuses = new List<GuildStatus>();
  4449. protected override void ReadPacket(BinaryReader reader)
  4450. {
  4451. int count=reader.ReadInt32();
  4452. for (int i = 0; i < count; i++)
  4453. {
  4454. var guild = new GuildStatus();
  4455. guild.Read(reader);
  4456. guildStatuses.Add(guild);
  4457. }
  4458. }
  4459. protected override void WritePacket(BinaryWriter writer)
  4460. {
  4461. writer.Write(guildStatuses.Count);
  4462. for (int i = 0; i < guildStatuses.Count; i++)
  4463. {
  4464. guildStatuses[i].Write(writer);
  4465. }
  4466. }
  4467. }
  4468. public sealed class GetAllJoinRequest : Packet
  4469. {
  4470. public override ushort Index
  4471. {
  4472. get { return (ushort)ServerPacketIds.GetAllJoinRequest; }
  4473. }
  4474. public List<JoinRequestInfo> JoinRequestInfos = new List<JoinRequestInfo>();
  4475. protected override void ReadPacket(BinaryReader reader)
  4476. {
  4477. int count = reader.ReadInt32();
  4478. for (int i = 0; i < count; i++)
  4479. {
  4480. var requestInfo = new JoinRequestInfo();
  4481. requestInfo.Read(reader);
  4482. JoinRequestInfos.Add(requestInfo);
  4483. }
  4484. }
  4485. protected override void WritePacket(BinaryWriter writer)
  4486. {
  4487. writer.Write(JoinRequestInfos.Count);
  4488. for (int i = 0; i < JoinRequestInfos.Count; i++)
  4489. {
  4490. JoinRequestInfos[i].Write(writer);
  4491. }
  4492. }
  4493. }
  4494. public sealed class JoinRequestInfo
  4495. {
  4496. public int Index;
  4497. public string Name;
  4498. public byte Class;
  4499. public int Level;
  4500. public DateTime RequestTime;
  4501. public string Remark;
  4502. public void Read(BinaryReader reader)
  4503. {
  4504. Index=reader.ReadInt32();
  4505. Name=reader.ReadString();
  4506. Class=reader.ReadByte();
  4507. Level=reader.ReadInt32();
  4508. RequestTime= DateTime.FromBinary(reader.ReadInt64());
  4509. //Remark=reader.ReadString();
  4510. }
  4511. public void Write(BinaryWriter writer)
  4512. {
  4513. writer.Write(Index);
  4514. writer.Write(Name);
  4515. writer.Write(Class);
  4516. writer.Write(Level);
  4517. writer.Write(RequestTime.ToBinary());
  4518. //writer.Write(Remark);
  4519. }
  4520. }
  4521. public sealed class GuildStatus : Packet
  4522. {
  4523. public override ushort Index
  4524. {
  4525. get { return (ushort)ServerPacketIds.GuildStatus; }
  4526. }
  4527. public string GuildName = string.Empty;
  4528. public string GuildRankName = string.Empty;
  4529. public byte Level;
  4530. public long Experience;
  4531. public long MaxExperience;
  4532. public uint Gold;
  4533. public byte SparePoints;
  4534. public int MemberCount;
  4535. public int MaxMembers;
  4536. public int Votes;
  4537. public bool Voting;
  4538. public byte ItemCount;
  4539. public byte BuffCount;
  4540. public RankOptions MyOptions;
  4541. public int MyRankId;
  4542. public int GuildIndex;
  4543. public string Leader;
  4544. public List<string> EnemyGuilds= new List<string>();
  4545. protected override void ReadPacket(BinaryReader reader)
  4546. {
  4547. GuildName = reader.ReadString();
  4548. GuildRankName = reader.ReadString();
  4549. Level = reader.ReadByte();
  4550. Experience = reader.ReadInt64();
  4551. MaxExperience = reader.ReadInt64();
  4552. Gold = reader.ReadUInt32();
  4553. SparePoints = reader.ReadByte();
  4554. MemberCount = reader.ReadInt32();
  4555. MaxMembers = reader.ReadInt32();
  4556. Votes = reader.ReadInt32();
  4557. Voting = reader.ReadBoolean();
  4558. ItemCount = reader.ReadByte();
  4559. BuffCount = reader.ReadByte();
  4560. MyOptions = (RankOptions)reader.ReadByte();
  4561. MyRankId = reader.ReadInt32();
  4562. GuildIndex = reader.ReadInt32();
  4563. Leader = reader.ReadString();
  4564. int count=reader.ReadInt32();
  4565. for (int i = 0; i < count; i++)
  4566. {
  4567. EnemyGuilds.Add(reader.ReadString());
  4568. }
  4569. }
  4570. public void Read(BinaryReader reader)
  4571. {
  4572. ReadPacket(reader);
  4573. }
  4574. protected override void WritePacket(BinaryWriter writer)
  4575. {
  4576. writer.Write(GuildName);
  4577. writer.Write(GuildRankName);
  4578. writer.Write(Level);
  4579. writer.Write(Experience);
  4580. writer.Write(MaxExperience);
  4581. writer.Write(Gold);
  4582. writer.Write(SparePoints);
  4583. writer.Write(MemberCount);
  4584. writer.Write(MaxMembers);
  4585. writer.Write(Votes);
  4586. writer.Write(Voting);
  4587. writer.Write(ItemCount);
  4588. writer.Write(BuffCount);
  4589. writer.Write((byte)MyOptions);
  4590. writer.Write(MyRankId);
  4591. writer.Write(GuildIndex);
  4592. writer.Write(Leader);
  4593. writer.Write(EnemyGuilds.Count);
  4594. for (int i = 0; i < EnemyGuilds.Count; i++)
  4595. {
  4596. writer.Write(EnemyGuilds[i]);
  4597. }
  4598. }
  4599. public void Write(BinaryWriter writer)
  4600. {
  4601. WritePacket(writer);
  4602. }
  4603. }
  4604. public sealed class GuildInvite : Packet
  4605. {
  4606. public override ushort Index { get { return (ushort)ServerPacketIds.GuildInvite; } }
  4607. public string Name = string.Empty;
  4608. protected override void ReadPacket(BinaryReader reader)
  4609. {
  4610. Name = reader.ReadString();
  4611. }
  4612. protected override void WritePacket(BinaryWriter writer)
  4613. {
  4614. writer.Write(Name);
  4615. }
  4616. }
  4617. public sealed class GuildExpGain : Packet
  4618. {
  4619. public override ushort Index { get { return (ushort)ServerPacketIds.GuildExpGain; } }
  4620. public uint Amount = 0;
  4621. protected override void ReadPacket(BinaryReader reader)
  4622. {
  4623. Amount = reader.ReadUInt32();
  4624. }
  4625. protected override void WritePacket(BinaryWriter writer)
  4626. {
  4627. writer.Write(Amount);
  4628. }
  4629. }
  4630. public sealed class GuildNameRequest : Packet
  4631. {
  4632. public override ushort Index { get { return (ushort)ServerPacketIds.GuildNameRequest; } }
  4633. protected override void ReadPacket(BinaryReader reader)
  4634. {
  4635. }
  4636. protected override void WritePacket(BinaryWriter writer)
  4637. {
  4638. }
  4639. }
  4640. public sealed class GuildStorageGoldChange : Packet
  4641. {
  4642. public override ushort Index { get { return (ushort)ServerPacketIds.GuildStorageGoldChange; } }
  4643. public uint Amount = 0;
  4644. public byte Type = 0;
  4645. public string Name = string.Empty;
  4646. protected override void ReadPacket(BinaryReader reader)
  4647. {
  4648. Amount = reader.ReadUInt32();
  4649. Type = reader.ReadByte();
  4650. Name = reader.ReadString();
  4651. }
  4652. protected override void WritePacket(BinaryWriter writer)
  4653. {
  4654. writer.Write(Amount);
  4655. writer.Write(Type);
  4656. writer.Write(Name);
  4657. }
  4658. }
  4659. public sealed class GuildStorageItemChange : Packet
  4660. {
  4661. public override ushort Index { get { return (ushort)ServerPacketIds.GuildStorageItemChange; } }
  4662. public int User = 0;
  4663. public byte Type = 0;
  4664. public int To = 0;
  4665. public int From = 0;
  4666. public GuildStorageItem Item = null;
  4667. protected override void ReadPacket(BinaryReader reader)
  4668. {
  4669. Type = reader.ReadByte();
  4670. To = reader.ReadInt32();
  4671. From = reader.ReadInt32();
  4672. User = reader.ReadInt32();
  4673. if (!reader.ReadBoolean()) return;
  4674. Item = new GuildStorageItem();
  4675. Item.UserId = reader.ReadInt64();
  4676. Item.Item = new UserItem(reader);
  4677. }
  4678. protected override void WritePacket(BinaryWriter writer)
  4679. {
  4680. writer.Write(Type);
  4681. writer.Write(To);
  4682. writer.Write(From);
  4683. writer.Write(User);
  4684. writer.Write(Item != null);
  4685. if (Item == null) return;
  4686. writer.Write(Item.UserId);
  4687. Item.Item.Save(writer);
  4688. }
  4689. }
  4690. public sealed class GuildStorageList : Packet
  4691. {
  4692. public override ushort Index
  4693. {
  4694. get { return (ushort)ServerPacketIds.GuildStorageList; }
  4695. }
  4696. public GuildStorageItem[] Items;
  4697. protected override void ReadPacket(BinaryReader reader)
  4698. {
  4699. Items = new GuildStorageItem[reader.ReadInt32()];
  4700. for (int i = 0; i < Items.Length; i++)
  4701. {
  4702. if (reader.ReadBoolean() == true)
  4703. Items[i] = new GuildStorageItem(reader);
  4704. }
  4705. }
  4706. protected override void WritePacket(BinaryWriter writer)
  4707. {
  4708. writer.Write(Items.Length);
  4709. for (int i = 0; i < Items.Length; i++)
  4710. {
  4711. writer.Write(Items[i] != null);
  4712. if (Items[i] != null)
  4713. Items[i].save(writer);
  4714. }
  4715. }
  4716. }
  4717. public sealed class GuildRequestWar : Packet
  4718. {
  4719. public override ushort Index { get { return (ushort)ServerPacketIds.GuildRequestWar; } }
  4720. protected override void ReadPacket(BinaryReader reader)
  4721. {
  4722. }
  4723. protected override void WritePacket(BinaryWriter writer)
  4724. {
  4725. }
  4726. }
  4727. public sealed class DefaultNPC : Packet
  4728. {
  4729. public override ushort Index { get { return (ushort)ServerPacketIds.DefaultNPC; } }
  4730. public uint ObjectID;
  4731. protected override void ReadPacket(BinaryReader reader)
  4732. {
  4733. ObjectID = reader.ReadUInt32();
  4734. }
  4735. protected override void WritePacket(BinaryWriter writer)
  4736. {
  4737. writer.Write(ObjectID);
  4738. }
  4739. }
  4740. public sealed class NPCUpdate : Packet
  4741. {
  4742. public override ushort Index { get { return (ushort)ServerPacketIds.NPCUpdate; } }
  4743. public uint NPCID;
  4744. protected override void ReadPacket(BinaryReader reader)
  4745. {
  4746. NPCID = reader.ReadUInt32();
  4747. }
  4748. protected override void WritePacket(BinaryWriter writer)
  4749. {
  4750. writer.Write(NPCID);
  4751. }
  4752. }
  4753. public sealed class MountUpdate : Packet
  4754. {
  4755. public override ushort Index { get { return (ushort)ServerPacketIds.MountUpdate; } }
  4756. public long ObjectID;
  4757. public short MountType;
  4758. public bool RidingMount;
  4759. protected override void ReadPacket(BinaryReader reader)
  4760. {
  4761. ObjectID = reader.ReadInt64();
  4762. MountType = reader.ReadInt16();
  4763. RidingMount = reader.ReadBoolean();
  4764. }
  4765. protected override void WritePacket(BinaryWriter writer)
  4766. {
  4767. writer.Write(ObjectID);
  4768. writer.Write(MountType);
  4769. writer.Write(RidingMount);
  4770. }
  4771. }
  4772. public sealed class TransformUpdate : Packet
  4773. {
  4774. public override ushort Index { get { return (ushort)ServerPacketIds.TransformUpdate; } }
  4775. public long ObjectID;
  4776. public short TransformType;
  4777. protected override void ReadPacket(BinaryReader reader)
  4778. {
  4779. ObjectID = reader.ReadInt64();
  4780. TransformType = reader.ReadInt16();
  4781. }
  4782. protected override void WritePacket(BinaryWriter writer)
  4783. {
  4784. writer.Write(ObjectID);
  4785. writer.Write(TransformType);
  4786. }
  4787. }
  4788. public sealed class EquipSlotItem : Packet
  4789. {
  4790. public override ushort Index
  4791. {
  4792. get { return (ushort)ServerPacketIds.EquipSlotItem; }
  4793. }
  4794. public MirGridType Grid;
  4795. public ulong UniqueID;
  4796. public int To;
  4797. public bool Success;
  4798. public MirGridType GridTo;
  4799. protected override void ReadPacket(BinaryReader reader)
  4800. {
  4801. Grid = (MirGridType)reader.ReadByte();
  4802. UniqueID = reader.ReadUInt64();
  4803. To = reader.ReadInt32();
  4804. GridTo = (MirGridType)reader.ReadByte();
  4805. Success = reader.ReadBoolean();
  4806. }
  4807. protected override void WritePacket(BinaryWriter writer)
  4808. {
  4809. writer.Write((byte)Grid);
  4810. writer.Write(UniqueID);
  4811. writer.Write(To);
  4812. writer.Write((byte)GridTo);
  4813. writer.Write(Success);
  4814. }
  4815. }
  4816. public sealed class FishingUpdate : Packet
  4817. {
  4818. public override ushort Index { get { return (ushort)ServerPacketIds.FishingUpdate; } }
  4819. public long ObjectID;
  4820. public bool Fishing;
  4821. public int ProgressPercent;
  4822. public int ChancePercent;
  4823. public Point FishingPoint;
  4824. public bool FoundFish;
  4825. protected override void ReadPacket(BinaryReader reader)
  4826. {
  4827. ObjectID = reader.ReadInt64();
  4828. Fishing = reader.ReadBoolean();
  4829. ProgressPercent = reader.ReadInt32();
  4830. ChancePercent = reader.ReadInt32();
  4831. FishingPoint = new Point(reader.ReadInt32(), reader.ReadInt32());
  4832. FoundFish = reader.ReadBoolean();
  4833. }
  4834. protected override void WritePacket(BinaryWriter writer)
  4835. {
  4836. writer.Write(ObjectID);
  4837. writer.Write(Fishing);
  4838. writer.Write(ProgressPercent);
  4839. writer.Write(ChancePercent);
  4840. writer.Write(FishingPoint.X);
  4841. writer.Write(FishingPoint.Y);
  4842. writer.Write(FoundFish);
  4843. }
  4844. }
  4845. //public sealed class UpdateQuests : Packet
  4846. //{
  4847. // public override ushort Index
  4848. // {
  4849. // get { return (ushort)ServerPacketIds.UpdateQuests; }
  4850. // }
  4851. // public List<ClientQuestProgress> CurrentQuests = new List<ClientQuestProgress>();
  4852. // public List<int> CompletedQuests = new List<int>();
  4853. // protected override void ReadPacket(BinaryReader reader)
  4854. // {
  4855. // int count = reader.ReadInt32();
  4856. // for (var i = 0; i < count; i++)
  4857. // CurrentQuests.Add(new ClientQuestProgress(reader));
  4858. // count = reader.ReadInt32();
  4859. // for (var i = 0; i < count; i++)
  4860. // CompletedQuests.Add(reader.ReadInt32());
  4861. // }
  4862. // protected override void WritePacket(BinaryWriter writer)
  4863. // {
  4864. // writer.Write(CurrentQuests.Count);
  4865. // foreach (var q in CurrentQuests)
  4866. // q.Save(writer);
  4867. // writer.Write(CompletedQuests.Count);
  4868. // foreach (int q in CompletedQuests)
  4869. // writer.Write(q);
  4870. // }
  4871. //}
  4872. public sealed class ChangeQuest : Packet
  4873. {
  4874. public override ushort Index
  4875. {
  4876. get { return (ushort)ServerPacketIds.ChangeQuest; }
  4877. }
  4878. public ClientQuestProgress Quest = new ClientQuestProgress();
  4879. public QuestState QuestState;
  4880. public bool TrackQuest;
  4881. protected override void ReadPacket(BinaryReader reader)
  4882. {
  4883. Quest = new ClientQuestProgress(reader);
  4884. QuestState = (QuestState)reader.ReadByte();
  4885. TrackQuest = reader.ReadBoolean();
  4886. }
  4887. protected override void WritePacket(BinaryWriter writer)
  4888. {
  4889. Quest.Save(writer);
  4890. writer.Write((byte)QuestState);
  4891. writer.Write(TrackQuest);
  4892. }
  4893. }
  4894. public sealed class CompleteQuest : Packet
  4895. {
  4896. public override ushort Index
  4897. {
  4898. get { return (ushort)ServerPacketIds.CompleteQuest; }
  4899. }
  4900. public List<int> CompletedQuests = new List<int>();
  4901. protected override void ReadPacket(BinaryReader reader)
  4902. {
  4903. int count = reader.ReadInt32();
  4904. for (var i = 0; i < count; i++)
  4905. CompletedQuests.Add(reader.ReadInt32());
  4906. }
  4907. protected override void WritePacket(BinaryWriter writer)
  4908. {
  4909. writer.Write(CompletedQuests.Count);
  4910. foreach (int q in CompletedQuests)
  4911. writer.Write(q);
  4912. }
  4913. }
  4914. public sealed class ShareQuest : Packet
  4915. {
  4916. public override ushort Index
  4917. {
  4918. get { return (ushort)ServerPacketIds.ShareQuest; }
  4919. }
  4920. public int QuestIndex;
  4921. public string SharerName;
  4922. protected override void ReadPacket(BinaryReader reader)
  4923. {
  4924. QuestIndex = reader.ReadInt32();
  4925. SharerName = reader.ReadString();
  4926. }
  4927. protected override void WritePacket(BinaryWriter writer)
  4928. {
  4929. writer.Write(QuestIndex);
  4930. writer.Write(SharerName);
  4931. }
  4932. }
  4933. public sealed class NewQuestInfo : Packet
  4934. {
  4935. public override ushort Index
  4936. {
  4937. get { return (ushort)ServerPacketIds.NewQuestInfo; }
  4938. }
  4939. public ClientQuestInfo Info;
  4940. protected override void ReadPacket(BinaryReader reader)
  4941. {
  4942. Info = new ClientQuestInfo(reader);
  4943. }
  4944. protected override void WritePacket(BinaryWriter writer)
  4945. {
  4946. Info.Save(writer);
  4947. }
  4948. }
  4949. public sealed class GainedQuestItem : Packet
  4950. {
  4951. public override ushort Index
  4952. {
  4953. get { return (ushort)ServerPacketIds.GainedQuestItem; }
  4954. }
  4955. public UserItem Item;
  4956. protected override void ReadPacket(BinaryReader reader)
  4957. {
  4958. Item = new UserItem(reader);
  4959. }
  4960. protected override void WritePacket(BinaryWriter writer)
  4961. {
  4962. Item.Save(writer);
  4963. }
  4964. }
  4965. public sealed class DeleteQuestItem : Packet
  4966. {
  4967. public override ushort Index
  4968. {
  4969. get { return (ushort)ServerPacketIds.DeleteQuestItem; }
  4970. }
  4971. public ulong UniqueID;
  4972. public uint Count;
  4973. protected override void ReadPacket(BinaryReader reader)
  4974. {
  4975. UniqueID = reader.ReadUInt64();
  4976. Count = reader.ReadUInt32();
  4977. }
  4978. protected override void WritePacket(BinaryWriter writer)
  4979. {
  4980. writer.Write(UniqueID);
  4981. writer.Write(Count);
  4982. }
  4983. }
  4984. public sealed class GameShopInfo : Packet
  4985. {
  4986. public override ushort Index
  4987. {
  4988. get { return (ushort)ServerPacketIds.GameShopInfo; }
  4989. }
  4990. public GameShopItem Item;
  4991. public int StockLevel;
  4992. protected override void ReadPacket(BinaryReader reader)
  4993. {
  4994. Item = new GameShopItem(reader, true);
  4995. StockLevel = reader.ReadInt32();
  4996. }
  4997. protected override void WritePacket(BinaryWriter writer)
  4998. {
  4999. Item.Save(writer, true);
  5000. writer.Write(StockLevel);
  5001. }
  5002. }
  5003. public sealed class GameShopStock : Packet
  5004. {
  5005. public override ushort Index
  5006. {
  5007. get { return (ushort)ServerPacketIds.GameShopStock; }
  5008. }
  5009. public int GIndex;
  5010. public int StockLevel;
  5011. protected override void ReadPacket(BinaryReader reader)
  5012. {
  5013. GIndex = reader.ReadInt32();
  5014. StockLevel = reader.ReadInt32();
  5015. }
  5016. protected override void WritePacket(BinaryWriter writer)
  5017. {
  5018. writer.Write(GIndex);
  5019. writer.Write(StockLevel);
  5020. }
  5021. }
  5022. public sealed class CancelReincarnation : Packet
  5023. {
  5024. public override ushort Index { get { return (ushort)ServerPacketIds.CancelReincarnation; } }
  5025. protected override void ReadPacket(BinaryReader reader)
  5026. {
  5027. }
  5028. protected override void WritePacket(BinaryWriter writer)
  5029. {
  5030. }
  5031. }
  5032. public sealed class RequestReincarnation : Packet
  5033. {
  5034. public override ushort Index { get { return (ushort)ServerPacketIds.RequestReincarnation; } }
  5035. protected override void ReadPacket(BinaryReader reader)
  5036. {
  5037. }
  5038. protected override void WritePacket(BinaryWriter writer)
  5039. {
  5040. }
  5041. }
  5042. public sealed class UserBackStep : Packet
  5043. {
  5044. public override ushort Index
  5045. {
  5046. get { return (ushort)ServerPacketIds.UserBackStep; }
  5047. }
  5048. public Point Location;
  5049. public MirDirection Direction;
  5050. protected override void ReadPacket(BinaryReader reader)
  5051. {
  5052. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  5053. Direction = (MirDirection)reader.ReadByte();
  5054. }
  5055. protected override void WritePacket(BinaryWriter writer)
  5056. {
  5057. writer.Write(Location.X);
  5058. writer.Write(Location.Y);
  5059. writer.Write((byte)Direction);
  5060. }
  5061. }
  5062. public sealed class ObjectBackStep : Packet
  5063. {
  5064. public override ushort Index
  5065. {
  5066. get { return (ushort)ServerPacketIds.ObjectBackStep; }
  5067. }
  5068. public uint ObjectID;
  5069. public Point Location;
  5070. public MirDirection Direction;
  5071. public int Distance;
  5072. protected override void ReadPacket(BinaryReader reader)
  5073. {
  5074. ObjectID = reader.ReadUInt32();
  5075. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  5076. Direction = (MirDirection)reader.ReadByte();
  5077. Distance = reader.ReadInt16();
  5078. }
  5079. protected override void WritePacket(BinaryWriter writer)
  5080. {
  5081. writer.Write(ObjectID);
  5082. writer.Write(Location.X);
  5083. writer.Write(Location.Y);
  5084. writer.Write((byte)Direction);
  5085. writer.Write(Distance);
  5086. }
  5087. }
  5088. public sealed class UserDashAttack : Packet
  5089. {
  5090. public override ushort Index
  5091. {
  5092. get { return (ushort)ServerPacketIds.UserDashAttack; }
  5093. }
  5094. public Point Location;
  5095. public MirDirection Direction;
  5096. protected override void ReadPacket(BinaryReader reader)
  5097. {
  5098. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  5099. Direction = (MirDirection)reader.ReadByte();
  5100. }
  5101. protected override void WritePacket(BinaryWriter writer)
  5102. {
  5103. writer.Write(Location.X);
  5104. writer.Write(Location.Y);
  5105. writer.Write((byte)Direction);
  5106. }
  5107. }
  5108. public sealed class ObjectDashAttack : Packet
  5109. {
  5110. public override ushort Index
  5111. {
  5112. get { return (ushort)ServerPacketIds.ObjectDashAttack; }
  5113. }
  5114. public uint ObjectID;
  5115. public Point Location;
  5116. public MirDirection Direction;
  5117. public int Distance;
  5118. protected override void ReadPacket(BinaryReader reader)
  5119. {
  5120. ObjectID = reader.ReadUInt32();
  5121. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  5122. Direction = (MirDirection)reader.ReadByte();
  5123. Distance = reader.ReadInt16();
  5124. }
  5125. protected override void WritePacket(BinaryWriter writer)
  5126. {
  5127. writer.Write(ObjectID);
  5128. writer.Write(Location.X);
  5129. writer.Write(Location.Y);
  5130. writer.Write((byte)Direction);
  5131. writer.Write(Distance);
  5132. }
  5133. }
  5134. public sealed class UserAttackMove : Packet//warrior skill - SlashingBurst move packet
  5135. {
  5136. public override ushort Index
  5137. {
  5138. get { return (ushort)ServerPacketIds.UserAttackMove; }
  5139. }
  5140. public Point Location;
  5141. public MirDirection Direction;
  5142. protected override void ReadPacket(BinaryReader reader)
  5143. {
  5144. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  5145. Direction = (MirDirection)reader.ReadByte();
  5146. }
  5147. protected override void WritePacket(BinaryWriter writer)
  5148. {
  5149. writer.Write(Location.X);
  5150. writer.Write(Location.Y);
  5151. writer.Write((byte)Direction);
  5152. }
  5153. }
  5154. public sealed class CombineItem : Packet
  5155. {
  5156. public override ushort Index
  5157. {
  5158. get { return (ushort)ServerPacketIds.CombineItem; }
  5159. }
  5160. public ulong IDFrom, IDTo;
  5161. public bool Success;
  5162. public bool Destroy;
  5163. protected override void ReadPacket(BinaryReader reader)
  5164. {
  5165. IDFrom = reader.ReadUInt64();
  5166. IDTo = reader.ReadUInt64();
  5167. Success = reader.ReadBoolean();
  5168. Destroy = reader.ReadBoolean();
  5169. }
  5170. protected override void WritePacket(BinaryWriter writer)
  5171. {
  5172. writer.Write(IDFrom);
  5173. writer.Write(IDTo);
  5174. writer.Write(Success);
  5175. writer.Write(Destroy);
  5176. }
  5177. }
  5178. public sealed class ItemUpgraded : Packet
  5179. {
  5180. public override ushort Index
  5181. {
  5182. get { return (ushort)ServerPacketIds.ItemUpgraded; }
  5183. }
  5184. public UserItem Item;
  5185. protected override void ReadPacket(BinaryReader reader)
  5186. {
  5187. Item = new UserItem(reader);
  5188. }
  5189. protected override void WritePacket(BinaryWriter writer)
  5190. {
  5191. Item.Save(writer);
  5192. }
  5193. }
  5194. public sealed class SetConcentration : Packet
  5195. {
  5196. public override ushort Index { get { return (ushort)ServerPacketIds.SetConcentration; } }
  5197. public uint ObjectID;
  5198. public bool Enabled;
  5199. public bool Interrupted;
  5200. protected override void ReadPacket(BinaryReader reader)
  5201. {
  5202. ObjectID = reader.ReadUInt32();
  5203. Enabled = reader.ReadBoolean();
  5204. Interrupted = reader.ReadBoolean();
  5205. }
  5206. protected override void WritePacket(BinaryWriter writer)
  5207. {
  5208. writer.Write(ObjectID);
  5209. writer.Write(Enabled);
  5210. writer.Write(Interrupted);
  5211. }
  5212. }
  5213. public sealed class SetObjectConcentration : Packet
  5214. {
  5215. public override ushort Index { get { return (ushort)ServerPacketIds.SetObjectConcentration; } }
  5216. public uint ObjectID;
  5217. public bool Enabled;
  5218. public bool Interrupted;
  5219. protected override void ReadPacket(BinaryReader reader)
  5220. {
  5221. ObjectID = reader.ReadUInt32();
  5222. Enabled = reader.ReadBoolean();
  5223. Interrupted = reader.ReadBoolean();
  5224. }
  5225. protected override void WritePacket(BinaryWriter writer)
  5226. {
  5227. writer.Write(ObjectID);
  5228. writer.Write(Enabled);
  5229. writer.Write(Interrupted);
  5230. }
  5231. }
  5232. public sealed class SetElemental : Packet
  5233. {
  5234. public override ushort Index { get { return (ushort)ServerPacketIds.SetElemental; } }
  5235. public uint ObjectID;
  5236. public bool Enabled;
  5237. public uint Value;
  5238. public uint ElementType;
  5239. public uint ExpLast;
  5240. protected override void ReadPacket(BinaryReader reader)
  5241. {
  5242. ObjectID = reader.ReadUInt32();
  5243. Enabled = reader.ReadBoolean();
  5244. Value = reader.ReadUInt32();
  5245. ElementType = reader.ReadUInt32();
  5246. ExpLast = reader.ReadUInt32();
  5247. }
  5248. protected override void WritePacket(BinaryWriter writer)
  5249. {
  5250. writer.Write(ObjectID);
  5251. writer.Write(Enabled);
  5252. writer.Write(Value);
  5253. writer.Write(ElementType);
  5254. writer.Write(ExpLast);
  5255. }
  5256. }
  5257. public sealed class SetObjectElemental : Packet
  5258. {
  5259. public override ushort Index { get { return (ushort)ServerPacketIds.SetObjectElemental; } }
  5260. public uint ObjectID;
  5261. public bool Enabled;
  5262. public bool Casted;
  5263. public uint Value;
  5264. public uint ElementType;
  5265. public uint ExpLast;
  5266. protected override void ReadPacket(BinaryReader reader)
  5267. {
  5268. ObjectID = reader.ReadUInt32();
  5269. Enabled = reader.ReadBoolean();
  5270. Casted = reader.ReadBoolean();
  5271. Value = reader.ReadUInt32();
  5272. ElementType = reader.ReadUInt32();
  5273. ExpLast = reader.ReadUInt32();
  5274. }
  5275. protected override void WritePacket(BinaryWriter writer)
  5276. {
  5277. writer.Write(ObjectID);
  5278. writer.Write(Enabled);
  5279. writer.Write(Casted);
  5280. writer.Write(Value);
  5281. writer.Write(ElementType);
  5282. writer.Write(ExpLast);
  5283. }
  5284. }
  5285. public sealed class ObjectDeco : Packet
  5286. {
  5287. public override ushort Index
  5288. {
  5289. get { return (ushort)ServerPacketIds.ObjectDeco; }
  5290. }
  5291. public uint ObjectID;
  5292. public Point Location;
  5293. public ushort Image;
  5294. protected override void ReadPacket(BinaryReader reader)
  5295. {
  5296. ObjectID = reader.ReadUInt32();
  5297. Location = new Point(reader.ReadInt32(), reader.ReadInt32());
  5298. Image = reader.ReadUInt16();
  5299. }
  5300. protected override void WritePacket(BinaryWriter writer)
  5301. {
  5302. writer.Write(ObjectID);
  5303. writer.Write(Location.X);
  5304. writer.Write(Location.Y);
  5305. writer.Write(Image);
  5306. }
  5307. }
  5308. public sealed class ObjectSneaking : Packet
  5309. {
  5310. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectSneaking; } }
  5311. public uint ObjectID;
  5312. public bool SneakingActive;
  5313. protected override void ReadPacket(BinaryReader reader)
  5314. {
  5315. ObjectID = reader.ReadUInt32();
  5316. SneakingActive = reader.ReadBoolean();
  5317. }
  5318. protected override void WritePacket(BinaryWriter writer)
  5319. {
  5320. writer.Write(ObjectID);
  5321. writer.Write(SneakingActive);
  5322. }
  5323. }
  5324. public sealed class ObjectLevelEffects : Packet
  5325. {
  5326. public override ushort Index { get { return (ushort)ServerPacketIds.ObjectLevelEffects; } }
  5327. public uint ObjectID;
  5328. public LevelEffects LevelEffects;
  5329. protected override void ReadPacket(BinaryReader reader)
  5330. {
  5331. ObjectID = reader.ReadUInt32();
  5332. LevelEffects = (LevelEffects)reader.ReadByte();
  5333. }
  5334. protected override void WritePacket(BinaryWriter writer)
  5335. {
  5336. writer.Write(ObjectID);
  5337. writer.Write((byte)LevelEffects);
  5338. }
  5339. }
  5340. public sealed class SetBindingShot : Packet
  5341. {
  5342. public override ushort Index { get { return (ushort)ServerPacketIds.SetBindingShot; } }
  5343. public uint ObjectID;
  5344. public bool Enabled;
  5345. public long Value;
  5346. protected override void ReadPacket(BinaryReader reader)
  5347. {
  5348. ObjectID = reader.ReadUInt32();
  5349. Enabled = reader.ReadBoolean();
  5350. Value = reader.ReadInt64();
  5351. }
  5352. protected override void WritePacket(BinaryWriter writer)
  5353. {
  5354. writer.Write(ObjectID);
  5355. writer.Write(Enabled);
  5356. writer.Write(Value);
  5357. }
  5358. }
  5359. public sealed class SendOutputMessage : Packet
  5360. {
  5361. public override ushort Index { get { return (ushort)ServerPacketIds.SendOutputMessage; } }
  5362. public string Message;
  5363. public OutputMessageType Type;
  5364. protected override void ReadPacket(BinaryReader reader)
  5365. {
  5366. Message = reader.ReadString();
  5367. Type = (OutputMessageType)reader.ReadByte();
  5368. }
  5369. protected override void WritePacket(BinaryWriter writer)
  5370. {
  5371. writer.Write(Message);
  5372. writer.Write((byte)Type);
  5373. }
  5374. }
  5375. public sealed class NPCAwakening : Packet
  5376. {
  5377. public override ushort Index { get { return (ushort)ServerPacketIds.NPCAwakening; } }
  5378. public string AwakeInfosJson;
  5379. protected override void ReadPacket(BinaryReader reader)
  5380. {
  5381. AwakeInfosJson = reader.ReadString();
  5382. }
  5383. protected override void WritePacket(BinaryWriter writer)
  5384. {
  5385. writer.Write(AwakeInfosJson);
  5386. }
  5387. }
  5388. public sealed class NPCUnAwaken : Packet
  5389. {
  5390. public override ushort Index { get { return (ushort)ServerPacketIds.NPCUnAwaken; } }
  5391. protected override void ReadPacket(BinaryReader reader)
  5392. {
  5393. }
  5394. protected override void WritePacket(BinaryWriter writer)
  5395. {
  5396. }
  5397. }
  5398. public sealed class NPCDisassemble : Packet
  5399. {
  5400. public override ushort Index { get { return (ushort)ServerPacketIds.NPCDisassemble; } }
  5401. protected override void ReadPacket(BinaryReader reader)
  5402. {
  5403. }
  5404. protected override void WritePacket(BinaryWriter writer)
  5405. {
  5406. }
  5407. }
  5408. public sealed class NPCDowngrade : Packet
  5409. {
  5410. public override ushort Index { get { return (ushort)ServerPacketIds.NPCDowngrade; } }
  5411. protected override void ReadPacket(BinaryReader reader)
  5412. {
  5413. }
  5414. protected override void WritePacket(BinaryWriter writer)
  5415. {
  5416. }
  5417. }
  5418. public sealed class NPCReset : Packet
  5419. {
  5420. public override ushort Index { get { return (ushort)ServerPacketIds.NPCReset; } }
  5421. protected override void ReadPacket(BinaryReader reader)
  5422. {
  5423. }
  5424. protected override void WritePacket(BinaryWriter writer)
  5425. {
  5426. }
  5427. }
  5428. public sealed class AwakeningNeedMaterials : Packet
  5429. {
  5430. public override ushort Index { get { return (ushort)ServerPacketIds.AwakeningNeedMaterials; } }
  5431. public ItemInfo[] Materials;
  5432. public byte[] MaterialsCount;
  5433. public bool IsHaveEnoughMat;
  5434. protected override void ReadPacket(BinaryReader reader)
  5435. {
  5436. if (!reader.ReadBoolean()) return;
  5437. int count = reader.ReadInt32();
  5438. Materials = new ItemInfo[count];
  5439. MaterialsCount = new byte[count];
  5440. for (int i = 0; i < Materials.Length; i++)
  5441. {
  5442. if (!reader.ReadBoolean()) continue;
  5443. Materials[i] = new ItemInfo(reader);
  5444. MaterialsCount[i] = reader.ReadByte();
  5445. }
  5446. IsHaveEnoughMat = reader.ReadBoolean();
  5447. }
  5448. protected override void WritePacket(BinaryWriter writer)
  5449. {
  5450. writer.Write(Materials != null);
  5451. if (Materials == null) return;
  5452. writer.Write(Materials.Length);
  5453. for (int i = 0; i < Materials.Length; i++)
  5454. {
  5455. writer.Write(Materials[i] != null);
  5456. if (Materials[i] == null) continue;
  5457. Materials[i].Save(writer);
  5458. writer.Write(MaterialsCount[i]);
  5459. }
  5460. writer.Write(IsHaveEnoughMat);
  5461. }
  5462. }
  5463. public sealed class DropProtectNeedMaterials : Packet
  5464. {
  5465. public override ushort Index { get { return (ushort)ServerPacketIds.DropProtectNeedMaterials; } }
  5466. public ItemInfo[] Materials;
  5467. public byte[] MaterialsCount;
  5468. public bool IsHaveEnoughMat;
  5469. protected override void ReadPacket(BinaryReader reader)
  5470. {
  5471. if (!reader.ReadBoolean()) return;
  5472. int count = reader.ReadInt32();
  5473. Materials = new ItemInfo[count];
  5474. MaterialsCount = new byte[count];
  5475. for (int i = 0; i < Materials.Length; i++)
  5476. {
  5477. if (!reader.ReadBoolean()) continue;
  5478. Materials[i] = new ItemInfo(reader);
  5479. MaterialsCount[i] = reader.ReadByte();
  5480. }
  5481. IsHaveEnoughMat = reader.ReadBoolean();
  5482. }
  5483. protected override void WritePacket(BinaryWriter writer)
  5484. {
  5485. writer.Write(Materials != null);
  5486. if (Materials == null) return;
  5487. writer.Write(Materials.Length);
  5488. for (int i = 0; i < Materials.Length; i++)
  5489. {
  5490. writer.Write(Materials[i] != null);
  5491. if (Materials[i] == null) continue;
  5492. Materials[i].Save(writer);
  5493. writer.Write(MaterialsCount[i]);
  5494. }
  5495. writer.Write(IsHaveEnoughMat);
  5496. }
  5497. }
  5498. public sealed class AwakeningLockedItem : Packet
  5499. {
  5500. public override ushort Index { get { return (ushort)ServerPacketIds.AwakeningLockedItem; } }
  5501. public ulong UniqueID;
  5502. public bool Locked;
  5503. protected override void ReadPacket(BinaryReader reader)
  5504. {
  5505. UniqueID = reader.ReadUInt64();
  5506. Locked = reader.ReadBoolean();
  5507. }
  5508. protected override void WritePacket(BinaryWriter writer)
  5509. {
  5510. writer.Write(UniqueID);
  5511. writer.Write(Locked);
  5512. }
  5513. }
  5514. public sealed class Awakening : Packet
  5515. {
  5516. public override ushort Index
  5517. {
  5518. get { return (ushort)ServerPacketIds.Awakening; }
  5519. }
  5520. public int result;
  5521. public long removeID; //= -1
  5522. public ulong resultUid;
  5523. protected override void ReadPacket(BinaryReader reader)
  5524. {
  5525. result = reader.ReadInt32();
  5526. removeID = reader.ReadInt64();
  5527. resultUid = reader.ReadUInt64();
  5528. }
  5529. protected override void WritePacket(BinaryWriter writer)
  5530. {
  5531. writer.Write(result);
  5532. writer.Write(removeID);
  5533. writer.Write(resultUid);
  5534. }
  5535. }
  5536. public sealed class UnAwakening : Packet
  5537. {
  5538. public override ushort Index
  5539. {
  5540. get { return (ushort)ServerPacketIds.UnAwakening; }
  5541. }
  5542. public int result;
  5543. public long removeID; //= -1
  5544. public ulong resultUid;
  5545. protected override void ReadPacket(BinaryReader reader)
  5546. {
  5547. result = reader.ReadInt32();
  5548. removeID = reader.ReadInt64();
  5549. resultUid = reader.ReadUInt64();
  5550. }
  5551. protected override void WritePacket(BinaryWriter writer)
  5552. {
  5553. writer.Write(result);
  5554. writer.Write(removeID);
  5555. writer.Write(resultUid);
  5556. }
  5557. }
  5558. public sealed class ReceiveMail : Packet
  5559. {
  5560. public override ushort Index
  5561. {
  5562. get { return (ushort)ServerPacketIds.ReceiveMail; }
  5563. }
  5564. public List<ClientMail> Mail = new List<ClientMail>();
  5565. protected override void ReadPacket(BinaryReader reader)
  5566. {
  5567. int count = reader.ReadInt32();
  5568. try
  5569. {
  5570. for (int i = 0; i < count; i++)
  5571. {
  5572. System.Console.WriteLine(i);
  5573. Mail.Add(new ClientMail(reader));
  5574. }
  5575. }
  5576. catch (Exception e)
  5577. {
  5578. System.Console.WriteLine( e.Message + e.StackTrace);
  5579. throw;
  5580. }
  5581. }
  5582. protected override void WritePacket(BinaryWriter writer)
  5583. {
  5584. writer.Write(Mail.Count);
  5585. for (int i = 0; i < Mail.Count; i++)
  5586. Mail[i].Save(writer);
  5587. }
  5588. }
  5589. public sealed class MailLockedItem : Packet
  5590. {
  5591. public override ushort Index { get { return (ushort)ServerPacketIds.MailLockedItem; } }
  5592. public ulong UniqueID;
  5593. public bool Locked;
  5594. protected override void ReadPacket(BinaryReader reader)
  5595. {
  5596. UniqueID = reader.ReadUInt64();
  5597. Locked = reader.ReadBoolean();
  5598. }
  5599. protected override void WritePacket(BinaryWriter writer)
  5600. {
  5601. writer.Write(UniqueID);
  5602. writer.Write(Locked);
  5603. }
  5604. }
  5605. public sealed class MailSent : Packet
  5606. {
  5607. public sbyte Result;
  5608. public override ushort Index
  5609. {
  5610. get { return (ushort)ServerPacketIds.MailSent; }
  5611. }
  5612. protected override void ReadPacket(BinaryReader reader)
  5613. {
  5614. Result = reader.ReadSByte();
  5615. }
  5616. protected override void WritePacket(BinaryWriter writer)
  5617. {
  5618. writer.Write(Result);
  5619. }
  5620. }
  5621. public sealed class MailSendRequest : Packet
  5622. {
  5623. public override ushort Index
  5624. {
  5625. get { return (ushort)ServerPacketIds.MailSendRequest; }
  5626. }
  5627. protected override void ReadPacket(BinaryReader reader)
  5628. {
  5629. }
  5630. protected override void WritePacket(BinaryWriter writer)
  5631. {
  5632. }
  5633. }
  5634. public sealed class ParcelCollected : Packet
  5635. {
  5636. public sbyte Result;
  5637. public override ushort Index
  5638. {
  5639. get { return (ushort)ServerPacketIds.ParcelCollected; }
  5640. }
  5641. protected override void ReadPacket(BinaryReader reader)
  5642. {
  5643. Result = reader.ReadSByte();
  5644. }
  5645. protected override void WritePacket(BinaryWriter writer)
  5646. {
  5647. writer.Write(Result);
  5648. }
  5649. }
  5650. public sealed class MailCost : Packet
  5651. {
  5652. public uint Cost;
  5653. public override ushort Index
  5654. {
  5655. get { return (ushort)ServerPacketIds.MailCost; }
  5656. }
  5657. protected override void ReadPacket(BinaryReader reader)
  5658. {
  5659. Cost = reader.ReadUInt32();
  5660. }
  5661. protected override void WritePacket(BinaryWriter writer)
  5662. {
  5663. writer.Write(Cost);
  5664. }
  5665. }
  5666. public sealed class ResizeInventory : Packet
  5667. {
  5668. public override ushort Index { get { return (ushort)ServerPacketIds.ResizeInventory; } }
  5669. public int Size;
  5670. protected override void ReadPacket(BinaryReader reader)
  5671. {
  5672. Size = reader.ReadInt32();
  5673. }
  5674. protected override void WritePacket(BinaryWriter writer)
  5675. {
  5676. writer.Write(Size);
  5677. }
  5678. }
  5679. public sealed class NewIntelligentCreature : Packet//IntelligentCreature
  5680. {
  5681. public override ushort Index
  5682. {
  5683. get { return (ushort)ServerPacketIds.NewIntelligentCreature; }
  5684. }
  5685. public ClientIntelligentCreature Creature;
  5686. protected override void ReadPacket(BinaryReader reader)
  5687. {
  5688. Creature = new ClientIntelligentCreature(reader);
  5689. }
  5690. protected override void WritePacket(BinaryWriter writer)
  5691. {
  5692. Creature.Save(writer);
  5693. }
  5694. }
  5695. public sealed class UpdateIntelligentCreatureList : Packet//IntelligentCreature
  5696. {
  5697. public override ushort Index
  5698. {
  5699. get { return (ushort)ServerPacketIds.UpdateIntelligentCreatureList; }
  5700. }
  5701. public List<ClientIntelligentCreature> CreatureList = new List<ClientIntelligentCreature>();
  5702. public bool CreatureSummoned = false;
  5703. public IntelligentCreatureType SummonedCreatureType = IntelligentCreatureType.None;
  5704. public int PearlCount = 0;
  5705. protected override void ReadPacket(BinaryReader reader)
  5706. {
  5707. int count = reader.ReadInt32();
  5708. for (int i = 0; i < count; i++)
  5709. CreatureList.Add(new ClientIntelligentCreature(reader));
  5710. CreatureSummoned = reader.ReadBoolean();
  5711. SummonedCreatureType = (IntelligentCreatureType)reader.ReadByte();
  5712. PearlCount = reader.ReadInt32();
  5713. }
  5714. protected override void WritePacket(BinaryWriter writer)
  5715. {
  5716. writer.Write(CreatureList.Count);
  5717. for (int i = 0; i < CreatureList.Count; i++)
  5718. CreatureList[i].Save(writer);
  5719. writer.Write(CreatureSummoned);
  5720. writer.Write((byte)SummonedCreatureType);
  5721. writer.Write(PearlCount);
  5722. }
  5723. }
  5724. public sealed class IntelligentCreatureEnableRename : Packet
  5725. {
  5726. public override ushort Index
  5727. {
  5728. get { return (ushort)ServerPacketIds.IntelligentCreatureEnableRename; }
  5729. }
  5730. protected override void ReadPacket(BinaryReader reader)
  5731. {
  5732. }
  5733. protected override void WritePacket(BinaryWriter writer)
  5734. {
  5735. }
  5736. }
  5737. public sealed class IntelligentCreaturePickup : Packet
  5738. {
  5739. public override ushort Index
  5740. {
  5741. get { return (ushort)ServerPacketIds.IntelligentCreaturePickup; }
  5742. }
  5743. public uint ObjectID;
  5744. protected override void ReadPacket(BinaryReader reader)
  5745. {
  5746. ObjectID = reader.ReadUInt32();
  5747. }
  5748. protected override void WritePacket(BinaryWriter writer)
  5749. {
  5750. writer.Write(ObjectID);
  5751. }
  5752. }
  5753. public sealed class NPCPearlGoods : Packet
  5754. {
  5755. public override ushort Index { get { return (ushort)ServerPacketIds.NPCPearlGoods; } }
  5756. public List<UserItem> List = new List<UserItem>();
  5757. public float Rate;
  5758. protected override void ReadPacket(BinaryReader reader)
  5759. {
  5760. int count = reader.ReadInt32();
  5761. for (int i = 0; i < count; i++)
  5762. List.Add(new UserItem(reader));
  5763. Rate = reader.ReadSingle();
  5764. }
  5765. protected override void WritePacket(BinaryWriter writer)
  5766. {
  5767. writer.Write(List.Count);
  5768. for (int i = 0; i < List.Count; i++)
  5769. List[i].Save(writer);
  5770. writer.Write(Rate);
  5771. }
  5772. }
  5773. public sealed class FriendUpdate : Packet
  5774. {
  5775. public override ushort Index
  5776. {
  5777. get { return (ushort)ServerPacketIds.FriendUpdate; }
  5778. }
  5779. public List<ClientFriend> Friends = new List<ClientFriend>();
  5780. protected override void ReadPacket(BinaryReader reader)
  5781. {
  5782. int count = reader.ReadInt32();
  5783. for (int i = 0; i < count; i++)
  5784. Friends.Add(new ClientFriend(reader));
  5785. }
  5786. protected override void WritePacket(BinaryWriter writer)
  5787. {
  5788. writer.Write(Friends.Count);
  5789. for (int i = 0; i < Friends.Count; i++)
  5790. Friends[i].Save(writer);
  5791. }
  5792. }
  5793. public sealed class FriendRequest : Packet
  5794. {
  5795. public override ushort Index
  5796. {
  5797. get { return (ushort)ServerPacketIds.FriendRequest; }
  5798. }
  5799. public string RequestName;
  5800. protected override void ReadPacket(BinaryReader reader)
  5801. {
  5802. RequestName=reader.ReadString();
  5803. }
  5804. protected override void WritePacket(BinaryWriter writer)
  5805. {
  5806. writer.Write(RequestName);
  5807. }
  5808. }
  5809. public sealed class GuildBuffList : Packet
  5810. {
  5811. public override ushort Index { get { return (ushort)ServerPacketIds.GuildBuffList; } }
  5812. public byte Remove = 0;
  5813. public List<GuildBuff> ActiveBuffs = new List<GuildBuff>();
  5814. public List<GuildBuffInfo> GuildBuffs = new List<GuildBuffInfo>();
  5815. protected override void ReadPacket(BinaryReader reader)
  5816. {
  5817. Remove = reader.ReadByte();
  5818. int count = reader.ReadInt32();
  5819. for (int i = 0; i < count; i++)
  5820. ActiveBuffs.Add(new GuildBuff(reader));
  5821. count = reader.ReadInt32();
  5822. for (int i = 0; i < count; i++)
  5823. GuildBuffs.Add(new GuildBuffInfo(reader));
  5824. }
  5825. protected override void WritePacket(BinaryWriter writer)
  5826. {
  5827. writer.Write(Remove);
  5828. writer.Write(ActiveBuffs.Count);
  5829. for (int i = 0; i < ActiveBuffs.Count; i++)
  5830. ActiveBuffs[i].Save(writer);
  5831. writer.Write(GuildBuffs.Count);
  5832. for (int i = 0; i < GuildBuffs.Count; i++)
  5833. GuildBuffs[i].Save(writer);
  5834. }
  5835. }
  5836. public sealed class LoverUpdate : Packet
  5837. {
  5838. public override ushort Index
  5839. {
  5840. get { return (ushort)ServerPacketIds.LoverUpdate; }
  5841. }
  5842. public string Name;
  5843. public DateTime Date;
  5844. public string MapName;
  5845. public short MarriedDays;
  5846. protected override void ReadPacket(BinaryReader reader)
  5847. {
  5848. Name = reader.ReadString();
  5849. Date = DateTime.FromBinary(reader.ReadInt64());
  5850. MapName = reader.ReadString();
  5851. MarriedDays = reader.ReadInt16();
  5852. }
  5853. protected override void WritePacket(BinaryWriter writer)
  5854. {
  5855. writer.Write(Name);
  5856. writer.Write(Date.ToBinary());
  5857. writer.Write(MapName);
  5858. writer.Write(MarriedDays);
  5859. }
  5860. }
  5861. public sealed class MentorUpdate : Packet
  5862. {
  5863. public override ushort Index
  5864. {
  5865. get { return (ushort)ServerPacketIds.MentorUpdate; }
  5866. }
  5867. public string Name;
  5868. public ushort Level;
  5869. public bool Online;
  5870. public long MenteeEXP;
  5871. protected override void ReadPacket(BinaryReader reader)
  5872. {
  5873. Name = reader.ReadString();
  5874. Level = reader.ReadUInt16();
  5875. Online = reader.ReadBoolean();
  5876. MenteeEXP = reader.ReadInt64();
  5877. }
  5878. protected override void WritePacket(BinaryWriter writer)
  5879. {
  5880. writer.Write(Name);
  5881. writer.Write(Level);
  5882. writer.Write(Online);
  5883. writer.Write(MenteeEXP);
  5884. }
  5885. }
  5886. public sealed class NPCRequestInput : Packet
  5887. {
  5888. public override ushort Index { get { return (ushort)ServerPacketIds.NPCRequestInput; } }
  5889. public uint NPCID;
  5890. public string PageName;
  5891. protected override void ReadPacket(BinaryReader reader)
  5892. {
  5893. NPCID = reader.ReadUInt32();
  5894. PageName = reader.ReadString();
  5895. }
  5896. protected override void WritePacket(BinaryWriter writer)
  5897. {
  5898. writer.Write(NPCID);
  5899. writer.Write(PageName);
  5900. }
  5901. }
  5902. public sealed class Rankings : Packet
  5903. {
  5904. public override ushort Index { get { return (ushort)ServerPacketIds.Rankings; } }
  5905. public byte RankType = 0;
  5906. public int MyRank = 0;
  5907. public List<Rank_Character_Info> Listings = new List<Rank_Character_Info>();
  5908. protected override void ReadPacket(BinaryReader reader)
  5909. {
  5910. RankType = reader.ReadByte();
  5911. MyRank = reader.ReadInt32();
  5912. int count = reader.ReadInt32();
  5913. for (int i = 0; i < count; i++)
  5914. {
  5915. Listings.Add(new Rank_Character_Info(reader));
  5916. }
  5917. }
  5918. protected override void WritePacket(BinaryWriter writer)
  5919. {
  5920. writer.Write(RankType);
  5921. writer.Write(MyRank);
  5922. writer.Write(Listings.Count);
  5923. for (int i = 0; i < Listings.Count; i++)
  5924. Listings[i].Save(writer);
  5925. }
  5926. }
  5927. public sealed class Opendoor : Packet
  5928. {
  5929. public override ushort Index { get { return (ushort)ServerPacketIds.Opendoor; } }
  5930. public bool Close = false;
  5931. public byte DoorIndex;
  5932. protected override void ReadPacket(BinaryReader reader)
  5933. {
  5934. DoorIndex = reader.ReadByte();
  5935. Close = reader.ReadBoolean();
  5936. }
  5937. protected override void WritePacket(BinaryWriter writer)
  5938. {
  5939. writer.Write(DoorIndex);
  5940. writer.Write(Close);
  5941. }
  5942. }
  5943. public sealed class ReshRecipes : Packet
  5944. {
  5945. public override ushort Index { get { return (ushort)ServerPacketIds.ReshRecipes; } }
  5946. public List<int> Recipes = new List<int>();
  5947. protected override void ReadPacket(BinaryReader reader)
  5948. {
  5949. int count = reader.ReadInt32();
  5950. for (var i = 0; i < count; i++)
  5951. Recipes.Add(reader.ReadInt32());
  5952. }
  5953. protected override void WritePacket(BinaryWriter writer)
  5954. {
  5955. writer.Write(Recipes.Count);
  5956. for (int i = 0; i < Recipes.Count; i++)
  5957. writer.Write(Recipes[i]);
  5958. }
  5959. }
  5960. public sealed class AboutToQuest : Packet
  5961. {
  5962. public override ushort Index { get { return (ushort)ServerPacketIds.AboutToQuest; } }
  5963. public QuestState questState = QuestState.None;
  5964. public int questindex = 0;
  5965. protected override void ReadPacket(BinaryReader reader)
  5966. {
  5967. questState = (QuestState)reader.ReadByte();
  5968. questindex = reader.ReadInt32();
  5969. }
  5970. protected override void WritePacket(BinaryWriter writer)
  5971. {
  5972. writer.Write((byte)questState);
  5973. writer.Write(questindex);
  5974. }
  5975. }
  5976. public sealed class ServerArea : Packet
  5977. {
  5978. public override ushort Index { get { return (ushort)ServerPacketIds.ServerArea; } }
  5979. public string areas = "";
  5980. protected override void ReadPacket(BinaryReader reader)
  5981. {
  5982. areas = reader.ReadString();
  5983. }
  5984. protected override void WritePacket(BinaryWriter writer)
  5985. {
  5986. writer.Write(areas);
  5987. }
  5988. }
  5989. public sealed class OpenJyxt : Packet
  5990. {
  5991. public override ushort Index { get { return (ushort)ServerPacketIds.OpenJyxt; } }
  5992. protected override void ReadPacket(BinaryReader reader)
  5993. {
  5994. }
  5995. protected override void WritePacket(BinaryWriter writer)
  5996. {
  5997. }
  5998. }
  5999. public sealed class InitialItem : Packet
  6000. {
  6001. public override ushort Index { get { return (ushort)ServerPacketIds.InitialItem; } }
  6002. public int result = 0;
  6003. protected override void ReadPacket(BinaryReader reader)
  6004. {
  6005. result = reader.ReadInt32();
  6006. }
  6007. protected override void WritePacket(BinaryWriter writer)
  6008. {
  6009. writer.Write(result);
  6010. }
  6011. }
  6012. public sealed class MoveShield : Packet
  6013. {
  6014. public override ushort Index { get { return (ushort)ServerPacketIds.MoveShield; } }
  6015. public string ShieldID;
  6016. public int SessionID;
  6017. public string NewShieldIP;
  6018. public int NewShieldPort;
  6019. protected override void ReadPacket(BinaryReader reader)
  6020. {
  6021. ShieldID = reader.ReadString();
  6022. SessionID = reader.ReadInt32();
  6023. NewShieldIP = reader.ReadString();
  6024. NewShieldPort = reader.ReadInt32();
  6025. }
  6026. protected override void WritePacket(BinaryWriter writer)
  6027. {
  6028. writer.Write(ShieldID);
  6029. writer.Write(SessionID);
  6030. writer.Write(NewShieldIP);
  6031. writer.Write(NewShieldPort);
  6032. }
  6033. }
  6034. }