MatrixCoder0101 commited on
Commit
8e8ce9f
·
1 Parent(s): f254904
Dockerfile ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
+
4
+ FROM python:3.9
5
+
6
+ RUN useradd -m -u 1000 user
7
+ USER user
8
+ ENV PATH="/home/user/.local/bin:$PATH"
9
+
10
+ WORKDIR /app
11
+
12
+ COPY --chown=user ./requirements.txt requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
+
15
+ COPY --chown=user . /app
16
+ CMD ["uvicorn", "bot_with_api:app", "--host", "0.0.0.0", "--port", "7860"]
Pb2/DEcwHisPErMsG_pb2.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: DecodeWhisperMsg.proto
5
+ # Protobuf Python Version: 6.30.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 30,
16
+ 0,
17
+ '',
18
+ 'DecodeWhisperMsg.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x44\x65\x63odeWhisperMsg.proto\"\xa8\x02\n\rDecodeWhisper\x12$\n\x04\x44\x61ta\x18\x05 \x01(\x0b\x32\x16.DecodeWhisper.Nested1\x1a\xf0\x01\n\x07Nested1\x12\x0b\n\x03uid\x18\x01 \x01(\x04\x12\x0f\n\x07\x43hat_ID\x18\x02 \x01(\x04\x12\x11\n\tchat_type\x18\x03 \x01(\x05\x12\x0b\n\x03msg\x18\x04 \x01(\t\x12/\n\x07\x44\x65tails\x18\t \x01(\x0b\x32\x1e.DecodeWhisper.Nested1.Nested2\x12\x35\n\rPlatform_Info\x18\r \x01(\x0b\x32\x1e.DecodeWhisper.Nested1.Nested3\x1a\x1b\n\x07Nested2\x12\x10\n\x08Nickname\x18\x01 \x01(\t\x1a\"\n\x07Nested3\x12\x17\n\x0fprofile_pic_url\x18\x01 \x01(\tb\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'DecodeWhisperMsg_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_DECODEWHISPER']._serialized_start=27
35
+ _globals['_DECODEWHISPER']._serialized_end=323
36
+ _globals['_DECODEWHISPER_NESTED1']._serialized_start=83
37
+ _globals['_DECODEWHISPER_NESTED1']._serialized_end=323
38
+ _globals['_DECODEWHISPER_NESTED1_NESTED2']._serialized_start=260
39
+ _globals['_DECODEWHISPER_NESTED1_NESTED2']._serialized_end=287
40
+ _globals['_DECODEWHISPER_NESTED1_NESTED3']._serialized_start=289
41
+ _globals['_DECODEWHISPER_NESTED1_NESTED3']._serialized_end=323
42
+ # @@protoc_insertion_point(module_scope)
Pb2/Fo_pb2.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: Friends.proto
4
+ # Protobuf Python Version: 4.25.1
5
+ """Generated protocol buffer code."""
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ from google.protobuf.internal import builder as _builder
10
+ # @@protoc_insertion_point(imports)
11
+
12
+ _sym_db = _symbol_database.Default()
13
+
14
+
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rFriends.proto\"\"\n\x06\x46riend\x12\n\n\x02ID\x18\x01 \x01(\x03\x12\x0c\n\x04Name\x18\x03 \x01(\t\"#\n\x07\x46riends\x12\x18\n\x07\x66ield_1\x18\x01 \x03(\x0b\x32\x07.Friendb\x06proto3')
18
+
19
+ _globals = globals()
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'Friends_pb2', _globals)
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+ DESCRIPTOR._options = None
24
+ _globals['_FRIEND']._serialized_start=17
25
+ _globals['_FRIEND']._serialized_end=51
26
+ _globals['_FRIENDS']._serialized_start=53
27
+ _globals['_FRIENDS']._serialized_end=88
28
+ # @@protoc_insertion_point(module_scope)
Pb2/GenWhisperMsg_pb2.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: GenWhisperMsg.proto
5
+ # Protobuf Python Version: 6.30.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 30,
16
+ 0,
17
+ '',
18
+ 'GenWhisperMsg.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13GenWhisperMsg.proto\"\x85\x06\n\nGenWhisper\x12\x0c\n\x04type\x18\x01 \x01(\x05\x12!\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x13.GenWhisper.Nested2\x1a\xc5\x05\n\x07Nested2\x12\x0b\n\x03uid\x18\x01 \x01(\x04\x12\x0f\n\x07\x63hat_id\x18\x02 \x01(\x04\x12\x11\n\tchat_type\x18\x03 \x01(\x05\x12\x0b\n\x03msg\x18\x04 \x01(\t\x12\x11\n\ttimestamp\x18\x05 \x01(\x03\x12+\n\x06\x66ield9\x18\t \x01(\x0b\x32\x1b.GenWhisper.Nested2.Nested9\x12\x10\n\x08language\x18\n \x01(\t\x12-\n\x07\x66ield13\x18\r \x01(\x0b\x32\x1c.GenWhisper.Nested2.Nested13\x12\x31\n\x0b\x65mpty_field\x18\x0e \x01(\x0b\x32\x1c.GenWhisper.Nested2.Nested14\x12\x11\n\tCelebrity\x18\x10 \x01(\x04\x1a\n\n\x08Nested14\x1a\xff\x01\n\x07Nested9\x12\x10\n\x08Nickname\x18\x01 \x01(\t\x12\x11\n\tavatar_id\x18\x02 \x01(\x03\x12\x11\n\tbanner_id\x18\x03 \x01(\x03\x12\x0c\n\x04rank\x18\x04 \x01(\x05\x12\r\n\x05\x62\x61\x64ge\x18\x05 \x01(\x05\x12\x11\n\tClan_Name\x18\x08 \x01(\t\x12\x0f\n\x07\x66ield10\x18\n \x01(\x05\x12\x17\n\x0fglobal_rank_pos\x18\x0b \x01(\x05\x12\x30\n\x07\x66ield13\x18\r \x01(\x0b\x32\x1f.GenWhisper.Nested2.NestedBadge\x12\x30\n\x07\x66ield14\x18\x0e \x01(\x0b\x32\x1f.GenWhisper.Nested2.NestedPrime\x1a\x1c\n\x0bNestedBadge\x12\r\n\x05value\x18\x01 \x01(\x05\x1aH\n\x0bNestedPrime\x12\x11\n\tprime_uid\x18\x01 \x01(\x05\x12\x13\n\x0bprime_level\x18\x02 \x01(\x05\x12\x11\n\tprime_hex\x18\x03 \x01(\t\x1a?\n\x08Nested13\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x10\n\x08url_type\x18\x02 \x01(\x05\x12\x14\n\x0curl_platform\x18\x03 \x01(\x05\x62\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'GenWhisperMsg_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_GENWHISPER']._serialized_start=24
35
+ _globals['_GENWHISPER']._serialized_end=797
36
+ _globals['_GENWHISPER_NESTED2']._serialized_start=88
37
+ _globals['_GENWHISPER_NESTED2']._serialized_end=797
38
+ _globals['_GENWHISPER_NESTED2_NESTED14']._serialized_start=360
39
+ _globals['_GENWHISPER_NESTED2_NESTED14']._serialized_end=370
40
+ _globals['_GENWHISPER_NESTED2_NESTED9']._serialized_start=373
41
+ _globals['_GENWHISPER_NESTED2_NESTED9']._serialized_end=628
42
+ _globals['_GENWHISPER_NESTED2_NESTEDBADGE']._serialized_start=630
43
+ _globals['_GENWHISPER_NESTED2_NESTEDBADGE']._serialized_end=658
44
+ _globals['_GENWHISPER_NESTED2_NESTEDPRIME']._serialized_start=660
45
+ _globals['_GENWHISPER_NESTED2_NESTEDPRIME']._serialized_end=732
46
+ _globals['_GENWHISPER_NESTED2_NESTED13']._serialized_start=734
47
+ _globals['_GENWHISPER_NESTED2_NESTED13']._serialized_end=797
48
+ # @@protoc_insertion_point(module_scope)
Pb2/MajoRLoGinrEq_pb2.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: MajorLoginReq.proto
4
+ # Protobuf Python Version: 4.25.1
5
+ """Generated protocol buffer code."""
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ from google.protobuf.internal import builder as _builder
10
+ # @@protoc_insertion_point(imports)
11
+
12
+ _sym_db = _symbol_database.Default()
13
+
14
+
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13MajorLoginReq.proto\"\xfa\n\n\nMajorLogin\x12\x12\n\nevent_time\x18\x03 \x01(\t\x12\x11\n\tgame_name\x18\x04 \x01(\t\x12\x13\n\x0bplatform_id\x18\x05 \x01(\x05\x12\x16\n\x0e\x63lient_version\x18\x07 \x01(\t\x12\x17\n\x0fsystem_software\x18\x08 \x01(\t\x12\x17\n\x0fsystem_hardware\x18\t \x01(\t\x12\x18\n\x10telecom_operator\x18\n \x01(\t\x12\x14\n\x0cnetwork_type\x18\x0b \x01(\t\x12\x14\n\x0cscreen_width\x18\x0c \x01(\r\x12\x15\n\rscreen_height\x18\r \x01(\r\x12\x12\n\nscreen_dpi\x18\x0e \x01(\t\x12\x19\n\x11processor_details\x18\x0f \x01(\t\x12\x0e\n\x06memory\x18\x10 \x01(\r\x12\x14\n\x0cgpu_renderer\x18\x11 \x01(\t\x12\x13\n\x0bgpu_version\x18\x12 \x01(\t\x12\x18\n\x10unique_device_id\x18\x13 \x01(\t\x12\x11\n\tclient_ip\x18\x14 \x01(\t\x12\x10\n\x08language\x18\x15 \x01(\t\x12\x0f\n\x07open_id\x18\x16 \x01(\t\x12\x14\n\x0copen_id_type\x18\x17 \x01(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x18 \x01(\t\x12\'\n\x10memory_available\x18\x19 \x01(\x0b\x32\r.GameSecurity\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x1d \x01(\t\x12\x17\n\x0fplatform_sdk_id\x18\x1e \x01(\x05\x12\x1a\n\x12network_operator_a\x18) \x01(\t\x12\x16\n\x0enetwork_type_a\x18* \x01(\t\x12\x1c\n\x14\x63lient_using_version\x18\x39 \x01(\t\x12\x1e\n\x16\x65xternal_storage_total\x18< \x01(\x05\x12\"\n\x1a\x65xternal_storage_available\x18= \x01(\x05\x12\x1e\n\x16internal_storage_total\x18> \x01(\x05\x12\"\n\x1ainternal_storage_available\x18? \x01(\x05\x12#\n\x1bgame_disk_storage_available\x18@ \x01(\x05\x12\x1f\n\x17game_disk_storage_total\x18\x41 \x01(\x05\x12%\n\x1d\x65xternal_sdcard_avail_storage\x18\x42 \x01(\x05\x12%\n\x1d\x65xternal_sdcard_total_storage\x18\x43 \x01(\x05\x12\x10\n\x08login_by\x18I \x01(\x05\x12\x14\n\x0clibrary_path\x18J \x01(\t\x12\x12\n\nreg_avatar\x18L \x01(\x05\x12\x15\n\rlibrary_token\x18M \x01(\t\x12\x14\n\x0c\x63hannel_type\x18N \x01(\x05\x12\x10\n\x08\x63pu_type\x18O \x01(\x05\x12\x18\n\x10\x63pu_architecture\x18Q \x01(\t\x12\x1b\n\x13\x63lient_version_code\x18S \x01(\t\x12\x14\n\x0cgraphics_api\x18V \x01(\t\x12\x1d\n\x15supported_astc_bitset\x18W \x01(\r\x12\x1a\n\x12login_open_id_type\x18X \x01(\x05\x12\x18\n\x10\x61nalytics_detail\x18Y \x01(\x0c\x12\x14\n\x0cloading_time\x18\\ \x01(\r\x12\x17\n\x0frelease_channel\x18] \x01(\t\x12\x12\n\nextra_info\x18^ \x01(\t\x12 \n\x18\x61ndroid_engine_init_flag\x18_ \x01(\r\x12\x0f\n\x07if_push\x18\x61 \x01(\x05\x12\x0e\n\x06is_vpn\x18\x62 \x01(\x05\x12\x1c\n\x14origin_platform_type\x18\x63 \x01(\t\x12\x1d\n\x15primary_platform_type\x18\x64 \x01(\t\"5\n\x0cGameSecurity\x12\x0f\n\x07version\x18\x06 \x01(\x05\x12\x14\n\x0chidden_value\x18\x08 \x01(\x04\x62\x06proto3')
18
+
19
+ _globals = globals()
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'MajorLoginReq_pb2', _globals)
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+ DESCRIPTOR._options = None
24
+ _globals['_MAJORLOGIN']._serialized_start=24
25
+ _globals['_MAJORLOGIN']._serialized_end=1426
26
+ _globals['_GAMESECURITY']._serialized_start=1428
27
+ _globals['_GAMESECURITY']._serialized_end=1481
28
+ # @@protoc_insertion_point(module_scope)
Pb2/MajoRLoGinrEs_pb2.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: MajorLoginRes.proto
5
+ # Protobuf Python Version: 6.30.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 30,
16
+ 0,
17
+ '',
18
+ 'MajorLoginRes.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13MajorLoginRes.proto\"|\n\rMajorLoginRes\x12\x13\n\x0b\x61\x63\x63ount_uid\x18\x01 \x01(\x04\x12\x0e\n\x06region\x18\x02 \x01(\t\x12\r\n\x05token\x18\x08 \x01(\t\x12\x0b\n\x03url\x18\n \x01(\t\x12\x11\n\ttimestamp\x18\x15 \x01(\x03\x12\x0b\n\x03key\x18\x16 \x01(\x0c\x12\n\n\x02iv\x18\x17 \x01(\x0c\x62\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'MajorLoginRes_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_MAJORLOGINRES']._serialized_start=23
35
+ _globals['_MAJORLOGINRES']._serialized_end=147
36
+ # @@protoc_insertion_point(module_scope)
Pb2/PorTs_pb2.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: GetLoginDataRes.proto
5
+ # Protobuf Python Version: 6.30.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 30,
16
+ 0,
17
+ '',
18
+ 'GetLoginDataRes.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15GetLoginDataRes.proto\"\xa4\x01\n\x0cGetLoginData\x12\x12\n\nAccountUID\x18\x01 \x01(\x04\x12\x0e\n\x06Region\x18\x03 \x01(\t\x12\x13\n\x0b\x41\x63\x63ountName\x18\x04 \x01(\t\x12\x16\n\x0eOnline_IP_Port\x18\x0e \x01(\t\x12\x0f\n\x07\x43lan_ID\x18\x14 \x01(\x03\x12\x16\n\x0e\x41\x63\x63ountIP_Port\x18 \x01(\t\x12\x1a\n\x12\x43lan_Compiled_Data\x18\x37 \x01(\tb\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'GetLoginDataRes_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_GETLOGINDATA']._serialized_start=26
35
+ _globals['_GETLOGINDATA']._serialized_end=190
36
+ # @@protoc_insertion_point(module_scope)
Pb2/Team_msg_pb2.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: Team_msg.proto
5
+ # Protobuf Python Version: 6.30.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 30,
16
+ 0,
17
+ '',
18
+ 'Team_msg.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eTeam_msg.proto\"\x94\x06\n\x0eGenTeamWhisper\x12\x0c\n\x04type\x18\x01 \x01(\x05\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.GenTeamWhisper.Nested2\x1a\xcc\x05\n\x07Nested2\x12\x0b\n\x03uid\x18\x01 \x01(\x03\x12\x0f\n\x07\x63hat_id\x18\x02 \x01(\x03\x12\x0b\n\x03msg\x18\x04 \x01(\t\x12\x11\n\ttimestamp\x18\x05 \x01(\x03\x12\x11\n\tchat_type\x18\x07 \x01(\x05\x12\r\n\x05title\x18\x08 \x01(\x05\x12/\n\x06\x66ield9\x18\t \x01(\x0b\x32\x1f.GenTeamWhisper.Nested2.Nested9\x12\x10\n\x08language\x18\n \x01(\t\x12\x31\n\x07\x66ield13\x18\r \x01(\x0b\x32 .GenTeamWhisper.Nested2.Nested13\x12\x35\n\x0b\x65mpty_field\x18\x0e \x01(\x0b\x32 .GenTeamWhisper.Nested2.Nested14\x1a\n\n\x08Nested14\x1a\xf2\x02\n\x07Nested9\x12\x10\n\x08Nickname\x18\x01 \x01(\t\x12\x11\n\tavatar_id\x18\x02 \x01(\x03\x12\x0c\n\x04rank\x18\x04 \x01(\x05\x12\r\n\x05\x62\x61\x64ge\x18\x05 \x01(\x05\x12\x11\n\tClan_Name\x18\x08 \x01(\t\x12\x0f\n\x07\x66ield10\x18\n \x01(\x05\x12\x17\n\x0fglobal_rank_pos\x18\x0b \x01(\x05\x12?\n\nbadge_info\x18\r \x01(\x0b\x32+.GenTeamWhisper.Nested2.Nested9.NestedBadge\x12?\n\nprime_info\x18\x0e \x01(\x0b\x32+.GenTeamWhisper.Nested2.Nested9.NestedPrime\x1a\x1c\n\x0bNestedBadge\x12\r\n\x05value\x18\x01 \x01(\x05\x1aH\n\x0bNestedPrime\x12\x11\n\tprime_uid\x18\x01 \x01(\x05\x12\x13\n\x0bprime_level\x18\x02 \x01(\x05\x12\x11\n\tprime_hex\x18\x03 \x01(\t\x1a\x33\n\x08Nested13\x12\x10\n\x08url_type\x18\x02 \x01(\x05\x12\x15\n\rcurl_platform\x18\x03 \x01(\x05\x62\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'Team_msg_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_GENTEAMWHISPER']._serialized_start=19
35
+ _globals['_GENTEAMWHISPER']._serialized_end=807
36
+ _globals['_GENTEAMWHISPER_NESTED2']._serialized_start=91
37
+ _globals['_GENTEAMWHISPER_NESTED2']._serialized_end=807
38
+ _globals['_GENTEAMWHISPER_NESTED2_NESTED14']._serialized_start=371
39
+ _globals['_GENTEAMWHISPER_NESTED2_NESTED14']._serialized_end=381
40
+ _globals['_GENTEAMWHISPER_NESTED2_NESTED9']._serialized_start=384
41
+ _globals['_GENTEAMWHISPER_NESTED2_NESTED9']._serialized_end=754
42
+ _globals['_GENTEAMWHISPER_NESTED2_NESTED9_NESTEDBADGE']._serialized_start=652
43
+ _globals['_GENTEAMWHISPER_NESTED2_NESTED9_NESTEDBADGE']._serialized_end=680
44
+ _globals['_GENTEAMWHISPER_NESTED2_NESTED9_NESTEDPRIME']._serialized_start=682
45
+ _globals['_GENTEAMWHISPER_NESTED2_NESTED9_NESTEDPRIME']._serialized_end=754
46
+ _globals['_GENTEAMWHISPER_NESTED2_NESTED13']._serialized_start=756
47
+ _globals['_GENTEAMWHISPER_NESTED2_NESTED13']._serialized_end=807
48
+ # @@protoc_insertion_point(module_scope)
Pb2/__pycache__/DEcwHisPErMsG_pb2.cpython-311.pyc ADDED
Binary file (2.17 kB). View file
 
