12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520 |
- using System;
- using System.IO;
- using System.Collections.Generic;
- using System.Text;
- using CommonAI.RTS;
- using CommonLang.Vector;
- using CommonLang.IO;
- using CommonLang.ByteOrder;
- using CommonLang.IO.Attribute;
- using CommonLang;
- using CommonLang.Protocol;
- using CommonAI.Zone.Helper;
- using CommonAI.ZoneClient;
- using CommonAI.Zone.Instance;
- using CommonLang.Log;
- using CommonAI.ZoneServer.JSGModule;
- using CommonAI.Data;
- namespace CommonAI.Zone
- {
- #region ABSTRACT
-
-
-
- abstract public class Action : IMessage, BattleMessage
- {
-
- public GameEntity sender;
- public int MessageID { get; set; }
- public Action() { }
- abstract public void WriteExternal(IOutputStream output);
- abstract public void ReadExternal(IInputStream input);
- virtual public void BeforeWrite(TemplateManager templates) { }
- virtual public void EndRead(TemplateManager templates) { }
- }
-
-
-
- abstract public class Event : IMessage, BattleMessage
- {
- public GameEntity sender;
- public int MessageID { get; set; }
- abstract public void WriteExternal(IOutputStream output);
- abstract public void ReadExternal(IInputStream input);
- virtual public void BeforeWrite(TemplateManager templates) { }
- virtual public void EndRead(TemplateManager templates) { }
- }
- public interface BattleMessage
- {
- void BeforeWrite(TemplateManager templates);
- void EndRead(TemplateManager templates);
- }
-
-
-
- public interface PositionMessage
- {
- float X { get; }
- float Y { get; }
- }
-
-
-
- public interface ActorMessage
- {
- uint ObjectID { get; }
- }
-
- public abstract class PlayerSingleMsg : ObjectEvent
- {
- }
-
-
-
- public interface SystemMessage
- {
- }
-
-
-
-
- abstract public class ObjectAction : Action
- {
-
-
-
- public uint object_id;
- protected ObjectAction() { }
- protected ObjectAction(uint obj_id)
- {
- this.object_id = obj_id;
- }
- override public void WriteExternal(IOutputStream output)
- {
-
- }
- override public void ReadExternal(IInputStream input)
- {
-
- }
- }
-
-
-
- abstract public class ObjectEvent : Event
- {
- public uint object_id;
- public uint ObjectID { get { return object_id; } }
- protected ObjectEvent() { }
- protected ObjectEvent(uint obj_id)
- {
- this.object_id = obj_id;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutVU32(object_id);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.object_id = input.GetVU32();
- }
- }
-
-
-
-
- abstract public class ActorRequest : ObjectAction
- {
- protected ActorRequest() { }
- protected ActorRequest(uint obj_id)
- : base(obj_id)
- {
- }
- }
-
-
-
- abstract public class ActorResponse : ObjectEvent, ActorMessage
- {
- protected ActorResponse() { }
- protected ActorResponse(uint obj_id)
- : base(obj_id)
- {
- }
- }
- #endregion
-
- #region ZONE_EVENTS_0x8000
- public abstract class ZoneEvent : Event
- {
- }
-
-
-
- [MessageType(0x8001)]
- public class AddUnitEvent : ZoneEvent
- {
- public SyncUnitInfo Sync;
- public string ErrorMessage;
- public byte flag;
- public uint unit_id
- {
- get
- {
- if (Sync != null)
- {
- return Sync.ObjectID;
- }
- return 0;
- }
- }
- public AddUnitEvent() { }
- public AddUnitEvent(SyncUnitInfo sync)
- {
- this.Sync = sync;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutExt(Sync);
- output.PutUTF(ErrorMessage);
- output.PutU8(flag);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.Sync = input.GetExt<SyncUnitInfo>();
- this.ErrorMessage = input.GetUTF();
- this.flag = input.GetU8();
- }
- }
-
-
-
- [MessageType(0x8002)]
- public class AddSpellEvent : ZoneEvent
- {
- private BitSet8 mask = new BitSet8();
- public bool IsLauncherSender
- {
- get { return mask.Get(0); }
- private set { mask.Set(0, value); }
- }
- public bool IsTargetPos
- {
- get { return mask.Get(1); }
- private set { mask.Set(1, value); }
- }
- public bool IsTargetObject
- {
- get { return mask.Get(2); }
- private set { mask.Set(2, value); }
- }
- public bool IsHeight
- {
- get { return mask.Get(3); }
- private set { mask.Set(3, value); }
- }
- public bool IsSyncPos
- {
- get { return mask.Get(4); }
- private set { mask.Set(4, value); }
- }
- public bool IsHalf
- {
- get { return mask.Get(7); }
- private set { mask.Set(7, value); }
- }
- public int spell_template_id
- {
- get { return (launch_data != null) ? launch_data.SpellID : 0; }
- }
- public LaunchSpell LaunchData
- {
- get { return launch_data; }
- }
- private LaunchSpell launch_data;
- private uint launch_data_sn = 0;
- public uint spell_id;
- public uint launcher_unit_id;
- public uint sender_unit_id;
- public uint target_obj_id;
- public Vector2 target_pos;
- public float x;
- public float y;
- public float direction;
- public float height;
- public int SpellID;
- public AddSpellEvent() { }
- public AddSpellEvent(InstanceSpell spell)
- {
- this.launch_data = spell.LaunchData;
- this.spell_id = spell.ID;
- this.sender_unit_id = spell.SenderID;
- this.launcher_unit_id = spell.LauncherID;
- this.target_obj_id = spell.TargetID;
- this.target_pos = spell.TargetPos;
- this.x = spell.X;
- this.y = spell.Y;
- this.direction = spell.Direction;
- this.height = spell.Z;
-
- this.IsLauncherSender = (launcher_unit_id == sender_unit_id);
- this.IsTargetPos = (spell.Info.MType == SpellTemplate.MotionType.Cannon || spell.Info.MType == SpellTemplate.MotionType.CurveMissile) && (target_pos != null);
- this.IsTargetObject = (target_obj_id != 0);
- this.IsHeight = (height != 0);
- this.IsHalf = spell.Parent.IsHalfSync;
- this.IsSyncPos = spell.Info.IsLaunchSpellEventSyncPos;
- this.SpellID = this.launch_data.SpellID;
- }
- public override void BeforeWrite(TemplateManager templates)
- {
- base.BeforeWrite(templates);
- if (launch_data != null)
- {
- this.launch_data_sn = this.LaunchData.IsCodeCreate() ? uint.MaxValue: launch_data.SerialNumber;
- }
- }
- public override void EndRead(TemplateManager templates)
- {
- base.EndRead(templates);
- if(this.launch_data_sn == uint.MaxValue)
- {
- this.launch_data = JSGGlobalData.GetUnConfigSpellByID((int)this.SpellID);
-
- }
- else
- {
- this.launch_data = templates.GetSnData<LaunchSpell>(launch_data_sn);
- }
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutU8(mask.Mask);
- output.PutVU32(spell_id);
- output.PutVU32(launch_data_sn);
- if (this.IsLauncherSender)
- {
- output.PutVU32(launcher_unit_id);
- }
- else
- {
- output.PutVU32(sender_unit_id);
- output.PutVU32(launcher_unit_id);
- }
- if (this.IsTargetObject)
- {
- output.PutVU32(target_obj_id);
- }
- if (this.IsTargetPos)
- {
- MoveHelper.WritePos(IsHalf, target_pos.X, target_pos.Y, output);
- }
- if (this.IsSyncPos)
- {
- MoveHelper.WritePosAndDirection(IsHalf, x, y, direction, output);
- }
- if (this.IsHeight)
- {
- MoveHelper.WritePos(IsHalf, height, output);
- }
- if (this.LaunchData.IsCodeCreate())
- {
- output.PutS32(this.SpellID);
- }
-
- }
- override public void ReadExternal(IInputStream input)
- {
- this.mask.Mask = input.GetU8();
- this.spell_id = input.GetVU32();
- this.launch_data_sn = input.GetVU32();
- if (this.IsLauncherSender)
- {
- this.launcher_unit_id = this.sender_unit_id = input.GetVU32();
- }
- else
- {
- this.sender_unit_id = input.GetVU32();
- this.launcher_unit_id = input.GetVU32();
- }
- if (this.IsTargetObject)
- {
- this.target_obj_id = input.GetVU32();
- }
- if (this.IsTargetPos)
- {
- this.target_pos = new Vector2();
- MoveHelper.ReadPos(IsHalf, ref target_pos, input);
- }
- if (this.IsSyncPos)
- {
- MoveHelper.ReadPosAndDirection(IsHalf, out x, out y, out direction, input);
- }
- if (this.IsHeight)
- {
- MoveHelper.ReadPos(IsHalf, out height, input);
- }
- if(this.launch_data_sn == uint.MaxValue)
- {
- this.SpellID = input.GetS32();
- }
- }
- }
-
-
-
- [MessageType(0x8003)]
- public class AddEffectEvent : ZoneEvent, PositionMessage
- {
- public uint hostId = 0;
- public float x;
- public float y;
- public float direction;
- private uint effect_sn = 0;
- public LaunchEffect effect { get; set; }
- public AddEffectEvent() { }
- public AddEffectEvent(uint hostId , float x, float y, float dir, LaunchEffect effect)
- {
- this.hostId = hostId;
- this.x = x;
- this.y = y;
- this.direction = dir;
- this.effect = effect;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutVU32(hostId);
- output.PutF32(x);
- output.PutF32(y);
- output.PutF32(direction);
- output.PutVU32(effect_sn);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.hostId = input.GetVU32();
- this.x = input.GetF32();
- this.y = input.GetF32();
- this.direction = input.GetF32();
- this.effect_sn = input.GetVU32();
- }
- public override void BeforeWrite(TemplateManager templates)
- {
- if (effect != null)
- {
- this.effect_sn = effect.SerialNumber;
- }
- }
- public override void EndRead(TemplateManager templates)
- {
- this.effect = templates.GetSnData<LaunchEffect>(effect_sn);
- }
- public float X { get { return x; } }
- public float Y { get { return y; } }
- }
-
-
-
- [MessageType(0x8004)]
- public class AddItemEvent : ZoneEvent
- {
- public SyncItemInfo Sync;
- public string ErrorMessage;
- public uint unit_id
- {
- get { if (Sync != null) { return Sync.ObjectID; } return 0; }
- }
- public AddItemEvent() { }
- public AddItemEvent(SyncItemInfo sync)
- {
- this.Sync = sync;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutExt(Sync);
- output.PutUTF(ErrorMessage);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.Sync = input.GetExt<SyncItemInfo>();
- this.ErrorMessage = input.GetUTF();
- }
- }
-
-
-
- [MessageType(0x8005)]
- public class RemoveObjectEvent : ZoneEvent
- {
- public uint object_id;
- public RemoveObjectEvent() { }
- public RemoveObjectEvent(uint oid)
- {
- this.object_id = oid;
- }
- override public void WriteExternal(IOutputStream output)
- {
-
- output.PutVU32(object_id);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.object_id = input.GetVU32();
- }
- }
-
-
-
- [MessageType(0x8006)]
- public class SyncPosEvent : ZoneEvent
- {
- public struct UnitPos : IVector2
- {
- private uint m_ID;
- private float m_X;
- private float m_Y;
- private float m_Z;
- private float m_Direction;
- public uint ID { get { return m_ID; } }
- public float Direction { get { return m_Direction; } set { m_Direction = value; } }
- public float X { get { return m_X; } set { m_X = value; } }
- public float Y { get { return m_Y; } set { m_Y = value; } }
- public float Z { get { return m_Z; } set { m_Z = value; } }
- public void SetObject(InstanceZoneObject obj)
- {
- this.m_ID = obj.ID;
- this.m_X = obj.X;
- this.m_Y = obj.Y;
- this.m_Z = obj.Z;
- this.m_Direction = obj.Direction;
- }
- internal void Write(IOutputStream output, bool half, bool sync_z)
- {
- output.PutVU32(m_ID);
- if (half)
- {
- output.PutU16(MoveHelper.ToPos16(m_X));
- output.PutU16(MoveHelper.ToPos16(m_Y));
- if (sync_z) output.PutU16(MoveHelper.ToPos16(m_Z));
- }
- else
- {
- output.PutF32(m_X);
- output.PutF32(m_Y);
- if (sync_z) output.PutF32(m_Z);
- }
-
- output.PutU8(MoveHelper.ToDirectionD8(m_Direction));
-
-
-
-
- }
- internal void Read(IInputStream input, bool half, bool sync_z)
- {
- m_ID = input.GetVU32();
- if (half)
- {
- m_X = MoveHelper.ToPosF32(input.GetU16());
- m_Y = MoveHelper.ToPosF32(input.GetU16());
- if (sync_z) m_Z = MoveHelper.ToPosF32(input.GetU16());
- }
- else
- {
- m_X = input.GetF32();
- m_Y = input.GetF32();
- if (sync_z) m_Z = input.GetF32();
- }
- m_Direction = MoveHelper.ToDirectionF32(input.GetU8());
- }
- public void SetX(float value)
- {
-
- }
- public void SetY(float value)
- {
-
- }
- public void AddX(float value)
- {
-
- }
- public void AddY(float value)
- {
-
- }
- }
- public struct UnitState
- {
- private uint m_ID;
- private byte m_UnitMainState;
- private byte m_UnitSubState;
- public uint ID { get { return m_ID; } }
- public UnitActionStatus UnitMainState
- {
- get { return (UnitActionStatus)m_UnitMainState; }
- set { m_UnitMainState = (byte)value; }
- }
- public byte UnitSubState
- {
- get { return m_UnitSubState; }
- set { m_UnitSubState = value; }
- }
- public void SetObject(InstanceUnit obj)
- {
- this.m_ID = obj.ID;
- this.m_UnitMainState = (byte)obj.CurrentActionStatus;
- this.m_UnitSubState = (byte)obj.CurrentActionSubstate;
- }
- internal void Write(IOutputStream output)
- {
- output.PutVU32(m_ID);
- output.PutU8(m_UnitMainState);
- output.PutU8(m_UnitSubState);
-
-
-
-
- }
- internal void Read(IInputStream input)
- {
- m_ID = input.GetVU32();
- m_UnitMainState = input.GetU8();
- m_UnitSubState = input.GetU8();
- }
- }
- private BitSet8 mask = new BitSet8();
- private long pass_time_ms;
- public UnitPos[] units_pos;
- public UnitState[] units_st;
- public bool IsHalf
- {
- get { return mask.Get(0); }
- private set { mask.Set(0, value); }
- }
- public bool IsSyncZ
- {
- get { return mask.Get(1); }
- private set { mask.Set(1, value); }
- }
- public long PassTimeMS { get { return pass_time_ms; } }
- public bool IsEmpty { get { return (units_pos == null || units_pos.Length == 0) && (units_st == null || units_st.Length == 0); } }
- public SyncPosEvent() { }
- public SyncPosEvent(bool half, bool sync_z, long passtime)
- {
- this.IsHalf = half;
- this.IsSyncZ = sync_z;
- this.pass_time_ms = passtime;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutU8(mask.Mask);
- output.PutVS64(pass_time_ms);
- bool syncz = IsSyncZ;
- bool half = IsHalf;
- if (units_pos != null)
- {
- output.PutVS32(units_pos.Length);
- for (int i = 0; i < units_pos.Length; i++)
- {
- units_pos[i].Write(output, half, syncz);
- }
- }
- else
- {
- output.PutVS32(0);
- }
- if (units_st != null)
- {
- output.PutVS32(units_st.Length);
- for (int i = 0; i < units_st.Length; i++)
- {
- units_st[i].Write(output);
- }
- }
- else
- {
- output.PutVS32(0);
- }
- }
- override public void ReadExternal(IInputStream input)
- {
- this.mask.Mask = input.GetU8();
- this.pass_time_ms = input.GetVS64();
- bool syncz = IsSyncZ;
- bool half = IsHalf;
- this.units_pos = new UnitPos[input.GetVS32()];
- for (int i = 0; i < units_pos.Length; i++)
- {
- units_pos[i].Read(input, half, syncz);
- }
- this.units_st = new UnitState[input.GetVS32()];
- for (int i = 0; i < units_st.Length; i++)
- {
-
- units_st[i].Read(input);
- }
- }
- }
-
-
-
- [MessageType(0x8007)]
- public class DoScriptEvent : ZoneEvent
- {
- public string ScriptFileName;
- public DoScriptEvent() { }
- public DoScriptEvent(string filename)
- {
- this.ScriptFileName = filename;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutUTF(ScriptFileName);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.ScriptFileName = input.GetUTF();
- }
- }
-
-
-
- [MessageType(0x8008)]
- public class ScriptCommandEvent : ZoneEvent
- {
- public string message;
- public ScriptCommandEvent() { }
- public ScriptCommandEvent(string msg)
- {
- this.message = msg;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutUTF(message);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.message = input.GetUTF();
- }
- }
-
-
-
- [MessageType(0x8009)]
- public class GameOverEvent : ZoneEvent
- {
- public string message;
- public int WinForce;
- public GameOverEvent() { }
- public GameOverEvent(int force, string msg)
- {
- this.WinForce = force;
- this.message = msg;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutUTF(message);
- output.PutS32(WinForce);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.message = input.GetUTF();
- this.WinForce = input.GetS32();
- }
- }
- [MessageType(0x800A)]
- public class DecorationChangedEvent : ZoneEvent
- {
- public string Name;
- public bool Enable;
- public DecorationChangedEvent() { }
- public DecorationChangedEvent(string name, bool enable)
- {
- this.Name = name;
- this.Enable = enable;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutUTF(Name);
- output.PutBool(Enable);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.Name = input.GetUTF();
- this.Enable = input.GetBool();
- }
- }
- [MessageType(0x800B)]
- public class SyncEnvironmentVarEvent : ZoneEvent
- {
- public string Key;
- public object Value;
- public SyncEnvironmentVarEvent() { }
- public SyncEnvironmentVarEvent(string key, object value)
- {
- this.Key = key;
- this.Value = value;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutUTF(Key);
- output.PutData(Value);
- }
- override public void ReadExternal(IInputStream input)
- {
- DataType dtype;
- this.Key = input.GetUTF();
- this.Value = input.GetData(out dtype);
- }
- }
- [MessageType(0x800C)]
- public class ChangeBGMEvent : ZoneEvent
- {
- public string FileName;
- public ChangeBGMEvent() { }
- public ChangeBGMEvent(string file)
- {
- this.FileName = file;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutUTF(FileName);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.FileName = input.GetUTF();
- }
- }
- [MessageType(0x800D)]
- public class FlagTagChangedEvent : ZoneEvent
- {
- public string Name;
- public string Tag;
- public FlagTagChangedEvent() { }
- public FlagTagChangedEvent(string name, string tag = null)
- {
- this.Name = name;
- this.Tag = tag;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutUTF(Name);
- output.PutUTF(Tag);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.Name = input.GetUTF();
- this.Tag = input.GetUTF();
- }
- }
- #endregion
-
- #region OBJECT_EVENTS_0x8100
-
-
-
- [MessageType(0x8100)]
- public class UnitFieldChangedEvent : ObjectEvent
- {
- public const uint MASK_ALL = 0xFFFF;
- public const uint MASK_HP = 1;
- public const uint MASK_MP = 1 << 1;
- public const uint MASK_MAX_HP = 1 << 2;
- public const uint MASK_MAX_MP = 1 << 3;
- public const uint MASK_SPEED = 1 << 4;
- public const uint MASK_SP = 1 << 5;
- public const uint MASK_MAX_SP = 1 << 6;
- public const uint MASK_FCR = 1 << 7;
- public const uint MASK_MONEY = 1 << 8;
- public const uint MASK_LEVEL = 1 << 9;
- public const uint MASK_DUMMY_0 = 1 << 10;
- public const uint MASK_DUMMY_1 = 1 << 11;
- public const uint MASK_DUMMY_2 = 1 << 12;
- public const uint MASK_DUMMY_3 = 1 << 13;
- public const uint MASK_DUMMY_4 = 1 << 14;
- public const uint MASK_DUMMY_5 = 1 << 15;
-
- public const uint MASK_SKILL_CD_ACC = 1 << 16;
- public const uint MASK_CONTROLED_ACC = 1 << 17;
-
- public uint mask = 0;
- public int currentHP;
- public int currentMP;
- public int maxHP;
- public int maxMP;
- public int currentSP;
- public int maxSP;
- public float currentSpeed;
- public float currentFCR;
- public int currentMoney;
- public int level;
- public int dummy_0;
- public int dummy_1;
- public int dummy_2;
- public int dummy_3;
- public int dummy_4;
- public int dummy_5;
-
- public int skill_cd_acc;
- public int controled_acc;
- public UnitFieldChangedEvent() { }
- public UnitFieldChangedEvent(uint unit_id, ushort mask)
- : base(unit_id)
- {
- this.mask = mask;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutVU32(mask);
- if ((mask & MASK_HP) != 0) output.PutS32(currentHP);
- if ((mask & MASK_MP) != 0) output.PutS32(currentMP);
- if ((mask & MASK_MAX_HP) != 0) output.PutS32(maxHP);
- if ((mask & MASK_MAX_MP) != 0) output.PutS32(maxMP);
- if ((mask & MASK_SP) != 0) output.PutS32(currentSP);
- if ((mask & MASK_MAX_SP) != 0) output.PutS32(maxSP);
- if ((mask & MASK_SPEED) != 0) output.PutF32(currentSpeed);
- if ((mask & MASK_FCR) != 0) output.PutF32(currentFCR);
- if ((mask & MASK_MONEY) != 0) output.PutS32(currentMoney);
- if ((mask & MASK_LEVEL) != 0) output.PutS32(level);
- if ((mask & MASK_DUMMY_0) != 0) output.PutS32(dummy_0);
- if ((mask & MASK_DUMMY_1) != 0) output.PutS32(dummy_1);
- if ((mask & MASK_DUMMY_2) != 0) output.PutS32(dummy_2);
- if ((mask & MASK_DUMMY_3) != 0) output.PutS32(dummy_3);
- if ((mask & MASK_DUMMY_4) != 0) output.PutS32(dummy_4);
- if ((mask & MASK_DUMMY_5) != 0) output.PutS32(dummy_5);
-
- if ((mask & MASK_SKILL_CD_ACC) != 0) output.PutS32(skill_cd_acc);
- if ((mask & MASK_CONTROLED_ACC) != 0) output.PutS32(controled_acc);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.mask = input.GetVU32();
- if ((mask & MASK_HP) != 0) this.currentHP = input.GetS32();
- if ((mask & MASK_MP) != 0) this.currentMP = input.GetS32();
- if ((mask & MASK_MAX_HP) != 0) this.maxHP = input.GetS32();
- if ((mask & MASK_MAX_MP) != 0) this.maxMP = input.GetS32();
- if ((mask & MASK_SP) != 0) this.currentSP = input.GetS32();
- if ((mask & MASK_MAX_SP) != 0) this.maxSP = input.GetS32();
- if ((mask & MASK_SPEED) != 0) this.currentSpeed = input.GetF32();
- if ((mask & MASK_FCR) != 0) this.currentFCR = input.GetF32();
- if ((mask & MASK_MONEY) != 0) this.currentMoney = input.GetS32();
- if ((mask & MASK_LEVEL) != 0) this.level = input.GetS32();
- if ((mask & MASK_DUMMY_0) != 0) this.dummy_0 = input.GetS32();
- if ((mask & MASK_DUMMY_1) != 0) this.dummy_1 = input.GetS32();
- if ((mask & MASK_DUMMY_2) != 0) this.dummy_2 = input.GetS32();
- if ((mask & MASK_DUMMY_3) != 0) this.dummy_3 = input.GetS32();
- if ((mask & MASK_DUMMY_4) != 0) this.dummy_4 = input.GetS32();
- if ((mask & MASK_DUMMY_5) != 0) this.dummy_5 = input.GetS32();
-
- if ((mask & MASK_SKILL_CD_ACC) != 0) this.skill_cd_acc = input.GetS32();
- if ((mask & MASK_CONTROLED_ACC) != 0) this.controled_acc = input.GetS32();
- }
- }
-
-
-
- [MessageType(0x810a)]
- public class UnitChantSkillEvent : ObjectEvent
- {
- public int skill_id;
- public int chant_ms;
- public UnitChantSkillEvent() { }
- public UnitChantSkillEvent(uint unit_id, SkillTemplate sk)
- : base(unit_id)
- {
- this.skill_id = sk.TemplateID;
- this.chant_ms = sk.ChantTimeMS;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(skill_id);
- output.PutVS32(chant_ms);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.skill_id = input.GetS32();
- this.chant_ms = input.GetVS32();
- }
- }
-
-
-
- [MessageType(0x810b)]
- public class UnitLaunchSkillEvent : ObjectEvent
- {
- public int skill_id { get; private set; }
-
-
-
- public byte action_index { get; private set; }
-
-
-
- public int[] action_time_array { get; private set; }
- public int TotalCDTimeMS { get; private set; }
- public float action_speed { get; private set; }
- public Vector2 spell_target_pos { get; private set; }
- public uint target_object_id { get; private set; }
-
- public float [] action_speed_add { get; private set; }
- private BitSet8 bitMask = new BitSet8();
- public bool IsSingleAction
- {
- get { return bitMask.Get(0); }
- private set { bitMask.Set(0, value); }
- }
- public bool ActionSpeedAddition
- {
- get { return bitMask.Get(1); }
- private set { bitMask.Set(1, value); }
- }
- public bool IsActionSpeedUP
- {
- get { return bitMask.Get(2); }
- private set { bitMask.Set(2, value); }
- }
- public bool IsActionTimeChanged
- {
- get { return bitMask.Get(3); }
- private set { bitMask.Set(3, value); }
- }
- public bool IsAutoFocusNearTarget
- {
- get { return bitMask.Get(4); }
- private set { bitMask.Set(4, value); }
- }
- public bool IsSpellTargetPos
- {
- get { return bitMask.Get(5); }
- private set { bitMask.Set(5, value); }
- }
- public bool IsTargetObject
- {
- get { return bitMask.Get(6); }
- private set { bitMask.Set(6, value); }
- }
- public bool IsChangeTotalCDTime
- {
- get { return bitMask.Get(7); }
- private set { bitMask.Set(7, value); }
- }
-
- public int TotalActionTimeMS
- {
- get
- {
- int total = 0;
- if (action_time_array != null)
- {
- foreach (int timeMS in action_time_array)
- {
- total += timeMS;
- }
- }
- return total;
- }
- }
- public UnitLaunchSkillEvent() { }
- public UnitLaunchSkillEvent(
- uint unit_id,
- SkillTemplate sk,
- byte actionIndex,
- float actionSpeed,
- int totalCDTimeMS,
- bool isAutoFaceToTarget,
- Vector2 spellTargetPos,
- uint targetObjectID,
- int lockActionStep)
- : base(unit_id)
- {
- this.skill_id = sk.TemplateID;
- this.action_speed = actionSpeed;
- this.TotalCDTimeMS = totalCDTimeMS;
- this.spell_target_pos = spellTargetPos;
- this.target_object_id = targetObjectID;
- this.IsAutoFocusNearTarget = isAutoFaceToTarget;
- this.IsSingleAction = sk.IsSingleAction;
- this.IsActionSpeedUP = (actionSpeed != 1f);
- this.IsTargetObject = (targetObjectID != 0);
- this.IsSpellTargetPos = spellTargetPos != null;
- this.IsChangeTotalCDTime = totalCDTimeMS != sk.CoolDownMS;
-
- this.action_speed_add = new float[sk.ActionQueue.Count];
- for(int i = 0; i < sk.ActionQueue.Count; i++)
- {
- if(sk.ActionQueue[i].ActionSpeedRate != 0.0f)
- {
- this.action_speed_add[i] = sk.ActionQueue[i].ActionSpeedRate;
- this.ActionSpeedAddition = true;
- }
- }
- if (sk.IsSingleAction || lockActionStep >= 0)
- {
- this.action_index = actionIndex;
- this.action_time_array = new int[] { sk.ActionQueue[actionIndex].TotalTimeMS };
- }
- else
- {
- this.action_index = 0;
- this.action_time_array = sk.ActionQueueTimeArray;
- }
- }
- public override void BeforeWrite(TemplateManager templates)
- {
- base.BeforeWrite(templates);
- var orgin_temp = templates.getSkill(skill_id);
- if (this.action_time_array == null)
- {
- this.IsActionTimeChanged = false;
- }
- else if (this.IsSingleAction)
- {
- this.IsActionTimeChanged = (this.action_time_array[0] != orgin_temp.ActionQueue[action_index].TotalTimeMS);
- }
- else
- {
- this.IsActionTimeChanged = !CUtils.ArraysEqual<int>(this.action_time_array, orgin_temp.ActionQueueTimeArray);
- }
- }
- public override void EndRead(TemplateManager templates)
- {
- base.EndRead(templates);
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(skill_id);
- output.PutU8(bitMask.Mask);
- if (IsSingleAction)
- {
- output.PutU8(action_index);
- if (IsActionTimeChanged) output.PutS32(action_time_array[0]);
- }
- else
- {
- if (IsActionTimeChanged) output.PutArray<int>(action_time_array, output.PutS32);
- }
- if (IsActionSpeedUP)
- {
- output.PutF32(action_speed);
- }
- if (IsChangeTotalCDTime)
- {
- output.PutVS32(TotalCDTimeMS);
- }
- if (IsTargetObject)
- {
- output.PutU32(this.target_object_id);
- }
- if (IsSpellTargetPos)
- {
- output.PutF32(spell_target_pos.X);
- output.PutF32(spell_target_pos.Y);
- }
- if(ActionSpeedAddition)
- {
- output.PutArray<float>(this.action_speed_add, output.PutF32);
- }
-
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.skill_id = input.GetS32();
- this.bitMask.Mask = input.GetU8();
- if (IsSingleAction)
- {
- this.action_index = input.GetU8();
- if (IsActionTimeChanged) this.action_time_array = new int[] { input.GetS32() };
- }
- else
- {
- if (IsActionTimeChanged) this.action_time_array = input.GetArray<int>(input.GetS32);
- }
- if (IsActionSpeedUP)
- {
- this.action_speed = input.GetF32();
- }
- else
- {
- this.action_speed = 1f;
- }
- if (IsChangeTotalCDTime)
- {
- this.TotalCDTimeMS = input.GetVS32();
- }
- if (IsTargetObject)
- {
- this.target_object_id = input.GetU32();
- }
- if (IsSpellTargetPos)
- {
- spell_target_pos = new Vector2();
- spell_target_pos.SetX(input.GetF32());
- spell_target_pos.SetY(input.GetF32());
- }
- if (ActionSpeedAddition)
- {
- this.action_speed_add = input.GetArray<float>(input.GetF32);
- }
- }
- public override string ToString()
- {
- return string.Format("LaunchSkill: {0}@{1}", skill_id, action_index);
- }
- }
-
-
-
- [MessageType(0x810d)]
- public class UnitEffectEvent : ObjectEvent
- {
- private uint effect_sn = 0;
-
-
-
- public LaunchEffect effect { get; set; }
- public UnitEffectEvent() { }
- public UnitEffectEvent(uint unit_id, LaunchEffect effect)
- : base(unit_id)
- {
- this.effect = effect;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutVU32(effect_sn);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.effect_sn = input.GetVU32();
- }
- public override void BeforeWrite(TemplateManager templates)
- {
- if (effect != null)
- {
- this.effect_sn = effect.SerialNumber;
- }
- }
- public override void EndRead(TemplateManager templates)
- {
- this.effect = templates.GetSnData<LaunchEffect>(effect_sn);
- }
- }
-
-
-
- [MessageType(0x810e)]
- public class UnitDoActionEvent : ObjectEvent
- {
- public string ActionName;
- public UnitDoActionEvent() { }
- public UnitDoActionEvent(uint unit_id, string actionName)
- : base(unit_id)
- {
- this.ActionName = actionName;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutUTF(ActionName);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- ActionName = input.GetUTF();
- }
- }
-
-
-
- [MessageType(0x810f)]
- public class UnitHitEvent : ObjectEvent
- {
- public bool isDead
- {
- get { return BitMask.BitGetMask(bitMask, 0); }
- set { BitMask.BitSetMask(ref bitMask, 0, value); }
- }
-
- public bool isSpecialHit
- {
- get { return BitMask.BitGetMask(bitMask, 1); }
- set { BitMask.BitSetMask(ref bitMask, 1, value); }
- }
- public bool isCritical
- {
- get { return BitMask.BitGetMask(bitMask, 2); }
- set { BitMask.BitSetMask(ref bitMask, 2, value); }
- }
- public bool HasEffect
- {
- get { return BitMask.BitGetMask(bitMask, 3); }
- private set { BitMask.BitSetMask(ref bitMask, 3, value); }
- }
- public bool HasSourceAttack
- {
- get { return BitMask.BitGetMask(bitMask, 6); }
- private set { BitMask.BitSetMask(ref bitMask, 6, value); }
- }
- public uint senderId;
- public int hp;
- public byte client_state;
- private byte bitMask = 0;
- private LaunchEffect biteffect;
- private uint biteffect_sn;
- private AttackProp sourceAttack;
- private uint sourceAttack_sn;
-
- public DamageSource dmgSrc;
-
-
- public bool InViewForceSend = false;
- public uint senderMasterId;
- public uint hitMasterId;
- public LaunchEffect effect
- {
- get { return biteffect; }
- set
- {
- this.biteffect = value;
- this.HasEffect = (value != null);
- }
- }
- public AttackProp SourceAttack
- {
- get { return sourceAttack; }
- set
- {
- this.sourceAttack = value;
- this.HasSourceAttack = (value != null);
- }
- }
- public UnitHitEvent() { }
- public UnitHitEvent(uint unit_id)
- : base(unit_id)
- {
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutVU32(senderId);
- output.PutVS32(hp);
- output.PutU8(client_state);
- output.PutU8(bitMask);
- if (HasEffect)
- {
- output.PutVU32(biteffect_sn);
- }
- if (HasSourceAttack)
- {
- output.PutVU32(sourceAttack_sn);
- }
- if(isSpecialHit)
- {
- output.PutEnum8(dmgSrc);
- }
-
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.senderId = input.GetVU32();
- this.hp = input.GetVS32();
- this.client_state = input.GetU8();
- this.bitMask = input.GetU8();
- if (HasEffect)
- {
- this.biteffect_sn = input.GetVU32();
- }
- if (HasSourceAttack)
- {
- this.sourceAttack_sn = input.GetVU32();
- }
- if(isSpecialHit)
- {
- this.dmgSrc = input.GetEnum8<DamageSource>();
- }
-
-
- }
- public override void BeforeWrite(TemplateManager templates)
- {
- if (HasEffect)
- {
- this.biteffect_sn = biteffect.SerialNumber;
- }
- if (HasSourceAttack)
- {
- this.sourceAttack_sn = sourceAttack.SerialNumber;
- }
- }
- public override void EndRead(TemplateManager templates)
- {
- if (HasEffect)
- {
- this.biteffect = templates.GetSnData<LaunchEffect>(biteffect_sn);
- }
- if (HasSourceAttack)
- {
- this.sourceAttack = templates.GetSnData<AttackProp>(sourceAttack_sn);
- }
- }
- }
-
-
-
- [MessageType(0x8111)]
- public class UnitDeadEvent : ObjectEvent
- {
- public bool Crushed;
- public uint attacker_id;
- public int RebirthTimeMS;
- public UnitDeadEvent() { }
- public UnitDeadEvent(uint unit_id, uint attacker_id, bool crushed, int rebirthTimeMS)
- : base(unit_id)
- {
- this.Crushed = crushed;
- this.attacker_id = attacker_id;
- this.RebirthTimeMS = rebirthTimeMS;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutBool(Crushed);
- output.PutVU32(attacker_id);
- output.PutVS32(RebirthTimeMS);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.Crushed = input.GetBool();
- this.attacker_id = input.GetVU32();
- this.RebirthTimeMS = input.GetVS32();
- }
- }
-
-
-
- [MessageType(0x8112)]
- public class UnitLaunchBuffEvent : ObjectEvent
- {
- public bool IsEquip
- {
- get { return BitMask.BitGetMask(bitMask, 0); }
- set { BitMask.BitSetMask(ref bitMask, 0, value); }
- }
- public bool IsOverlayLevel
- {
- get { return BitMask.BitGetMask(bitMask, 1); }
- set { BitMask.BitSetMask(ref bitMask, 1, value); }
- }
- public bool IsHasExtData
- {
- get { return BitMask.BitGetMask(bitMask, 2); }
- set { BitMask.BitSetMask(ref bitMask, 2, value); }
- }
- private byte bitMask = 0;
- public int buffTemplateID;
- public int buffTimeMS;
- public byte overlayLevel;
- public uint senderID;
- public int buffExtData;
- public UnitLaunchBuffEvent() { }
- public UnitLaunchBuffEvent(uint unit_id, int buffID, uint senderID, int timeMS, bool equip, byte overlayLevel, int extData)
- : base(unit_id)
- {
- this.buffTemplateID = buffID;
- this.buffTimeMS = timeMS;
- this.senderID = senderID;
- this.IsEquip = equip;
- if (overlayLevel > 0)
- {
- this.IsOverlayLevel = true;
- this.overlayLevel = overlayLevel;
- }
- if(extData > 0)
- {
- this.IsHasExtData = true;
- this.buffExtData = extData;
- }
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutU8(bitMask);
- output.PutS32(buffTemplateID);
- output.PutVU32(senderID);
- if (!IsEquip)
- {
- output.PutVS32(buffTimeMS);
- }
- if (IsOverlayLevel)
- {
- output.PutU8(overlayLevel);
- }
- if (IsHasExtData)
- {
- output.PutVS32(buffExtData);
- }
-
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.bitMask = input.GetU8();
- this.buffTemplateID = input.GetS32();
- this.senderID = input.GetVU32();
- if (!IsEquip)
- {
- this.buffTimeMS = input.GetVS32();
- }
- if (IsOverlayLevel)
- {
- this.overlayLevel = input.GetU8();
- }
- if (IsHasExtData)
- {
- this.buffExtData = input.GetVS32();
- }
- }
- }
-
-
-
- [MessageType(0x8113)]
- public class UnitStopBuffEvent : ObjectEvent
- {
- public int buffTemplateID;
- public uint senderID;
- public UnitStopBuffEvent() { }
- public UnitStopBuffEvent(uint unit_id, int buffID, uint senderID)
- : base(unit_id)
- {
- this.buffTemplateID = buffID;
- this.senderID = senderID;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(buffTemplateID);
- output.PutVU32(senderID);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.buffTemplateID = input.GetS32();
- this.senderID = input.GetVU32();
- }
- }
-
-
-
- [MessageType(0x8114)]
- public class UnitSyncInventoryItemEvent : ObjectEvent, ActorMessage
- {
- public int ItemTemplateID;
- public int Index;
- public int Count;
- public UnitSyncInventoryItemEvent() { }
- public UnitSyncInventoryItemEvent(uint unit_id, int itemID, int index, int count)
- : base(unit_id)
- {
- this.ItemTemplateID = itemID;
- this.Index = index;
- this.Count = count;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(ItemTemplateID);
- output.PutVS32(Index);
- output.PutVS32(Count);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.ItemTemplateID = input.GetS32();
- this.Index = input.GetVS32();
- this.Count = input.GetVS32();
- }
- }
-
-
-
- [MessageType(0x8115)]
- public class UnitUseItemEvent : ObjectEvent, ActorMessage
- {
- public int ItemTemplateID;
- public UnitUseItemEvent() { }
- public UnitUseItemEvent(uint unit_id, int itemID)
- : base(unit_id)
- {
- this.ItemTemplateID = itemID;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(ItemTemplateID);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.ItemTemplateID = input.GetS32();
- }
- }
- [MessageType(0x8116)]
- public class UnitSyncMultiTimeLine : ObjectEvent
- {
- public List<bool> timelines;
- public UnitSyncMultiTimeLine() { }
- public UnitSyncMultiTimeLine(uint unit_id) : base(unit_id) { }
- public bool Update(List<MultiTimeLine> tlines)
- {
- bool ret = false;
- if (timelines == null)
- {
- timelines = new List<bool>(tlines.Count);
- }
- if (timelines.Count != tlines.Count)
- {
- CUtils.SetListSize<bool>(timelines, tlines.Count);
- ret = true;
- }
- for (int i = tlines.Count - 1; i >= 0; --i)
- {
- if (timelines[i] != tlines[i].Enable)
- {
- timelines[i] = tlines[i].Enable;
- ret = true;
- }
- }
- return ret;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutList(timelines, output.PutBool);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.timelines = input.GetList<bool>(input.GetBool);
- }
- }
-
-
-
- [MessageType(0x8117)]
- public class UnitRebirthEvent : ObjectEvent
- {
- public UnitRebirthEvent() { }
- public UnitRebirthEvent(uint unit_id) : base(unit_id) { }
- }
-
-
-
- [MessageType(0x8118)]
- public class UnitContinueKillValue : ObjectEvent
- {
- public short continuekills;
- public UnitContinueKillValue() { }
- public UnitContinueKillValue(uint unit_id, short continuekills)
- : base(unit_id)
- {
- this.continuekills = continuekills;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS16(continuekills);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- continuekills = input.GetS16();
- }
- }
-
-
-
- [MessageType(0x8119)]
- public class UnitDamageEvent : ObjectEvent
- {
- public bool HasDamageTime
- {
- get { return mask.Get(0); }
- private set { mask.Set(0, value); }
- }
- public bool HasFly
- {
- get { return mask.Get(1); }
- private set { mask.Set(1, value); }
- }
- public bool HasZLimit
- {
- get { return mask.Get(2); }
- private set { mask.Set(2, value); }
- }
- public bool HasKnockDown
- {
- get { return mask.Get(3); }
- private set { mask.Set(3, value); }
- }
- public bool HasZGravity
- {
- get { return mask.Get(4); }
- private set { mask.Set(4, value); }
- }
- public bool HasMoveTime
- {
- get { return mask.Get(5); }
- private set { mask.Set(5, value); }
- }
- public AttackProp Source { get; private set; }
-
-
-
- public int TotalTimeMS
- {
- get { return MoveTimeMS + DamageTimeMS; }
- }
-
-
-
- public string DamageActionName
- {
- get { return Source.DamageActionName; }
- }
-
-
-
- public bool HasDamageAction
- {
- get { return !string.IsNullOrEmpty(Source.DamageActionName); }
- }
- private BitSet8 mask = new BitSet8();
- private uint source_sn = 0;
- public int DamageTimeMS = 0;
- public int MoveTimeMS = 0;
- public float ZSpeedSEC = 0;
- public float ZLimit = 0;
- public float ZGravity = 0;
- public UnitDamageEvent() { }
- public UnitDamageEvent(uint unit_id, int damageTimeMS, int moveTimeMS, float zspeed, float zgravity, float zlimit, bool knockDown, AttackProp source)
- : base(unit_id)
- {
- this.Source = source;
- this.DamageTimeMS = damageTimeMS;
- this.MoveTimeMS = moveTimeMS;
- this.ZSpeedSEC = zspeed;
- this.ZLimit = zlimit;
- this.ZGravity = zgravity;
- this.HasDamageTime = (DamageTimeMS != 0);
- this.HasMoveTime = (MoveTimeMS != 0);
- this.HasFly = (zspeed != 0);
- this.HasZGravity = (zgravity != 0);
- this.HasZLimit = (zlimit > 0);
- this.HasKnockDown = knockDown;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutU8(mask.Mask);
- output.PutVU32(source_sn);
- if (HasDamageTime)
- {
- output.PutVS32(DamageTimeMS);
- }
- if (HasMoveTime)
- {
- output.PutVS32(MoveTimeMS);
- }
- if (HasFly)
- {
- output.PutF32(ZSpeedSEC);
- }
- if (HasZLimit)
- {
- output.PutF32(ZLimit);
- }
- if (HasZGravity)
- {
- output.PutF32(ZGravity);
- }
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.mask.Mask = input.GetU8();
- this.source_sn = input.GetVU32();
- if (HasDamageTime)
- {
- this.DamageTimeMS = input.GetVS32();
- }
- if (HasMoveTime)
- {
- this.MoveTimeMS = input.GetVS32();
- }
- if (HasFly)
- {
- this.ZSpeedSEC = input.GetF32();
- }
- if (HasZLimit)
- {
- this.ZLimit = input.GetF32();
- }
- if (HasZGravity)
- {
- this.ZGravity = input.GetF32();
- }
- }
- public override void BeforeWrite(TemplateManager templates)
- {
- if (Source != null)
- {
- this.source_sn = Source.SerialNumber;
- }
- }
- public override void EndRead(TemplateManager templates)
- {
- if (source_sn != 0)
- {
- this.Source = templates.GetSnData<AttackProp>(source_sn);
- }
- }
- }
-
-
-
- [MessageType(0x811A)]
- public class UnitSkillActionChangeEvent : ObjectEvent
- {
- public byte ActionIndex;
- public UnitSkillActionChangeEvent() { }
- public UnitSkillActionChangeEvent(uint unit_id, byte index)
- : base(unit_id)
- {
- this.ActionIndex = index;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutU8(ActionIndex);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.ActionIndex = input.GetU8();
- }
- }
-
-
-
- [MessageType(0x811B)]
- public class UnitStartPickObjectEvent : ObjectEvent
- {
- public int PickTimeMS;
- public uint PickObjectID;
- public string PickStatus;
- public UnitStartPickObjectEvent() { }
- public UnitStartPickObjectEvent(uint unit_id, int pickTimeMS, uint pickObjID, string status)
- : base(unit_id)
- {
- this.PickTimeMS = pickTimeMS;
- this.PickObjectID = pickObjID;
- this.PickStatus = status;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutVS32(PickTimeMS);
- output.PutVU32(PickObjectID);
- output.PutUTF(PickStatus);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.PickTimeMS = input.GetVS32();
- this.PickObjectID = input.GetVU32();
- this.PickStatus = input.GetUTF();
- }
- }
- [MessageType(0x811C)]
- public class UnitStopPickObjectEvent : ObjectEvent
- {
- public string StopReason;
- public UnitStopPickObjectEvent() { }
- public UnitStopPickObjectEvent(uint unit_id, string reason)
- : base(unit_id)
- {
- this.StopReason = reason;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutUTF(StopReason);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.StopReason = input.GetUTF();
- }
- }
-
-
-
- [MessageType(0x811D)]
- public class UnitGotInstanceItemEvent : ObjectEvent, ActorMessage
- {
- public uint ItemObjectID;
- public byte flag;
- public UnitGotInstanceItemEvent() { }
- public UnitGotInstanceItemEvent(uint unit_id, uint pickObjID, byte flag = 0)
- : base(unit_id)
- {
- this.ItemObjectID = pickObjID;
- this.flag = flag;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutU32(ItemObjectID);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.ItemObjectID = input.GetU32();
- }
- }
-
-
-
- [MessageType(0x811E)]
- public class UnitJumpEvent : ObjectEvent
- {
- public float ZSpeed;
- public float ZLimit;
- public float ZGravity;
- public UnitJumpEvent() { }
- public UnitJumpEvent(uint unit_id, float zspeed, float zgravity, float zlimit)
- : base(unit_id)
- {
- this.ZSpeed = zspeed;
- this.ZLimit = zlimit;
- this.ZGravity = zgravity;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutF32(ZSpeed);
- output.PutF32(ZLimit);
- output.PutF32(ZGravity);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.ZSpeed = input.GetF32();
- this.ZLimit = input.GetF32();
- this.ZGravity = input.GetF32();
- }
- }
-
-
-
- [MessageType(0x811F)]
- public class UnitForceSyncPosEvent : ObjectEvent
- {
- public float X;
- public float Y;
- public float Direction;
- public byte UnitMainState;
- public byte UnitSubState;
- public UnitForceSyncPosEvent() { }
- public UnitForceSyncPosEvent(uint unit_id, float x, float y, float d, byte state, byte sub_state)
- : base(unit_id)
- {
- this.X = x;
- this.Y = y;
- this.Direction = d;
- this.UnitMainState = state;
- this.UnitSubState = sub_state;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutF32(this.X);
- output.PutF32(this.Y);
- output.PutF32(this.Direction);
- output.PutU8(this.UnitMainState);
- output.PutU8(this.UnitSubState);
-
-
-
-
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.X = input.GetF32();
- this.Y = input.GetF32();
- this.Direction = input.GetF32();
- this.UnitMainState = input.GetU8();
- this.UnitSubState = input.GetU8();
- }
- }
-
-
-
- [MessageType(0x8120)]
- public class ObjectForceSyncPosEvent : ObjectEvent
- {
- public float X;
- public float Y;
- public float Direction;
- public ObjectForceSyncPosEvent() { }
- public ObjectForceSyncPosEvent(uint unit_id, float x, float y, float d)
- : base(unit_id)
- {
- this.X = x;
- this.Y = y;
- this.Direction = d;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutF32(this.X);
- output.PutF32(this.Y);
- output.PutF32(this.Direction);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.X = input.GetF32();
- this.Y = input.GetF32();
- this.Direction = input.GetF32();
- }
- }
-
-
-
- [MessageType(0x8130)]
- public class SpellLockTargetEvent : ObjectEvent, PositionMessage
- {
- public uint target_obj_id;
- private float x;
- private float y;
- public SpellLockTargetEvent() { }
- public SpellLockTargetEvent(uint spell_id, uint target_obj_id, float x, float y)
- : base(spell_id)
- {
- this.target_obj_id = target_obj_id;
- this.x = x;
- this.y = y;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutVU32(target_obj_id);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.target_obj_id = input.GetVU32();
- }
- public float X { get { return x; } }
- public float Y { get { return y; } }
- }
- #endregion
-
- #region CONTROL_0x8200
-
-
-
- [MessageType(0x8200)]
- public class UnitGuardAction : ObjectAction
- {
- public bool guard = false;
- public string reason = null;
- public bool forceNotify = false;
- public UnitGuardAction() { }
- public UnitGuardAction(uint unit_id, bool guard)
- : base(unit_id)
- {
- this.guard = guard;
- }
- public UnitGuardAction(uint unit_id, bool guard, string reason)
- : base(unit_id)
- {
- this.guard = guard;
- this.reason = reason;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutBool(guard);
- output.PutUTF(reason);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.guard = input.GetBool();
- this.reason = input.GetUTF();
- }
- }
-
-
-
- [MessageType(0x8206)]
- public class UnitAttackToAction : ObjectAction
- {
- public float targetX;
- public float targetY;
- public bool attack;
- public UnitAttackToAction() { }
- public UnitAttackToAction(uint unit_id, float x, float y, bool attack)
- : base(unit_id)
- {
- this.targetX = x;
- this.targetY = y;
- this.attack = attack;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutF32(targetX);
- output.PutF32(targetY);
- output.PutBool(attack);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.targetX = input.GetF32();
- this.targetY = input.GetF32();
- this.attack = input.GetBool();
- }
- }
-
-
-
- [MessageType(0x8201)]
- public class UnitMoveAction : ObjectAction
- {
- public float x;
- public float y;
- public UnitMoveAction() { }
- public UnitMoveAction(uint unit_id, float x, float y)
- : base(unit_id)
- {
- this.x = x;
- this.y = y;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutF32(x);
- output.PutF32(y);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.x = input.GetF32();
- this.y = input.GetF32();
- }
- }
-
-
-
- [MessageType(0x8202)]
- public class UnitFaceToAction : ObjectAction
- {
- public float Direction;
- public UnitFaceToAction() { }
- public UnitFaceToAction(uint unit_id, float d)
- : base(unit_id)
- {
- this.Direction = d;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutF32(Direction);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.Direction = input.GetF32();
- }
- }
-
-
-
- [MessageType(0x8203)]
- public class UnitSlipAction : ObjectAction
- {
- public float x;
- public float y;
- public UnitSlipAction() { }
- public UnitSlipAction(uint unit_id, float x, float y)
- : base(unit_id)
- {
- this.x = x;
- this.y = y;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutF32(x);
- output.PutF32(y);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.x = input.GetF32();
- this.y = input.GetF32();
- }
- }
-
-
-
- [MessageType(0x8204)]
- public class UnitFocuseTargetAction : ObjectAction
- {
- public uint targetUnitID;
- public UnitFocuseTargetAction() { }
- public UnitFocuseTargetAction(uint unit_id, uint target_id)
- : base(unit_id)
- {
- this.targetUnitID = target_id;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutU32(targetUnitID);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.targetUnitID = input.GetU32();
- }
- }
-
-
-
- [MessageType(0x8205)]
- public class UnitLaunchSkillAction : ObjectAction
- {
- private BitSet8 mask = new BitSet8();
- public bool IsAutoFocusNearTarget
- {
- get { return mask.Get(0); }
- set { mask.Set(0, value); }
- }
- private bool IsTargetID
- {
- get { return mask.Get(1); }
- set { mask.Set(1, value); }
- }
- private bool IsTargetPos
- {
- get { return mask.Get(2); }
- set { mask.Set(2, value); }
- }
- public bool SyncDirection
- {
- get { return mask.Get(3); }
- set { mask.Set(3, value); }
- }
- public int SkillID;
- public uint TargetObjID = 0;
- public Vector2 SpellTargetPos = null;
- public float Direction = 0;
- public UnitLaunchSkillAction() { }
- public UnitLaunchSkillAction(uint unit_id, int skill_id, bool autoFocuseTarget = false, uint targetObjID = 0, Vector2 spellTargetPos = null, float direction = 0.0f)
- : base(unit_id)
- {
- this.SkillID = skill_id;
- this.TargetObjID = targetObjID;
- this.SpellTargetPos = spellTargetPos;
- this.IsAutoFocusNearTarget = autoFocuseTarget;
- this.Direction = direction;
- }
- override public void WriteExternal(IOutputStream output)
- {
- this.IsTargetID = (TargetObjID != 0);
- this.IsTargetPos = (SpellTargetPos != null);
- base.WriteExternal(output);
- mask.WriteExternal(output);
- output.PutS32(SkillID);
- if (SyncDirection)
- {
- output.PutF32(Direction);
- }
-
- if (IsTargetID)
- {
- output.PutU32(TargetObjID);
- }
- if (IsTargetPos)
- {
- output.PutF32(SpellTargetPos.X);
- output.PutF32(SpellTargetPos.Y);
- }
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- mask.ReadExternal(input);
- this.SkillID = input.GetS32();
- if (SyncDirection)
- {
- this.Direction = input.GetF32();
- }
- if (IsTargetID)
- {
- this.TargetObjID = input.GetU32();
- }
- if (IsTargetPos)
- {
- this.SpellTargetPos = new Vector2();
- this.SpellTargetPos.SetX(input.GetF32());
- this.SpellTargetPos.SetY(input.GetF32());
- }
- }
- }
-
-
-
- [MessageType(0x8207)]
- public class UnitAxisAction : ObjectAction
- {
- public bool IsZero { get { return dx == 0 && dy == 0; } }
- public float dx;
- public float dy;
- public UnitAxisAction() { }
- public UnitAxisAction(uint unit_id)
- : base(unit_id)
- {
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- float angle = (float)Math.Atan2(dy, dx);
- output.PutS8((sbyte)(Math.Cos(angle) * 100f));
- output.PutS8((sbyte)(Math.Sin(angle) * 100f));
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.dx = input.GetS8() / 100f;
- this.dy = input.GetS8() / 100f;
- }
- public bool AxisEquals(UnitAxisAction obj)
- {
- if (obj == null) return false;
- return (obj.dx == this.dx) && (obj.dy == this.dy);
- }
- }
-
-
-
- [MessageType(0x8208)]
- public class UnitStopMoveAction : ObjectAction
- {
- public UnitStopMoveAction() { }
- public UnitStopMoveAction(uint unit_id)
- : base(unit_id)
- {
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- }
- }
-
-
-
- [MessageType(0x8209)]
- public class UnitUseItemAction : ObjectAction
- {
- public int Index;
- public int Count;
- public UnitUseItemAction() { }
- public UnitUseItemAction(uint unit_id, int index, int count = 1)
- : base(unit_id)
- {
- this.Index = index;
- this.Count = count;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutVS32(this.Index);
- output.PutVS32(this.Count);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.Index = input.GetVS32();
- this.Count = input.GetVS32();
- }
- }
-
-
-
- [MessageType(0x820A)]
- public class UnitPickObjectAction : ObjectAction
- {
- public uint PickableObjectID;
- public UnitPickObjectAction() { }
- public UnitPickObjectAction(uint unit_id, uint item_obj_id)
- : base(unit_id)
- {
- this.PickableObjectID = item_obj_id;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutVU32(this.PickableObjectID);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.PickableObjectID = input.GetVU32();
- }
- }
-
-
-
- [MessageType(0x820B)]
- public class UnitUpdatePosAction : ObjectAction
- {
- public bool isHalf;
- public float x;
- public float y;
- public float d;
- public UnitActionStatus st;
- public UnitUpdatePosAction() { }
- public UnitUpdatePosAction(uint unit_id, bool isHalf, float x, float y, float d, UnitActionStatus s)
- : base(unit_id)
- {
- this.isHalf = isHalf;
- this.x = x;
- this.y = y;
- this.d = d;
- this.st = s;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutBool(isHalf);
- if (isHalf)
- {
- output.PutU16(MoveHelper.ToPos16(x));
- output.PutU16(MoveHelper.ToPos16(y));
- output.PutU8(MoveHelper.ToDirectionD8(d));
- }
- else
- {
- output.PutF32(x);
- output.PutF32(y);
- output.PutF32(d);
- }
- output.PutEnum8(st);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.isHalf = input.GetBool();
- if (isHalf)
- {
- this.x = MoveHelper.ToPosF32(input.GetU16());
- this.y = MoveHelper.ToPosF32(input.GetU16());
- this.d = MoveHelper.ToDirectionF32(input.GetU8());
- }
- else
- {
- this.x = input.GetF32();
- this.y = input.GetF32();
- this.d = input.GetF32();
- }
- this.st = input.GetEnum8<UnitActionStatus>();
-
- }
- public bool DataEquals(UnitUpdatePosAction o)
- {
- if (o == null) return false;
- return o.x == this.x && o.y == this.y && o.d == this.d && o.st == this.st;
- }
- public void Set(UnitUpdatePosAction other)
- {
- this.object_id = other.object_id;
- this.isHalf = other.isHalf;
- this.x = other.x;
- this.y = other.y;
- this.d = other.d;
- this.st = other.st;
- }
- }
- [MessageType(0x820C)]
- public class UnitSetSyncModeAction : ObjectAction
- {
- public SyncMode Mode;
- public UnitSetSyncModeAction() { }
- public UnitSetSyncModeAction(uint unit_id, SyncMode mode)
- : base(unit_id)
- {
- this.Mode = mode;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutEnum8(Mode);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.Mode = input.GetEnum8<SyncMode>();
- }
- }
- [MessageType(0x820D)]
- public class UnitCancelBuffAction : ObjectAction
- {
- public int BuffID;
- public UnitCancelBuffAction() { }
- public UnitCancelBuffAction(uint unit_id, int buffID)
- : base(unit_id)
- {
- this.BuffID = buffID;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(BuffID);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.BuffID = input.GetS32();
- }
- }
-
-
-
- public class UnitStatisticData : IExternalizable
- {
- public uint ObjectID;
-
-
-
- public int DeadCount;
-
-
-
- public int KillUnitCount;
-
-
-
- public int KillPlayerCount;
-
-
-
- public long SelfDamage;
-
-
-
- public long TotalDamage;
-
-
-
- public long PlayerDamage;
-
-
-
- public long TotalHealing;
-
-
-
- public long PlayerHealing;
- public virtual void WriteExternal(IOutputStream output)
- {
- output.PutVU32(ObjectID);
- output.PutVS32(DeadCount);
- output.PutVS32(KillUnitCount);
- output.PutVS32(KillPlayerCount);
- output.PutVS64(SelfDamage);
- output.PutVS64(TotalDamage);
- output.PutVS64(PlayerDamage);
- output.PutVS64(TotalHealing);
- output.PutVS64(PlayerHealing);
- }
- public virtual void ReadExternal(IInputStream input)
- {
- ObjectID = input.GetVU32();
- DeadCount = input.GetVS32();
- KillUnitCount = input.GetVS32();
- KillPlayerCount = input.GetVS32();
- SelfDamage = input.GetVS64();
- TotalDamage = input.GetVS64();
- PlayerDamage = input.GetVS64();
- TotalHealing = input.GetVS64();
- PlayerHealing = input.GetVS64();
- }
- }
- [MessageType(0x8210)]
- public class UnitGetStatisticRequest : ActorRequest
- {
- public uint[] RequestObjectsID;
- public UnitGetStatisticRequest() { }
- public UnitGetStatisticRequest(uint objID, params uint[] objectsID) : base(objID)
- {
- this.RequestObjectsID = objectsID;
- }
- public override void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(MessageID);
- output.PutArray(RequestObjectsID, output.PutU32);
- }
- public override void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.MessageID = input.GetS32();
- this.RequestObjectsID = input.GetArray<uint>(input.GetU32);
- }
- }
- [MessageType(0x8211)]
- public class UnitGetStatisticResponse : ActorResponse
- {
- public HashMap<uint, UnitStatisticData> Statistics = new HashMap<uint, UnitStatisticData>();
- public override void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(MessageID);
- output.PutVS32(Statistics.Count);
- foreach (KeyValuePair<uint, UnitStatisticData> e in Statistics)
- {
- output.PutU32(e.Key);
- output.PutExt(e.Value);
- }
- }
- public override void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.MessageID = input.GetS32();
- int count = input.GetVS32();
- for (int i = 0; i < count; i++)
- {
- var key = input.GetU32();
- var data = input.GetExtAny() as UnitStatisticData;
- Statistics.Put(key, data);
- }
- }
- }
-
-
-
- [MessageType(0x8212)]
- public class UnitSetSubStateAction : ObjectAction
- {
- public byte UnitSubState;
- public UnitSetSubStateAction() { }
- public UnitSetSubStateAction(uint objID, byte state)
- : base(objID)
- {
- this.UnitSubState = state;
- }
- public override void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutU8(UnitSubState);
- }
- public override void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.UnitSubState = input.GetU8();
- }
- }
-
-
-
- [MessageType(0x8213)]
- public class UnitReadAction : ObjectAction
- {
- public UnitReadAction() { }
- public UnitReadAction(uint objID)
- : base(objID)
- {
- }
- public override void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- }
- public override void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- }
- }
- #endregion
-
-
- #region CLIENT_EVENTS_0x8300
- public abstract class ClientEvent : ZoneEvent
- {
- }
-
-
-
- [MessageType(0x8300)]
- public class LookAtEvent : ClientEvent
- {
- public string target;
- public float x;
- public float y;
- public LookAtEvent() { }
- public LookAtEvent(string target, float x, float y)
- {
- this.target = target;
- this.x = x;
- this.y = y;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutUTF(target);
- output.PutF32(x);
- output.PutF32(y);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.target = input.GetUTF();
- this.x = input.GetF32();
- this.y = input.GetF32();
- }
- }
-
-
-
- [MessageType(0x8301)]
- public class ChangeTimeScaleEvent : ClientEvent
- {
-
-
-
- public float TimeScalePct = 100f;
- public ChangeTimeScaleEvent() { }
- public ChangeTimeScaleEvent(float pct)
- {
- this.TimeScalePct = pct;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutF32(TimeScalePct);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.TimeScalePct = input.GetF32();
- }
- }
-
-
-
- [MessageType(0x8302)]
- public class GamePauseEvent : ClientEvent
- {
-
-
-
- public float Seconds = 0f;
- public GamePauseEvent() { }
- public GamePauseEvent(float sec)
- {
- this.Seconds = sec;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutF32(Seconds);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.Seconds = input.GetF32();
- }
- }
-
-
-
- [MessageType(0x8303)]
- public class GameResumeEvent : ClientEvent
- {
- public GameResumeEvent() { }
- public override void WriteExternal(IOutputStream output)
- {
- }
- public override void ReadExternal(IInputStream input)
- {
- }
- }
-
-
-
- [MessageType(0x8304)]
- public class CameraMoveToEvent : ClientEvent
- {
-
-
-
- public float MoveSpeedSec = 1f;
-
-
-
- public int TimeMS = 0;
- public float x;
- public float y;
- public float height;
- public CameraMoveToEvent() { }
- public CameraMoveToEvent(float x, float y, float height, float speed, int timeMS)
- {
- this.x = x;
- this.y = y;
- this.height = height;
- this.MoveSpeedSec = speed;
- this.TimeMS = timeMS;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutF32(x);
- output.PutF32(y);
- output.PutF32(height);
- output.PutF32(MoveSpeedSec);
- output.PutS32(TimeMS);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.x = input.GetF32();
- this.y = input.GetF32();
- this.height = input.GetF32();
- this.MoveSpeedSec = input.GetF32();
- this.TimeMS = input.GetS32();
- }
- }
-
-
-
- [MessageType(0x8305)]
- public class CameraFocusUnitEvent : ClientEvent
- {
- public uint ObjectID;
- public CameraFocusUnitEvent() { }
- public CameraFocusUnitEvent(uint oid)
- {
- this.ObjectID = oid;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutU32(ObjectID);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.ObjectID = input.GetU32();
- }
- }
-
-
-
- [MessageType(0x8306)]
- public class CameraZoomToEvent : ClientEvent
- {
-
-
-
- public float ZoomDistance = 10f;
-
-
-
- public float ZoomSpeedSec = 1f;
- public CameraZoomToEvent() { }
- public CameraZoomToEvent(float distance, float speed)
- {
- this.ZoomDistance = distance;
- this.ZoomSpeedSec = speed;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutF32(ZoomDistance);
- output.PutF32(ZoomSpeedSec);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.ZoomDistance = input.GetF32();
- this.ZoomSpeedSec = input.GetF32();
- }
- }
-
-
-
- [MessageType(0x8307)]
- public class CameraRotateToEvent : ClientEvent
- {
-
-
-
- public float RotateAngle = 10f;
-
-
-
- public float RotateSpeedSec = 1f;
- public CameraRotateToEvent() { }
- public CameraRotateToEvent(float angle, float speed)
- {
- this.RotateAngle = angle;
- this.RotateSpeedSec = speed;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutF32(RotateAngle);
- output.PutF32(RotateSpeedSec);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.RotateAngle = input.GetF32();
- this.RotateSpeedSec = input.GetF32();
- }
- }
-
-
-
- [MessageType(0x8308)]
- public class CameraResetEvent : ClientEvent
- {
- public override void WriteExternal(IOutputStream output)
- {
- }
- public override void ReadExternal(IInputStream input)
- {
- }
- }
-
-
-
- [MessageType(0x8309)]
- public class ClientEventQueue : ClientEvent
- {
- public List<ClientEvent> EventQueue = new List<ClientEvent>();
- override public void WriteExternal(IOutputStream output)
- {
- output.PutU8((byte)EventQueue.Count);
- foreach (ClientEvent e in EventQueue)
- {
- output.PutExt(e);
- }
- }
- override public void ReadExternal(IInputStream input)
- {
- int count = input.GetU8();
- for (int i = 0; i < count; i++)
- {
- EventQueue.Add(input.GetExtAny() as ClientEvent);
- }
- }
- }
-
-
-
- [MessageType(0x830B)]
- public class CameraHoldEvent : ClientEvent
- {
- public float x;
- public float y;
- public int TimeMS;
- public CameraHoldEvent() { }
- public CameraHoldEvent(float x, float y, int timeMS)
- {
- this.x = x;
- this.y = y;
- this.TimeMS = timeMS;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutF32(x);
- output.PutF32(y);
- output.PutS32(TimeMS);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.x = input.GetF32();
- this.y = input.GetF32();
- this.TimeMS = input.GetS32();
- }
- }
-
-
-
- [MessageType(0x830C)]
- public class ClientMsgEvent : ClientEvent
- {
- public string Message;
- public ClientMsgEvent() { }
- public ClientMsgEvent(string msg)
- {
- this.Message = msg;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutUTF(Message);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.Message = input.GetUTF();
- }
- }
- #endregion
-
- #region PLAYER_EVENTS_0x8400
- public abstract class PlayerEvent : ObjectEvent
- {
- public PlayerEvent() { }
- public PlayerEvent(uint objID) : base(objID) { }
- }
- [MessageType(0x8400)]
- public class PlayerCDEvent : PlayerEvent
- {
- private byte mask = 0;
- public bool is_all
- {
- get { return BitMask.BitGetMask(mask, 0); }
- set { BitMask.BitSetMask(ref mask, 0, value); }
- }
- public bool is_decrease_time
- {
- get { return BitMask.BitGetMask(mask, 1); }
- set { BitMask.BitSetMask(ref mask, 1, value); }
- }
- public bool is_decrease_pct
- {
- get { return BitMask.BitGetMask(mask, 2); }
- set { BitMask.BitSetMask(ref mask, 2, value); }
- }
- public bool is_clear
- {
- get { return BitMask.BitGetMask(mask, 3); }
- set { BitMask.BitSetMask(ref mask, 3, value); }
- }
- public int decrease_timeMS;
- public float decrease_pct;
- public int skill_template_id;
- public PlayerCDEvent() { }
- public PlayerCDEvent(uint unit_id) : base(unit_id) { }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutU8(mask);
- if (is_all)
- {
- if (is_decrease_pct)
- output.PutF32(decrease_pct);
- if (is_decrease_time)
- output.PutVS32(decrease_timeMS);
- }
- else
- {
- output.PutS32(skill_template_id);
- if (is_decrease_pct)
- output.PutF32(decrease_pct);
- if (is_decrease_time)
- output.PutVS32(decrease_timeMS);
- }
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.mask = input.GetU8();
- if (is_all)
- {
- if (is_decrease_pct)
- decrease_pct = input.GetF32();
- if (is_decrease_time)
- decrease_timeMS = input.GetVS32();
- }
- else
- {
- skill_template_id = input.GetS32();
- if (is_decrease_pct)
- decrease_pct = input.GetF32();
- if (is_decrease_time)
- decrease_timeMS = input.GetVS32();
- }
- }
- }
- [MessageType(0x8401)]
- public class PlayerSkillChangedEvent : PlayerEvent
- {
- public SkillTemplate baseSkill;
- public List<SkillTemplate> skills = new List<SkillTemplate>();
- public float unitFastCastRate;
- public PlayerSkillChangedEvent() { }
- public PlayerSkillChangedEvent(uint unit_id) : base(unit_id) { }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutF32(this.unitFastCastRate);
- output.PutExt(this.baseSkill);
- output.PutList<SkillTemplate>(this.skills, output.PutExt);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.unitFastCastRate = input.GetF32();
- this.baseSkill = input.GetExt<SkillTemplate>();
- this.skills = input.GetList<SkillTemplate>(input.GetExt<SkillTemplate>);
- }
- }
- [MessageType(0x8402)]
- public class PlayerSyncEnvironmentVarEvent : PlayerEvent
- {
- public string Key;
- public object Value;
- public PlayerSyncEnvironmentVarEvent() { }
- public PlayerSyncEnvironmentVarEvent(uint unit_id, string key, object value)
- : base(unit_id)
- {
- this.Key = key;
- this.Value = value;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutUTF(Key);
- output.PutData(Value);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- DataType dtype;
- this.Key = input.GetUTF();
- this.Value = input.GetData(out dtype);
- }
- }
- [MessageType(0x8403)]
- public class PlayerSkillStopEvent : PlayerEvent
- {
- public int SkillID;
- public PlayerSkillStopEvent() { }
- public PlayerSkillStopEvent(uint unit_id, int skillID)
- : base(unit_id)
- {
- this.SkillID = skillID;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(SkillID);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.SkillID = input.GetS32();
- }
- }
- [MessageType(0x8404)]
- public class PlayerSkillAddedEvent : PlayerEvent
- {
- public SkillTemplate Skill;
- public bool IsDefault;
- public PlayerSkillAddedEvent() { }
- public PlayerSkillAddedEvent(uint unit_id, SkillTemplate sk, bool isDefault)
- : base(unit_id)
- {
- this.Skill = sk;
- this.IsDefault = isDefault;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutExt(this.Skill);
- output.PutBool(this.IsDefault);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.Skill = input.GetExt<SkillTemplate>();
- this.IsDefault = input.GetBool();
- }
- }
- [MessageType(0x8405)]
- public class PlayerSkillRemovedEvent : PlayerEvent
- {
- public int SkillID;
- public PlayerSkillRemovedEvent() { }
- public PlayerSkillRemovedEvent(uint unit_id, int skillID)
- : base(unit_id)
- {
- this.SkillID = skillID;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(this.SkillID);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.SkillID = input.GetS32();
- }
- }
-
-
-
- [MessageType(0x8406)]
- public class PlayerScriptCommandEvent : PlayerEvent
- {
- public string message;
- public PlayerScriptCommandEvent() { }
- public PlayerScriptCommandEvent(uint unit_id, string msg)
- : base(unit_id)
- {
- this.message = msg;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutUTF(message);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.message = input.GetUTF();
- }
- }
-
-
-
- [MessageType(0x8407)]
- public class PlayerSkillActiveChangedEvent : PlayerEvent
- {
- public struct State
- {
- public int SkillTemplateID;
- public SkillActiveState ST;
- public bool IsActive { get { return ST == SkillActiveState.Active; } }
- public bool IsPauseOnDeactive { get { return ST == SkillActiveState.DeactiveAndPause; } }
- }
- public List<State> Skills;
- public PlayerSkillActiveChangedEvent() { this.Skills = new List<State>(); }
- public PlayerSkillActiveChangedEvent(uint unit_id, int skillCount) : base(unit_id)
- {
- this.Skills = new List<State>(skillCount);
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutVS32(Skills.Count);
- for (int i = 0; i < Skills.Count; i++)
- {
- State sat = Skills[i];
- output.PutS32(sat.SkillTemplateID);
- output.PutEnum8(sat.ST);
- }
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- int count = input.GetVS32();
- this.Skills.Capacity = count;
- for (int i = 0; i < count; i++)
- {
- State sat = new State();
- sat.SkillTemplateID = input.GetS32();
- sat.ST = input.GetEnum8<SkillActiveState>();
- this.Skills.Add(sat);
- }
- }
- }
- [MessageType(0x8408)]
- public class PlayerSkillTimeChangedEvent : PlayerEvent
- {
- public int SkillTemplateID;
- public int SkillPassTimeMS;
- public int SkillTotalTimeMS;
- public PlayerSkillTimeChangedEvent() { }
- public PlayerSkillTimeChangedEvent(uint unit_id, int skillID, int passTimeMS, int totalTimeMS)
- : base(unit_id)
- {
- this.SkillTemplateID = skillID;
- this.SkillPassTimeMS = passTimeMS;
- this.SkillTotalTimeMS = totalTimeMS;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(this.SkillTemplateID);
- output.PutVS32(this.SkillPassTimeMS);
- output.PutVS32(this.SkillTotalTimeMS);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.SkillTemplateID = input.GetS32();
- this.SkillPassTimeMS = input.GetVS32();
- this.SkillTotalTimeMS = input.GetVS32();
- }
- }
-
-
-
- [MessageType(0x8409)]
- public class PlayerFocuseTargetEvent : PlayerEvent
- {
- public uint targetUnitID;
- public SkillTemplate.CastTarget expectTarget;
- public PlayerFocuseTargetEvent() { }
- public PlayerFocuseTargetEvent(uint unit_id, uint target_id, SkillTemplate.CastTarget expect)
- : base(unit_id)
- {
- this.targetUnitID = target_id;
- this.expectTarget = expect;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutU32(targetUnitID);
- output.PutEnum8(expectTarget);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.targetUnitID = input.GetU32();
- this.expectTarget = input.GetEnum8<SkillTemplate.CastTarget>();
- }
- }
- #endregion
-
- #region TEXT_0x8500
- public enum ChatMessageType : byte
- {
- SystemToAll,
- SystemToForce,
- SystemToPlayer,
- PlayerToAll,
- PlayerToForce,
- PlayerToPlayer,
- }
- [MessageType(0x8500)]
- public class ChatAction : ObjectAction
- {
- public string Message;
- public ChatMessageType To = ChatMessageType.SystemToAll;
- public string TargetPlayerUUID;
- public override void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutU8((byte)this.To);
- output.PutUTF(this.Message);
- output.PutUTF(this.TargetPlayerUUID);
- }
- public override void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.To = (ChatMessageType)input.GetU8();
- this.Message = input.GetUTF();
- this.TargetPlayerUUID = input.GetUTF();
- }
- }
- [MessageType(0x8501)]
- public class ChatEvent : ZoneEvent
- {
- public ChatMessageType To = ChatMessageType.SystemToAll;
- public int Force;
- public string FromPlayerUUID;
- public string ToPlayerUUID;
- public string Message;
- public uint KeepTimeMS;
- public ChatEvent() { }
- public ChatEvent(ChatMessageType to, uint timeMS = 2000)
- {
- this.To = to;
- KeepTimeMS = timeMS;
- }
- public override void WriteExternal(IOutputStream output)
- {
- output.PutU8((byte)this.To);
- output.PutVS32((int)KeepTimeMS);
- output.PutUTF(this.Message);
- switch (To)
- {
- case ChatMessageType.PlayerToAll:
- output.PutUTF(this.FromPlayerUUID);
- break;
- case ChatMessageType.PlayerToForce:
- output.PutUTF(this.FromPlayerUUID);
- output.PutVS32(this.Force);
- break;
- case ChatMessageType.PlayerToPlayer:
- output.PutUTF(this.FromPlayerUUID);
- output.PutUTF(this.ToPlayerUUID);
- break;
- case ChatMessageType.SystemToAll:
- break;
- case ChatMessageType.SystemToForce:
- output.PutVS32(this.Force);
- break;
- case ChatMessageType.SystemToPlayer:
- output.PutUTF(this.ToPlayerUUID);
- break;
- }
- }
- public override void ReadExternal(IInputStream input)
- {
- this.To = (ChatMessageType)input.GetU8();
- this.KeepTimeMS = (uint)input.GetVS32();
- this.Message = input.GetUTF();
- switch (To)
- {
- case ChatMessageType.PlayerToAll:
- this.FromPlayerUUID = input.GetUTF();
- break;
- case ChatMessageType.PlayerToForce:
- this.FromPlayerUUID = input.GetUTF();
- this.Force = input.GetVS32();
- break;
- case ChatMessageType.PlayerToPlayer:
- this.FromPlayerUUID = input.GetUTF();
- this.ToPlayerUUID = input.GetUTF();
- break;
- case ChatMessageType.SystemToAll:
- break;
- case ChatMessageType.SystemToForce:
- this.Force = input.GetVS32();
- break;
- case ChatMessageType.SystemToPlayer:
- this.ToPlayerUUID = input.GetUTF();
- break;
- }
- }
- }
- [MessageType(0x8502)]
- public class BubbleTalkEvent : ZoneEvent
- {
- public bool PauseBattle;
- public List<TalkInfo> TalkInfos = new List<TalkInfo>();
- public BubbleTalkEvent() { }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutBool(PauseBattle);
- output.PutExtList<TalkInfo>(this.TalkInfos);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.PauseBattle = input.GetBool();
- this.TalkInfos = input.GetExtList<TalkInfo>();
- }
- public class TalkInfo : IExternalizable
- {
- public uint TalkUnit;
- public string TalkContent;
- public string TalkActionType;
- public int TalkDelayTimeMS;
- public int TalkKeepTimeMS;
- public TalkInfo() { }
- public TalkInfo(uint TalkUnit, string TalkContent, string TalkActionType, int TalkDelayTimeMS, int TalkKeepTimeMS)
- {
- this.TalkUnit = TalkUnit;
- this.TalkContent = TalkContent;
- this.TalkActionType = TalkActionType;
- this.TalkDelayTimeMS = TalkDelayTimeMS;
- this.TalkKeepTimeMS = TalkKeepTimeMS;
- }
- public void WriteExternal(IOutputStream output)
- {
- output.PutVU32(TalkUnit);
- output.PutUTF(TalkContent);
- output.PutUTF(TalkActionType);
- output.PutVS32(TalkDelayTimeMS);
- output.PutVS32(TalkKeepTimeMS);
- }
- public void ReadExternal(IInputStream input)
- {
- this.TalkUnit = input.GetVU32();
- this.TalkContent = input.GetUTF();
- this.TalkActionType = input.GetUTF();
- this.TalkDelayTimeMS = input.GetVS32();
- this.TalkKeepTimeMS = input.GetVS32();
- }
- }
- }
- [MessageType(0x8503)]
- public class PlayerSkillUseTimeChangedEvent : PlayerEvent
- {
- public int SkillTemplateID;
- public byte useTimes;
- public byte hasNext;
- public PlayerSkillUseTimeChangedEvent() { }
- public PlayerSkillUseTimeChangedEvent(uint unit_id, int skillID, byte useTimes)
- : base(unit_id)
- {
- this.SkillTemplateID = skillID;
- this.useTimes = useTimes;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(this.SkillTemplateID);
- output.PutU8(this.useTimes);
- output.PutU8(this.hasNext);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.SkillTemplateID = input.GetS32();
- this.useTimes = input.GetU8();
- this.hasNext = input.GetU8();
- }
- }
-
-
-
- [MessageType(0x8504)]
- public class SyncUnitBuffState : ObjectEvent
- {
- public int buffTemplateID;
- public byte overlayLevel;
- public int buffExtData;
- public SyncUnitBuffState() { }
- public SyncUnitBuffState(uint unit_id, int buffID, byte overlayLevel, int extData)
- : base(unit_id)
- {
- this.buffTemplateID = buffID;
- this.overlayLevel = overlayLevel;
- this.buffExtData = extData;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutVS32(buffTemplateID);
- output.PutU8(overlayLevel);
- output.PutVS32(buffExtData);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.buffTemplateID = input.GetVS32();
- this.overlayLevel = input.GetU8();
- this.buffExtData = input.GetVS32();
- }
- }
-
-
-
- [MessageType(0x8505)]
- public class UnitTriggerAblity : ObjectEvent
- {
- public int ablityID;
- public UnitTriggerAblity() { }
- public UnitTriggerAblity(uint unit_id, int id)
- : base(unit_id)
- {
- this.ablityID = id;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutVS32(ablityID);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.ablityID = input.GetVS32();
- }
- }
-
-
-
- [MessageType(0x8506)]
- public class UnitHitBreak : ObjectEvent
- {
- public UnitHitBreak() { }
- public UnitHitBreak(uint unit_id)
- : base(unit_id)
- {
-
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
-
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
-
- }
- }
-
-
-
- [MessageType(0x8507)]
- public class UnitStealthInfo : ObjectEvent
- {
- public byte stealth;
- public short flag;
- public UnitStealthInfo() { }
- public UnitStealthInfo(uint unit_id, byte stealth, short flag)
- : base(unit_id)
- {
- this.stealth = stealth;
- this.flag = flag;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutU8(this.stealth);
- output.PutS16(this.flag);
-
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.stealth = input.GetU8();
- this.flag = input.GetS16();
- }
- }
-
-
-
- [MessageType(0x8508)]
- public class BuffDataNotify : ObjectEvent
- {
- public int buffId;
- public uint senderId;
- public byte overlayLevel;
- public BuffDataNotify() { }
- public BuffDataNotify(uint unit_id, int buffId, uint senderId, int layer)
- : base(unit_id)
- {
- this.buffId = buffId;
- this.senderId = senderId;
- this.overlayLevel = (byte)layer;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(this.buffId);
- output.PutU32(this.senderId);
- output.PutU8(this.overlayLevel);
-
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.buffId = input.GetS32();
- this.senderId = input.GetU32();
- this.overlayLevel = input.GetU8();
- }
- }
- #endregion
-
- #region SYSTEM_0x8600
- [MessageType(0x8600)]
- public class Ping : Action, SystemMessage
- {
- public uint DayOfMS;
- public Ping()
- {
- DayOfMS = (uint)CUtils.CurrentTimeMS;
- }
- public void Begin()
- {
- DayOfMS = (uint)CUtils.CurrentTimeMS;
- }
- public override void WriteExternal(IOutputStream output)
- {
- output.PutU32(DayOfMS);
- }
- public override void ReadExternal(IInputStream input)
- {
- DayOfMS = input.GetU32();
- }
- }
- [MessageType(0x8601)]
- public class Pong : Event, SystemMessage
- {
- public uint ClientTimeDayOfMS;
- public Pong() { }
- public Pong(Ping ping) { this.ClientTimeDayOfMS = ping.DayOfMS; }
- public override void WriteExternal(IOutputStream output)
- {
- output.PutU32(ClientTimeDayOfMS);
- }
- public override void ReadExternal(IInputStream input)
- {
- ClientTimeDayOfMS = input.GetU32();
- }
- }
-
-
-
- [MessageType(0x8602)]
- public class PackEvent : Event, SystemMessage
- {
- protected static readonly Logger log = LoggerFactory.GetDefLogger();
- public int sequenceNo;
- public List<IMessage> events = new List<IMessage>();
- public override string ToString()
- {
- var sb = new StringBuilder("PackEvent: no=").Append(sequenceNo).AppendLine();
- foreach (IMessage e in events)
- {
- sb.AppendLine(e.ToString());
- }
- return sb.ToString();
- }
- public override void WriteExternal(IOutputStream output)
- {
- output.PutVS32(sequenceNo);
- output.PutVS32(events.Count);
- #if JSGProfile
- long startSize = output.GetBuffPos();
- #endif
- foreach (IMessage e in events)
- {
-
-
-
-
- output.PutExt(e);
- #if JSGProfile
- long tempSize = output.GetBuffPos();
- JSGServerProfile.RecordSend(output.GetTypeID(e), tempSize - startSize);
- startSize = tempSize;
- #endif
- }
- }
- public override void ReadExternal(IInputStream input)
- {
- this.sequenceNo = input.GetVS32();
- int count = input.GetVS32();
- events.Clear();
- events.Capacity = count;
- for (int i = 0; i < count; i++)
- {
- try
- {
- IMessage e = (IMessage)input.GetExtAny();
- events.Add(e);
- }
- catch (Exception err)
- {
- log.Error("PackEvent readExt catch:" + err);
- }
- }
- }
- public override void BeforeWrite(TemplateManager templates)
- {
- foreach (IMessage e in events)
- {
- if (e is BattleMessage)
- {
- (e as BattleMessage).BeforeWrite(templates);
- }
- }
- }
- public override void EndRead(TemplateManager templates)
- {
- foreach (IMessage e in events)
- {
- if (e is BattleMessage)
- {
- (e as BattleMessage).EndRead(templates);
- }
- }
- }
- }
-
-
-
- [MessageType(0x8603)]
- public class TestMessageBox : Event, SystemMessage
- {
- public string msg;
- public TestMessageBox() { }
- public TestMessageBox(string msg)
- {
- this.msg = msg;
- }
- public override void WriteExternal(IOutputStream output)
- {
- output.PutUTF(this.msg);
- }
- public override void ReadExternal(IInputStream input)
- {
- this.msg = input.GetUTF();
- }
- }
-
-
-
- [MessageType(0x8604)]
- public class ServerStatusB2C : Event, SystemMessage
- {
- public int PID;
- public long PrivateMemorySize64;
- public int ActiveGameObjectCount;
- public int ActiveInstanceZoneCount;
- public int AllocGameObjectCount;
- public int AllocInstanceZoneCount;
- public ServerStatusB2C() { }
- public void Update(System.Diagnostics.Process p)
- {
- this.PID = p.Id;
- this.PrivateMemorySize64 = p.PrivateMemorySize64;
- this.ActiveGameObjectCount = InstanceZoneObject.ActiveObjectCount;
- this.ActiveInstanceZoneCount = InstanceZone.ActiveZoneCount;
- this.AllocGameObjectCount = InstanceZoneObject.AllocObjectCount;
- this.AllocInstanceZoneCount = InstanceZone.AllocZoneCount;
- }
- public override void WriteExternal(IOutputStream output)
- {
- output.PutVS32(this.PID);
- output.PutVS64(this.PrivateMemorySize64);
- output.PutVS32(this.ActiveGameObjectCount);
- output.PutVS32(this.ActiveInstanceZoneCount);
- output.PutVS32(this.AllocGameObjectCount);
- output.PutVS32(this.AllocInstanceZoneCount);
- }
- public override void ReadExternal(IInputStream input)
- {
- this.PID = input.GetVS32();
- this.PrivateMemorySize64 = input.GetVS64();
- this.ActiveGameObjectCount = input.GetVS32();
- this.ActiveInstanceZoneCount = input.GetVS32();
- this.AllocGameObjectCount = input.GetVS32();
- this.AllocInstanceZoneCount = input.GetVS32();
- }
- }
-
-
-
- [MessageType(0x8605)]
- public class ServerExceptionB2C : Event, SystemMessage
- {
- public string Message;
- public string StackTrace;
- public ServerExceptionB2C() { }
- public ServerExceptionB2C(string message, string stackTrace)
- {
- this.Message = message;
- this.StackTrace = stackTrace;
- }
- public override void WriteExternal(IOutputStream output)
- {
- output.PutUTF(this.Message);
- output.PutUTF(this.StackTrace);
- }
- public override void ReadExternal(IInputStream input)
- {
- this.Message = input.GetUTF();
- this.StackTrace = input.GetUTF();
- }
- }
- [MessageType(0x8606)]
- public class UnitFollowAction : ObjectAction
- {
- public bool follow = false;
- public string reason = null;
- public UnitFollowAction() { }
- public UnitFollowAction(uint unit_id, bool guard)
- : base(unit_id)
- {
- this.follow = guard;
- }
- public UnitFollowAction(uint unit_id, bool guard, string reason)
- : base(unit_id)
- {
- this.follow = guard;
- this.reason = reason;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutBool(follow);
- output.PutUTF(reason);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.follow = input.GetBool();
- this.reason = input.GetUTF();
- }
- }
- #endregion
-
-
-
-
- [MessageType(0x8700)]
- public class SkillMove : ObjectAction
- {
- public int SkillID;
- public Vector2 SkillPos;
- public SkillMove() { }
- public SkillMove(uint unit_id, int skill_id, Vector2 vec):base(unit_id)
- {
- this.SkillID = skill_id;
- this.SkillPos = vec;
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(SkillID);
- output.PutF32(SkillPos.X);
- output.PutF32(SkillPos.Y);
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- this.SkillID = input.GetS32();
- this.SkillPos = new Vector2();
- this.SkillPos.SetX(input.GetF32());
- this.SkillPos.SetY(input.GetF32());
- }
- }
-
-
-
- [MessageType(0x8701)]
- public class PlayDestoryEffect : ZoneEvent
- {
- public string EffectName;
- public float X;
- public float Y;
- public float Z;
-
- public float Direction;
- public PlayDestoryEffect() { }
- public PlayDestoryEffect(string effectName, float x, float y, float z, float direction)
- {
- EffectName = effectName;
- X = x;
- Y = y;
- Z = z;
- Direction = direction;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutUTF(EffectName);
- output.PutF32(X);
- output.PutF32(Y);
- output.PutF32(Z);
- output.PutF32(Direction);
- }
- override public void ReadExternal(IInputStream input)
- {
- this.EffectName = input.GetUTF();
- this.X = input.GetF32();
- this.Y = input.GetF32();
- this.Z = input.GetF32();
- this.Direction = input.GetF32();
- }
- }
-
-
-
-
- [MessageType(0x8702)]
- public class PlayPetTeleportAction : ObjectAction
- {
- public PlayPetTeleportAction() { }
- override public void WriteExternal(IOutputStream output)
- {
- }
- override public void ReadExternal(IInputStream input)
- {
- }
- }
-
-
-
-
- [MessageType(0x8703)]
- public class RefreshTalnetInfo: PlayerSingleMsg
- {
-
-
-
- public short value;
- public byte lv;
- public int lvUpdateTime;
- public RefreshTalnetInfo() { }
- public RefreshTalnetInfo(short value, byte lv = 0, int updateTime = 0)
- {
- this.value = value;
- this.lv = lv;
- this.lvUpdateTime = updateTime;
- }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutS16(this.value);
- output.PutU8(this.lv);
- if(this.lv > 0)
- {
- output.PutS32(this.lvUpdateTime);
- }
- }
- override public void ReadExternal(IInputStream input)
- {
- this.value = input.GetS16();
- this.lv = input.GetU8();
- if(this.lv > 0)
- {
- this.lvUpdateTime = input.GetS32();
- }
-
- }
- }
-
-
-
- [MessageType(0x8704)]
- public class RefreshCardInfo : PlayerSingleMsg
- {
- public byte[] cardData = new byte[(int)CardType.Max];
- public RefreshCardInfo()
- {
- for(int i = 0; i < (int)CardType.Max; i++)
- {
- cardData[i] = (byte)CardType.Max;
- }
- }
- override public void WriteExternal(IOutputStream output)
- {
- for(int i = 0; i < (int)CardType.Max; i++)
- {
- output.PutU8(cardData[i]);
- }
-
- }
- override public void ReadExternal(IInputStream input)
- {
-
- for (int i = 0; i < (int)CardType.Max; i++)
- {
- cardData[i] = input.GetU8();
- }
-
- }
- }
-
-
-
- [MessageType(0x8705)]
- public class PlayerLaunchCardSkill : PlayerSingleMsg
- {
- public int cardSkill;
- public CardType type;
- public byte layer;
- public byte[] cardData = new byte[(int)CardType.Max];
- public PlayerLaunchCardSkill() { }
- override public void WriteExternal(IOutputStream output)
- {
- output.PutS32(this.cardSkill);
- output.PutEnum8(type);
- output.PutU8(this.layer);
- for (int i = 0; i < (int)CardType.Max; i++)
- {
- output.PutU8(cardData[i]);
- }
-
- }
- override public void ReadExternal(IInputStream input)
- {
-
- this.cardSkill = input.GetS32();
- this.type = input.GetEnum8<CardType>();
- this.layer = input.GetU8();
- for (int i = 0; i < (int)CardType.Max; i++)
- {
- cardData[i] = input.GetU8();
- }
-
- }
- }
-
-
-
- [MessageType(0x8706)]
- public class RefreshBossCardInfo : ObjectEvent
- {
- public byte[] cardData = new byte[(int)CardType.Max];
- public RefreshBossCardInfo()
- {
- this.init();
- }
- public RefreshBossCardInfo(uint objId) : base(objId)
- {
- this.init();
- }
- private void init()
- {
- for (int i = 0; i < (int)CardType.Max; i++)
- {
- cardData[i] = (byte)CardType.Max;
- }
- }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- for (int i = 0; i < (int)CardType.Max; i++)
- {
- output.PutU8(cardData[i]);
- }
-
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- for (int i = 0; i < (int)CardType.Max; i++)
- {
- cardData[i] = input.GetU8();
- }
-
-
- }
- }
-
-
-
- [MessageType(0x8707)]
- public class BossTriggerCardSkill : ObjectEvent
- {
- public int cardSkill;
- public CardType type;
- public byte layer;
- public byte[] cardData = new byte[(int)CardType.Max];
- public BossTriggerCardSkill() { }
- public BossTriggerCardSkill(uint objId) : base(objId){ }
- override public void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutS32(this.cardSkill);
- output.PutEnum8(type);
- output.PutU8(this.layer);
- for (int i = 0; i < (int)CardType.Max; i++)
- {
- output.PutU8(cardData[i]);
- }
-
- }
- override public void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
-
- this.cardSkill = input.GetS32();
- this.type = input.GetEnum8<CardType>();
- this.layer = input.GetU8();
- for (int i = 0; i < (int)CardType.Max; i++)
- {
- cardData[i] = input.GetU8();
- }
-
- }
- }
-
-
-
- [MessageType(0x8708)]
- public class PlayerPKModeChangeEventB2C : ObjectEvent
- {
- public PKMode CurMode = PKMode.Peace;
- public PlayerPKModeChangeEventB2C() { }
- public PlayerPKModeChangeEventB2C(uint objId, PKMode mode) : base(objId)
- {
- this.CurMode = mode;
- }
- public override void WriteExternal(IOutputStream output)
- {
- base.WriteExternal(output);
- output.PutEnum8(CurMode);
- }
- public override void ReadExternal(IInputStream input)
- {
- base.ReadExternal(input);
- CurMode = input.GetEnum8<PKMode>();
- }
- }
- }
|