-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
runtime.go
1792 lines (1625 loc) · 115 KB
/
runtime.go
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
// Copyright 2018 The Nakama Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package server
import (
"context"
"database/sql"
"github.com/heroiclabs/nakama/runtime"
"os"
"path/filepath"
"strings"
"github.com/gofrs/uuid"
"github.com/golang/protobuf/jsonpb"
"github.com/heroiclabs/nakama/api"
"github.com/heroiclabs/nakama/rtapi"
"github.com/heroiclabs/nakama/social"
"github.com/pkg/errors"
"go.uber.org/zap"
"google.golang.org/grpc/codes"
)
var (
ErrRuntimeRPCNotFound = errors.New("RPC function not found")
)
const API_PREFIX = "/nakama.api.Nakama/"
const RTAPI_PREFIX = "*rtapi.Envelope_"
type (
RuntimeRpcFunction func(ctx context.Context, queryParams map[string][]string, userID, username string, expiry int64, sessionID, clientIP, clientPort, payload string) (string, error, codes.Code)
RuntimeBeforeRtFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, sessionID, clientIP, clientPort string, envelope *rtapi.Envelope) (*rtapi.Envelope, error)
RuntimeAfterRtFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, sessionID, clientIP, clientPort string, envelope *rtapi.Envelope) error
RuntimeBeforeGetAccountFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string) (error, codes.Code)
RuntimeAfterGetAccountFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Account) error
RuntimeBeforeUpdateAccountFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.UpdateAccountRequest) (*api.UpdateAccountRequest, error, codes.Code)
RuntimeAfterUpdateAccountFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.UpdateAccountRequest) error
RuntimeBeforeAuthenticateCustomFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AuthenticateCustomRequest) (*api.AuthenticateCustomRequest, error, codes.Code)
RuntimeAfterAuthenticateCustomFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Session, in *api.AuthenticateCustomRequest) error
RuntimeBeforeAuthenticateDeviceFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AuthenticateDeviceRequest) (*api.AuthenticateDeviceRequest, error, codes.Code)
RuntimeAfterAuthenticateDeviceFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Session, in *api.AuthenticateDeviceRequest) error
RuntimeBeforeAuthenticateEmailFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AuthenticateEmailRequest) (*api.AuthenticateEmailRequest, error, codes.Code)
RuntimeAfterAuthenticateEmailFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Session, in *api.AuthenticateEmailRequest) error
RuntimeBeforeAuthenticateFacebookFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AuthenticateFacebookRequest) (*api.AuthenticateFacebookRequest, error, codes.Code)
RuntimeAfterAuthenticateFacebookFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Session, in *api.AuthenticateFacebookRequest) error
RuntimeBeforeAuthenticateGameCenterFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AuthenticateGameCenterRequest) (*api.AuthenticateGameCenterRequest, error, codes.Code)
RuntimeAfterAuthenticateGameCenterFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Session, in *api.AuthenticateGameCenterRequest) error
RuntimeBeforeAuthenticateGoogleFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AuthenticateGoogleRequest) (*api.AuthenticateGoogleRequest, error, codes.Code)
RuntimeAfterAuthenticateGoogleFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Session, in *api.AuthenticateGoogleRequest) error
RuntimeBeforeAuthenticateSteamFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AuthenticateSteamRequest) (*api.AuthenticateSteamRequest, error, codes.Code)
RuntimeAfterAuthenticateSteamFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Session, in *api.AuthenticateSteamRequest) error
RuntimeBeforeListChannelMessagesFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListChannelMessagesRequest) (*api.ListChannelMessagesRequest, error, codes.Code)
RuntimeAfterListChannelMessagesFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.ChannelMessageList, in *api.ListChannelMessagesRequest) error
RuntimeBeforeListFriendsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string) (error, codes.Code)
RuntimeAfterListFriendsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Friends) error
RuntimeBeforeAddFriendsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AddFriendsRequest) (*api.AddFriendsRequest, error, codes.Code)
RuntimeAfterAddFriendsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AddFriendsRequest) error
RuntimeBeforeDeleteFriendsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.DeleteFriendsRequest) (*api.DeleteFriendsRequest, error, codes.Code)
RuntimeAfterDeleteFriendsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.DeleteFriendsRequest) error
RuntimeBeforeBlockFriendsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.BlockFriendsRequest) (*api.BlockFriendsRequest, error, codes.Code)
RuntimeAfterBlockFriendsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.BlockFriendsRequest) error
RuntimeBeforeImportFacebookFriendsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ImportFacebookFriendsRequest) (*api.ImportFacebookFriendsRequest, error, codes.Code)
RuntimeAfterImportFacebookFriendsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ImportFacebookFriendsRequest) error
RuntimeBeforeCreateGroupFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.CreateGroupRequest) (*api.CreateGroupRequest, error, codes.Code)
RuntimeAfterCreateGroupFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Group, in *api.CreateGroupRequest) error
RuntimeBeforeUpdateGroupFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.UpdateGroupRequest) (*api.UpdateGroupRequest, error, codes.Code)
RuntimeAfterUpdateGroupFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.UpdateGroupRequest) error
RuntimeBeforeDeleteGroupFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.DeleteGroupRequest) (*api.DeleteGroupRequest, error, codes.Code)
RuntimeAfterDeleteGroupFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.DeleteGroupRequest) error
RuntimeBeforeJoinGroupFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.JoinGroupRequest) (*api.JoinGroupRequest, error, codes.Code)
RuntimeAfterJoinGroupFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.JoinGroupRequest) error
RuntimeBeforeLeaveGroupFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.LeaveGroupRequest) (*api.LeaveGroupRequest, error, codes.Code)
RuntimeAfterLeaveGroupFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.LeaveGroupRequest) error
RuntimeBeforeAddGroupUsersFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AddGroupUsersRequest) (*api.AddGroupUsersRequest, error, codes.Code)
RuntimeAfterAddGroupUsersFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AddGroupUsersRequest) error
RuntimeBeforeKickGroupUsersFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.KickGroupUsersRequest) (*api.KickGroupUsersRequest, error, codes.Code)
RuntimeAfterKickGroupUsersFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.KickGroupUsersRequest) error
RuntimeBeforePromoteGroupUsersFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.PromoteGroupUsersRequest) (*api.PromoteGroupUsersRequest, error, codes.Code)
RuntimeAfterPromoteGroupUsersFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.PromoteGroupUsersRequest) error
RuntimeBeforeListGroupUsersFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListGroupUsersRequest) (*api.ListGroupUsersRequest, error, codes.Code)
RuntimeAfterListGroupUsersFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.GroupUserList, in *api.ListGroupUsersRequest) error
RuntimeBeforeListUserGroupsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListUserGroupsRequest) (*api.ListUserGroupsRequest, error, codes.Code)
RuntimeAfterListUserGroupsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.UserGroupList, in *api.ListUserGroupsRequest) error
RuntimeBeforeListGroupsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListGroupsRequest) (*api.ListGroupsRequest, error, codes.Code)
RuntimeAfterListGroupsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.GroupList, in *api.ListGroupsRequest) error
RuntimeBeforeDeleteLeaderboardRecordFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.DeleteLeaderboardRecordRequest) (*api.DeleteLeaderboardRecordRequest, error, codes.Code)
RuntimeAfterDeleteLeaderboardRecordFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.DeleteLeaderboardRecordRequest) error
RuntimeBeforeListLeaderboardRecordsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListLeaderboardRecordsRequest) (*api.ListLeaderboardRecordsRequest, error, codes.Code)
RuntimeAfterListLeaderboardRecordsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.LeaderboardRecordList, in *api.ListLeaderboardRecordsRequest) error
RuntimeBeforeWriteLeaderboardRecordFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.WriteLeaderboardRecordRequest) (*api.WriteLeaderboardRecordRequest, error, codes.Code)
RuntimeAfterWriteLeaderboardRecordFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.LeaderboardRecord, in *api.WriteLeaderboardRecordRequest) error
RuntimeBeforeListLeaderboardRecordsAroundOwnerFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListLeaderboardRecordsAroundOwnerRequest) (*api.ListLeaderboardRecordsAroundOwnerRequest, error, codes.Code)
RuntimeAfterListLeaderboardRecordsAroundOwnerFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.LeaderboardRecordList, in *api.ListLeaderboardRecordsAroundOwnerRequest) error
RuntimeBeforeLinkCustomFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountCustom) (*api.AccountCustom, error, codes.Code)
RuntimeAfterLinkCustomFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountCustom) error
RuntimeBeforeLinkDeviceFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountDevice) (*api.AccountDevice, error, codes.Code)
RuntimeAfterLinkDeviceFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountDevice) error
RuntimeBeforeLinkEmailFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountEmail) (*api.AccountEmail, error, codes.Code)
RuntimeAfterLinkEmailFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountEmail) error
RuntimeBeforeLinkFacebookFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.LinkFacebookRequest) (*api.LinkFacebookRequest, error, codes.Code)
RuntimeAfterLinkFacebookFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.LinkFacebookRequest) error
RuntimeBeforeLinkGameCenterFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountGameCenter) (*api.AccountGameCenter, error, codes.Code)
RuntimeAfterLinkGameCenterFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountGameCenter) error
RuntimeBeforeLinkGoogleFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountGoogle) (*api.AccountGoogle, error, codes.Code)
RuntimeAfterLinkGoogleFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountGoogle) error
RuntimeBeforeLinkSteamFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountSteam) (*api.AccountSteam, error, codes.Code)
RuntimeAfterLinkSteamFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountSteam) error
RuntimeBeforeListMatchesFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListMatchesRequest) (*api.ListMatchesRequest, error, codes.Code)
RuntimeAfterListMatchesFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.MatchList, in *api.ListMatchesRequest) error
RuntimeBeforeListNotificationsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListNotificationsRequest) (*api.ListNotificationsRequest, error, codes.Code)
RuntimeAfterListNotificationsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.NotificationList, in *api.ListNotificationsRequest) error
RuntimeBeforeDeleteNotificationFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.DeleteNotificationsRequest) (*api.DeleteNotificationsRequest, error, codes.Code)
RuntimeAfterDeleteNotificationFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.DeleteNotificationsRequest) error
RuntimeBeforeListStorageObjectsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListStorageObjectsRequest) (*api.ListStorageObjectsRequest, error, codes.Code)
RuntimeAfterListStorageObjectsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.StorageObjectList, in *api.ListStorageObjectsRequest) error
RuntimeBeforeReadStorageObjectsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ReadStorageObjectsRequest) (*api.ReadStorageObjectsRequest, error, codes.Code)
RuntimeAfterReadStorageObjectsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.StorageObjects, in *api.ReadStorageObjectsRequest) error
RuntimeBeforeWriteStorageObjectsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.WriteStorageObjectsRequest) (*api.WriteStorageObjectsRequest, error, codes.Code)
RuntimeAfterWriteStorageObjectsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.StorageObjectAcks, in *api.WriteStorageObjectsRequest) error
RuntimeBeforeDeleteStorageObjectsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.DeleteStorageObjectsRequest) (*api.DeleteStorageObjectsRequest, error, codes.Code)
RuntimeAfterDeleteStorageObjectsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.DeleteStorageObjectsRequest) error
RuntimeBeforeJoinTournamentFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.JoinTournamentRequest) (*api.JoinTournamentRequest, error, codes.Code)
RuntimeAfterJoinTournamentFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.JoinTournamentRequest) error
RuntimeBeforeListTournamentRecordsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListTournamentRecordsRequest) (*api.ListTournamentRecordsRequest, error, codes.Code)
RuntimeAfterListTournamentRecordsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.TournamentRecordList, in *api.ListTournamentRecordsRequest) error
RuntimeBeforeListTournamentsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListTournamentsRequest) (*api.ListTournamentsRequest, error, codes.Code)
RuntimeAfterListTournamentsFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.TournamentList, in *api.ListTournamentsRequest) error
RuntimeBeforeWriteTournamentRecordFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.WriteTournamentRecordRequest) (*api.WriteTournamentRecordRequest, error, codes.Code)
RuntimeAfterWriteTournamentRecordFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.LeaderboardRecord, in *api.WriteTournamentRecordRequest) error
RuntimeBeforeListTournamentRecordsAroundOwnerFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.ListTournamentRecordsAroundOwnerRequest) (*api.ListTournamentRecordsAroundOwnerRequest, error, codes.Code)
RuntimeAfterListTournamentRecordsAroundOwnerFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.TournamentRecordList, in *api.ListTournamentRecordsAroundOwnerRequest) error
RuntimeBeforeUnlinkCustomFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountCustom) (*api.AccountCustom, error, codes.Code)
RuntimeAfterUnlinkCustomFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountCustom) error
RuntimeBeforeUnlinkDeviceFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountDevice) (*api.AccountDevice, error, codes.Code)
RuntimeAfterUnlinkDeviceFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountDevice) error
RuntimeBeforeUnlinkEmailFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountEmail) (*api.AccountEmail, error, codes.Code)
RuntimeAfterUnlinkEmailFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountEmail) error
RuntimeBeforeUnlinkFacebookFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountFacebook) (*api.AccountFacebook, error, codes.Code)
RuntimeAfterUnlinkFacebookFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountFacebook) error
RuntimeBeforeUnlinkGameCenterFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountGameCenter) (*api.AccountGameCenter, error, codes.Code)
RuntimeAfterUnlinkGameCenterFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountGameCenter) error
RuntimeBeforeUnlinkGoogleFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountGoogle) (*api.AccountGoogle, error, codes.Code)
RuntimeAfterUnlinkGoogleFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountGoogle) error
RuntimeBeforeUnlinkSteamFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountSteam) (*api.AccountSteam, error, codes.Code)
RuntimeAfterUnlinkSteamFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.AccountSteam) error
RuntimeBeforeGetUsersFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, in *api.GetUsersRequest) (*api.GetUsersRequest, error, codes.Code)
RuntimeAfterGetUsersFunction func(ctx context.Context, logger *zap.Logger, userID, username string, expiry int64, clientIP, clientPort string, out *api.Users, in *api.GetUsersRequest) error
RuntimeMatchmakerMatchedFunction func(entries []*MatchmakerEntry) (string, bool, error)
RuntimeMatchCreateFunction func(ctx context.Context, logger *zap.Logger, id uuid.UUID, node string, name string, labelUpdateFn RuntimeMatchLabelUpdateFunction) (RuntimeMatchCore, error)
RuntimeMatchLabelUpdateFunction func(string) error
RuntimeTournamentEndFunction func(tournament *api.Tournament, end, reset int64) error
RuntimeTournamentResetFunction func(tournament *api.Tournament, end, reset int64) error
RuntimeLeaderboardResetFunction func(leaderboard runtime.Leaderboard, reset int64) error
)
type RuntimeExecutionMode int
const (
RuntimeExecutionModeRunOnce RuntimeExecutionMode = iota
RuntimeExecutionModeRPC
RuntimeExecutionModeBefore
RuntimeExecutionModeAfter
RuntimeExecutionModeMatch
RuntimeExecutionModeMatchmaker
RuntimeExecutionModeMatchCreate
RuntimeExecutionModeTournamentEnd
RuntimeExecutionModeTournamentReset
RuntimeExecutionModeLeaderboardReset
)
func (e RuntimeExecutionMode) String() string {
switch e {
case RuntimeExecutionModeRunOnce:
return "run_once"
case RuntimeExecutionModeRPC:
return "rpc"
case RuntimeExecutionModeBefore:
return "before"
case RuntimeExecutionModeAfter:
return "after"
case RuntimeExecutionModeMatch:
return "match"
case RuntimeExecutionModeMatchmaker:
return "matchmaker"
case RuntimeExecutionModeMatchCreate:
return "match_create"
case RuntimeExecutionModeTournamentEnd:
return "tournament_end"
case RuntimeExecutionModeTournamentReset:
return "tournament_reset"
case RuntimeExecutionModeLeaderboardReset:
return "leaderboard_reset"
}
return ""
}
type RuntimeMatchCore interface {
MatchInit(params map[string]interface{}) (interface{}, int, string, error)
MatchJoinAttempt(tick int64, state interface{}, userID, sessionID uuid.UUID, username, node string, metadata map[string]string) (interface{}, bool, string, error)
MatchJoin(tick int64, state interface{}, joins []*MatchPresence) (interface{}, error)
MatchLeave(tick int64, state interface{}, leaves []*MatchPresence) (interface{}, error)
MatchLoop(tick int64, state interface{}, inputCh chan *MatchDataMessage) (interface{}, error)
MatchTerminate(tick int64, state interface{}, graceSeconds int) (interface{}, error)
Cancel()
}
type RuntimeBeforeReqFunctions struct {
beforeGetAccountFunction RuntimeBeforeGetAccountFunction
beforeUpdateAccountFunction RuntimeBeforeUpdateAccountFunction
beforeAuthenticateCustomFunction RuntimeBeforeAuthenticateCustomFunction
beforeAuthenticateDeviceFunction RuntimeBeforeAuthenticateDeviceFunction
beforeAuthenticateEmailFunction RuntimeBeforeAuthenticateEmailFunction
beforeAuthenticateFacebookFunction RuntimeBeforeAuthenticateFacebookFunction
beforeAuthenticateGameCenterFunction RuntimeBeforeAuthenticateGameCenterFunction
beforeAuthenticateGoogleFunction RuntimeBeforeAuthenticateGoogleFunction
beforeAuthenticateSteamFunction RuntimeBeforeAuthenticateSteamFunction
beforeListChannelMessagesFunction RuntimeBeforeListChannelMessagesFunction
beforeListFriendsFunction RuntimeBeforeListFriendsFunction
beforeAddFriendsFunction RuntimeBeforeAddFriendsFunction
beforeDeleteFriendsFunction RuntimeBeforeDeleteFriendsFunction
beforeBlockFriendsFunction RuntimeBeforeBlockFriendsFunction
beforeImportFacebookFriendsFunction RuntimeBeforeImportFacebookFriendsFunction
beforeCreateGroupFunction RuntimeBeforeCreateGroupFunction
beforeUpdateGroupFunction RuntimeBeforeUpdateGroupFunction
beforeDeleteGroupFunction RuntimeBeforeDeleteGroupFunction
beforeJoinGroupFunction RuntimeBeforeJoinGroupFunction
beforeLeaveGroupFunction RuntimeBeforeLeaveGroupFunction
beforeAddGroupUsersFunction RuntimeBeforeAddGroupUsersFunction
beforeKickGroupUsersFunction RuntimeBeforeKickGroupUsersFunction
beforePromoteGroupUsersFunction RuntimeBeforePromoteGroupUsersFunction
beforeListGroupUsersFunction RuntimeBeforeListGroupUsersFunction
beforeListUserGroupsFunction RuntimeBeforeListUserGroupsFunction
beforeListGroupsFunction RuntimeBeforeListGroupsFunction
beforeDeleteLeaderboardRecordFunction RuntimeBeforeDeleteLeaderboardRecordFunction
beforeListLeaderboardRecordsFunction RuntimeBeforeListLeaderboardRecordsFunction
beforeWriteLeaderboardRecordFunction RuntimeBeforeWriteLeaderboardRecordFunction
beforeListLeaderboardRecordsAroundOwnerFunction RuntimeBeforeListLeaderboardRecordsAroundOwnerFunction
beforeLinkCustomFunction RuntimeBeforeLinkCustomFunction
beforeLinkDeviceFunction RuntimeBeforeLinkDeviceFunction
beforeLinkEmailFunction RuntimeBeforeLinkEmailFunction
beforeLinkFacebookFunction RuntimeBeforeLinkFacebookFunction
beforeLinkGameCenterFunction RuntimeBeforeLinkGameCenterFunction
beforeLinkGoogleFunction RuntimeBeforeLinkGoogleFunction
beforeLinkSteamFunction RuntimeBeforeLinkSteamFunction
beforeListMatchesFunction RuntimeBeforeListMatchesFunction
beforeListNotificationsFunction RuntimeBeforeListNotificationsFunction
beforeDeleteNotificationFunction RuntimeBeforeDeleteNotificationFunction
beforeListStorageObjectsFunction RuntimeBeforeListStorageObjectsFunction
beforeReadStorageObjectsFunction RuntimeBeforeReadStorageObjectsFunction
beforeWriteStorageObjectsFunction RuntimeBeforeWriteStorageObjectsFunction
beforeDeleteStorageObjectsFunction RuntimeBeforeDeleteStorageObjectsFunction
beforeJoinTournamentFunction RuntimeBeforeJoinTournamentFunction
beforeListTournamentRecordsFunction RuntimeBeforeListTournamentRecordsFunction
beforeListTournamentsFunction RuntimeBeforeListTournamentsFunction
beforeWriteTournamentRecordFunction RuntimeBeforeWriteTournamentRecordFunction
beforeListTournamentRecordsAroundOwnerFunction RuntimeBeforeListTournamentRecordsAroundOwnerFunction
beforeUnlinkCustomFunction RuntimeBeforeUnlinkCustomFunction
beforeUnlinkDeviceFunction RuntimeBeforeUnlinkDeviceFunction
beforeUnlinkEmailFunction RuntimeBeforeUnlinkEmailFunction
beforeUnlinkFacebookFunction RuntimeBeforeUnlinkFacebookFunction
beforeUnlinkGameCenterFunction RuntimeBeforeUnlinkGameCenterFunction
beforeUnlinkGoogleFunction RuntimeBeforeUnlinkGoogleFunction
beforeUnlinkSteamFunction RuntimeBeforeUnlinkSteamFunction
beforeGetUsersFunction RuntimeBeforeGetUsersFunction
}
type RuntimeAfterReqFunctions struct {
afterGetAccountFunction RuntimeAfterGetAccountFunction
afterUpdateAccountFunction RuntimeAfterUpdateAccountFunction
afterAuthenticateCustomFunction RuntimeAfterAuthenticateCustomFunction
afterAuthenticateDeviceFunction RuntimeAfterAuthenticateDeviceFunction
afterAuthenticateEmailFunction RuntimeAfterAuthenticateEmailFunction
afterAuthenticateFacebookFunction RuntimeAfterAuthenticateFacebookFunction
afterAuthenticateGameCenterFunction RuntimeAfterAuthenticateGameCenterFunction
afterAuthenticateGoogleFunction RuntimeAfterAuthenticateGoogleFunction
afterAuthenticateSteamFunction RuntimeAfterAuthenticateSteamFunction
afterListChannelMessagesFunction RuntimeAfterListChannelMessagesFunction
afterListFriendsFunction RuntimeAfterListFriendsFunction
afterAddFriendsFunction RuntimeAfterAddFriendsFunction
afterDeleteFriendsFunction RuntimeAfterDeleteFriendsFunction
afterBlockFriendsFunction RuntimeAfterBlockFriendsFunction
afterImportFacebookFriendsFunction RuntimeAfterImportFacebookFriendsFunction
afterCreateGroupFunction RuntimeAfterCreateGroupFunction
afterUpdateGroupFunction RuntimeAfterUpdateGroupFunction
afterDeleteGroupFunction RuntimeAfterDeleteGroupFunction
afterJoinGroupFunction RuntimeAfterJoinGroupFunction
afterLeaveGroupFunction RuntimeAfterLeaveGroupFunction
afterAddGroupUsersFunction RuntimeAfterAddGroupUsersFunction
afterKickGroupUsersFunction RuntimeAfterKickGroupUsersFunction
afterPromoteGroupUsersFunction RuntimeAfterPromoteGroupUsersFunction
afterListGroupUsersFunction RuntimeAfterListGroupUsersFunction
afterListUserGroupsFunction RuntimeAfterListUserGroupsFunction
afterListGroupsFunction RuntimeAfterListGroupsFunction
afterDeleteLeaderboardRecordFunction RuntimeAfterDeleteLeaderboardRecordFunction
afterListLeaderboardRecordsFunction RuntimeAfterListLeaderboardRecordsFunction
afterWriteLeaderboardRecordFunction RuntimeAfterWriteLeaderboardRecordFunction
afterListLeaderboardRecordsAroundOwnerFunction RuntimeAfterListLeaderboardRecordsAroundOwnerFunction
afterLinkCustomFunction RuntimeAfterLinkCustomFunction
afterLinkDeviceFunction RuntimeAfterLinkDeviceFunction
afterLinkEmailFunction RuntimeAfterLinkEmailFunction
afterLinkFacebookFunction RuntimeAfterLinkFacebookFunction
afterLinkGameCenterFunction RuntimeAfterLinkGameCenterFunction
afterLinkGoogleFunction RuntimeAfterLinkGoogleFunction
afterLinkSteamFunction RuntimeAfterLinkSteamFunction
afterListMatchesFunction RuntimeAfterListMatchesFunction
afterListNotificationsFunction RuntimeAfterListNotificationsFunction
afterDeleteNotificationFunction RuntimeAfterDeleteNotificationFunction
afterListStorageObjectsFunction RuntimeAfterListStorageObjectsFunction
afterReadStorageObjectsFunction RuntimeAfterReadStorageObjectsFunction
afterWriteStorageObjectsFunction RuntimeAfterWriteStorageObjectsFunction
afterDeleteStorageObjectsFunction RuntimeAfterDeleteStorageObjectsFunction
afterJoinTournamentFunction RuntimeAfterJoinTournamentFunction
afterListTournamentRecordsFunction RuntimeAfterListTournamentRecordsFunction
afterListTournamentsFunction RuntimeAfterListTournamentsFunction
afterWriteTournamentRecordFunction RuntimeAfterWriteTournamentRecordFunction
afterListTournamentRecordsAroundOwnerFunction RuntimeAfterListTournamentRecordsAroundOwnerFunction
afterUnlinkCustomFunction RuntimeAfterUnlinkCustomFunction
afterUnlinkDeviceFunction RuntimeAfterUnlinkDeviceFunction
afterUnlinkEmailFunction RuntimeAfterUnlinkEmailFunction
afterUnlinkFacebookFunction RuntimeAfterUnlinkFacebookFunction
afterUnlinkGameCenterFunction RuntimeAfterUnlinkGameCenterFunction
afterUnlinkGoogleFunction RuntimeAfterUnlinkGoogleFunction
afterUnlinkSteamFunction RuntimeAfterUnlinkSteamFunction
afterGetUsersFunction RuntimeAfterGetUsersFunction
}
type Runtime struct {
matchCreateFunction RuntimeMatchCreateFunction
rpcFunctions map[string]RuntimeRpcFunction
beforeRtFunctions map[string]RuntimeBeforeRtFunction
afterRtFunctions map[string]RuntimeAfterRtFunction
beforeReqFunctions *RuntimeBeforeReqFunctions
afterReqFunctions *RuntimeAfterReqFunctions
matchmakerMatchedFunction RuntimeMatchmakerMatchedFunction
tournamentEndFunction RuntimeTournamentEndFunction
tournamentResetFunction RuntimeTournamentResetFunction
leaderboardResetFunction RuntimeLeaderboardResetFunction
}
func NewRuntime(logger, startupLogger *zap.Logger, db *sql.DB, jsonpbMarshaler *jsonpb.Marshaler, jsonpbUnmarshaler *jsonpb.Unmarshaler, config Config, socialClient *social.Client, leaderboardCache LeaderboardCache, leaderboardRankCache LeaderboardRankCache, leaderboardScheduler LeaderboardScheduler, sessionRegistry *SessionRegistry, matchRegistry MatchRegistry, tracker Tracker, router MessageRouter) (*Runtime, error) {
runtimeConfig := config.GetRuntime()
startupLogger.Info("Initialising runtime", zap.String("path", runtimeConfig.Path))
if err := os.MkdirAll(runtimeConfig.Path, os.ModePerm); err != nil {
return nil, err
}
paths := make([]string, 0)
if err := filepath.Walk(runtimeConfig.Path, func(path string, f os.FileInfo, err error) error {
if err != nil {
startupLogger.Error("Error listing runtime path", zap.String("path", path), zap.Error(err))
return err
}
// Ignore directories.
if !f.IsDir() {
paths = append(paths, path)
}
return nil
}); err != nil {
startupLogger.Error("Failed to list runtime path", zap.Error(err))
return nil, err
}
goModules, goRpcFunctions, goBeforeRtFunctions, goAfterRtFunctions, goBeforeReqFunctions, goAfterReqFunctions, goMatchmakerMatchedFunction, goMatchCreateFn, goTournamentEndFunction, goTournamentResetFunction, goLeaderboardResetFunction, goSetMatchCreateFn, goMatchNamesListFn, err := NewRuntimeProviderGo(logger, startupLogger, db, config, socialClient, leaderboardCache, leaderboardRankCache, leaderboardScheduler, sessionRegistry, matchRegistry, tracker, router, runtimeConfig.Path, paths)
if err != nil {
startupLogger.Error("Error initialising Go runtime provider", zap.Error(err))
return nil, err
}
luaModules, luaRpcFunctions, luaBeforeRtFunctions, luaAfterRtFunctions, luaBeforeReqFunctions, luaAfterReqFunctions, luaMatchmakerMatchedFunction, allMatchCreateFn, luaTournamentEndFunction, luaTournamentResetFunction, luaLeaderboardResetFunction, err := NewRuntimeProviderLua(logger, startupLogger, db, jsonpbMarshaler, jsonpbUnmarshaler, config, socialClient, leaderboardCache, leaderboardRankCache, leaderboardScheduler, sessionRegistry, matchRegistry, tracker, router, goMatchCreateFn, runtimeConfig.Path, paths)
if err != nil {
startupLogger.Error("Error initialising Lua runtime provider", zap.Error(err))
return nil, err
}
// allMatchCreateFn has already been set up by the Lua side to multiplex, now tell the Go side to use it too.
goSetMatchCreateFn(allMatchCreateFn)
allModules := make([]string, 0, len(goModules)+len(luaModules))
for _, module := range luaModules {
allModules = append(allModules, module)
}
for _, module := range goModules {
allModules = append(allModules, module)
}
startupLogger.Info("Found runtime modules", zap.Int("count", len(allModules)), zap.Strings("modules", allModules))
allRpcFunctions := make(map[string]RuntimeRpcFunction, len(goRpcFunctions)+len(luaRpcFunctions))
for id, fn := range luaRpcFunctions {
allRpcFunctions[id] = fn
startupLogger.Info("Registered Lua runtime RPC function invocation", zap.String("id", id))
}
for id, fn := range goRpcFunctions {
allRpcFunctions[id] = fn
startupLogger.Info("Registered Go runtime RPC function invocation", zap.String("id", id))
}
allBeforeRtFunctions := make(map[string]RuntimeBeforeRtFunction, len(goBeforeRtFunctions)+len(luaBeforeRtFunctions))
for id, fn := range luaBeforeRtFunctions {
allBeforeRtFunctions[id] = fn
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", strings.TrimPrefix(strings.TrimPrefix(id, API_PREFIX), RTAPI_PREFIX)))
}
for id, fn := range goBeforeRtFunctions {
allBeforeRtFunctions[id] = fn
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", strings.TrimPrefix(strings.TrimPrefix(id, API_PREFIX), RTAPI_PREFIX)))
}
allAfterRtFunctions := make(map[string]RuntimeAfterRtFunction, len(goAfterRtFunctions)+len(luaAfterRtFunctions))
for id, fn := range luaAfterRtFunctions {
allAfterRtFunctions[id] = fn
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", strings.TrimPrefix(strings.TrimPrefix(id, API_PREFIX), RTAPI_PREFIX)))
}
for id, fn := range goAfterRtFunctions {
allAfterRtFunctions[id] = fn
startupLogger.Info("Registered Go runtime After function invocation", zap.String("id", strings.TrimPrefix(strings.TrimPrefix(id, API_PREFIX), RTAPI_PREFIX)))
}
allBeforeReqFunctions := luaBeforeReqFunctions
if allBeforeReqFunctions.beforeGetAccountFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "getaccount"))
}
if allBeforeReqFunctions.beforeUpdateAccountFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "updateaccount"))
}
if allBeforeReqFunctions.beforeAuthenticateCustomFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "authenticatecustom"))
}
if allBeforeReqFunctions.beforeAuthenticateDeviceFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "authenticatedevice"))
}
if allBeforeReqFunctions.beforeAuthenticateEmailFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "authenticateemail"))
}
if allBeforeReqFunctions.beforeAuthenticateFacebookFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "authenticatefacebook"))
}
if allBeforeReqFunctions.beforeAuthenticateGameCenterFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "authenticategamecenter"))
}
if allBeforeReqFunctions.beforeAuthenticateGoogleFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "authenticategoogle"))
}
if allBeforeReqFunctions.beforeAuthenticateSteamFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "authenticatesteam"))
}
if allBeforeReqFunctions.beforeListChannelMessagesFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listchannelmessages"))
}
if allBeforeReqFunctions.beforeListFriendsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listfriends"))
}
if allBeforeReqFunctions.beforeAddFriendsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "addfriends"))
}
if allBeforeReqFunctions.beforeDeleteFriendsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "deletefriends"))
}
if allBeforeReqFunctions.beforeBlockFriendsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "blockfriends"))
}
if allBeforeReqFunctions.beforeImportFacebookFriendsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "importfacebookfriends"))
}
if allBeforeReqFunctions.beforeCreateGroupFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "creategroup"))
}
if allBeforeReqFunctions.beforeUpdateGroupFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "updategroup"))
}
if allBeforeReqFunctions.beforeDeleteGroupFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "deletegroup"))
}
if allBeforeReqFunctions.beforeJoinGroupFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "joingroup"))
}
if allBeforeReqFunctions.beforeLeaveGroupFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "leavegroup"))
}
if allBeforeReqFunctions.beforeAddGroupUsersFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "addgroupusers"))
}
if allBeforeReqFunctions.beforeKickGroupUsersFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "kickgroupusers"))
}
if allBeforeReqFunctions.beforePromoteGroupUsersFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "promotegroupusers"))
}
if allBeforeReqFunctions.beforeListGroupUsersFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listgroupusers"))
}
if allBeforeReqFunctions.beforeListUserGroupsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listusergroups"))
}
if allBeforeReqFunctions.beforeListGroupsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listgroups"))
}
if allBeforeReqFunctions.beforeDeleteLeaderboardRecordFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "deleteleaderboardrecord"))
}
if allBeforeReqFunctions.beforeListLeaderboardRecordsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listleaderboardrecords"))
}
if allBeforeReqFunctions.beforeWriteLeaderboardRecordFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "writeleaderboardrecord"))
}
if allBeforeReqFunctions.beforeListLeaderboardRecordsAroundOwnerFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listleaderboardrecordsaroundowner"))
}
if allBeforeReqFunctions.beforeLinkCustomFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "linkcustom"))
}
if allBeforeReqFunctions.beforeLinkDeviceFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "linkdevice"))
}
if allBeforeReqFunctions.beforeLinkEmailFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "linkemail"))
}
if allBeforeReqFunctions.beforeLinkFacebookFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "linkfacebook"))
}
if allBeforeReqFunctions.beforeLinkGameCenterFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "linkgamecenter"))
}
if allBeforeReqFunctions.beforeLinkGoogleFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "linkgoogle"))
}
if allBeforeReqFunctions.beforeLinkSteamFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "linksteam"))
}
if allBeforeReqFunctions.beforeListMatchesFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listmatches"))
}
if allBeforeReqFunctions.beforeListNotificationsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listnotifications"))
}
if allBeforeReqFunctions.beforeDeleteNotificationFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "deletenotification"))
}
if allBeforeReqFunctions.beforeListStorageObjectsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "liststorageobjects"))
}
if allBeforeReqFunctions.beforeReadStorageObjectsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "readstorageobjects"))
}
if allBeforeReqFunctions.beforeWriteStorageObjectsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "writestorageobjects"))
}
if allBeforeReqFunctions.beforeDeleteStorageObjectsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "deletestorageobjects"))
}
if allBeforeReqFunctions.beforeJoinTournamentFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "jointournament"))
}
if allBeforeReqFunctions.beforeListTournamentRecordsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listtournamentrecords"))
}
if allBeforeReqFunctions.beforeListTournamentsFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listtournaments"))
}
if allBeforeReqFunctions.beforeWriteTournamentRecordFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "writetournamentrecord"))
}
if allBeforeReqFunctions.beforeListTournamentRecordsAroundOwnerFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "listtournamentrecordsaroundowner"))
}
if allBeforeReqFunctions.beforeUnlinkCustomFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "unlinkcustom"))
}
if allBeforeReqFunctions.beforeUnlinkDeviceFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "unlinkdevice"))
}
if allBeforeReqFunctions.beforeUnlinkEmailFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "unlinkemail"))
}
if allBeforeReqFunctions.beforeUnlinkFacebookFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "unlinkfacebook"))
}
if allBeforeReqFunctions.beforeUnlinkGameCenterFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "unlinkgamecenter"))
}
if allBeforeReqFunctions.beforeUnlinkGoogleFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "unlinkgoogle"))
}
if allBeforeReqFunctions.beforeUnlinkSteamFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "unlinksteam"))
}
if allBeforeReqFunctions.beforeGetUsersFunction != nil {
startupLogger.Info("Registered Lua runtime Before function invocation", zap.String("id", "getusers"))
}
if goBeforeReqFunctions.beforeGetAccountFunction != nil {
allBeforeReqFunctions.beforeGetAccountFunction = goBeforeReqFunctions.beforeGetAccountFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "getaccount"))
}
if goBeforeReqFunctions.beforeUpdateAccountFunction != nil {
allBeforeReqFunctions.beforeUpdateAccountFunction = goBeforeReqFunctions.beforeUpdateAccountFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "updateaccount"))
}
if goBeforeReqFunctions.beforeAuthenticateCustomFunction != nil {
allBeforeReqFunctions.beforeAuthenticateCustomFunction = goBeforeReqFunctions.beforeAuthenticateCustomFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "authenticatecustom"))
}
if goBeforeReqFunctions.beforeAuthenticateDeviceFunction != nil {
allBeforeReqFunctions.beforeAuthenticateDeviceFunction = goBeforeReqFunctions.beforeAuthenticateDeviceFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "authenticatedevice"))
}
if goBeforeReqFunctions.beforeAuthenticateEmailFunction != nil {
allBeforeReqFunctions.beforeAuthenticateEmailFunction = goBeforeReqFunctions.beforeAuthenticateEmailFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "authenticateemail"))
}
if goBeforeReqFunctions.beforeAuthenticateFacebookFunction != nil {
allBeforeReqFunctions.beforeAuthenticateFacebookFunction = goBeforeReqFunctions.beforeAuthenticateFacebookFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "authenticatefacebook"))
}
if goBeforeReqFunctions.beforeAuthenticateGameCenterFunction != nil {
allBeforeReqFunctions.beforeAuthenticateGameCenterFunction = goBeforeReqFunctions.beforeAuthenticateGameCenterFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "authenticategamecenter"))
}
if goBeforeReqFunctions.beforeAuthenticateGoogleFunction != nil {
allBeforeReqFunctions.beforeAuthenticateGoogleFunction = goBeforeReqFunctions.beforeAuthenticateGoogleFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "authenticategoogle"))
}
if goBeforeReqFunctions.beforeAuthenticateSteamFunction != nil {
allBeforeReqFunctions.beforeAuthenticateSteamFunction = goBeforeReqFunctions.beforeAuthenticateSteamFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "authenticatesteam"))
}
if goBeforeReqFunctions.beforeListChannelMessagesFunction != nil {
allBeforeReqFunctions.beforeListChannelMessagesFunction = goBeforeReqFunctions.beforeListChannelMessagesFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listchannelmessages"))
}
if goBeforeReqFunctions.beforeListFriendsFunction != nil {
allBeforeReqFunctions.beforeListFriendsFunction = goBeforeReqFunctions.beforeListFriendsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listfriends"))
}
if goBeforeReqFunctions.beforeAddFriendsFunction != nil {
allBeforeReqFunctions.beforeAddFriendsFunction = goBeforeReqFunctions.beforeAddFriendsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "addfriends"))
}
if goBeforeReqFunctions.beforeDeleteFriendsFunction != nil {
allBeforeReqFunctions.beforeDeleteFriendsFunction = goBeforeReqFunctions.beforeDeleteFriendsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "deletefriends"))
}
if goBeforeReqFunctions.beforeBlockFriendsFunction != nil {
allBeforeReqFunctions.beforeBlockFriendsFunction = goBeforeReqFunctions.beforeBlockFriendsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "blockfriends"))
}
if goBeforeReqFunctions.beforeImportFacebookFriendsFunction != nil {
allBeforeReqFunctions.beforeImportFacebookFriendsFunction = goBeforeReqFunctions.beforeImportFacebookFriendsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "importfacebookfriends"))
}
if goBeforeReqFunctions.beforeCreateGroupFunction != nil {
allBeforeReqFunctions.beforeCreateGroupFunction = goBeforeReqFunctions.beforeCreateGroupFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "creategroup"))
}
if goBeforeReqFunctions.beforeUpdateGroupFunction != nil {
allBeforeReqFunctions.beforeUpdateGroupFunction = goBeforeReqFunctions.beforeUpdateGroupFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "updategroup"))
}
if goBeforeReqFunctions.beforeDeleteGroupFunction != nil {
allBeforeReqFunctions.beforeDeleteGroupFunction = goBeforeReqFunctions.beforeDeleteGroupFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "deletegroup"))
}
if goBeforeReqFunctions.beforeJoinGroupFunction != nil {
allBeforeReqFunctions.beforeJoinGroupFunction = goBeforeReqFunctions.beforeJoinGroupFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "joingroup"))
}
if goBeforeReqFunctions.beforeLeaveGroupFunction != nil {
allBeforeReqFunctions.beforeLeaveGroupFunction = goBeforeReqFunctions.beforeLeaveGroupFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "leavegroup"))
}
if goBeforeReqFunctions.beforeAddGroupUsersFunction != nil {
allBeforeReqFunctions.beforeAddGroupUsersFunction = goBeforeReqFunctions.beforeAddGroupUsersFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "addgroupusers"))
}
if goBeforeReqFunctions.beforeKickGroupUsersFunction != nil {
allBeforeReqFunctions.beforeKickGroupUsersFunction = goBeforeReqFunctions.beforeKickGroupUsersFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "kickgroupusers"))
}
if goBeforeReqFunctions.beforePromoteGroupUsersFunction != nil {
allBeforeReqFunctions.beforePromoteGroupUsersFunction = goBeforeReqFunctions.beforePromoteGroupUsersFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "promotegroupusers"))
}
if goBeforeReqFunctions.beforeListGroupUsersFunction != nil {
allBeforeReqFunctions.beforeListGroupUsersFunction = goBeforeReqFunctions.beforeListGroupUsersFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listgroupusers"))
}
if goBeforeReqFunctions.beforeListUserGroupsFunction != nil {
allBeforeReqFunctions.beforeListUserGroupsFunction = goBeforeReqFunctions.beforeListUserGroupsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listusergroups"))
}
if goBeforeReqFunctions.beforeListGroupsFunction != nil {
allBeforeReqFunctions.beforeListGroupsFunction = goBeforeReqFunctions.beforeListGroupsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listgroups"))
}
if goBeforeReqFunctions.beforeDeleteLeaderboardRecordFunction != nil {
allBeforeReqFunctions.beforeDeleteLeaderboardRecordFunction = goBeforeReqFunctions.beforeDeleteLeaderboardRecordFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "deleteleaderboardrecord"))
}
if goBeforeReqFunctions.beforeListLeaderboardRecordsFunction != nil {
allBeforeReqFunctions.beforeListLeaderboardRecordsFunction = goBeforeReqFunctions.beforeListLeaderboardRecordsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listleaderboardrecords"))
}
if goBeforeReqFunctions.beforeWriteLeaderboardRecordFunction != nil {
allBeforeReqFunctions.beforeWriteLeaderboardRecordFunction = goBeforeReqFunctions.beforeWriteLeaderboardRecordFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "writeleaderboardrecord"))
}
if goBeforeReqFunctions.beforeListLeaderboardRecordsAroundOwnerFunction != nil {
allBeforeReqFunctions.beforeListLeaderboardRecordsAroundOwnerFunction = goBeforeReqFunctions.beforeListLeaderboardRecordsAroundOwnerFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listleaderboardrecordsaroundowner"))
}
if goBeforeReqFunctions.beforeLinkCustomFunction != nil {
allBeforeReqFunctions.beforeLinkCustomFunction = goBeforeReqFunctions.beforeLinkCustomFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "linkcustom"))
}
if goBeforeReqFunctions.beforeLinkDeviceFunction != nil {
allBeforeReqFunctions.beforeLinkDeviceFunction = goBeforeReqFunctions.beforeLinkDeviceFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "linkdevice"))
}
if goBeforeReqFunctions.beforeLinkEmailFunction != nil {
allBeforeReqFunctions.beforeLinkEmailFunction = goBeforeReqFunctions.beforeLinkEmailFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "linkemail"))
}
if goBeforeReqFunctions.beforeLinkFacebookFunction != nil {
allBeforeReqFunctions.beforeLinkFacebookFunction = goBeforeReqFunctions.beforeLinkFacebookFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "linkfacebook"))
}
if goBeforeReqFunctions.beforeLinkGameCenterFunction != nil {
allBeforeReqFunctions.beforeLinkGameCenterFunction = goBeforeReqFunctions.beforeLinkGameCenterFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "linkgamecenter"))
}
if goBeforeReqFunctions.beforeLinkGoogleFunction != nil {
allBeforeReqFunctions.beforeLinkGoogleFunction = goBeforeReqFunctions.beforeLinkGoogleFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "linkgoogle"))
}
if goBeforeReqFunctions.beforeLinkSteamFunction != nil {
allBeforeReqFunctions.beforeLinkSteamFunction = goBeforeReqFunctions.beforeLinkSteamFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "linksteam"))
}
if goBeforeReqFunctions.beforeListMatchesFunction != nil {
allBeforeReqFunctions.beforeListMatchesFunction = goBeforeReqFunctions.beforeListMatchesFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listmatches"))
}
if goBeforeReqFunctions.beforeListNotificationsFunction != nil {
allBeforeReqFunctions.beforeListNotificationsFunction = goBeforeReqFunctions.beforeListNotificationsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listnotifications"))
}
if goBeforeReqFunctions.beforeDeleteNotificationFunction != nil {
allBeforeReqFunctions.beforeDeleteNotificationFunction = goBeforeReqFunctions.beforeDeleteNotificationFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "deletenotification"))
}
if goBeforeReqFunctions.beforeListStorageObjectsFunction != nil {
allBeforeReqFunctions.beforeListStorageObjectsFunction = goBeforeReqFunctions.beforeListStorageObjectsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "liststorageobjects"))
}
if goBeforeReqFunctions.beforeReadStorageObjectsFunction != nil {
allBeforeReqFunctions.beforeReadStorageObjectsFunction = goBeforeReqFunctions.beforeReadStorageObjectsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "readstorageobjects"))
}
if goBeforeReqFunctions.beforeWriteStorageObjectsFunction != nil {
allBeforeReqFunctions.beforeWriteStorageObjectsFunction = goBeforeReqFunctions.beforeWriteStorageObjectsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "writestorageobjects"))
}
if goBeforeReqFunctions.beforeDeleteStorageObjectsFunction != nil {
allBeforeReqFunctions.beforeDeleteStorageObjectsFunction = goBeforeReqFunctions.beforeDeleteStorageObjectsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "deletestorageobjects"))
}
if goBeforeReqFunctions.beforeJoinTournamentFunction != nil {
allBeforeReqFunctions.beforeJoinTournamentFunction = goBeforeReqFunctions.beforeJoinTournamentFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "jointournament"))
}
if goBeforeReqFunctions.beforeListTournamentRecordsFunction != nil {
allBeforeReqFunctions.beforeListTournamentRecordsFunction = goBeforeReqFunctions.beforeListTournamentRecordsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listtournamentrecords"))
}
if goBeforeReqFunctions.beforeListTournamentsFunction != nil {
allBeforeReqFunctions.beforeListTournamentsFunction = goBeforeReqFunctions.beforeListTournamentsFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listtournaments"))
}
if goBeforeReqFunctions.beforeWriteTournamentRecordFunction != nil {
allBeforeReqFunctions.beforeWriteTournamentRecordFunction = goBeforeReqFunctions.beforeWriteTournamentRecordFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "writetournamentrecord"))
}
if goBeforeReqFunctions.beforeListTournamentRecordsAroundOwnerFunction != nil {
allBeforeReqFunctions.beforeListTournamentRecordsAroundOwnerFunction = goBeforeReqFunctions.beforeListTournamentRecordsAroundOwnerFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "listtournamentrecordsaroundowner"))
}
if goBeforeReqFunctions.beforeUnlinkCustomFunction != nil {
allBeforeReqFunctions.beforeUnlinkCustomFunction = goBeforeReqFunctions.beforeUnlinkCustomFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "unlinkcustom"))
}
if goBeforeReqFunctions.beforeUnlinkDeviceFunction != nil {
allBeforeReqFunctions.beforeUnlinkDeviceFunction = goBeforeReqFunctions.beforeUnlinkDeviceFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "unlinkdevice"))
}
if goBeforeReqFunctions.beforeUnlinkEmailFunction != nil {
allBeforeReqFunctions.beforeUnlinkEmailFunction = goBeforeReqFunctions.beforeUnlinkEmailFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "unlinkemail"))
}
if goBeforeReqFunctions.beforeUnlinkFacebookFunction != nil {
allBeforeReqFunctions.beforeUnlinkFacebookFunction = goBeforeReqFunctions.beforeUnlinkFacebookFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "unlinkfacebook"))
}
if goBeforeReqFunctions.beforeUnlinkGameCenterFunction != nil {
allBeforeReqFunctions.beforeUnlinkGameCenterFunction = goBeforeReqFunctions.beforeUnlinkGameCenterFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "unlinkgamecenter"))
}
if goBeforeReqFunctions.beforeUnlinkGoogleFunction != nil {
allBeforeReqFunctions.beforeUnlinkGoogleFunction = goBeforeReqFunctions.beforeUnlinkGoogleFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "unlinkgoogle"))
}
if goBeforeReqFunctions.beforeUnlinkSteamFunction != nil {
allBeforeReqFunctions.beforeUnlinkSteamFunction = goBeforeReqFunctions.beforeUnlinkSteamFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "unlinksteam"))
}
if goBeforeReqFunctions.beforeGetUsersFunction != nil {
allBeforeReqFunctions.beforeGetUsersFunction = goBeforeReqFunctions.beforeGetUsersFunction
startupLogger.Info("Registered Go runtime Before function invocation", zap.String("id", "getusers"))
}
allAfterReqFunctions := luaAfterReqFunctions
if allAfterReqFunctions.afterGetAccountFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "getaccount"))
}
if allAfterReqFunctions.afterUpdateAccountFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "updateaccount"))
}
if allAfterReqFunctions.afterAuthenticateCustomFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "authenticatecustom"))
}
if allAfterReqFunctions.afterAuthenticateDeviceFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "authenticatedevice"))
}
if allAfterReqFunctions.afterAuthenticateEmailFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "authenticateemail"))
}
if allAfterReqFunctions.afterAuthenticateFacebookFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "authenticatefacebook"))
}
if allAfterReqFunctions.afterAuthenticateGameCenterFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "authenticategamecenter"))
}
if allAfterReqFunctions.afterAuthenticateGoogleFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "authenticategoogle"))
}
if allAfterReqFunctions.afterAuthenticateSteamFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "authenticatesteam"))
}
if allAfterReqFunctions.afterListChannelMessagesFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listchannelmessages"))
}
if allAfterReqFunctions.afterListFriendsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listfriends"))
}
if allAfterReqFunctions.afterAddFriendsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "addfriends"))
}
if allAfterReqFunctions.afterDeleteFriendsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "deletefriends"))
}
if allAfterReqFunctions.afterBlockFriendsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "blockfriends"))
}
if allAfterReqFunctions.afterImportFacebookFriendsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "importfacebookfriends"))
}
if allAfterReqFunctions.afterCreateGroupFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "creategroup"))
}
if allAfterReqFunctions.afterUpdateGroupFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "updategroup"))
}
if allAfterReqFunctions.afterDeleteGroupFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "deletegroup"))
}
if allAfterReqFunctions.afterJoinGroupFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "joingroup"))
}
if allAfterReqFunctions.afterLeaveGroupFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "leavegroup"))
}
if allAfterReqFunctions.afterAddGroupUsersFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "addgroupusers"))
}
if allAfterReqFunctions.afterKickGroupUsersFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "kickgroupusers"))
}
if allAfterReqFunctions.afterPromoteGroupUsersFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "promotegroupusers"))
}
if allAfterReqFunctions.afterListGroupUsersFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listgroupusers"))
}
if allAfterReqFunctions.afterListUserGroupsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listusergroups"))
}
if allAfterReqFunctions.afterListGroupsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listgroups"))
}
if allAfterReqFunctions.afterDeleteLeaderboardRecordFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "deleteleaderboardrecord"))
}
if allAfterReqFunctions.afterListLeaderboardRecordsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listleaderboardrecords"))
}
if allAfterReqFunctions.afterWriteLeaderboardRecordFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "writeleaderboardrecord"))
}
if allAfterReqFunctions.afterListLeaderboardRecordsAroundOwnerFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listleaderboardrecordsaroundowner"))
}
if allAfterReqFunctions.afterLinkCustomFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "linkcustom"))
}
if allAfterReqFunctions.afterLinkDeviceFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "linkdevice"))
}
if allAfterReqFunctions.afterLinkEmailFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "linkemail"))
}
if allAfterReqFunctions.afterLinkFacebookFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "linkfacebook"))
}
if allAfterReqFunctions.afterLinkGameCenterFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "linkgamecenter"))
}
if allAfterReqFunctions.afterLinkGoogleFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "linkgoogle"))
}
if allAfterReqFunctions.afterLinkSteamFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "linksteam"))
}
if allAfterReqFunctions.afterListMatchesFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listmatches"))
}
if allAfterReqFunctions.afterListNotificationsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listnotifications"))
}
if allAfterReqFunctions.afterDeleteNotificationFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "deletenotification"))
}
if allAfterReqFunctions.afterListStorageObjectsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "liststorageobjects"))
}
if allAfterReqFunctions.afterReadStorageObjectsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "readstorageobjects"))
}
if allAfterReqFunctions.afterWriteStorageObjectsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "writestorageobjects"))
}
if allAfterReqFunctions.afterDeleteStorageObjectsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "deletestorageobjects"))
}
if allAfterReqFunctions.afterJoinTournamentFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "jointournament"))
}
if allAfterReqFunctions.afterListTournamentRecordsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listtournamentrecords"))
}
if allAfterReqFunctions.afterListTournamentsFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listtournaments"))
}
if allAfterReqFunctions.afterWriteTournamentRecordFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "writetournamentrecord"))
}
if allAfterReqFunctions.afterListTournamentRecordsAroundOwnerFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "listtournamentrecordsaroundowner"))
}
if allAfterReqFunctions.afterUnlinkCustomFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "unlinkcustom"))
}
if allAfterReqFunctions.afterUnlinkDeviceFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "unlinkdevice"))
}
if allAfterReqFunctions.afterUnlinkEmailFunction != nil {
startupLogger.Info("Registered Lua runtime After function invocation", zap.String("id", "unlinkemail"))