Pb2/__pycache__/DEcwHisPErMsG_pb2.cpython-312.pyc ADDED
Binary file (2.06 kB). View file
 
Pb2/__pycache__/DEcwHisPErMsG_pb2.cpython-313.pyc ADDED
Binary file (2.05 kB). View file
 
Pb2/__pycache__/Fo_pb2.cpython-313.pyc ADDED
Binary file (1.29 kB). View file
 
Pb2/__pycache__/MajoRLoGinrEq_pb2.cpython-311.pyc ADDED
Binary file (2.81 kB). View file
 
Pb2/__pycache__/MajoRLoGinrEq_pb2.cpython-312.pyc ADDED
Binary file (2.72 kB). View file
 
Pb2/__pycache__/MajoRLoGinrEq_pb2.cpython-313.pyc ADDED
Binary file (2.71 kB). View file
 
Pb2/__pycache__/MajoRLoGinrEs_pb2.cpython-311.pyc ADDED
Binary file (1.64 kB). View file
 
Pb2/__pycache__/MajoRLoGinrEs_pb2.cpython-312.pyc ADDED
Binary file (1.56 kB). View file
 
Pb2/__pycache__/MajoRLoGinrEs_pb2.cpython-313.pyc ADDED
Binary file (1.56 kB). View file
 
Pb2/__pycache__/PorTs_pb2.cpython-311.pyc ADDED
Binary file (1.68 kB). View file
 
Pb2/__pycache__/PorTs_pb2.cpython-312.pyc ADDED
Binary file (1.6 kB). View file
 
Pb2/__pycache__/PorTs_pb2.cpython-313.pyc ADDED
Binary file (1.59 kB). View file
 
Pb2/__pycache__/Team_msg_pb2.cpython-311.pyc ADDED
Binary file (3.03 kB). View file
 
Pb2/__pycache__/Team_msg_pb2.cpython-312.pyc ADDED
Binary file (2.88 kB). View file
 
Pb2/__pycache__/Team_msg_pb2.cpython-313.pyc ADDED
Binary file (2.87 kB). View file
 
Pb2/__pycache__/sQ_pb2.cpython-311.pyc ADDED
Binary file (1.74 kB). View file
 
Pb2/__pycache__/sQ_pb2.cpython-312.pyc ADDED
Binary file (1.65 kB). View file
 
Pb2/__pycache__/sQ_pb2.cpython-313.pyc ADDED
Binary file (1.65 kB). View file
 
