-
Notifications
You must be signed in to change notification settings - Fork 36
/
saacproto_cli.c
2166 lines (1992 loc) · 100 KB
/
saacproto_cli.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "version.h"
#define _SAACPROTOCLI_C_
#include "version.h"
#include "saacproto_cli.h"
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "common.h"
#include "net.h"
#ifdef _SEND_EFFECT // WON ADD AC送下雪、下雨等特效
#include "chatmagic.h"
#endif
#define IS_2BYTEWORD( _a_ ) ( (char)(0x80) <= (_a_) && (_a_) <= (char)(0xFF) )
/*
90 : <LI> <a name="ACServerLoginC"><font color=red>clienttoserver ACServerLogin(string servername,string serverpas);<br></font></a>
91 : 必□丞扔□田□互失市它件玄扔□田□卞夫弘奶件允月午五卞银丹[
92 : 涛粮毛舰匀凶丐午}仇及夫弘奶件毛仄卅中午允屯化及扔□申旦毛仄卅中[
93 : <br><br>
94 : <dl>
95 : <dt>string servername
96 : <dd>扔□田□ [acserv.cf卞涩烂今木化中月[
97 : <dt>string serverpas
98 : <dd>扔□田□由旦伐□玉[acserv.cf卞涩烂今木化中月[
99 : </dl>
100 :
*/
#ifdef _ALLDOMAN // (不可开) Syu ADD 排行榜NPC
void saacproto_UpdataStele_send( int fd , char *cdkey , char *name , char *title , int level , int trns , int time , int floor) {
saacproto_CreateHeader( saacproto.work , "UpdataStele" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( cdkey ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( name ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( title ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( level ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( trns ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( time ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( floor ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
#endif
void saacproto_ACServerLogin_send( int fd,char* servername,char* serverpas )
{
saacproto_CreateHeader( saacproto.work , "ACServerLogin" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( servername ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( serverpas ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
/*
114 : <LI><a name="ACServerLogoutC"><font color=red>clienttoserver ACServerLogout(void);<br></font></a>
115 : 扔□田□互失市它件玄扔□田□井日夫弘失它玄允月午五卞银丹[
116 : 涛粮反扔□田卞方匀化 澎卞濠日木月[仄凶互匀化仇木卞覆允月失市它件玄扔□田
117 : 及忒蚕反戊生弁扑亦件毛濠月仪匹丐月[
118 : <br>
119 : <br>
120 : <br>
121 :
122 :
*/
void saacproto_ACServerLogout_send( int fd )
{
saacproto_CreateHeader( saacproto.work , "ACServerLogout" );
saacproto_strcatsafe( saacproto.work , "" ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
#ifdef _PKSEVER_VER
void saacproto_ACCharList_send( int fd,char* id,char* pas,int mesgid, int star)
#else
void saacproto_ACCharList_send( int fd,char* id,char* pas,int mesgid )
#endif
{
saacproto_CreateHeader( saacproto.work , "ACCharList" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( pas ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( mesgid ) ,saacproto.workbufsize );
#ifdef _PKSEVER_VER
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( star ) ,saacproto.workbufsize );
#endif
saacproto_Send( fd , saacproto.work );
}
void saacproto_ACCharLoad_send( int fd,char* id,char* pas,char* charname,int lock,char* opt,int mesgid )
{
saacproto_CreateHeader( saacproto.work , "ACCharLoad" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( pas ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( lock ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( opt ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( mesgid ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
#ifdef _NEWSAVE
void saacproto_ACCharSave_send( int fd,char* id,char* charname,char* opt,char* charinfo,int unlock,int mesgid,int saveindex )
#else
void saacproto_ACCharSave_send( int fd,char* id,char* charname,char* opt,char* charinfo,int unlock,int mesgid )
#endif
{
saacproto_CreateHeader( saacproto.work , "ACCharSave" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( opt ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charinfo ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( unlock ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( mesgid ) ,saacproto.workbufsize );
#ifdef _NEWSAVE
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( saveindex ) ,saacproto.workbufsize );
#endif
saacproto_Send( fd , saacproto.work );
}
#ifdef _PAUCTION_MAN
void saacproto_ACItemAuction_send( int fd, char *ITEMNAME, char *data, int itemID, int ret, int flg)
{
print("ACItemAuction( %d, %s, %s, %d, %d)\n", fd, ITEMNAME, data, itemID, flg);
saacproto_CreateHeader( saacproto.work , "AUCTIONADDITEM" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( ITEMNAME ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( data ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( itemID ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( ret ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( flg ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
#endif
void saacproto_ACCharDelete_send( int fd,char* id,char* passwd,char* charname,char* option,int mesgid )
{
saacproto_CreateHeader( saacproto.work , "ACCharDelete" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( passwd ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( option ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( mesgid ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_ACLock_send( int fd,char* id,int lock,int mesgid )
{
saacproto_CreateHeader( saacproto.work , "ACLock" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( lock ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( mesgid ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_ACUCheck_send( int fd,char* mem_id,int status )
{
saacproto_CreateHeader( saacproto.work , "ACUCheck" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( mem_id ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( status ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_DBUpdateEntryString_send( int fd,char* table,char* key,char* value,int msgid,int msgid2 )
{
saacproto_CreateHeader( saacproto.work , "DBUpdateEntryString" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( key ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( value ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_DBDeleteEntryString_send( int fd,char* table,char* key,int msgid,int msgid2 )
{
saacproto_CreateHeader( saacproto.work , "DBDeleteEntryString" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( key ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_DBGetEntryString_send( int fd,char* table,char* key,int msgid,int msgid2 )
{
saacproto_CreateHeader( saacproto.work , "DBGetEntryString" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( key ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_DBUpdateEntryInt_send( int fd,char* table,char* key,int value,char* info,int msgid,int msgid2 )
{
saacproto_CreateHeader( saacproto.work , "DBUpdateEntryInt" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( key ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( value ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( info ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_DBGetEntryRank_send( int fd,char* table,char* key,int msgid,int msgid2 )
{
saacproto_CreateHeader( saacproto.work , "DBGetEntryRank" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( key ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_DBDeleteEntryInt_send( int fd,char* table,char* key,int msgid,int msgid2 )
{
saacproto_CreateHeader( saacproto.work , "DBDeleteEntryInt" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( key ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_DBGetEntryInt_send( int fd,char* table,char* key,int msgid,int msgid2 )
{
saacproto_CreateHeader( saacproto.work , "DBGetEntryInt" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( key ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_DBGetEntryByRank_send( int fd,char* table,int rank_start,int rank_end,int msgid,int msgid2 )
{
saacproto_CreateHeader( saacproto.work , "DBGetEntryByRank" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( rank_start ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( rank_end ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_DBGetEntryByCount_send( int fd,char* table,int count_start,int num,int msgid,int msgid2 )
{
saacproto_CreateHeader( saacproto.work , "DBGetEntryByCount" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( count_start ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( num ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
/*
608 : <LI><a name="Broadcast"><font color=red>clienttoserver Broadcast( string id, string charname, string message , int flag );</font></a><BR>
609 : 必□丞扔□田□卞覆仄化仇及戊穴件玉毛霜耨允月午}
610 : 允屯化及必□丞扔□田□卞凶中仄化 元丢永本□斥互霜耨今木月[
611 : id , charname 反方仁勾井歹木月及匹}蜊 及娄醒毛手勾方丹卞仄凶[
612 : 中切中切 侬 由□旦及伙□民件毛踏井卅仁化手中中方丹卞[
613 : <dl>
614 : <dt>string id
615 : <dd>user ID
616 : <dt>string charname
617 : <dd>平乓仿 (巨旦弗□皿卅仄)
618 : <dt>string message
619 : <dd> 霜今木月丢永本□斥[必□丞扔□田□互驯五卞银丹[
620 : </dl>
*/
void saacproto_Broadcast_send( int fd,char* id,char* charname,char* message,int flag )
{
saacproto_CreateHeader( saacproto.work , "Broadcast" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( message ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( flag ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
/*
634 : <LI><a name="Message"><font color=red>clienttoserver Message( string id_from, string charname_from, string id_to, string charname_to, string message , int option );</font></a><BR>
635 : 奶件旦正件玄丢永本□斥毛霜耨允月
636 : <dl>
637 : <dt>string id_from
638 : <dd>from ID
639 : <dt>string charname_from
640 : <dd>from Character name
641 : <dt>string id_to
642 : <dd>to ID
643 : <dt>string charname_to
644 : <dd>to character name
645 : <dt>string message
646 : <dd>丢永本□斥
647 : <dt>int option
648 : <dd>左皿扑亦件[民乓永玄及缙午井中欠中欠 木木月[漆 及傀舰迕
649 : 仇木毛升丹银丹井反必□丞扔□田□及 澎匹}失市它件玄扔□田□反
650 : 域濠仇及 卞正永民仄卅中
651 : </dL>
*/
void saacproto_Message_send( int fd,char* id_from,char* charname_from,char* id_to,char* charname_to,char* message,int option )
{
saacproto_CreateHeader( saacproto.work , "Message" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id_from ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname_from ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id_to ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname_to ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( message ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( option ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_MessageAck_send( int fd,char* id,char* charname,char* result,int mesgid )
{
saacproto_CreateHeader( saacproto.work , "MessageAck" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( result ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( mesgid ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
void saacproto_MessageFlush_send( int fd,char* id,char* charname )
{
saacproto_CreateHeader( saacproto.work , "MessageFlush" );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id ) ,saacproto.workbufsize );
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname ) ,saacproto.workbufsize );
saacproto_Send( fd , saacproto.work );
}
/************************************************************
* CoolFish: Family 2001/5/18
***********************************************************/
#ifdef _PERSONAL_FAME
void saacproto_ACAddFM_send(int fd, char *fmname, char *fmleadername,
char *fmleaderid, int fmleaderlv, char *petname, char *petattr,
char *fmrule, int fmsprite, int fmleadergrano, int fame, int charfdid)
#else
void saacproto_ACAddFM_send(int fd, char *fmname, char *fmleadername,
char *fmleaderid, int fmleaderlv, char *petname, char *petattr,
char *fmrule, int fmsprite, int fmleadergrano, int charfdid)
#endif
{
saacproto_CreateHeader(saacproto.work, "ACAddFM");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmleadername), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmleaderid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmleaderlv), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(petname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(petattr), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmrule), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmsprite), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmleadergrano), saacproto.workbufsize);
// #ifdef _PERSONAL_FAME
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fame), saacproto.workbufsize);
// #endif
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
#ifdef _PERSONAL_FAME // Arminius: 家族个人声望
void saacproto_ACJoinFM_send(int fd, char *fmname, int fmindex, char *charname,
char *charid, int charlv, int index, int fame, int charfdid)
#else
void saacproto_ACJoinFM_send(int fd, char *fmname, int fmindex, char *charname,
char *charid, int charlv, int index, int charfdid)
#endif
{
saacproto_CreateHeader(saacproto.work, "ACJoinFM");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charlv), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
// #ifdef _PERSONAL_FAME // Arminius: 家族个人声望
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fame), saacproto.workbufsize);
// #endif
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACLeaveFM_send(int fd, char *fmname, int fmindex, char *charname,
char *charid, int index, int charfdid)
{
saacproto_CreateHeader(saacproto.work, "ACLeaveFM");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACDelFM_send(int fd, char *fmname, int fmindex, int index,
char *charname, char *charid, int charfdid)
{
saacproto_CreateHeader(saacproto.work, "ACDelFM");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACShowFMList_send(int fd)
{
saacproto_CreateHeader(saacproto.work, "ACShowFMList");
saacproto_Send(fd, saacproto.work);
}
#ifdef _DEATH_FAMILY_GM_COMMAND // WON ADD 家族战GM指令
void saacproto_ACShowMemberList_2_send( int fd, int charaindex, int fm1, int fm2, int time, int id )
{
saacproto_CreateHeader(saacproto.work, "ACShowMemberList2");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charaindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fm1), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fm2), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(time), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(id), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
#endif
void saacproto_ACShowMemberList_send(int fd, int index)
{
saacproto_CreateHeader(saacproto.work, "ACShowMemberList");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string("MemberList"), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACFMDetail_send(int fd, char *fmname, int fmindex, int index, int charfdid)
{
saacproto_CreateHeader(saacproto.work, "ACFMDetail");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
#ifdef _FMVER21
void saacproto_ACMemberJoinFM_send(int fd, char *fmname, int fmindex,
char *charname, int charindex, int index, int result, int meindex,
int charfdid)
#else
void saacproto_ACMemberJoinFM_send(int fd, char *fmname, int fmindex,
char *charname, int charindex, int index, int result, int charfdid)
#endif
{
saacproto_CreateHeader(saacproto.work, "ACMemberJoinFM");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(result), saacproto.workbufsize);
#ifdef _FMVER21
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(meindex), saacproto.workbufsize);
#endif
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
#ifdef _FMVER21
void saacproto_ACMemberLeaveFM_send(int fd, char *fmname, int fmindex,
char *charname, int charindex, int index, int meindex, int charfdid)
#else
void saacproto_ACMemberLeaveFM_send(int fd, char *fmname, int fmindex,
char *charname, int charindex, int index, int charfdid)
#endif
{
saacproto_CreateHeader(saacproto.work, "ACMemberLeaveFM");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
#ifdef _FMVER21
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(meindex), saacproto.workbufsize);
#endif
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
#ifdef _FM_MODIFY
void saacproto_ACFMCharLogin_send(int fd, char *fmname, int fmindex, char *charname,
char *charid, int charlv, int eventflag, int charfdid,int gsnum)
#else
#ifdef _FMVER21
void saacproto_ACFMCharLogin_send(int fd, char *fmname, int fmindex, char *charname,
char *charid, int charlv, int eventflag, int charfdid)
#else
void saacproto_ACFMCharLogin_send(int fd, char *fmname, int fmindex, char *charname,
char *charid, int charlv, int charfdid)
#endif
#endif
{
saacproto_CreateHeader(saacproto.work, "ACFMCharLogin");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charlv), saacproto.workbufsize);
#ifdef _FMVER21
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(eventflag), saacproto.workbufsize);
#endif
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
#ifdef _FM_MODIFY
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(gsnum), saacproto.workbufsize);
#endif
saacproto_Send(fd, saacproto.work);
}
#ifdef _DEATH_FAMILY_LOGIN_CHECK // WON ADD 家族战登入检查
void saacproto_new_ACFM_Login_send( int acfd, int charaindex, char *char_id, char *char_name )
{
saacproto_CreateHeader(saacproto.work, "ACFMCharLogin2");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(char_id), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(char_name), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charaindex), saacproto.workbufsize);
saacproto_Send( acfd, saacproto.work );
}
#endif
#ifdef _DEATH_FAMILY_GM_COMMAND // WON ADD 家族战GM指令
void saacproto_ReloadFamily_send( int acfd, int charaindex )
{
saacproto_CreateHeader(saacproto.work, "ACRELOADFM");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charaindex), saacproto.workbufsize);
saacproto_Send( acfd, saacproto.work );
}
#endif
void saacproto_ACFMCharLogout_send(int fd, char *fmname, int fmindex, char *charname,
char *charid, int charlv, int index, int charfdid)
{
saacproto_CreateHeader(saacproto.work, "ACFMCharLogout");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charlv), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACFMReadMemo_send(int fd, int index)
{
saacproto_CreateHeader(saacproto.work, "ACFMReadMemo");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string("ReadMemo"), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACFMWriteMemo_send(int fd, char *fmname, int fmindex,
char *data, int index)
{
saacproto_CreateHeader(saacproto.work, "ACFMWriteMemo");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(data), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACFMPointList_send(int fd)
{
saacproto_CreateHeader(saacproto.work, "ACFMPointList");
saacproto_Send(fd, saacproto.work);
}
#ifdef _CK_ONLINE_PLAYER_COUNT // WON ADD 计算线上人数
void saacproto_GS_PLAYER_COUNT_SEND(int acfd, int num)
{
saacproto_CreateHeader(saacproto.work, "ACGSPCOUNT");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(num), saacproto.workbufsize);
saacproto_Send(acfd, saacproto.work);
}
#endif
void saacproto_ACSetFMPoint_send(int fd, char *fmname, int fmindex, int index,
int fmpointindex, int fl, int x, int y, int charfdid)
{
saacproto_CreateHeader(saacproto.work, "ACSetFMPoint");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmpointindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fl), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(x), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(y), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACFixFMPoint_send(int fd, char *winfmname, int winfmindex,
int winindex, char *losefmname, int losefmindex, int loseindex,
int village)
{
saacproto_CreateHeader(saacproto.work, "ACFixFMPoint");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(winfmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(winfmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(winindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(losefmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(losefmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(loseindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(village), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACFMAnnounce_send(int fd, char *fmname, int fmindex, int index,
char *data, int color)
{
saacproto_CreateHeader(saacproto.work, "ACFMAnnounce");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(data), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(color), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACShowTopFMList_send(int fd, int kindflag)
{
saacproto_CreateHeader(saacproto.work, "ACShowTopFMList");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string("ShowTopFMList"), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(kindflag), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACFixFMData_send(int fd, char *fmname, int fmindex, int index,
int kindflag, char *data1, char *data2, int charindex, int charfdid)
{
saacproto_CreateHeader(saacproto.work, "ACFixFMData");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(kindflag), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(data1), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(data2), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
#ifdef _FAMILYBANKSTONELOG
void saacproto_ACgetFMBankgold_send(int fd, char *fmname, int fmindex, int index,
int charindex, int charfdid)
{
saacproto_CreateHeader(saacproto.work, "ACgetFMBankgold");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
#endif
#ifdef _DEATH_FAMILY_STRUCT // WON ADD 家族战存放胜负资料
void saacproto_Init_FM_PK_STRUC_send( int fd )
{
saacproto_CreateHeader(saacproto.work, "FMINITPKSTRUCT");
saacproto_Send(fd, saacproto.work);
}
void saacproto_FM_PK_STRUCT_send( int fd, char *msg )
{
saacproto_CreateHeader(saacproto.work, "FMPKSTRUCT");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(msg), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
#endif
void saacproto_ACFixFMPK_send(int fd, char *winfmname, int winfmindex,
int winindex, char *losefmname, int losefmindex, int loseindex)
{
saacproto_CreateHeader(saacproto.work, "ACFixFMPK");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(winfmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(winfmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(winindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(losefmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(losefmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(loseindex), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACGMFixFMData_send(int fd, int index, char *charid, char *cmd,
char *data, int charfdid)
{
saacproto_CreateHeader(saacproto.work, "ACGMFixFMData");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string("ACGMFixFMData"), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(charid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(cmd), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(data), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACGetFMData_send(int fd, char *fmname, int fmindex, int index,
int kindflag, int charfdid)
{
saacproto_CreateHeader(saacproto.work, "ACGetFMData");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(fmname), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(index), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(kindflag), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(charfdid), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
// Arminius 7.26 manor pk acknowledge
void saacproto_ACManorPKAck_send(int fd, char *data)
{
saacproto_CreateHeader(saacproto.work, "ACManorPKAck");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(data), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACreLoadFmData_send( int fd, int type, int data)
{
saacproto_CreateHeader( saacproto.work, "ACreLoadFmData");
saacproto_strcatsafe( saacproto.work, saacproto_mkstr_int( type), saacproto.workbufsize);
saacproto_strcatsafe( saacproto.work, saacproto_mkstr_int( data), saacproto.workbufsize);
saacproto_Send( fd, saacproto.work);
}
#ifdef _ACFMPK_LIST
void saacproto_ACLoadFmPk_send(int fd, int fmpks_pos)
{
saacproto_CreateHeader(saacproto.work, "ACLoadFmPk");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmpks_pos), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
void saacproto_ACSendFmPk_send(int fd, int toindex, int PkFlg, int fmpks_pos, char *msg)
{
saacproto_CreateHeader(saacproto.work, "ACSendFmPk");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(fmpks_pos), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int( toindex), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int( PkFlg), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(msg), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
#endif
#ifdef _RECAL_ASK_PLAYER // WON 要求人物资料
void saacproto_Recal_Player_send(int acfd, char *uid, int userfdid, int GmCliId, char *id, int char_num, int date, int backup_flag)
{
saacproto_CreateHeader(saacproto.work, "ACSendRecalPlayer");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(uid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(userfdid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(GmCliId), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(id), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(char_num), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(date), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(backup_flag), saacproto.workbufsize);
saacproto_Send(acfd, saacproto.work);
}
void saacproto_Recal_Backup_send(int acfd, char *uid, int userfdid, int GmCliId, char *id, int char_num, int date, char *char_data, int backup_flag)
{
saacproto_CreateHeader(saacproto.work, "ACSendRecalBackup");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(uid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(userfdid), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(GmCliId), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(id), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(char_num), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(date), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(char_data), saacproto.workbufsize);
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_int(backup_flag), saacproto.workbufsize);
saacproto_Send(acfd, saacproto.work);
}
#endif // end RECAL_ASK_PLAYER
void saacproto_ACAuctionSold_send(int fd, char *data)
{
saacproto_CreateHeader(saacproto.work, "ACAuctionSold");
saacproto_strcatsafe(saacproto.work, saacproto_mkstr_string(data), saacproto.workbufsize);
saacproto_Send(fd, saacproto.work);
}
int saacproto_ClientDispatchMessage(int fd ,char*line)
{
int msgid;
char funcname[1024];
saacproto_strcpysafe( saacproto.work , line, saacproto.workbufsize );
saacproto_splitString( saacproto.work);
saacproto_GetMessageInfo( &msgid , funcname , sizeof(funcname),saacproto.token_list);
#ifdef _ANDYLOG_TEST
print( "funcname:%s , line len:%d\n", funcname, strlen( line));
#endif
if( strcmp( funcname , "ACGmsvDownRequest" ) == 0 ){
int min;
min = saacproto_demkstr_int( saacproto.token_list[2] );
saacproto_ACGmsvDownRequest_recv( fd,min);
return 0;
}
if( strcmp( funcname , "ACServerLogin" ) == 0 ){
char* result;
char* data;
result = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
saacproto_ACServerLogin_recv( fd,result,data);
return 0;
}
if( strcmp( funcname , "ACCharList" ) == 0 ){
char* result;
char* output;
int id;
result = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
output = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
id = saacproto_demkstr_int( saacproto.token_list[4] );
saacproto_ACCharList_recv( fd,result,output,id);
return 0;
}
if( strcmp( funcname , "ACCharLoad" ) == 0 ){
char* result=NULL;
char* data=NULL;
int id;
#ifdef _NEWSAVE
int saveindex;
#endif
result = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
id = saacproto_demkstr_int( saacproto.token_list[4] );
if( data == NULL ) return 0;
if( result == NULL ) return 0;
#ifdef _NEWSAVE
saveindex = saacproto_demkstr_int( saacproto.token_list[5] );
saacproto_ACCharLoad_recv( fd,result,data,id,saveindex);
#else
saacproto_ACCharLoad_recv( fd,result,data,id, -1);
#endif
return 0;
}
if( strcmp( funcname , "ACCharSave" ) == 0 ){
char* result;
char* data;
int id;
result = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
id = saacproto_demkstr_int( saacproto.token_list[4] );
saacproto_ACCharSave_recv( fd,result,data,id);
return 0;
}
#ifdef _DEATH_CONTEND
if( strcmp( funcname , "PKLISTGETDATA" ) == 0 ){
char* result;
char* data;
int ti;
ti = saacproto_demkstr_int( saacproto.token_list[2] );
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
result = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] ));
saacproto_LoadPkTeamListData_recv( fd, result, data, ti);
return 0;
}
if( strcmp( funcname , "PKLISTCHARTS" ) == 0 ){
char* data;
int type, flg;
data = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
type = saacproto_demkstr_int( saacproto.token_list[3] );
flg = saacproto_demkstr_int( saacproto.token_list[4] );
saacproto_PKLISTCHARTS_recv( fd, data, type, flg);
return 0;
}
#endif
#ifdef _PAUCTION_MAN
if( strcmp( funcname , "AUCTIONADDITEM" ) == 0 ){
int itemID;
char *name;
char *data;
int flg, ret;
name = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
itemID = saacproto_demkstr_int( saacproto.token_list[4] );
ret = saacproto_demkstr_int( saacproto.token_list[5] );
flg = saacproto_demkstr_int( saacproto.token_list[6] );
saacproto_ACItemAuction_recv( fd, name, data, itemID, ret, flg);
return 0;
}
#endif
if( strcmp( funcname , "ACCharDelete" ) == 0 ){
char* result;
char* data;
int id;
result = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
id = saacproto_demkstr_int( saacproto.token_list[4] );
saacproto_ACCharDelete_recv( fd,result,data,id);
return 0;
}
if( strcmp( funcname , "ACLock" ) == 0 ){
char* result;
char* data;
int id;
result = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
id = saacproto_demkstr_int( saacproto.token_list[4] );
saacproto_ACLock_recv( fd,result,data,id);
return 0;
}
#ifdef _WAEI_KICK
if( strcmp( funcname , "ACKick" ) == 0 ){
int act;
char* data;
int id;
act = saacproto_demkstr_int( saacproto.token_list[2] );
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
id = saacproto_demkstr_int( saacproto.token_list[4] );
saacproto_ACKick_recv( fd, act, data, id);
return 0;
}
#endif
#ifdef _NEW_PLAYERGOLD
if( strcmp( funcname , "LoadNEWPlayer" ) == 0 ){
char* data;
int charaindex;
charaindex = saacproto_demkstr_int( saacproto.token_list[2] );
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
saacproto_LoadNEWPlayer_recv( fd, charaindex, data);
return 0;
}
#endif
#ifdef _CHAR_POOLITEM
if( strcmp( funcname , "ACSavePoolItem" ) == 0 ){
char* result;
char* data;
int id;
result = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
id = saacproto_demkstr_int( saacproto.token_list[4] );
saacproto_ACCharSavePoolItem_recv( fd, result, data, id);
return 0;
}
if( strcmp( funcname , "ACGetPoolItem" ) == 0 ){
char* result;
char* data;
int id, npcid;
result = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
id = saacproto_demkstr_int( saacproto.token_list[4] );
npcid = saacproto_demkstr_int( saacproto.token_list[5] );
saacproto_ACCharGetPoolItem_recv( fd, result, data, id, npcid);
return 0;
}
#endif
#ifdef _CHAR_POOLPET
if( strcmp( funcname , "ACSavePoolPet" ) == 0 ){
char* result;
char* data;
int id;
result = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
id = saacproto_demkstr_int( saacproto.token_list[4] );
saacproto_ACCharSavePoolPet_recv( fd, result, data, id);
return 0;
}
if( strcmp( funcname , "ACGetPoolPet" ) == 0 ){
char* result;
char* data;
int id, npcid;
result = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] ));
data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] ));
id = saacproto_demkstr_int( saacproto.token_list[4] );
npcid = saacproto_demkstr_int( saacproto.token_list[5] );
saacproto_ACCharGetPoolPet_recv( fd, result, data, id, npcid);
return 0;
}