Pb2/sQ_pb2.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: recieved_chat.proto
5
+ # Protobuf Python Version: 6.30.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 30,
16
+ 0,
17
+ '',
18
+ 'recieved_chat.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13recieved_chat.proto\"\x80\x01\n\rrecieved_chat\x12\x13\n\x0bpacket_type\x18\x04 \x01(\x03\x12&\n\x07\x64\x65tails\x18\x05 \x01(\x0b\x32\x15.recieved_chat.nested\x1a\x32\n\x06nested\x12\x12\n\nplayer_uid\x18\x01 \x01(\x03\x12\x14\n\x0cteam_session\x18\x0e \x01(\tb\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'recieved_chat_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_RECIEVED_CHAT']._serialized_start=24
35
+ _globals['_RECIEVED_CHAT']._serialized_end=152
36
+ _globals['_RECIEVED_CHAT_NESTED']._serialized_start=102
37
+ _globals['_RECIEVED_CHAT_NESTED']._serialized_end=152
38
+ # @@protoc_insertion_point(module_scope)
api.py ADDED
@@ -0,0 +1,420 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ============================================
2
+ # PRODUCTION API WITH WEBSOCKET - api.py
3
+ # Real-time team updates, no JSON storage
4
+ # ============================================
5
+
6
+ from flask import Flask, request, jsonify
7
+ from flask_cors import CORS
8
+ from flask_sock import Sock
9
+ import queue
10
+ import json
11
+ import time
12
+
13
+ app = Flask(__name__)
14
+ CORS(app)
15
+ sock = Sock(app)
16
+
17
+ command_queue = queue.Queue()
18
+
19
+ # WebSocket clients list
20
+ websocket_clients = []
21
+
22
+ # ============================================
23
+ # WEBSOCKET - Real-time Team Updates
24
+ # ============================================
25
+
26
+ @sock.route('/ws')
27
+ def websocket(ws):
28
+ """WebSocket connection for real-time updates"""
29
+ print(f"[WS] Client connected")
30
+ websocket_clients.append(ws)
31
+
32
+ try:
33
+ # Send initial team status
34
+ team_status = get_live_team_status()
35
+ ws.send(json.dumps({
36
+ 'type': 'initial',
37
+ 'data': team_status
38
+ }))
39
+
40
+ # Keep connection alive
41
+ while True:
42
+ # Receive messages from client (optional)
43
+ message = ws.receive(timeout=30)
44
+ if message:
45
+ data = json.loads(message)
46
+
47
+ # Handle client requests
48
+ if data.get('type') == 'get_team':
49
+ team_status = get_live_team_status()
50
+ ws.send(json.dumps({
51
+ 'type': 'team_update',
52
+ 'data': team_status
53
+ }))
54
+
55
+ except Exception as e:
56
+ print(f"[WS] Client disconnected: {e}")
57
+
58
+ finally:
59
+ if ws in websocket_clients:
60
+ websocket_clients.remove(ws)
61
+ print(f"[WS] Client removed")
62
+
63
+
64
+ def broadcast_team_update(event_type, data):
65
+ """Broadcast team updates to all connected WebSocket clients"""
66
+
67
+ # DEBUG: Log what we're sending
68
+ if event_type in ['member_joined', 'member_left']:
69
+ player = data.get('player', {})
70
+ print(f"[WS→] {event_type}: {player.get('name')} (UID: {player.get('uid')})")
71
+
72
+ message = json.dumps({
73
+ 'type': event_type,
74
+ 'data': data,
75
+ 'timestamp': time.time()
76
+ }, ensure_ascii=False) # Important for Unicode characters
77
+
78
+ disconnected = []
79
+ sent_count = 0
80
+
81
+ for client in websocket_clients:
82
+ try:
83
+ client.send(message)
84
+ sent_count += 1
85
+ except Exception as e:
86
+ print(f"[WS→] Failed to send to client: {e}")
87
+ disconnected.append(client)
88
+
89
+ if sent_count > 0:
90
+ print(f"[WS→] Sent to {sent_count} client(s)")
91
+
92
+ # Remove disconnected clients
93
+ for client in disconnected:
94
+ if client in websocket_clients:
95
+ websocket_clients.remove(client)
96
+
97
+
98
+ # ============================================
99
+ # JOIN TEAM API
100
+ # ============================================
101
+
102
+ @app.route('/join', methods=['GET', 'POST'])
103
+ def join_team():
104
+ """Join a team using teamcode"""
105
+ try:
106
+ if request.method == 'GET':
107
+ teamcode = request.args.get('teamcode')
108
+ else:
109
+ data = request.get_json(silent=True)
110
+ teamcode = data.get('teamcode') if data else None
111
+
112
+ if not teamcode:
113
+ return jsonify({
114
+ 'success': False,
115
+ 'message': 'teamcode is required'
116
+ }), 400
117
+
118
+ command_queue.put({
119
+ 'type': 'join',
120
+ 'teamcode': teamcode
121
+ })
122
+
123
+ return jsonify({
124
+ 'success': True,
125
+ 'message': 'Join command queued',
126
+ 'teamcode': teamcode
127
+ })
128
+
129
+ except Exception as e:
130
+ return jsonify({
131
+ 'success': False,
132
+ 'message': str(e)
133
+ }), 500
134
+
135
+
136
+ # ============================================
137
+ # EMOTE API
138
+ # ============================================
139
+
140
+ @app.route('/emote', methods=['POST'])
141
+ def send_emote():
142
+ """Send emote to players (bot must be in team)"""
143
+ try:
144
+ data = request.get_json(silent=True)
145
+ if not data:
146
+ return jsonify({
147
+ 'success': False,
148
+ 'message': 'JSON body required'
149
+ }), 400
150
+
151
+ uids = data.get('uids')
152
+ emote_code = data.get('emote_code')
153
+
154
+ if not emote_code:
155
+ return jsonify({
156
+ 'success': False,
157
+ 'message': 'emote_code is required'
158
+ }), 400
159
+
160
+ if not isinstance(uids, list) or len(uids) == 0:
161
+ return jsonify({
162
+ 'success': False,
163
+ 'message': 'uids must be a non-empty array'
164
+ }), 400
165
+
166
+ if len(uids) > 5:
167
+ return jsonify({
168
+ 'success': False,
169
+ 'message': 'Maximum 5 UIDs allowed per request'
170
+ }), 400
171
+
172
+ # Check if bot is in team (LIVE CHECK)
173
+ team_status = get_live_team_status()
174
+ if not team_status['in_team']:
175
+ return jsonify({
176
+ 'success': False,
177
+ 'message': 'Bot is not in any team. Join a team first.',
178
+ 'in_team': False
179
+ }), 400
180
+
181
+ # Queue emote command
182
+ command_queue.put({
183
+ 'type': 'emote',
184
+ 'uids': uids,
185
+ 'emote_code': emote_code
186
+ })
187
+
188
+ return jsonify({
189
+ 'success': True,
190
+ 'message': f'Emote queued for {len(uids)} player(s)',
191
+ 'uids': uids,
192
+ 'emote_code': emote_code,
193
+ 'in_team': True
194
+ })
195
+
196
+ except Exception as e:
197
+ return jsonify({
198
+ 'success': False,
199
+ 'message': str(e)
200
+ }), 500
201
+
202
+
203
+ # ============================================
204
+ # EMOTE ALL TEAM MEMBERS
205
+ # ============================================
206
+
207
+ @app.route('/emote/team', methods=['POST'])
208
+ def emote_team():
209
+ """Send emote to all team members"""
210
+ try:
211
+ data = request.get_json(silent=True)
212
+ if not data:
213
+ return jsonify({
214
+ 'success': False,
215
+ 'message': 'JSON body required'
216
+ }), 400
217
+
218
+ emote_code = data.get('emote_code')
219
+
220
+ if not emote_code:
221
+ return jsonify({
222
+ 'success': False,
223
+ 'message': 'emote_code is required'
224
+ }), 400
225
+
226
+ # Get LIVE team status
227
+ team_status = get_live_team_status()
228
+ if not team_status['in_team']:
229
+ return jsonify({
230
+ 'success': False,
231
+ 'message': 'Bot is not in any team',
232
+ 'in_team': False
233
+ }), 400
234
+
235
+ if not team_status.get('members'):
236
+ return jsonify({
237
+ 'success': False,
238
+ 'message': 'No team members found',
239
+ 'in_team': True
240
+ }), 400
241
+
242
+ uids = [m['uid'] for m in team_status['members']]
243
+
244
+ # Queue emote for all members
245
+ command_queue.put({
246
+ 'type': 'emote',
247
+ 'uids': uids,
248
+ 'emote_code': emote_code
249
+ })
250
+
251
+ return jsonify({
252
+ 'success': True,
253
+ 'message': f'Emote queued for all {len(uids)} team members',
254
+ 'uids': uids,
255
+ 'emote_code': emote_code,
256
+ 'team_size': len(uids)
257
+ })
258
+
259
+ except Exception as e:
260
+ return jsonify({
261
+ 'success': False,
262
+ 'message': str(e)
263
+ }), 500
264
+
265
+
266
+ # ============================================
267
+ # GET TEAM MEMBERS - LIVE DATA
268
+ # ============================================
269
+
270
+ @app.route('/team/members', methods=['GET'])
271
+ def get_team_members():
272
+ """Get current team members - LIVE from memory, not JSON"""
273
+ try:
274
+ team_status = get_live_team_status()
275
+
276
+ # Bot is NOT in team
277
+ if not team_status['in_team']:
278
+ return jsonify({
279
+ 'success': False,
280
+ 'message': 'Bot is not in any team',
281
+ 'in_team': False,
282
+ 'members': [],
283
+ 'total_members': 0
284
+ })
285
+
286
+ # Bot IS in team - return LIVE data
287
+ return jsonify({
288
+ 'success': True,
289
+ 'message': 'Team members retrieved',
290
+ 'in_team': True,
291
+ 'total_members': team_status['total_members'],
292
+ 'leader_uid': team_status['leader_uid'],
293
+ 'members': team_status['members']
294
+ })
295
+
296
+ except Exception as e:
297
+ return jsonify({
298
+ 'success': False,
299
+ 'message': str(e)
300
+ }), 500
301
+
302
+
303
+ # ============================================
304
+ # BOT STATUS
305
+ # ============================================
306
+
307
+ @app.route('/status', methods=['GET'])
308
+ def bot_status():
309
+ """Get bot connection status"""
310
+ try:
311
+ from main import online_writer, whisper_writer, key, iv, region
312
+
313
+ connections = {
314
+ 'online': online_writer is not None,
315
+ 'chat': whisper_writer is not None,
316
+ 'authenticated': key is not None and iv is not None,
317
+ 'region': region
318
+ }
319
+
320
+ team_status = get_live_team_status()
321
+
322
+ return jsonify({
323
+ 'success': True,
324
+ 'bot_online': connections['online'] and connections['chat'],
325
+ 'connections': connections,
326
+ 'team': team_status,
327
+ 'queue_size': command_queue.qsize(),
328
+ 'ws_clients': len(websocket_clients)
329
+ })
330
+
331
+ except ImportError:
332
+ return jsonify({
333
+ 'success': False,
334
+ 'message': 'Bot not running',
335
+ 'bot_online': False
336
+ }), 503
337
+
338
+
339
+ # ============================================
340
+ # HOME / API INFO
341
+ # ============================================
342
+
343
+ @app.route('/', methods=['GET'])
344
+ def home():
345
+ """API documentation"""
346
+ return jsonify({
347
+ 'name': 'FF Emote Bot API',
348
+ 'version': '2.0',
349
+ 'status': 'online',
350
+ 'websocket': 'ws://host:5000/ws',
351
+ 'endpoints': {
352
+ 'POST /join': 'Join team - Body: {"teamcode": "ABC123"}',
353
+ 'POST /emote': 'Send emote - Body: {"uids": ["123"], "emote_code": "909000001"}',
354
+ 'POST /emote/team': 'Emote all team - Body: {"emote_code": "909000001"}',
355
+ 'GET /team/members': 'Get team members (LIVE)',
356
+ 'GET /status': 'Bot status',
357
+ 'WS /ws': 'WebSocket for real-time updates'
358
+ }
359
+ })
360
+
361
+
362
+ # ============================================
363
+ # HELPER FUNCTIONS - LIVE DATA FROM MEMORY
364
+ # ============================================
365
+
366
+ def get_live_team_status():
367
+ """Get LIVE team status from bot memory (not JSON file)"""
368
+ try:
369
+ from main import team_collection_active, team_members_data, current_team_leader
370
+
371
+ # Check if bot is actually in a team RIGHT NOW
372
+ in_team = team_collection_active and len(team_members_data) > 0
373
+
374
+ if not in_team:
375
+ return {
376
+ 'in_team': False,
377
+ 'total_members': 0,
378
+ 'leader_uid': None,
379
+ 'members': []
380
+ }
381
+
382
+ return {
383
+ 'in_team': True,
384
+ 'total_members': len(team_members_data),
385
+ 'leader_uid': str(current_team_leader) if current_team_leader else None,
386
+ 'members': team_members_data
387
+ }
388
+ except:
389
+ return {
390
+ 'in_team': False,
391
+ 'total_members': 0,
392
+ 'leader_uid': None,
393
+ 'members': []
394
+ }
395
+
396
+
397
+ # ============================================
398
+ # RUN SERVER
399
+ # ============================================
400
+
401
+ if __name__ == '__main__':
402
+ print("""
403
+ ╔══════════════════════════════════════════════╗
404
+ ║ FF Emote Bot API - Production v2.0 ║
405
+ ║ with WebSocket Support ║
406
+ ╚══════════════════════════════════════════════╝
407
+
408
+ 📡 HTTP API: http://0.0.0.0:5000
409
+ 🔌 WebSocket: ws://0.0.0.0:5000/ws
410
+
411
+ Endpoints:
412
+ • POST /join - Join team
413
+ • POST /emote - Send emote (requires team)
414
+ • POST /emote/team - Emote all team members
415
+ • GET /team/members - Get team info (LIVE)
416
+ • GET /status - Bot status
417
+ • WS /ws - Real-time updates
418
+
419
+ """)
420
+ app.run(host='0.0.0.0', port=7860, debug=False)
bot_with_api.py ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ============================================
2
+ # PRODUCTION BOT WITH API - bot_with_api.py
3
+ # Clean command processing, no excess logs
4
+ # ============================================
5
+
6
+ import asyncio
7
+ import threading
8
+ from api import app, command_queue
9
+ import sys
10
+
11
+ # ============================================
12
+ # COMMAND PROCESSOR - Clean & Efficient
13
+ # ============================================
14
+
15
+ async def process_api_commands():
16
+ """Process commands from API queue - production version"""
17
+ while True:
18
+ try:
19
+ if not command_queue.empty():
20
+ command = command_queue.get_nowait()
21
+
22
+ if command['type'] == 'join':
23
+ await handle_join(command)
24
+
25
+ elif command['type'] == 'emote':
26
+ await handle_emote(command)
27
+
28
+ await asyncio.sleep(0.1)
29
+
30
+ except Exception as e:
31
+ print(f"[API ERROR] {e}")
32
+ await asyncio.sleep(1)
33
+
34
+
35
+ # ============================================
36
+ # JOIN HANDLER
37
+ # ============================================
38
+
39
+ async def handle_join(command):
40
+ """Handle join team command"""
41
+ teamcode = command['teamcode']
42
+
43
+ try:
44
+ from main import online_writer, key, iv
45
+ from xC4 import GenJoinSquadsPacket
46
+
47
+ if not online_writer:
48
+ print(f"[JOIN] Failed - Bot not connected")
49
+ return
50
+
51
+ if not key or not iv:
52
+ print(f"[JOIN] Failed - No encryption keys")
53
+ return
54
+
55
+ packet = await GenJoinSquadsPacket(teamcode, key, iv)
56
+ online_writer.write(packet)
57
+ await online_writer.drain()
58
+
59
+ print(f"[JOIN] ✓ Team: {teamcode}")
60
+
61
+ except Exception as e:
62
+ print(f"[JOIN] ✗ Error: {e}")
63
+
64
+
65
+ # ============================================
66
+ # EMOTE HANDLER - Only works if in team
67
+ # ============================================
68
+
69
+ async def handle_emote(command):
70
+ """Handle emote command - checks team status first"""
71
+ uids = command['uids']
72
+ emote_code = command['emote_code']
73
+
74
+ try:
75
+ from main import online_writer, key, iv, region, team_collection_active, team_members_data
76
+ from xC4 import Emote_k
77
+
78
+ # Check if bot is in team
79
+ if not team_collection_active or len(team_members_data) == 0:
80
+ print(f"[EMOTE] ✗ Bot not in team - Skipped")
81
+ return
82
+
83
+ if not online_writer or not key or not iv or not region:
84
+ print(f"[EMOTE] ✗ Bot not ready")
85
+ return
86
+
87
+ success = 0
88
+ failed = 0
89
+
90
+ for uid in uids:
91
+ try:
92
+ packet = await Emote_k(
93
+ int(uid),
94
+ int(emote_code),
95
+ key,
96
+ iv,
97
+ region
98
+ )
99
+
100
+ online_writer.write(packet)
101
+ await online_writer.drain()
102
+ success += 1
103
+
104
+ await asyncio.sleep(0.3) # Rate limit
105
+
106
+ except Exception as e:
107
+ failed += 1
108
+
109
+ if success > 0:
110
+ print(f"[EMOTE] ✓ Sent: {success}/{len(uids)} | Code: {emote_code}")
111
+ if failed > 0:
112
+ print(f"[EMOTE] ✗ Failed: {failed}")
113
+
114
+ except Exception as e:
115
+ print(f"[EMOTE] ✗ Error: {e}")
116
+
117
+
118
+ # ============================================
119
+ # FLASK SERVER THREAD
120
+ # ============================================
121
+
122
+ def run_flask():
123
+ """Run Flask in separate thread"""
124
+ app.run(host='0.0.0.0', port=7860, debug=False, use_reloader=False)
125
+
126
+
127
+ # ============================================
128
+ # MAIN RUNNER
129
+ # ============================================
130
+
131
+ async def run_bot_with_api():
132
+ """Main function - runs bot + API together"""
133
+
134
+ # Start Flask API
135
+ flask_thread = threading.Thread(target=run_flask, daemon=True)
136
+ flask_thread.start()
137
+ print("[API] Started on http://0.0.0.0:5000")
138
+
139
+ # Start command processor
140
+ api_processor = asyncio.create_task(process_api_commands())
141
+
142
+ # Start main bot
143
+ try:
144
+ from main import StarTinG
145
+
146
+ print("[BOT] Starting...")
147
+ bot_task = asyncio.create_task(StarTinG())
148
+
149
+ await asyncio.gather(api_processor, bot_task)
150
+
151
+ except ImportError as e:
152
+ print(f"[ERROR] Could not import bot: {e}")
153
+ print("[API] Running in API-only mode...")
154
+ await api_processor
155
+
156
+
157
+ # ============================================
158
+ # ENTRY POINT
159
+ # ============================================
160
+
161
+ if __name__ == '__main__':
162
+ print("""
163
+ ╔══════════════════════════════════════════════╗
164
+ ║ FF Emote Bot - Production Mode ║
165
+ ╚══════════���═══════════════════════════════════╝
166
+
167
+ Starting services...
168
+ """)
169
+
170
+ try:
171
+ asyncio.run(run_bot_with_api())
172
+ except KeyboardInterrupt:
173
+ print("\n[SHUTDOWN] Stopping...")
174
+ sys.exit(0)
main.py ADDED
@@ -0,0 +1,869 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests , os , psutil , sys , jwt , pickle , json , binascii , time , urllib3 , base64 , datetime , re , socket , threading , ssl , pytz , aiohttp
2
+ from protobuf_decoder.protobuf_decoder import Parser
3
+ from xC4 import * ; from xHeaders import *
4
+ from datetime import datetime
5
+ from google.protobuf.timestamp_pb2 import Timestamp
6
+ from concurrent.futures import ThreadPoolExecutor
7
+ from threading import Thread
8
+ from Pb2 import DEcwHisPErMsG_pb2 , MajoRLoGinrEs_pb2 , PorTs_pb2 , MajoRLoGinrEq_pb2 , sQ_pb2 , Team_msg_pb2
9
+ from cfonts import render, say
10
+
11
+
12
+ #EMOTES BY MatrixCoder
13
+
14
+ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
15
+
16
+ # Global variables for API access - FILE START में
17
+ online_writer = None
18
+ whisper_writer = None
19
+ key = None
20
+ iv = None
21
+ region = None
22
+
23
+ # बाकी सब कुछ वैसा ही रहने दें...
24
+
25
+ # ... rest of your existing global variables
26
+ spam_room = False
27
+ spammer_uid = None
28
+ spam_chat_id = None
29
+ spam_uid = None
30
+ Spy = False
31
+ Chat_Leave = False
32
+
33
+ # Add to main.py at top with other globals:
34
+ team_members_data = []
35
+ team_history = []
36
+ current_team_leader = None
37
+ team_collection_active = False
38
+ last_member_update = None
39
+ previous_team_state = set()
40
+ previous_team_uids = set() # Track previous state
41
+ ####################################
42
+
43
+
44
+ Hr = {
45
+ 'User-Agent': "Dalvik/2.1.0 (Linux; U; Android 11; ASUS_Z01QD Build/PI)",
46
+ 'Connection': "Keep-Alive",
47
+ 'Accept-Encoding': "gzip",
48
+ 'Content-Type': "application/x-www-form-urlencoded",
49
+ 'Expect': "100-continue",
50
+ 'X-Unity-Version': "2018.4.11f1",
51
+ 'X-GA': "v1 1",
52
+ 'ReleaseVersion': "OB52"}
53
+
54
+ def get_random_color():
55
+ colors = [
56
+ "[FF0000]", "[00FF00]", "[0000FF]", "[FFFF00]", "[FF00FF]", "[00FFFF]", "[FFFFFF]", "[FFA500]",
57
+ "[A52A2A]", "[800080]", "[000000]", "[808080]", "[C0C0C0]", "[FFC0CB]", "[FFD700]", "[ADD8E6]",
58
+ "[90EE90]", "[D2691E]", "[DC143C]", "[00CED1]", "[9400D3]", "[F08080]", "[20B2AA]", "[FF1493]",
59
+ "[7CFC00]", "[B22222]", "[FF4500]", "[DAA520]", "[00BFFF]", "[00FF7F]", "[4682B4]", "[6495ED]",
60
+ "[5F9EA0]", "[DDA0DD]", "[E6E6FA]", "[B0C4DE]", "[556B2F]", "[8FBC8F]", "[2E8B57]", "[3CB371]",
61
+ "[6B8E23]", "[808000]", "[B8860B]", "[CD5C5C]", "[8B0000]", "[FF6347]", "[FF8C00]", "[BDB76B]",
62
+ "[9932CC]", "[8A2BE2]", "[4B0082]", "[6A5ACD]", "[7B68EE]", "[4169E1]", "[1E90FF]", "[191970]",
63
+ "[00008B]", "[000080]", "[008080]", "[008B8B]", "[B0E0E6]", "[AFEEEE]", "[E0FFFF]", "[F5F5DC]",
64
+ "[FAEBD7]"
65
+ ]
66
+ return random.choice(colors)
67
+ #
68
+
69
+
70
+
71
+ # ============================================
72
+ # BROADCAST FUNCTION - WebSocket Updates
73
+ # ============================================
74
+
75
+ def broadcast_team_change(event_type, team_data):
76
+ """Broadcast team changes to WebSocket clients with data validation"""
77
+ try:
78
+ # Validate data before sending
79
+ if event_type in ['member_joined', 'member_left']:
80
+ player = team_data.get('player', {})
81
+
82
+ # Ensure all required fields exist
83
+ validated_player = {
84
+ 'uid': str(player.get('uid', 'unknown')),
85
+ 'name': player.get('name', 'Unknown'),
86
+ 'region': player.get('region', 'UNK'),
87
+ 'level': int(player.get('level', 0)),
88
+ 'character': str(player.get('character', 'Unknown')),
89
+ 'position': player.get('position', 'Member')
90
+ }
91
+
92
+ team_data['player'] = validated_player
93
+
94
+ # Debug log
95
+ print(f"[WS-PREP] {event_type}: {validated_player['name']} (Level {validated_player['level']})")
96
+
97
+ from api import broadcast_team_update
98
+ broadcast_team_update(event_type, team_data)
99
+ except Exception as e:
100
+ print(f"[WS-ERROR] Failed to broadcast: {e}")
101
+
102
+
103
+ # ============================================
104
+ # TEAM COLLECTION WITH STATE MANAGEMENT
105
+ # ============================================
106
+
107
+ async def collect_team_members_dynamic(packet_type, parsed_data):
108
+ """Team collection with proper state management and WebSocket broadcasting"""
109
+ global team_members_data, current_team_leader, team_collection_active
110
+ global last_member_update, previous_team_uids
111
+
112
+ try:
113
+ if packet_type != '0500_LARGE':
114
+ return False
115
+
116
+ new_members = []
117
+
118
+ # Leader detection
119
+ if '1' in parsed_data and parsed_data['1'].get('data'):
120
+ leader_uid = parsed_data['1']['data']
121
+ if leader_uid != current_team_leader:
122
+ current_team_leader = leader_uid
123
+
124
+ leader_info = await extract_complete_player_info(parsed_data, leader_uid, "Leader")
125
+ if leader_info and leader_info['name'] != "Player_Unknown":
126
+ if not any(m['uid'] == str(leader_uid) for m in new_members):
127
+ new_members.append(leader_info)
128
+
129
+ # Deep scan
130
+ deep_players = await deep_scan_for_players(parsed_data)
131
+ for player in deep_players:
132
+ if not any(m['uid'] == player['uid'] for m in new_members):
133
+ new_members.append(player)
134
+
135
+ # Field structures
136
+ if '5' in parsed_data and 'data' in parsed_data['5']:
137
+ squad_data = parsed_data['5']['data']
138
+ field6_players = await extract_from_field_structure_fixed(squad_data)
139
+ for player in field6_players:
140
+ if not any(m['uid'] == player['uid'] for m in new_members):
141
+ new_members.append(player)
142
+
143
+ # Nested
144
+ if '3' in squad_data and 'data' in squad_data['3']:
145
+ nested_data = squad_data['3']['data']
146
+ nested_players = await extract_from_field_structure_fixed(nested_data)
147
+ for player in nested_players:
148
+ if not any(m['uid'] == player['uid'] for m in new_members):
149
+ new_members.append(player)
150
+
151
+ # ========== STATE CHANGE DETECTION ==========
152
+ current_uids = set(m['uid'] for m in new_members)
153
+
154
+ # Detect JOINED players
155
+ joined = current_uids - previous_team_uids
156
+ if joined:
157
+ for uid in joined:
158
+ player = next((m for m in new_members if m['uid'] == uid), None)
159
+ if player:
160
+ print(f"[TEAM] + {player['name']} joined")
161
+
162
+ # Broadcast join event with COMPLETE data
163
+ broadcast_team_change('member_joined', {
164
+ 'player': {
165
+ 'uid': player['uid'],
166
+ 'name': player['name'],
167
+ 'region': player['region'],
168
+ 'level': player['level'],
169
+ 'character': player.get('character', 'Unknown'),
170
+ 'position': player['position']
171
+ },
172
+ 'total_members': len(current_uids)
173
+ })
174
+
175
+ # Detect LEFT/KICKED players
176
+ left = previous_team_uids - current_uids
177
+ if left:
178
+ for uid in left:
179
+ old_player = next((m for m in team_members_data if m['uid'] == uid), None)
180
+ if old_player:
181
+ print(f"[TEAM] - {old_player['name']} left")
182
+
183
+ # Broadcast leave event with COMPLETE data
184
+ broadcast_team_change('member_left', {
185
+ 'player': {
186
+ 'uid': old_player['uid'],
187
+ 'name': old_player['name'],
188
+ 'region': old_player['region'],
189
+ 'level': old_player['level'],
190
+ 'character': old_player.get('character', 'Unknown'),
191
+ 'position': old_player['position']
192
+ },
193
+ 'total_members': len(current_uids)
194
+ })
195
+
196
+ # Update global state with ONLY current members
197
+ team_members_data.clear()
198
+ team_members_data.extend(new_members)
199
+ previous_team_uids = current_uids
200
+
201
+ # Update team status
202
+ if len(new_members) > 0:
203
+ if not team_collection_active:
204
+ print(f"[TEAM] ✓ Joined team ({len(new_members)} members)")
205
+
206
+ # Broadcast team joined with COMPLETE member data
207
+ broadcast_team_change('team_joined', {
208
+ 'in_team': True,
209
+ 'total_members': len(new_members),
210
+ 'leader_uid': str(current_team_leader) if current_team_leader else None,
211
+ 'members': [
212
+ {
213
+ 'uid': m['uid'],
214
+ 'name': m['name'],
215
+ 'region': m['region'],
216
+ 'level': m['level'],
217
+ 'character': m.get('character', 'Unknown'),
218
+ 'position': m['position']
219
+ }
220
+ for m in new_members
221
+ ]
222
+ })
223
+
224
+ team_collection_active = True
225
+ last_member_update = datetime.now()
226
+ return True
227
+ else:
228
+ # No members found - bot left team
229
+ if team_collection_active:
230
+ print(f"[TEAM] ✗ Left team")
231
+
232
+ # Broadcast team left
233
+ broadcast_team_change('team_left', {
234
+ 'in_team': False,
235
+ 'total_members': 0,
236
+ 'members': []
237
+ })
238
+
239
+ team_collection_active = False
240
+ team_members_data.clear()
241
+ previous_team_uids.clear()
242
+ current_team_leader = None
243
+
244
+ return False
245
+
246
+ except:
247
+ return False
248
+
249
+
250
+ async def extract_complete_player_info(parsed_data, uid, position="Member"):
251
+ """Extract player info - Better name detection"""
252
+ try:
253
+ player_info = {
254
+ 'uid': str(uid),
255
+ 'name': None, # Will be set below
256
+ 'region': 'UNK',
257
+ 'level': 0,
258
+ 'position': position,
259
+ 'character': 'Unknown',
260
+ 'timestamp': datetime.now().isoformat()
261
+ }
262
+
263
+ def find_player_details(obj, target_uid, depth=0):
264
+ if depth > 5:
265
+ return None
266
+
267
+ if isinstance(obj, dict):
268
+ if ('1' in obj and obj['1'].get('data') == target_uid):
269
+ details = {}
270
+
271
+ if '2' in obj and isinstance(obj['2'].get('data'), str):
272
+ name = obj['2']['data']
273
+ if name and len(name) > 1 and not name.isdigit():
274
+ details['name'] = name
275
+
276
+ if '3' in obj and isinstance(obj['3'].get('data'), str):
277
+ details['region'] = obj['3']['data']
278
+
279
+ if '5' in obj and isinstance(obj['5'].get('data'), int):
280
+ details['level'] = obj['5']['data']
281
+
282
+ if '6' in obj and isinstance(obj['6'].get('data'), (int, str)):
283
+ details['character'] = str(obj['6']['data'])
284
+
285
+ return details
286
+
287
+ for key, value in obj.items():
288
+ if isinstance(value, dict):
289
+ result = find_player_details(value, target_uid, depth+1)
290
+ if result:
291
+ return result
292
+ elif isinstance(value, list):
293
+ for item in value:
294
+ if isinstance(item, dict):
295
+ result = find_player_details(item, target_uid, depth+1)
296
+ if result:
297
+ return result
298
+ return None
299
+
300
+ details = find_player_details(parsed_data, uid)
301
+ if details:
302
+ player_info.update(details)
303
+
304
+ # If still no name found, use UID as fallback
305
+ if not player_info['name']:
306
+ player_info['name'] = f"Player_{uid}"
307
+
308
+ return player_info
309
+
310
+ except:
311
+ return None
312
+
313
+
314
+ async def deep_scan_for_players(data, path="", depth=0):
315
+ """Scan for players"""
316
+ players = []
317
+
318
+ if depth > 6:
319
+ return players
320
+
321
+ if isinstance(data, dict):
322
+ if ('1' in data and '2' in data and
323
+ isinstance(data['1'].get('data'), (int, str)) and
324
+ isinstance(data['2'].get('data'), str)):
325
+
326
+ uid = data['1']['data']
327
+ name = data['2']['data']
328
+
329
+ if (name and
330
+ name != "Player_Unknown" and
331
+ not name.startswith("Player_") and
332
+ not name.isdigit() and
333
+ len(name) > 1):
334
+
335
+ player = {
336
+ 'uid': str(uid),
337
+ 'name': name,
338
+ 'region': data['3']['data'] if '3' in data and isinstance(data['3'].get('data'), str) else 'UNK',
339
+ 'level': data['5']['data'] if '5' in data and isinstance(data['5'].get('data'), int) else 0,
340
+ 'character': str(data['6']['data']) if '6' in data and isinstance(data['6'].get('data'), (int, str)) else 'Unknown',
341
+ 'position': 'Leader' if str(uid) == str(current_team_leader) else 'Member',
342
+ 'timestamp': datetime.now().isoformat()
343
+ }
344
+ players.append(player)
345
+
346
+ for key, value in data.items():
347
+ if isinstance(value, (dict, list)):
348
+ nested_players = await deep_scan_for_players(value, f"{path}.{key}", depth+1)
349
+ players.extend(nested_players)
350
+
351
+ elif isinstance(data, list):
352
+ for item in data:
353
+ if isinstance(item, (dict, list)):
354
+ nested_players = await deep_scan_for_players(item, f"{path}[]", depth+1)
355
+ players.extend(nested_players)
356
+
357
+ return players
358
+
359
+
360
+ async def extract_from_field_structure_fixed(squad_data):
361
+ """Extract from field structure"""
362
+ players = []
363
+
364
+ try:
365
+ if '6' in squad_data and 'data' in squad_data['6']:
366
+ player_data = squad_data['6']['data']
367
+ if isinstance(player_data, dict) and '1' in player_data and '2' in player_data:
368
+ uid = player_data['1'].get('data')
369
+ name = player_data['2'].get('data')
370
+
371
+ if uid and isinstance(name, str) and len(name) > 1 and not name.isdigit():
372
+ player = {
373
+ 'uid': str(uid),
374
+ 'name': name,
375
+ 'region': player_data['3']['data'] if '3' in player_data and isinstance(player_data['3'].get('data'), str) else 'UNK',
376
+ 'level': player_data['5']['data'] if '5' in player_data and isinstance(player_data['5'].get('data'), int) else 0,
377
+ 'character': str(player_data['6']['data']) if '6' in player_data and isinstance(player_data['6'].get('data'), (int, str)) else 'Unknown',
378
+ 'position': 'Leader' if str(uid) == str(current_team_leader) else 'Member',
379
+ 'timestamp': datetime.now().isoformat()
380
+ }
381
+ players.append(player)
382
+
383
+ for pos in ['1', '2', '3', '4', '7', '8']:
384
+ if pos in squad_data and 'data' in squad_data[pos]:
385
+ player_data = squad_data[pos]['data']
386
+ if isinstance(player_data, dict) and '1' in player_data and '2' in player_data:
387
+ uid = player_data['1'].get('data')
388
+ name = player_data['2'].get('data')
389
+
390
+ if uid and isinstance(name, str) and len(name) > 1 and not name.isdigit():
391
+ player = {
392
+ 'uid': str(uid),
393
+ 'name': name,
394
+ 'region': player_data['3']['data'] if '3' in player_data and isinstance(player_data['3'].get('data'), str) else 'UNK',
395
+ 'level': player_data['5']['data'] if '5' in player_data and isinstance(player_data['5'].get('data'), int) else 0,
396
+ 'character': str(player_data['6']['data']) if '6' in player_data and isinstance(player_data['6'].get('data'), (int, str)) else 'Unknown',
397
+ 'position': 'Leader' if str(uid) == str(current_team_leader) else 'Member',
398
+ 'timestamp': datetime.now().isoformat()
399
+ }
400
+ players.append(player)
401
+
402
+ except:
403
+ pass
404
+
405
+ return players
406
+
407
+
408
+
409
+ async def encrypted_proto(encoded_hex):
410
+ key = b'Yg&tc%DEuh6%Zc^8'
411
+ iv = b'6oyZDr22E3ychjM%'
412
+ cipher = AES.new(key, AES.MODE_CBC, iv)
413
+ padded_message = pad(encoded_hex, AES.block_size)
414
+ encrypted_payload = cipher.encrypt(padded_message)
415
+ return encrypted_payload
416
+
417
+ async def GeNeRaTeAccEss(uid , password):
418
+ url = "https://100067.connect.garena.com/oauth/guest/token/grant"
419
+ headers = {
420
+ "Host": "100067.connect.garena.com",
421
+ "User-Agent": (await Ua()),
422
+ "Content-Type": "application/x-www-form-urlencoded",
423
+ "Accept-Encoding": "gzip, deflate, br",
424
+ "Connection": "close"}
425
+ data = {
426
+ "uid": uid,
427
+ "password": password,
428
+ "response_type": "token",
429
+ "client_type": "2",
430
+ "client_secret": "2ee44819e9b4598845141067b281621874d0d5d7af9d8f7e00c1e54715b7d1e3",
431
+ "client_id": "100067"}
432
+ async with aiohttp.ClientSession() as session:
433
+ async with session.post(url, headers=Hr, data=data) as response:
434
+ if response.status != 200: return "Failed to get access token"
435
+ data = await response.json()
436
+ open_id = data.get("open_id")
437
+ access_token = data.get("access_token")
438
+ return (open_id, access_token) if open_id and access_token else (None, None)
439
+
440
+ async def EncRypTMajoRLoGin(open_id, access_token):
441
+ major_login = MajoRLoGinrEq_pb2.MajorLogin()
442
+ major_login.event_time = str(datetime.now())[:-7]
443
+ major_login.game_name = "free fire"
444
+ major_login.platform_id = 1
445
+ major_login.client_version = "1.120.2"
446
+ major_login.system_software = "Android OS 9 / API-28 (PQ3B.190801.10101846/G9650ZHU2ARC6)"
447
+ major_login.system_hardware = "Handheld"
448
+ major_login.telecom_operator = "Verizon"
449
+ major_login.network_type = "WIFI"
450
+ major_login.screen_width = 1920
451
+ major_login.screen_height = 1080
452
+ major_login.screen_dpi = "280"
453
+ major_login.processor_details = "ARM64 FP ASIMD AES VMH | 2865 | 4"
454
+ major_login.memory = 3003
455
+ major_login.gpu_renderer = "Adreno (TM) 640"
456
+ major_login.gpu_version = "OpenGL ES 3.1 v1.46"
457
+ major_login.unique_device_id = "Google|34a7dcdf-a7d5-4cb6-8d7e-3b0e448a0c57"
458
+ major_login.client_ip = "223.191.51.89"
459
+ major_login.language = "en"
460
+ major_login.open_id = open_id
461
+ major_login.open_id_type = "4"
462
+ major_login.device_type = "Handheld"
463
+ memory_available = major_login.memory_available
464
+ memory_available.version = 55
465
+ memory_available.hidden_value = 81
466
+ major_login.access_token = access_token
467
+ major_login.platform_sdk_id = 1
468
+ major_login.network_operator_a = "Verizon"
469
+ major_login.network_type_a = "WIFI"
470
+ major_login.client_using_version = "7428b253defc164018c604a1ebbfebdf"
471
+ major_login.external_storage_total = 36235
472
+ major_login.external_storage_available = 31335
473
+ major_login.internal_storage_total = 2519
474
+ major_login.internal_storage_available = 703
475
+ major_login.game_disk_storage_available = 25010
476
+ major_login.game_disk_storage_total = 26628
477
+ major_login.external_sdcard_avail_storage = 32992
478
+ major_login.external_sdcard_total_storage = 36235
479
+ major_login.login_by = 3
480
+ major_login.library_path = "/data/app/com.dts.freefireth-YPKM8jHEwAJlhpmhDhv5MQ==/lib/arm64"
481
+ major_login.reg_avatar = 1
482
+ major_login.library_token = "5b892aaabd688e571f688053118a162b|/data/app/com.dts.freefireth-YPKM8jHEwAJlhpmhDhv5MQ==/base.apk"
483
+ major_login.channel_type = 3
484
+ major_login.cpu_type = 2
485
+ major_login.cpu_architecture = "64"
486
+ major_login.client_version_code = "2019116753"
487
+ major_login.graphics_api = "OpenGLES2"
488
+ major_login.supported_astc_bitset = 16383
489
+ major_login.login_open_id_type = 4
490
+ major_login.analytics_detail = b"FwQVTgUPX1UaUllDDwcWCRBpWAUOUgsvA1snWlBaO1kFYg=="
491
+ major_login.loading_time = 13564
492
+ major_login.release_channel = "android"
493
+ major_login.extra_info = "KqsHTymw5/5GB23YGniUYN2/q47GATrq7eFeRatf0NkwLKEMQ0PK5BKEk72dPflAxUlEBir6Vtey83XqF593qsl8hwY="
494
+ major_login.android_engine_init_flag = 110009
495
+ major_login.if_push = 1
496
+ major_login.is_vpn = 1
497
+ major_login.origin_platform_type = "4"
498
+ major_login.primary_platform_type = "4"
499
+ string = major_login.SerializeToString()
500
+ return await encrypted_proto(string)
501
+
502
+ async def MajorLogin(payload):
503
+ url = "https://loginbp.ggblueshark.com/MajorLogin"
504
+ ssl_context = ssl.create_default_context()
505
+ ssl_context.check_hostname = False
506
+ ssl_context.verify_mode = ssl.CERT_NONE
507
+ async with aiohttp.ClientSession() as session:
508
+ async with session.post(url, data=payload, headers=Hr, ssl=ssl_context) as response:
509
+ if response.status == 200: return await response.read()
510
+ return None
511
+
512
+ async def GetLoginData(base_url, payload, token):
513
+ url = f"{base_url}/GetLoginData"
514
+ ssl_context = ssl.create_default_context()
515
+ ssl_context.check_hostname = False
516
+ ssl_context.verify_mode = ssl.CERT_NONE
517
+ Hr['Authorization']= f"Bearer {token}"
518
+ async with aiohttp.ClientSession() as session:
519
+ async with session.post(url, data=payload, headers=Hr, ssl=ssl_context) as response:
520
+ if response.status == 200: return await response.read()
521
+ return None
522
+
523
+ async def DecRypTMajoRLoGin(MajoRLoGinResPonsE):
524
+ proto = MajoRLoGinrEs_pb2.MajorLoginRes()
525
+ proto.ParseFromString(MajoRLoGinResPonsE)
526
+ return proto
527
+
528
+ async def DecRypTLoGinDaTa(LoGinDaTa):
529
+ proto = PorTs_pb2.GetLoginData()
530
+ proto.ParseFromString(LoGinDaTa)
531
+ return proto
532
+
533
+ async def DecodeWhisperMessage(hex_packet):
534
+ packet = bytes.fromhex(hex_packet)
535
+ proto = DEcwHisPErMsG_pb2.DecodeWhisper()
536
+ proto.ParseFromString(packet)
537
+ return proto
538
+
539
+ async def decode_team_packet(hex_packet):
540
+ packet = bytes.fromhex(hex_packet)
541
+ proto = sQ_pb2.recieved_chat()
542
+ proto.ParseFromString(packet)
543
+ return proto
544
+
545
+ async def xAuThSTarTuP(TarGeT, token, timestamp, key, iv):
546
+ uid_hex = hex(TarGeT)[2:]
547
+ uid_length = len(uid_hex)
548
+ encrypted_timestamp = await DecodE_HeX(timestamp)
549
+ encrypted_account_token = token.encode().hex()
550
+ encrypted_packet = await EnC_PacKeT(encrypted_account_token, key, iv)
551
+ encrypted_packet_length = hex(len(encrypted_packet) // 2)[2:]
552
+ if uid_length == 9: headers = '0000000'
553
+ elif uid_length == 8: headers = '00000000'
554
+ elif uid_length == 10: headers = '000000'
555
+ elif uid_length == 7: headers = '000000000'
556
+ else: print('Unexpected length') ; headers = '0000000'
557
+ return f"0115{headers}{uid_hex}{encrypted_timestamp}00000{encrypted_packet_length}{encrypted_packet}"
558
+
559
+ async def cHTypE(H):
560
+ if not H: return 'Squid'
561
+ elif H == 1: return 'CLan'
562
+ elif H == 2: return 'PrivaTe'
563
+
564
+ async def SEndMsG(H , message , Uid , chat_id , key , iv):
565
+ TypE = await cHTypE(H)
566
+ if TypE == 'Squid': msg_packet = await xSEndMsgsQ(message , chat_id , key , iv)
567
+ elif TypE == 'CLan': msg_packet = await xSEndMsg(message , 1 , chat_id , chat_id , key , iv)
568
+ elif TypE == 'PrivaTe': msg_packet = await xSEndMsg(message , 2 , Uid , Uid , key , iv)
569
+ return msg_packet
570
+
571
+ async def SEndPacKeT(OnLinE , ChaT , TypE , PacKeT):
572
+ if TypE == 'ChaT' and ChaT: whisper_writer.write(PacKeT) ; await whisper_writer.drain()
573
+ elif TypE == 'OnLine': online_writer.write(PacKeT) ; await online_writer.drain()
574
+ else: return 'UnsoPorTed TypE ! >> ErrrroR (:():)'
575
+
576
+ async def TcPOnLine(ip, port, key_val, iv_val, AutHToKen, reconnect_delay=0.5):
577
+ global online_writer, key, iv, team_members_data, current_team_leader
578
+ global team_collection_active, previous_team_uids
579
+
580
+ key = key_val
581
+ iv = iv_val
582
+
583
+ while True:
584
+ try:
585
+ # Reset team state on new connection
586
+ team_members_data = []
587
+ current_team_leader = None
588
+ team_collection_active = False
589
+ previous_team_uids = set()
590
+
591
+ reader, writer = await asyncio.open_connection(ip, int(port))
592
+ online_writer = writer
593
+ print(f"[ONLINE] Connected to {ip}:{port}")
594
+
595
+ bytes_payload = bytes.fromhex(AutHToKen)
596
+ online_writer.write(bytes_payload)
597
+ await online_writer.drain()
598
+
599
+ while True:
600
+ data2 = await reader.read(9999)
601
+ if not data2: break
602
+
603
+ packet_hex = data2.hex()
604
+
605
+ # Team collection
606
+ if packet_hex.startswith('0500') and len(packet_hex) > 1000:
607
+ try:
608
+ decoded = await DeCode_PackEt(packet_hex[10:])
609
+ parsed = json.loads(decoded)
610
+ await collect_team_members_dynamic('0500_LARGE', parsed)
611
+ except:
612
+ pass
613
+
614
+ # Your existing chat code
615
+ if data2.hex().startswith('0500') and len(data2.hex()) > 1000:
616
+ try:
617
+ packet = await DeCode_PackEt(data2.hex()[10:])
618
+ packet = json.loads(packet)
619
+ OwNer_UiD, CHaT_CoDe, SQuAD_CoDe = await GeTSQDaTa(packet)
620
+
621
+ JoinCHaT = await AutH_Chat(3, OwNer_UiD, CHaT_CoDe, key, iv)
622
+ await SEndPacKeT(whisper_writer, online_writer, 'ChaT', JoinCHaT)
623
+ except:
624
+ pass
625
+
626
+ online_writer.close()
627
+ await online_writer.wait_closed()
628
+ online_writer = None
629
+
630
+ # Broadcast disconnect
631
+ if team_collection_active:
632
+ print(f"[TEAM] ✗ Disconnected from team")
633
+ broadcast_team_change('team_left', {
634
+ 'in_team': False,
635
+ 'total_members': 0,
636
+ 'members': []
637
+ })
638
+
639
+ # Reset state on disconnect
640
+ team_members_data = []
641
+ current_team_leader = None
642
+ team_collection_active = False
643
+ previous_team_uids = set()
644
+
645
+ except Exception as e:
646
+ print(f"[ERROR] {ip}:{port} - {e}")
647
+ online_writer = None
648
+
649
+ # Reset state on error
650
+ team_members_data = []
651
+ current_team_leader = None
652
+ team_collection_active = False
653
+ previous_team_uids = set()
654
+
655
+ await asyncio.sleep(reconnect_delay)
656
+
657
+ async def TcPChaT(ip, port, AutHToKen, key_val, iv_val, LoGinDaTaUncRypTinG, ready_event, region_val, reconnect_delay=0.5):
658
+ global spam_room, whisper_writer, spammer_uid, spam_chat_id, spam_uid, online_writer, chat_id, XX, uid, Spy, data2, Chat_Leave
659
+ global region # API access के लिए
660
+
661
+ # Update global variables for API
662
+ region = region_val
663
+
664
+ print(region, 'TCP CHAT')
665
+
666
+ while True:
667
+ try:
668
+ reader, writer = await asyncio.open_connection(ip, int(port))
669
+ whisper_writer = writer
670
+ print(f"[CHAT] Connected to {ip}:{port}") # Debug message
671
+
672
+ bytes_payload = bytes.fromhex(AutHToKen)
673
+ whisper_writer.write(bytes_payload)
674
+ await whisper_writer.drain()
675
+ ready_event.set()
676
+
677
+ if LoGinDaTaUncRypTinG.Clan_ID:
678
+ clan_id = LoGinDaTaUncRypTinG.Clan_ID
679
+ clan_compiled_data = LoGinDaTaUncRypTinG.Clan_Compiled_Data
680
+ print('\n - TarGeT BoT in CLan ! ')
681
+ print(f' - Clan Uid > {clan_id}')
682
+ print(f' - BoT ConnEcTed WiTh CLan ChaT SuccEssFuLy ! ')
683
+ pK = await AuthClan(clan_id, clan_compiled_data, key_val, iv_val)
684
+ if whisper_writer:
685
+ whisper_writer.write(pK)
686
+ await whisper_writer.drain()
687
+
688
+ while True:
689
+ data = await reader.read(9999)
690
+ if not data: break
691
+
692
+ if data.hex().startswith("120000"):
693
+ msg = await DeCode_PackEt(data.hex()[10:])
694
+ chatdata = json.loads(msg)
695
+ try:
696
+ response = await DecodeWhisperMessage(data.hex()[10:])
697
+ uid = response.Data.uid
698
+ chat_id = response.Data.Chat_ID
699
+ XX = response.Data.chat_type
700
+ inPuTMsG = response.Data.msg.lower()
701
+ except:
702
+ response = None
703
+
704
+ if response:
705
+ if inPuTMsG.startswith(("/5")):
706
+ try:
707
+ dd = chatdata['5']['data']['16']
708
+ print('msg in private')
709
+ message = f"[B][C]{get_random_color()}\n\nAccepT My Invitation FasT\n\n"
710
+ P = await SEndMsG(response.Data.chat_type, message, uid, chat_id, key_val, iv_val)
711
+ await SEndPacKeT(whisper_writer, online_writer, 'ChaT', P)
712
+ PAc = await OpEnSq(key_val, iv_val, region_val)
713
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', PAc)
714
+ C = await cHSq(5, uid, key_val, iv_val, region_val)
715
+ await asyncio.sleep(0.5)
716
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', C)
717
+ V = await SEnd_InV(5, uid, key_val, iv_val, region_val)
718
+ await asyncio.sleep(0.5)
719
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', V)
720
+ E = await ExiT(None, key_val, iv_val)
721
+ await asyncio.sleep(3)
722
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', E)
723
+ except:
724
+ print('msg in squad')
725
+
726
+ if inPuTMsG.startswith('/x/'):
727
+ CodE = inPuTMsG.split('/x/')[1]
728
+ try:
729
+ dd = chatdata['5']['data']['16']
730
+ print('msg in private')
731
+ EM = await GenJoinSquadsPacket(CodE, key_val, iv_val)
732
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', EM)
733
+ except:
734
+ print('msg in squad')
735
+
736
+ if inPuTMsG.startswith('/solo'):
737
+ leave = await ExiT(uid, key_val, iv_val)
738
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', leave)
739
+
740
+ if inPuTMsG.strip().startswith('/s'):
741
+ EM = await FS(key_val, iv_val)
742
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', EM)
743
+
744
+ if inPuTMsG.strip().startswith('!e'):
745
+ try:
746
+ dd = chatdata['5']['data']['16']
747
+ print('msg in private')
748
+ message = f"[B][C]{get_random_color()}\n\nCommand Available OnLy In SQuaD ! \n\n"
749
+ P = await SEndMsG(response.Data.chat_type, message, uid, chat_id, key_val, iv_val)
750
+ await SEndPacKeT(whisper_writer, online_writer, 'ChaT', P)
751
+ except:
752
+ print('msg in squad')
753
+ parts = inPuTMsG.strip().split()
754
+ print(response.Data.chat_type, uid, chat_id)
755
+ message = f'[B][C]{get_random_color()}\nACITVE TarGeT -> {xMsGFixinG(uid)}\n'
756
+ P = await SEndMsG(response.Data.chat_type, message, uid, chat_id, key_val, iv_val)
757
+ uid2 = uid3 = uid4 = uid5 = None
758
+ s = False
759
+ try:
760
+ uid = int(parts[1])
761
+ uid2 = int(parts[2])
762
+ uid3 = int(parts[3])
763
+ uid4 = int(parts[4])
764
+ uid5 = int(parts[5])
765
+ idT = int(parts[5])
766
+ except ValueError as ve:
767
+ print("ValueError:", ve)
768
+ s = True
769
+ except Exception:
770
+ idT = len(parts) - 1
771
+ idT = int(parts[idT])
772
+ print(idT)
773
+ print(uid)
774
+ if not s:
775
+ try:
776
+ await SEndPacKeT(whisper_writer, online_writer, 'ChaT', P)
777
+ H = await Emote_k(uid, idT, key_val, iv_val, region_val)
778
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', H)
779
+ if uid2:
780
+ H = await Emote_k(uid2, idT, key_val, iv_val, region_val)
781
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', H)
782
+ if uid3:
783
+ H = await Emote_k(uid3, idT, key_val, iv_val, region_val)
784
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', H)
785
+ if uid4:
786
+ H = await Emote_k(uid4, idT, key_val, iv_val, region_val)
787
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', H)
788
+ if uid5:
789
+ H = await Emote_k(uid5, idT, key_val, iv_val, region_val)
790
+ await SEndPacKeT(whisper_writer, online_writer, 'OnLine', H)
791
+ except Exception as e:
792
+ pass
793
+
794
+
795
+ whisper_writer.close()
796
+ await whisper_writer.wait_closed()
797
+ whisper_writer = None
798
+
799
+ except Exception as e:
800
+ print(f"ErroR {ip}:{port} - {e}")
801
+ whisper_writer = None
802
+ await asyncio.sleep(reconnect_delay)
803
+
804
+ async def MaiiiinE():
805
+ Uid, Pw = '4214594434','AE39055DB186EB71CADBAA70CD00764240E18B4742D0E16588C01E927FD85C2C'
806
+
807
+ open_id, access_token = await GeNeRaTeAccEss(Uid, Pw)
808
+ if not open_id or not access_token:
809
+ print("ErroR - InvaLid AccounT")
810
+ return None
811
+
812
+ PyL = await EncRypTMajoRLoGin(open_id, access_token)
813
+ MajoRLoGinResPonsE = await MajorLogin(PyL)
814
+ if not MajoRLoGinResPonsE:
815
+ print("TarGeT AccounT => BannEd / NoT ReGisTeReD ! ")
816
+ return None
817
+
818
+ MajoRLoGinauTh = await DecRypTMajoRLoGin(MajoRLoGinResPonsE)
819
+ UrL = MajoRLoGinauTh.url
820
+ print(UrL)
821
+ region_val = MajoRLoGinauTh.region
822
+
823
+ ToKen = MajoRLoGinauTh.token
824
+ TarGeT = MajoRLoGinauTh.account_uid
825
+ key_val = MajoRLoGinauTh.key
826
+ iv_val = MajoRLoGinauTh.iv
827
+ timestamp = MajoRLoGinauTh.timestamp
828
+
829
+ LoGinDaTa = await GetLoginData(UrL, PyL, ToKen)
830
+ if not LoGinDaTa:
831
+ print("ErroR - GeTinG PorTs From LoGin DaTa !")
832
+ return None
833
+
834
+ LoGinDaTaUncRypTinG = await DecRypTLoGinDaTa(LoGinDaTa)
835
+ OnLinePorTs = LoGinDaTaUncRypTinG.Online_IP_Port
836
+ ChaTPorTs = LoGinDaTaUncRypTinG.AccountIP_Port
837
+ OnLineiP, OnLineporT = OnLinePorTs.split(":")
838
+ ChaTiP, ChaTporT = ChaTPorTs.split(":")
839
+ acc_name = LoGinDaTaUncRypTinG.AccountName
840
+
841
+ print(ToKen)
842
+ equie_emote(ToKen, UrL)
843
+ AutHToKen = await xAuThSTarTuP(int(TarGeT), ToKen, int(timestamp), key_val, iv_val)
844
+ ready_event = asyncio.Event()
845
+
846
+ task1 = asyncio.create_task(TcPChaT(ChaTiP, ChaTporT, AutHToKen, key_val, iv_val, LoGinDaTaUncRypTinG, ready_event, region_val))
847
+ await ready_event.wait()
848
+ await asyncio.sleep(1)
849
+ task2 = asyncio.create_task(TcPOnLine(OnLineiP, OnLineporT, key_val, iv_val, AutHToKen))
850
+
851
+ os.system('clear')
852
+ print(render('WINTER', colors=['white', 'green'], align='center'))
853
+ print('')
854
+ print(f" - BoT STarTinG And OnLine on TarGet : {TarGeT} | BOT NAME : {acc_name}\n")
855
+ print(f" - BoT sTaTus > GooD | OnLinE ! (:")
856
+ print(f" - Subscribe > MatrixCoder | Gaming ! (:")
857
+ await asyncio.gather(task1, task2)
858
+
859
+ async def StarTinG():
860
+ while True:
861
+ try:
862
+ await asyncio.wait_for(MaiiiinE(), timeout=7 * 60 * 60)
863
+ except asyncio.TimeoutError:
864
+ print("Token ExpiRed ! , ResTartinG")
865
+ except Exception as e:
866
+ print(f"ErroR TcP - {e} => ResTarTinG ...")
867
+
868
+ if __name__ == '__main__':
869
+ asyncio.run(StarTinG())
requirements.txt ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ requests
2
+ httpx
3
+ google
4
+ protobuf
5
+ pycryptodome
6
+ psutil
7
+ PyJWT
8
+ urllib3
9
+ protobuf-decoder
10
+ pytz
11
+ aiohttp
12
+ cfonts
13
+ flask_cors
14
+ flask
15
+ flask-sock
16
+ requests
xC4.py ADDED
@@ -0,0 +1,378 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # By AbdeeLkarim BesTo
2
+
3
+ import requests , json , binascii , time , urllib3 , base64 , datetime , re ,socket , threading , random , os , asyncio
4
+ from protobuf_decoder.protobuf_decoder import Parser
5
+ from Crypto.Cipher import AES
6
+ from Crypto.Util.Padding import pad , unpad
7
+ from datetime import datetime
8
+ from google.protobuf.timestamp_pb2 import Timestamp
9
+
10
+ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
11
+
12
+ Key , Iv = bytes([89, 103, 38, 116, 99, 37, 68, 69, 117, 104, 54, 37, 90, 99, 94, 56]) , bytes([54, 111, 121, 90, 68, 114, 50, 50, 69, 51, 121, 99, 104, 106, 77, 37])
13
+
14
+ async def EnC_AEs(HeX):
15
+ cipher = AES.new(Key , AES.MODE_CBC , Iv)
16
+ return cipher.encrypt(pad(bytes.fromhex(HeX), AES.block_size)).hex()
17
+
18
+ async def DEc_AEs(HeX):
19
+ cipher = AES.new(Key , AES.MODE_CBC , Iv)
20
+ return unpad(cipher.decrypt(bytes.fromhex(HeX)), AES.block_size).hex()
21
+
22
+ async def EnC_PacKeT(HeX , K , V):
23
+ return AES.new(K , AES.MODE_CBC , V).encrypt(pad(bytes.fromhex(HeX) ,16)).hex()
24
+
25
+ async def DEc_PacKeT(HeX , K , V):
26
+ return unpad(AES.new(K , AES.MODE_CBC , V).decrypt(bytes.fromhex(HeX)) , 16).hex()
27
+
28
+ async def EnC_Uid(H , Tp):
29
+ e , H = [] , int(H)
30
+ while H:
31
+ e.append((H & 0x7F) | (0x80 if H > 0x7F else 0)) ; H >>= 7
32
+ return bytes(e).hex() if Tp == 'Uid' else None
33
+
34
+ async def EnC_Vr(N):
35
+ if N < 0: ''
36
+ H = []
37
+ while True:
38
+ BesTo = N & 0x7F ; N >>= 7
39
+ if N: BesTo |= 0x80
40
+ H.append(BesTo)
41
+ if not N: break
42
+ return bytes(H)
43
+
44
+ def DEc_Uid(H):
45
+ n = s = 0
46
+ for b in bytes.fromhex(H):
47
+ n |= (b & 0x7F) << s
48
+ if not b & 0x80: break
49
+ s += 7
50
+ return n
51
+
52
+ async def CrEaTe_VarianT(field_number, value):
53
+ field_header = (field_number << 3) | 0
54
+ return await EnC_Vr(field_header) + await EnC_Vr(value)
55
+
56
+ async def CrEaTe_LenGTh(field_number, value):
57
+ field_header = (field_number << 3) | 2
58
+ encoded_value = value.encode() if isinstance(value, str) else value
59
+ return await EnC_Vr(field_header) + await EnC_Vr(len(encoded_value)) + encoded_value
60
+
61
+ async def CrEaTe_ProTo(fields):
62
+ packet = bytearray()
63
+ for field, value in fields.items():
64
+ if isinstance(value, dict):
65
+ nested_packet = await CrEaTe_ProTo(value) # لازم await
66
+ packet.extend(await CrEaTe_LenGTh(field, nested_packet))
67
+ elif isinstance(value, int):
68
+ packet.extend(await CrEaTe_VarianT(field, value))
69
+ elif isinstance(value, str) or isinstance(value, bytes):
70
+ packet.extend(await CrEaTe_LenGTh(field, value))
71
+ return packet
72
+
73
+ async def DecodE_HeX(H):
74
+ R = hex(H)
75
+ F = str(R)[2:]
76
+ if len(F) == 1: F = "0" + F ; return F
77
+ else: return F
78
+
79
+ async def Fix_PackEt(parsed_results):
80
+ result_dict = {}
81
+ for result in parsed_results:
82
+ field_data = {}
83
+ field_data['wire_type'] = result.wire_type
84
+ if result.wire_type == "varint":
85
+ field_data['data'] = result.data
86
+ if result.wire_type == "string":
87
+ field_data['data'] = result.data
88
+ if result.wire_type == "bytes":
89
+ field_data['data'] = result.data
90
+ elif result.wire_type == 'length_delimited':
91
+ field_data["data"] = await Fix_PackEt(result.data.results)
92
+ result_dict[result.field] = field_data
93
+ return result_dict
94
+
95
+ async def DeCode_PackEt(input_text):
96
+ try:
97
+ parsed_results = Parser().parse(input_text)
98
+ parsed_results_objects = parsed_results
99
+ parsed_results_dict = await Fix_PackEt(parsed_results_objects)
100
+ json_data = json.dumps(parsed_results_dict)
101
+ return json_data
102
+ except Exception as e:
103
+ print(f"error {e}")
104
+ return None
105
+
106
+ def xMsGFixinG(n):
107
+ return '🗿'.join(str(n)[i:i + 3] for i in range(0 , len(str(n)) , 3))
108
+
109
+ async def Ua():
110
+ versions = [
111
+ '4.0.18P6', '4.0.19P7', '4.0.20P1', '4.1.0P3', '4.1.5P2', '4.2.1P8',
112
+ '4.2.3P1', '5.0.1B2', '5.0.2P4', '5.1.0P1', '5.2.0B1', '5.2.5P3',
113
+ '5.3.0B1', '5.3.2P2', '5.4.0P1', '5.4.3B2', '5.5.0P1', '5.5.2P3'
114
+ ]
115
+ models = [
116
+ 'SM-A125F', 'SM-A225F', 'SM-A325M', 'SM-A515F', 'SM-A725F', 'SM-M215F', 'SM-M325FV',
117
+ 'Redmi 9A', 'Redmi 9C', 'POCO M3', 'POCO M4 Pro', 'RMX2185', 'RMX3085',
118
+ 'moto g(9) play', 'CPH2239', 'V2027', 'OnePlus Nord', 'ASUS_Z01QD',
119
+ ]
120
+ android_versions = ['9', '10', '11', '12', '13', '14']
121
+ languages = ['en-US', 'es-MX', 'pt-BR', 'id-ID', 'ru-RU', 'hi-IN']
122
+ countries = ['USA', 'MEX', 'BRA', 'IDN', 'RUS', 'IND']
123
+ version = random.choice(versions)
124
+ model = random.choice(models)
125
+ android = random.choice(android_versions)
126
+ lang = random.choice(languages)
127
+ country = random.choice(countries)
128
+ return f"GarenaMSDK/{version}({model};Android {android};{lang};{country};)"
129
+
130
+ async def ArA_CoLor():
131
+ Tp = ["32CD32" , "00BFFF" , "00FA9A" , "90EE90" , "FF4500" , "FF6347" , "FF69B4" , "FF8C00" , "FF6347" , "FFD700" , "FFDAB9" , "F0F0F0" , "F0E68C" , "D3D3D3" , "A9A9A9" , "D2691E" , "CD853F" , "BC8F8F" , "6A5ACD" , "483D8B" , "4682B4", "9370DB" , "C71585" , "FF8C00" , "FFA07A"]
132
+ return random.choice(Tp)
133
+
134
+ async def xBunnEr():
135
+ bN = [902000126 , 902000154 , 902000003 , 902027018 , 902027027 , 902039014 , 902040027 , 902042011 , 902048021 , 902048018 , 902000027 , 902000078 , 902000013 , 902000093 , 902000100 , 902000117 , 902000111 , 902000151 , 902000207 , 902000203 , 902027016 , 902027018 , 902033016 , 902027018 , 902027018 , 902027018 , 902027018 , 902027018 , 902027018]
136
+ return random.choice(bN)
137
+
138
+ async def xSEndMsg(Msg , Tp , Tp2 , id , K , V):
139
+ feilds = {1: id , 2: Tp2 , 3: Tp, 4: Msg, 5: 1735129800, 7: 2, 9: {1: "xBesTo - C4", 2: int(await xBunnEr()), 3: 901048018, 4: 330, 5: 909034009, 8: "xBesTo - C4", 10: 1, 11: 1, 13: {1: 2}, 14: {1: 12484827014, 2: 8, 3: "\u0010\u0015\b\n\u000b\u0013\f\u000f\u0011\u0004\u0007\u0002\u0003\r\u000e\u0012\u0001\u0005\u0006"}, 12: 0}, 10: "en", 13: {3: 1}}
140
+ Pk = (await CrEaTe_ProTo(feilds)).hex()
141
+ Pk = "080112" + await EnC_Uid(len(Pk) // 2, Tp='Uid') + Pk
142
+ return await GeneRaTePk(Pk, '1201', K, V)
143
+
144
+ async def xSEndMsgsQ(Msg , id , K , V):
145
+ fields = {1: id , 2: id , 4: Msg , 5: 1756580149, 7: 2, 8: 904990072, 9: {1: "xBe4!sTo - C4", 2: await xBunnEr(), 4: 330, 5: 827001005, 8: "xBe4!sTo - C4", 10: 1, 11: 1, 13: {1: 2}, 14: {1: 1158053040, 2: 8, 3: "\u0010\u0015\b\n\u000b\u0015\f\u000f\u0011\u0004\u0007\u0002\u0003\r\u000e\u0012\u0001\u0005\u0006"}}, 10: "en", 13: {2: 2, 3: 1}}
146
+ Pk = (await CrEaTe_ProTo(fields)).hex()
147
+ Pk = "080112" + await EnC_Uid(len(Pk) // 2, Tp='Uid') + Pk
148
+ return await GeneRaTePk(Pk, '1201', K, V)
149
+ async def AuthClan(CLan_Uid, AuTh, K, V):
150
+ fields = {1: 3, 2: {1: int(CLan_Uid), 2: 1, 4: str(AuTh)}}
151
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , '1201' , K , V)
152
+ async def AutH_GlobAl(K, V):
153
+ fields = {
154
+ 1: 3,
155
+ 2: {
156
+ 2: 5,
157
+ 3: "en"
158
+ }
159
+ }
160
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , '1215' , K , V)
161
+
162
+ async def LagSquad(K,V):
163
+ fields = {
164
+ 1: 15,
165
+ 2: {
166
+ 1: 1124759936,
167
+ 2: 1
168
+ }
169
+ }
170
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , '0515' , K , V)
171
+
172
+ async def GeT_Status(PLayer_Uid , K , V):
173
+ PLayer_Uid = await EnC_Uid(PLayer_Uid , Tp = 'Uid')
174
+ if len(PLayer_Uid) == 8: Pk = f'080112080a04{PLayer_Uid}1005'
175
+ elif len(PLayer_Uid) == 10: Pk = f"080112090a05{PLayer_Uid}1005"
176
+ return await GeneRaTePk(Pk , '0f15' , K , V)
177
+
178
+ async def SPam_Room(Uid , Rm , Nm , K , V):
179
+ fields = {1: 78, 2: {1: int(Rm), 2: f"[{ArA_CoLor()}]{Nm}", 3: {2: 1, 3: 1}, 4: 330, 5: 1, 6: 201, 10: xBunnEr(), 11: int(Uid), 12: 1}}
180
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , '0e15' , K , V)
181
+ async def GenJoinSquadsPacket(code, K , V):
182
+ fields = {}
183
+ fields[1] = 4
184
+ fields[2] = {}
185
+ fields[2][4] = bytes.fromhex("01090a0b121920")
186
+ fields[2][5] = str(code)
187
+ fields[2][6] = 6
188
+ fields[2][8] = 1
189
+ fields[2][9] = {}
190
+ fields[2][9][2] = 800
191
+ fields[2][9][6] = 11
192
+ fields[2][9][8] = "1.111.1"
193
+ fields[2][9][9] = 5
194
+ fields[2][9][10] = 1
195
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , '0515' , K , V)
196
+ async def GenJoinGlobaL(owner , code , K, V):
197
+ fields = {
198
+ 1: 4,
199
+ 2: {
200
+ 1: owner,
201
+ 6: 1,
202
+ 8: 1,
203
+ 13: "en",
204
+ 15: code,
205
+ 16: "OR",
206
+ }
207
+ }
208
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , '0515' , K , V)
209
+
210
+ async def FS(K,V,region):
211
+ fields = {
212
+ 1: 9,
213
+ 2: {
214
+ 1: 13256361202
215
+ }
216
+ }
217
+ if region.lower() == "ind":
218
+ packet = '0514'
219
+ elif region.lower() == "bd":
220
+ packet = "0519"
221
+ else:
222
+ packet = "0515"
223
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , packet , K , V)
224
+
225
+
226
+
227
+
228
+ #EMOTES BY PARAHEX X CODEX
229
+ async def Emote_k(TarGeT , idT, K, V,region):
230
+ fields = {
231
+ 1: 21,
232
+ 2: {
233
+ 1: 804266360,
234
+ 2: 909000001,
235
+ 5: {
236
+ 1: TarGeT,
237
+ 3: idT,
238
+ }
239
+ }
240
+ }
241
+ if region.lower() == "ind":
242
+ packet = '0514'
243
+ elif region.lower() == "bd":
244
+ packet = "0519"
245
+ else:
246
+ packet = "0515"
247
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , packet , K , V)
248
+
249
+ #EMOTES BY PARAHEX X CODEX
250
+
251
+
252
+ async def GeTSQDaTa(D):
253
+ uid = D['5']['data']['1']['data']
254
+ chat_code = D["5"]["data"]["17"]["data"]
255
+ squad_code = D["5"]["data"]["31"]["data"]
256
+
257
+
258
+ return uid, chat_code , squad_code
259
+
260
+
261
+ async def AutH_Chat(T , uid, code , K, V):
262
+ fields = {
263
+ 1: T,
264
+ 2: {
265
+ 1: uid,
266
+ 3: "en",
267
+ 4: str(code)
268
+ }
269
+ }
270
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , '1215' , K , V)
271
+ async def Msg_Sq(msg, owner, bot, K, V):
272
+ fields = {
273
+ 1: 1,
274
+ 2: 2,
275
+ 2: {
276
+ 1: bot,
277
+ 2: owner,
278
+ 4: msg,
279
+ 5: 1757799182,
280
+ 7: 2,
281
+ 9: {
282
+ 1: "Fun1w5a2",
283
+ 2: await xBunnEr(),
284
+ 3: 909000024,
285
+ 4: 330,
286
+ 5: 909000024,
287
+ 7: 2,
288
+ 10: 1,
289
+ 11: 1,
290
+ 12: 0,
291
+ 13: {1: 2},
292
+ 14: {
293
+ 1: bot,
294
+ 2: 8,
295
+ 3: "\u0010\u0015\b\n\u000b\u0013\f\u000f\u0011\u0004\u0007\u0002\u0003\r\u000e\u0012\u0001\u0005\u0006"
296
+ }
297
+ },
298
+ 10: "ar",
299
+ 13: {3: 1},
300
+ 14: ""
301
+ }
302
+ }
303
+ proto_bytes = await CrEaTe_ProTo(fields)
304
+ return await GeneRaTePk(proto_bytes.hex(), '1215', K, V)
305
+
306
+
307
+ async def ghost_pakcet(player_id , secret_code ,K , V):
308
+ fields = {
309
+ 1: 61,
310
+ 2: {
311
+ 1: int(player_id),
312
+ 2: {
313
+ 1: int(player_id),
314
+ 2: int(time.time()),
315
+ 3: "MR3SKR",
316
+ 5: 12,
317
+ 6: 9999999,
318
+ 7: 1,
319
+ 8: {
320
+ 2: 1,
321
+ 3: 1,
322
+ },
323
+ 9: 3,
324
+ },
325
+ 3: secret_code,},}
326
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , '0515' , K , V)
327
+ async def GeneRaTePk(Pk , N , K , V):
328
+ PkEnc = await EnC_PacKeT(Pk , K , V)
329
+ _ = await DecodE_HeX(int(len(PkEnc) // 2))
330
+ if len(_) == 2: HeadEr = N + "000000"
331
+ elif len(_) == 3: HeadEr = N + "00000"
332
+ elif len(_) == 4: HeadEr = N + "0000"
333
+ elif len(_) == 5: HeadEr = N + "000"
334
+ else: print('ErroR => GeneRatinG ThE PacKeT !! ')
335
+ return bytes.fromhex(HeadEr + _ + PkEnc)
336
+ async def OpEnSq(K , V,region):
337
+ fields = {1: 1, 2: {2: "\u0001", 3: 1, 4: 1, 5: "en", 9: 1, 11: 1, 13: 1, 14: {2: 5756, 6: 11, 8: "1.111.5", 9: 2, 10: 4}}}
338
+ if region.lower() == "ind":
339
+ packet = '0514'
340
+ elif region.lower() == "bd":
341
+ packet = "0519"
342
+ else:
343
+ packet = "0515"
344
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , packet , K , V)
345
+
346
+ async def cHSq(Nu , Uid , K , V,region):
347
+ fields = {1: 17, 2: {1: int(Uid), 2: 1, 3: int(Nu - 1), 4: 62, 5: "\u001a", 8: 5, 13: 329}}
348
+ if region.lower() == "ind":
349
+ packet = '0514'
350
+ elif region.lower() == "bd":
351
+ packet = "0519"
352
+ else:
353
+ packet = "0515"
354
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , packet , K , V)
355
+
356
+
357
+
358
+ async def SEnd_InV(Nu , Uid , K , V,region):
359
+
360
+ fields = {1: 2 , 2: {1: int(Uid) , 2: region , 4: int(Nu)}}
361
+
362
+ if region.lower() == "ind":
363
+ packet = '0514'
364
+ elif region.lower() == "bd":
365
+ packet = "0519"
366
+ else:
367
+ packet = "0515"
368
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , packet , K , V)
369
+
370
+
371
+ async def ExiT(idT , K , V):
372
+ fields = {
373
+ 1: 7,
374
+ 2: {
375
+ 1: idT,
376
+ }
377
+ }
378
+ return await GeneRaTePk((await CrEaTe_ProTo(fields)).hex() , '0515' , K , V)
xHeaders.py ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests , os , psutil , sys , jwt , pickle , json , binascii , time , urllib3 , base64 , datetime , re ,socket , threading
2
+ from protobuf_decoder.protobuf_decoder import Parser
3
+ from xC4 import *
4
+ from datetime import datetime
5
+ from google.protobuf.timestamp_pb2 import Timestamp
6
+ from concurrent.futures import ThreadPoolExecutor
7
+ from threading import Thread
8
+
9
+ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
10
+
11
+ def ToK():
12
+ while True:
13
+ try:
14
+ r = requests.get('https://tokens-asfufvfshnfkhvbb.francecentral-01.azurewebsites.net/ReQuesT?&type=ToKens')
15
+ t = r.text
16
+ i = t.find("ToKens : [")
17
+ if i != -1:
18
+ j = t.find("]", i)
19
+ L = [x.strip(" '\"") for x in t[i+11:j].split(',') if x.strip()]
20
+ if L:
21
+ with open("token.txt", "w") as f:
22
+ f.write(random.choice(L))
23
+ except: pass
24
+ time.sleep(5 * 60 * 60)
25
+
26
+ Thread(target=ToK , daemon = True).start()
27
+
28
+
29
+
30
+ def equie_emote(JWT,url):
31
+ url = f"{url}/ChooseEmote"
32
+
33
+ headers = {
34
+ "Accept-Encoding": "gzip",
35
+ "Authorization": f"Bearer {JWT}",
36
+ "Connection": "Keep-Alive",
37
+ "Content-Type": "application/x-www-form-urlencoded",
38
+ "Expect": "100-continue",
39
+ #"Host": "clientbp.ggblueshark.com",
40
+ "ReleaseVersion": "OB52",
41
+ "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 9; G011A Build/PI)",
42
+ "X-GA": "v1 1",
43
+ "X-Unity-Version": "2018.4.11f1",
44
+ }
45
+
46
+ data = bytes.fromhex("CA F6 83 22 2A 25 C7 BE FE B5 1F 59 54 4D B3 13")
47
+
48
+ requests.post(url, headers=headers, data=data)
49
+
50
+
51
+
52
+
53
+
54
+ def GeTToK():
55
+ with open("token.txt") as f: return f.read().strip()
56
+
57
+ def Likes(id):
58
+ try:
59
+ text = requests.get(f"https://tokens-asfufvfshnfkhvbb.francecentral-01.azurewebsites.net/ReQuesT?id={id}&type=likes").text
60
+ get = lambda p: re.search(p, text)
61
+ name, lvl, exp, lb, la, lg = (get(r).group(1) if get(r) else None for r in
62
+ [r"PLayer NamE\s*:\s*(.+)", r"PLayer SerVer\s*:\s*(.+)", r"Exp\s*:\s*(\d+)",
63
+ r"LiKes BeFore\s*:\s*(\d+)", r"LiKes After\s*:\s*(\d+)", r"LiKes GiVen\s*:\s*(\d+)"])
64
+ return name , f"{lvl}" if lvl else None, int(lb) if lb else None, int(la) if la else None, int(lg) if lg else None
65
+ except: return None, None, None, None, None
66
+
67
+ def Requests_SPam(id):
68
+ Api = requests.get(f'https://tokens-asfufvfshnfkhvbb.francecentral-01.azurewebsites.net/ReQuesT?id={id}&type=spam')
69
+ if Api.status_code in [200, 201] and '[SuccessFuLy] -> SenDinG Spam ReQuesTs !' in Api.text: return True
70
+ else: return False
71
+
72
+ def GeT_Name(uid , Token):
73
+ data = bytes.fromhex(EnC_AEs(f"08{EnC_Uid(uid , Tp = 'Uid')}1007"))
74
+ url = "https://clientbp.common.ggbluefox.com/GetPlayerPersonalShow"
75
+ headers = {
76
+ 'X-Unity-Version': '2018.4.11f1',
77
+ 'ReleaseVersion': 'OB52',
78
+ 'Content-Type': 'application/x-www-form-urlencoded',
79
+ 'X-GA': 'v1 1',
80
+ 'Authorization': f'Bearer {GeTToK()}',
81
+ 'Content-Length': '16',
82
+ 'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 7.1.2; ASUS_Z01QD Build/QKQ1.190825.002)',
83
+ 'Host': 'clientbp.ggblueshark.com',
84
+ 'Connection': 'Keep-Alive',
85
+ 'Accept-Encoding': 'gzip'
86
+ }
87
+ response = requests.post(url , headers=headers , data=data ,verify=False)
88
+ if response.status_code == 200 or 201:
89
+ packet = binascii.hexlify(response.content).decode('utf-8')
90
+ BesTo_data = json.loads(DeCode_PackEt(packet))
91
+ try:
92
+ a1 = BesTo_data["1"]["data"]["3"]["data"]
93
+ return a1
94
+ except: return ''
95
+ else: return ''
96
+
97
+ def GeT_PLayer_InFo(uid , Token):
98
+ data = bytes.fromhex(EnC_AEs(f"08{EnC_Uid(uid , Tp = 'Uid')}1007"))
99
+ url = "https://clientbp.common.ggbluefox.com/GetPlayerPersonalShow"
100
+ headers = {
101
+ 'X-Unity-Version': '2018.4.11f1',
102
+ 'ReleaseVersion': 'OB52',
103
+ 'Content-Type': 'application/x-www-form-urlencoded',
104
+ 'X-GA': 'v1 1',
105
+ 'Authorization': f'Bearer {GeTToK()}',
106
+ 'Content-Length': '16',
107
+ 'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 7.1.2; ASUS_Z01QD Build/QKQ1.190825.002)',
108
+ 'Host': 'clientbp.ggblueshark.com',
109
+ 'Connection': 'Keep-Alive',
110
+ 'Accept-Encoding': 'gzip'}
111
+ response = requests.post(url , headers=headers , data=data ,verify=False)
112
+ if response.status_code == 200 or 201:
113
+ packet = binascii.hexlify(response.content).decode('utf-8')
114
+ BesTo_data = json.loads(DeCode_PackEt(packet))
115
+ NoCLan = False
116
+ try:
117
+ a1 = str(BesTo_data["1"]["data"]["1"]["data"])
118
+ a2 = BesTo_data["1"]["data"]["21"]["data"]
119
+ a3 = BesTo_data["1"]["data"]["3"]["data"]
120
+ player_server = BesTo_data["1"]["data"]["5"]["data"]
121
+ player_bio = BesTo_data["9"]["data"]["9"]["data"]
122
+ player_level = BesTo_data["1"]["data"]["6"]["data"]
123
+ account_date = datetime.fromtimestamp(BesTo_data["1"]["data"]["44"]["data"]).strftime("%I:%M %p - %d/%m/%y")
124
+ last_login = datetime.fromtimestamp(BesTo_data["1"]["data"]["24"]["data"]).strftime("%I:%M %p - %d/%m/%y")
125
+ try:
126
+ clan_id = BesTo_data["6"]["data"]["1"]["data"]
127
+ clan_name = BesTo_data["6"]["data"]["2"]["data"]
128
+ clan_leader = BesTo_data["6"]["data"]["3"]["data"]
129
+ clan_level = BesTo_data["6"]["data"]["4"]["data"]
130
+ clan_members_num = BesTo_data["6"]["data"]["6"]["data"]
131
+ clan_leader_name = BesTo_data["7"]["data"]["3"]["data"]
132
+ except:
133
+ NoCLan = True
134
+ if NoCLan:
135
+ a = f'''
136
+ [b][c][90EE90] [SuccessFully] - Get PLayer s'InFo !
137
+
138
+ [FFFF00][1] - ProFile InFo :
139
+ [ffffff]
140
+ Name : {a3}
141
+ Uid : {xMsGFixinG(a1)}
142
+ Likes : {xMsGFixinG(a2)}
143
+ LeveL : {player_level}
144
+ Server : {player_server}
145
+ Bio : {player_bio}
146
+ Creating : {account_date}
147
+ LasT LoGin : {last_login}
148
+
149
+ [90EE90]Dev : C4 Team OfficieL\n'''
150
+ a = a.replace('[i]','')
151
+ return a
152
+
153
+ else:
154
+ a = f'''
155
+ [b][c][90EE90] [SuccessFully] - Get PLayer s'InFo !
156
+
157
+ [FFFF00][1] - ProFile InFo :
158
+ [ffffff]
159
+ Name : {a3}
160
+ Uid : {xMsGFixinG(a1)}
161
+ Likes : {xMsGFixinG(a2)}
162
+ LeveL : {player_level}
163
+ Server : {player_server}
164
+ Bio : {player_bio}
165
+ Creating : {account_date}
166
+ LasT LoGin : {last_login}
167
+
168
+ [b][c][FFFF00][2] - Guild InFo :
169
+ [ffffff]
170
+ Guild Name : {clan_name}
171
+ Guild Uid : {xMsGFixinG(clan_id)}
172
+ Guild LeveL : {clan_level}
173
+ Guild Members : {clan_members_num}
174
+ Leader s'Uid : {xMsGFixinG(clan_leader)}
175
+ Leader s'Name : {clan_leader_name}
176
+
177
+ [90EE90]Dev : C4 Team OfficieL\n'''
178
+ a = a.replace('[i]','')
179
+ return a
180
+
181
+ except Exception as e:
182
+ return f'\n[b][c][FFD700]FaiLEd GeTinG PLayer InFo !\n'
183
+ else:
184
+ return f'\n[b][c][FFD700]FaiLEd GeTinG PLayer InFo !\n'
185
+
186
+ def DeLet_Uid(id , Tok):
187
+ print(f' Done FuckinG > {id} ')
188
+ url = 'https://clientbp.common.ggbluefox.com/RemoveFriend'
189
+ headers = {
190
+ 'X-Unity-Version': '2018.4.11f1',
191
+ 'ReleaseVersion': 'OB52',
192
+ 'Content-Type': 'application/x-www-form-urlencoded',
193
+ 'X-GA': 'v1 1',
194
+ 'Authorization': f'Bearer {Tok}',
195
+ 'Content-Length': '16',
196
+ 'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 7.1.2; ASUS_Z01QD Build/QKQ1.190825.002)',
197
+ 'Host': 'clientbp.ggblueshark.com',
198
+ 'Connection': 'Keep-Alive',
199
+ 'Accept-Encoding': 'gzip'}
200
+ data = bytes.fromhex(EnC_AEs(f"08a7c4839f1e10{EnC_Uid(id , Tp = 'Uid')}"))
201
+ ResPonse = requests.post(url , headers=headers , data=data , verify=False)
202
+ if ResPonse.status_code == 400 and 'BR_FRIEND_NOT_SAME_REGION' in ResPonse.text:
203
+ return f'[b][c]Id : {xMsGFixinG(id)} Not In Same Region !'
204
+ elif ResPonse.status_code == 200:
205
+ return f'[b][c]Good Response Done Delete Id : {xMsGFixinG(id)} !'
206
+ else:
207
+ return f'[b][c]Erorr !'
208
+
209
+ def ChEck_The_Uid(id):
210
+ Api = requests.get("https://panel-g2ccathtf6gdcmdw.polandcentral-01.azurewebsites.net/Uids")
211
+ if Api.status_code not in [200, 201]:
212
+ return False
213
+ lines = Api.text.splitlines()
214
+ for i, line in enumerate(lines):
215
+ if f' - Uid : {id}' in line:
216
+ expire, status = None, None
217
+ for sub_line in lines[i:]:
218
+ if "Expire In" in sub_line:
219
+ expire = re.search(r"Expire In\s*:\s*(.*)", sub_line).group(1).strip()
220
+ if "Status" in sub_line:
221
+ status = re.search(r"Status\s*:\s*(\w+)", sub_line).group(1)
222
+ if expire and status: return status, expire
223
+ return False
224
+ return False